From 9381cb0b5a699b3aa8d8bba506882cf1a5132f05 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 10 Feb 2017 23:57:35 +0800 Subject: [PATCH] Add doc for indentmove layer --- .../SpaceVim/layers/cursor_move_by_indent.vim | 21 --------- .../{fold_by_regexp.vim => exprfold.vim} | 4 +- autoload/SpaceVim/layers/indentmove.vim | 43 +++++++++++++++++++ doc/SpaceVim.txt | 40 +++++++++++++---- 4 files changed, 76 insertions(+), 32 deletions(-) delete mode 100644 autoload/SpaceVim/layers/cursor_move_by_indent.vim rename autoload/SpaceVim/layers/{fold_by_regexp.vim => exprfold.vim} (88%) create mode 100644 autoload/SpaceVim/layers/indentmove.vim diff --git a/autoload/SpaceVim/layers/cursor_move_by_indent.vim b/autoload/SpaceVim/layers/cursor_move_by_indent.vim deleted file mode 100644 index b5e3e3344..000000000 --- a/autoload/SpaceVim/layers/cursor_move_by_indent.vim +++ /dev/null @@ -1,21 +0,0 @@ -function! SpaceVim#layers#cursor_move_by_indent#plugins() abort - return [ - \ ['ZSaberLv0/ZFVimIndentMove', { 'merged' : 0}], - \ ] -endfunction - -function! SpaceVim#layers#cursor_move_by_indent#config() abort - nnoremap E - nnoremap EE `` - nnoremap EH :call ZF_IndentMoveParent('n') - xnoremap EH :call ZF_IndentMoveParent('v') - nnoremap EL :call ZF_IndentMoveParentEnd('n') - xnoremap EL :call ZF_IndentMoveParentEnd('v') - nnoremap EK :call ZF_IndentMovePrev('n') - xnoremap EK :call ZF_IndentMovePrev('v') - nnoremap EJ :call ZF_IndentMoveNext('n') - xnoremap EJ :call ZF_IndentMoveNext('v') - nnoremap EI :call ZF_IndentMoveChild('n') - xnoremap EI :call ZF_IndentMoveChild('v') -endfunction - diff --git a/autoload/SpaceVim/layers/fold_by_regexp.vim b/autoload/SpaceVim/layers/exprfold.vim similarity index 88% rename from autoload/SpaceVim/layers/fold_by_regexp.vim rename to autoload/SpaceVim/layers/exprfold.vim index 64c4f9347..043cfbf80 100644 --- a/autoload/SpaceVim/layers/fold_by_regexp.vim +++ b/autoload/SpaceVim/layers/exprfold.vim @@ -1,12 +1,12 @@ -function! SpaceVim#layers#fold_by_regexp#plugins() abort +function! SpaceVim#layers#exprfold#plugins() abort return [ \ ['ZSaberLv0/ZFVimFoldBlock', {'merged' : 0}], \ ] endfunction -function! SpaceVim#layers#fold_by_regexp#config() abort +function! SpaceVim#layers#exprfold#config() abort nnoremap ZB q::call ZF_FoldBlockTemplate() nnoremap ZF :ZFFoldBlock // function! ZF_Plugin_ZFVimFoldBlock_comment() abort diff --git a/autoload/SpaceVim/layers/indentmove.vim b/autoload/SpaceVim/layers/indentmove.vim new file mode 100644 index 000000000..28895ea8b --- /dev/null +++ b/autoload/SpaceVim/layers/indentmove.vim @@ -0,0 +1,43 @@ +"" +" @section indentmove, indentmove +" @parentsection layers +" move cursor quickly accorrding to indent +" +" mappings: +" > +" Key mode function +" EH Normal/vasual move up to nearest line with smaller +" indent level +" EL Normal/vasual move down to nearest line with larger +" indent level +" EJ Normal/vasual move down to nearest line with smaller +" or same indent level +" EK Normal/vasual move down to nearest line with larger +" or same indent level +" EI Normal/vasual move down to nearest child indent +" < +" +" + + +function! SpaceVim#layers#indentmove#plugins() abort + return [ + \ ['ZSaberLv0/ZFVimIndentMove', { 'merged' : 0}], + \ ] +endfunction + +function! SpaceVim#layers#indentmove#config() abort + nnoremap E + nnoremap EE `` + nnoremap EH :call ZF_IndentMoveParent('n') + xnoremap EH :call ZF_IndentMoveParent('v') + nnoremap EL :call ZF_IndentMoveParentEnd('n') + xnoremap EL :call ZF_IndentMoveParentEnd('v') + nnoremap EK :call ZF_IndentMovePrev('n') + xnoremap EK :call ZF_IndentMovePrev('v') + nnoremap EJ :call ZF_IndentMoveNext('n') + xnoremap EJ :call ZF_IndentMoveNext('v') + nnoremap EI :call ZF_IndentMoveChild('n') + xnoremap EI :call ZF_IndentMoveChild('v') +endfunction + diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 4d3199b2c..582437326 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -24,15 +24,16 @@ CONTENTS *SpaceVim-contents* 2. autocomplete..................................|SpaceVim-autocomplete| 3. checkers....................................|SpaceVim-layer-checkers| 4. colorscheme....................................|SpaceVim-colorscheme| - 5. lang#c........................................|SpaceVim-layer-lang-c| - 6. lang#elixir..............................|SpaceVim-layer-lang-elixir| - 7. lang#go......................................|SpaceVim-layer-lang-go| - 8. lang#java..................................|SpaceVim-layer-lang-java| - 9. lang#php....................................|SpaceVim-layer-lang-php| - 10. lang#python.............................|SpaceVim-layer-lang-python| - 11. lang#rust.................................|SpaceVim-layer-lang-rust| - 12. lang#xml...................................|SpaceVim-layer-lang-xml| - 13. shell.........................................|SpaceVim-layer-shell| + 5. indentmove......................................|SpaceVim-indentmove| + 6. lang#c........................................|SpaceVim-layer-lang-c| + 7. lang#elixir..............................|SpaceVim-layer-lang-elixir| + 8. lang#go......................................|SpaceVim-layer-lang-go| + 9. lang#java..................................|SpaceVim-layer-lang-java| + 10. lang#php...................................|SpaceVim-layer-lang-php| + 11. lang#python.............................|SpaceVim-layer-lang-python| + 12. lang#rust.................................|SpaceVim-layer-lang-rust| + 13. lang#xml...................................|SpaceVim-layer-lang-xml| + 14. shell.........................................|SpaceVim-layer-shell| 5. FAQ........................................................|SpaceVim-faq| ============================================================================== @@ -427,6 +428,27 @@ colorschemes: if the colorscheme you want do not list below, PR welcome. OceanicNext < +============================================================================== +INDENTMOVE *SpaceVim-indentmove* + +move cursor quickly accorrding to indent + +mappings: +> + Key mode function + EH Normal/vasual move up to nearest line with smaller + indent level + EL Normal/vasual move down to nearest line with larger + indent level + EJ Normal/vasual move down to nearest line with smaller + or same indent level + EK Normal/vasual move down to nearest line with larger + or same indent level + EI Normal/vasual move down to nearest child indent +< + + + ============================================================================== LANG#C *SpaceVim-layer-lang-c*