vim: Add JavaScript/TypeScript iabbrevs

This commit is contained in:
Rob Watson 2021-12-12 11:00:21 +01:00
parent d184697933
commit 17129976de
2 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,11 @@
" https://stackoverflow.com/questions/11858927/preventing-trailing-whitespace-when-using-vim-abbreviations
func Eatchar(pat)
let c = nr2char(getchar(0))
return (c =~ a:pat) ? '' : c
endfunc
iabbrev clog console.log("<c-r>=Eatchar('\s')<cr>
iabbrev cdeb console.debug("<c-r>=Eatchar('\s')<cr>
iabbrev cerr console.error("<c-r>=Eatchar('\s')<cr>
iabbrev cwar console.warn("<c-r>=Eatchar('\s')<cr>

View File

@ -0,0 +1 @@
runtime after/ftplugin/javascript.vim