aboutsummaryrefslogtreecommitdiffstats
path: root/vimrc
diff options
context:
space:
mode:
authorTeddy Wing2014-06-28 08:47:38 -0400
committerTeddy Wing2014-06-28 08:50:37 -0400
commit735eccee90844afa6a684d142ccb9796e2a6f611 (patch)
tree04302508f80caeed8d2f653afe40b3f1ff49bbe2 /vimrc
parentefe80dae8fcc95865794d32055a997a479ae81d5 (diff)
downloaddotvim-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--vimrc20
1 files changed, 20 insertions, 0 deletions
diff --git a/vimrc b/vimrc
index 93ddb0f..8d0516d 100644
--- a/vimrc
+++ b/vimrc
@@ -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