aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorMax Christian Pohle2017-02-28 22:14:43 +0100
committerMax Christian Pohle2017-02-28 22:14:43 +0100
commitf53a1526417493746d771f6243f30ba62ef7438c (patch)
treed897f141265c53c5d4f81d5e4df5de501705381d /vimrc
parent3b7000901a735f880fb5cf70c5d214becfae100d (diff)
downloadvim-karlmarks-f53a1526417493746d771f6243f30ba62ef7438c.tar.bz2
vim-karlmarks-f53a1526417493746d771f6243f30ba62ef7438c.zip
improved xml handling
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc23
1 files changed, 20 insertions, 3 deletions
diff --git a/vimrc b/vimrc
index 48f8435..2217daa 100644
--- a/vimrc
+++ b/vimrc
@@ -209,6 +209,7 @@ inoremap <C-Space> <C-x><C-o>
209vnoremap < <gv| " allows deindenting a selected block and keeps selection 209vnoremap < <gv| " allows deindenting a selected block and keeps selection
210vnoremap > >gv| " allows indenting a selected block and keeps selection 210vnoremap > >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)
213inoremap 214inoremap
214 \ <C-Backspace> 215 \ <C-Backspace>
@@ -257,6 +258,7 @@ set nocursorcolumn | " turn visual cursor column off (improves perfor
257set nocursorline | " turn visual cursor line off (improves performance) 258set nocursorline | " turn visual cursor line off (improves performance)
258set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers 259set nrformats+=alpha | " allows CTRL-A & CTRL-X to increment and decrement letters, not just numbers
259set nofoldenable | " disable code folding. I hate code folding 260set nofoldenable | " disable code folding. I hate code folding
261set foldcolumn=4 | " if code folding gets used display it in the clutter bar, where line numbers live
260set relativenumber | " relative line numbers can speed up navigation 262set relativenumber | " relative line numbers can speed up navigation
261set noshowmode | " because we are using some powerline derivat 263set noshowmode | " because we are using some powerline derivat
262set nostartofline | " when scrolling: do not move the cursor to column 1 264set 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>
435endif 453endif
436 454
437 455nnoremap <leader>r :syntax sync fromstart
438
439 456
440" colorscheme base16-embers 457" colorscheme base16-embers
441" colorscheme base16-flat 458" colorscheme base16-flat
..