diff options
| author | Max Christian Pohle | 2017-02-28 22:14:43 +0100 |
|---|---|---|
| committer | Max Christian Pohle | 2017-02-28 22:14:43 +0100 |
| commit | f53a1526417493746d771f6243f30ba62ef7438c (patch) | |
| tree | d897f141265c53c5d4f81d5e4df5de501705381d | |
| parent | 3b7000901a735f880fb5cf70c5d214becfae100d (diff) | |
| download | vim-f53a1526417493746d771f6243f30ba62ef7438c.tar.bz2 vim-f53a1526417493746d771f6243f30ba62ef7438c.zip | |
improved xml handling
| -rw-r--r-- | doc/shortcuts.txt | 7 | ||||
| -rw-r--r-- | vimrc | 23 |
2 files changed, 26 insertions, 4 deletions
diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index fd21674..7b5b78b 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt | |||
| @@ -66,7 +66,8 @@ notice, that registers get used for both: macro recordings and copying text | |||
| 66 | 66 | ||
| 67 | [marker] | 67 | [marker] |
| 68 | ma = set marker a-z (a in this case) | 68 | ma = set marker a-z (a in this case) |
| 69 | 'a = go to marker a | 69 | `a = go to marker a (line & column) |
| 70 | 'a = go to marker a (line, first non blank), same as `a^ | ||
| 70 | 71 | ||
| 71 | 72 | ||
| 72 | [hotkeys] | 73 | [hotkeys] |
| @@ -124,6 +125,10 @@ gn = makes the directory under the cursor the root directory | |||
| 124 | a = toggles display of hidden files | 125 | a = toggles display of hidden files |
| 125 | 126 | ||
| 126 | 127 | ||
| 128 | [filetype:css] | ||
| 129 | viB:sort = sort inner block by name | ||
| 130 | |||
| 131 | |||
| 127 | [vim modeline] | 132 | [vim modeline] |
| 128 | filetype can have multiple values, like python.django | 133 | filetype can have multiple values, like python.django |
| 129 | The last line can be a mode line, which holds settings like tab width: | 134 | The last line can be a mode line, which holds settings like tab width: |
| @@ -209,6 +209,7 @@ inoremap <C-Space> <C-x><C-o> | |||
| 209 | vnoremap < <gv| " allows deindenting a selected block and keeps selection | 209 | vnoremap < <gv| " allows deindenting a selected block and keeps selection |
| 210 | vnoremap > >gv| " allows indenting a selected block and keeps selection | 210 | vnoremap > >gv| " allows indenting a selected block and keeps selection |
| 211 | 211 | ||
| 212 | |||
| 212 | " Bind CTRL+Backspace to vims version (CTRL+W) in " <CR> insert mode (only works with gvim) | 213 | " Bind CTRL+Backspace to vims version (CTRL+W) in " <CR> insert mode (only works with gvim) |
| 213 | inoremap | 214 | inoremap |
| 214 | \ <C-Backspace> | 215 | \ <C-Backspace> |
| @@ -257,6 +258,7 @@ set nocursorcolumn | " turn visual cursor column off (improves perfor | |||
| 257 | set nocursorline | " turn visual cursor line off (improves performance) | 258 | set nocursorline | " turn visual cursor line off (improves performance) |
| 258 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers | 259 | set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers |
| 259 | set nofoldenable | " disable code folding. I hate code folding | 260 | set nofoldenable | " disable code folding. I hate code folding |
| 261 | set foldcolumn=4 | " if code folding gets used display it in the clutter bar, where line numbers live | ||
| 260 | set relativenumber | " relative line numbers can speed up navigation | 262 | set relativenumber | " relative line numbers can speed up navigation |
| 261 | set noshowmode | " because we are using some powerline derivat | 263 | set noshowmode | " because we are using some powerline derivat |
| 262 | set nostartofline | " when scrolling: do not move the cursor to column 1 | 264 | set nostartofline | " when scrolling: do not move the cursor to column 1 |
| @@ -366,9 +368,25 @@ if has("autocmd") | |||
| 366 | " hitting K over a keyword shows a help in a buffer. | 368 | " hitting K over a keyword shows a help in a buffer. |
| 367 | " Here we define the commands used to look those keywords up | 369 | " Here we define the commands used to look those keywords up |
| 368 | " as per file type... | 370 | " as per file type... |
| 369 | augroup keyword_lookups | 371 | augroup filetype_specific |
| 370 | autocmd FileType python setlocal keywordprg=pydoc | 372 | autocmd FileType python setlocal keywordprg=pydoc |
| 371 | autocmd FileType vim setlocal keywordprg=:help |. | 373 | autocmd FileType vim setlocal keywordprg=:help |. |
| 374 | autocmd FileType c,cpp setlocal equalprg=clang-format | ||
| 375 | |||
| 376 | " keyboard mapping for xml alike languages | ||
| 377 | " Alt-Up : Move cursor up one tag | ||
| 378 | " Alt-Down: Move cursor down one tag | ||
| 379 | " leader-=: tidies currently selected tag and subtags and sorts attributes by name (alphabetically) | ||
| 380 | autocmd Filetype html,htmldjango,xml | ||
| 381 | \ :nnoremap | ||
| 382 | \ <M-Down> | ||
| 383 | \ :call search('^ *<', 'e')<CR>:nohlsearch<CR>| | ||
| 384 | \ :nnoremap | ||
| 385 | \ <M-Up> | ||
| 386 | \ :call search('^ *<', 'eb')<CR>:nohlsearch<CR>| | ||
| 387 | \ :nnoremap | ||
| 388 | \ <leader>= | ||
| 389 | \ vat:'<,'>!tidy -xml --wrap 0 --sort-attributes alpha 2>/dev/null<CR>vat= | ||
| 372 | augroup END | 390 | augroup END |
| 373 | 391 | ||
| 374 | 392 | ||
| @@ -434,8 +452,7 @@ else | |||
| 434 | nnoremap <leader>t :new +terminal<CR> | 452 | nnoremap <leader>t :new +terminal<CR> |
| 435 | endif | 453 | endif |
| 436 | 454 | ||
| 437 | 455 | nnoremap <leader>r :syntax sync fromstart | |
| 438 | |||
| 439 | 456 | ||
| 440 | " colorscheme base16-embers | 457 | " colorscheme base16-embers |
| 441 | " colorscheme base16-flat | 458 | " colorscheme base16-flat |
