mirror of
https://github.com/don-philipe/dotfiles.git
synced 2025-11-08 22:57:03 +01:00
Fix HTML tag auto-closing
This commit is contained in:
@@ -2,4 +2,12 @@ setlocal shiftwidth=4
|
||||
setlocal tabstop=4
|
||||
|
||||
" create closing xml tag when typing >
|
||||
inoremap <buffer> > ></<C-n><C-o>%
|
||||
" first write the actual closing bracket (>), then got to normal mode (<Esc>), find
|
||||
" opening bracket (F<), go one step to the right (l), yank the tag name (yiw),
|
||||
" find the closing bracket (f>), start appending opening bracket and slash (a</), paste
|
||||
" yanked word from default register (<C-r>"), add closing bracket (>), leave
|
||||
" insert mode (<Esc>), go back to opening bracket (F<), enter insert mode (i)
|
||||
inoremap > ><Esc>F<lyiwf>a</<C-r>"><Esc>F<i
|
||||
" overwrite automatic angle bracket closing from vimrc to make auto-closing
|
||||
" tags work properly
|
||||
inoremap < <
|
||||
|
||||
Reference in New Issue
Block a user