diff options
author | Teddy Wing | 2014-06-28 08:47:38 -0400 |
---|---|---|
committer | Teddy Wing | 2014-06-28 08:50:37 -0400 |
commit | 735eccee90844afa6a684d142ccb9796e2a6f611 (patch) | |
tree | 04302508f80caeed8d2f653afe40b3f1ff49bbe2 /vimrc | |
parent | efe80dae8fcc95865794d32055a997a479ae81d5 (diff) | |
download | dotvim-735eccee90844afa6a684d142ccb9796e2a6f611.tar.bz2 |
vimrc: add mapping to split multiple XML tags to separate lines
Faster way of going from
<div><span>Hello, world!</span></div>
to
<div>
<span>Hello, world!</span>
</div>
Respects current indentation length and expandtab value.
Diffstat (limited to 'vimrc')
-rw-r--r-- | vimrc | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -227,6 +227,11 @@ " * Add a statusline item that says what line endings are used in the " current file. "LF" is used for unix, "CRLF" is used for dos. " +" 2014.06.28: +" * Add mapping to split a line with multiple XML/HTML tags into multiple +" lines. Something I have to do every now and then and it's kind of a +" pain to do it manually. +" " Pathogen @@ -547,6 +552,21 @@ nnoremap <leader>om :execute '!mate "' . expand('%:p') . '"'<cr> " Open current file in Finder nnoremap <leader>of :execute '!open "' . expand('%:p:h') . '"'<cr> +" HTML +" Split outer tag on a single line to multiple lines +" Example: +" Before: +" <a><span>The Land of Chocolate</span></a> +" After: +" <a> +" <span>The Land of Chocolate</span> +" </a> +" +" Thanks to kdlv on Freenode for helping me realise that I don't need :execute +" "normal! " here. Turns out in the map, things like "\<cr>" are treated +" literally (as in "\<lt>cr>"), which is of course not what I wanted. +nnoremap <leader>hs $F<i<cr><esc>k0f>a<cr><tab><esc> + " Commands |