Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Last active December 14, 2015 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joyrexus/5109476 to your computer and use it in GitHub Desktop.
Save joyrexus/5109476 to your computer and use it in GitHub Desktop.
Supplements for ~/.vim/ftplugin/coffee.vim.
" Supplements for ~/.vim/ftplugin/coffee.vim.
" Use Mick Koch's [plugin](http://github.com/kchmck/vim-coffee-script) as base.
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
ab bang! #!/usr/bin/env coffee
" ,r run/execute code in file (faster to type than ,x)
" ,j show resulting javascript
" ,c compile to javascript
nmap <LocalLeader>r :!coffee %<CR>
nmap <LocalLeader>j :!coffee -p %<CR>
nmap <LocalLeader>c :!coffee -c %<CR>
" :<RANGE>R run/execute specified line range
" :<RANGE>J show resulting javascript of specified line range
command! -range=% -bar R <line1>,<line2>:w !coffee -s
command! -range=% -bar J <line1>,<line2>:w !coffee -sp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment