vim: Add JavaScript/TypeScript iabbrevs
This commit is contained in:
parent
d184697933
commit
17129976de
|
@ -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>
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
runtime after/ftplugin/javascript.vim
|
Loading…
Reference in New Issue