Skip to content

Commit

Permalink
auto indent newline inside tag
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaddr committed Oct 30, 2019
1 parent 872eac6 commit f298e29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,14 @@ imap <C-j> <Esc><C-j>
imap <C-k> <Esc><C-k>
imap <C-h> <Esc><C-h>
imap <C-l> <Esc><C-l>
function! EnterInsideTag()
if strcharpart(getline('.'), getpos('.')[2]-1, 1) == '<'
return "\<CR>\<Esc>O"
else
return "\<CR>"
endif
endfunction
imap <expr> <CR> EnterInsideTag()
inoremap (<CR> (<CR>)<C-c>O
inoremap [<CR> [<CR>]<C-c>O
inoremap {<CR> {<CR>}<C-c>O
Expand Down

0 comments on commit f298e29

Please sign in to comment.