Skip to content

Instantly share code, notes, and snippets.

@anacronw
Last active December 17, 2015 11: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 anacronw/5604074 to your computer and use it in GitHub Desktop.
Save anacronw/5604074 to your computer and use it in GitHub Desktop.
My vimrc settings for javascript
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z]+\.)*([A-Za-z]+)( extends [A-Za-z.]+)?$/\3/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z.]+):.*[-=]>.*$/\3/m,method/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/
--regex-coffee=/^[ \t]*@([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/f,field/
--regex-coffee=/^[ \t]*@([A-Za-z.]+):[^->\n]*$/\1/f,static field/
--regex-coffee=/^[ \t]*([A-Za-z.]+):[^->\n]*$/\1/f,field/
--regex-coffee=/(constructor: \()@([A-Za-z.]+)/\2/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){0}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){1}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){2}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){3}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){4}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){5}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){6}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){7}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){8}/\3/f,field/
--regex-coffee=/(constructor: \()@[A-Za-z.]+(, @([A-Za-z.]+)){9}/\3/f,field/
set nocompatible
execute pathogen#infect()
filetype plugin indent on
set ai
set ts=2
set sts=2
set et
set sw=2
set nobackup
set number
set nowrap
set clipboard=unnamed
set relativenumber
syntax on
au BufNewFile,BufRead *.cson set filetype=coffee
colorscheme delek
set background=dark
bash <(curl -s https://gist.githubusercontent.com/badunk/5604074/raw/vim-setup.sh)
#!/bin/bash
# Download Config files
curl -o ~/.ctags https://gist.github.com/badunk/5604074/raw/.ctags
curl -o ~/.vimrc https://gist.github.com/badunk/5604074/raw/.vimrc
# Pathogen
mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -Sso ~/.vim/autoload/pathogen.vim \
https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim
# Get plugins
git clone https://github.com/kchmck/vim-coffee-script.git ~/.vim/bundle/vim-coffee-script/
git clone https://github.com/pangloss/vim-javascript.git ~/.vim/bundle/vim-javascript/
git clone https://github.com/kien/ctrlp.vim.git ~/.vim/bundle/ctrlp/
git clone https://github.com/jeffkreeftmeijer/vim-numbertoggle.git ~/.vim/bundle/vim-numbertoggle/
git clone https://github.com/mattn/emmet-vim.git ~/.vim/bundle/emmet-vim/
git clone https://github.com/tmhedberg/matchit.git ~/.vim/bundle/matchit/
git clone https://github.com/mustache/vim-mustache-handlebars.git ~/.vim/bundle/vim-mustache-handlebars/
git clone https://github.com/nathanaelkane/vim-indent-guides.git ~/.vim/bundle/vim-indent-guides.git/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment