Skip to content

Instantly share code, notes, and snippets.

@al3rez
Forked from lukaszkorecki/js.vim
Created January 1, 2016 21:40
Show Gist options
  • Save al3rez/d1b9bacab6aa7800da88 to your computer and use it in GitHub Desktop.
Save al3rez/d1b9bacab6aa7800da88 to your computer and use it in GitHub Desktop.
" replace 'function' with λ
au BufNewFile,BufRead *.js syntax keyword javasScriptFunction function conceal cchar=λ
au BufNewFile,BufRead *.js hi! link javasScriptFunction Conceal
au BufNewFile,BufRead *.js setlocal conceallevel=2
" add abbreviations for JS
" f_
" expands to
" function() {
" <cursor>
"
" }
" f- expands to
" function() { <cursor )
autocmd Filetype javascript iabbr f_ function(){<CR>:}<ESC>?:<CR><ESC>xO
autocmd Filetype javascript iabbr f- function(){:}<ESC>?:<CR><ESC>xO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment