16 set list listchars=tab:\ \ ,trail:·
25 set wildmode=list:longest,list:full
26 set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*
31 " NERDTree configuration
32 let NERDTreeIgnore=['\.pyc$', '\.rbc$', '\~$']
33 map <Leader>n :NERDTreeToggle<CR>
36 map <Leader>rt :!ctags --extra=+f -R *<CR><CR>
39 " Remember last location in file
41 au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
42 \| exe "normal g'\"" | endif
45 function s:setupWrapping()
51 function s:setupMarkup()
52 call s:setupWrapping()
53 map <buffer> <Leader>p :Hammer<CR>
57 au FileType make set noexpandtab
59 " Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby
60 au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby
62 " md, markdown, and mk are markdown and define buffer-local preview
63 au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
65 " add json syntax highlighting
66 au BufNewFile,BufRead *.json set ft=javascript
68 au BufRead,BufNewFile *.txt call s:setupWrapping()
70 " make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
71 au FileType python set softtabstop=4 tabstop=4 shiftwidth=4 textwidth=79
73 " allow backspacing over everything in insert mode
74 set backspace=indent,eol,start
76 " load the plugin and indent settings for the detected filetype
77 filetype plugin indent on
80 " Opens an edit command with the path of the currently edited file filled in
81 " Normal mode: <Leader>e
82 map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
84 " Opens a tab edit command with the path of the currently edited file filled in
85 " Normal mode: <Leader>t
86 map <Leader>te :tabe <C-R>=expand("%:p:h") . "/" <CR>
88 " Inserts the path of the currently edited file into a command
89 " Command mode: Ctrl+P
90 cmap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
92 " Unimpaired configuration
96 " Bubble multiple lines
102 let g:gist_clip_command = 'pbcopy'
104 let g:gist_clip_command = 'xclip -selection clipboard'
106 let g:gist_detect_filetype = 1
107 let g:gist_open_browser_after_post = 1
109 " Use modeline overrides
113 " Default color scheme
117 " Directories for swp files
118 set backupdir=~/.vim/.backup
119 set directory=~/.vim/.backup
121 " Turn off jslint errors by default
122 let g:JSLintHighlightErrorLine = 0
124 " MacVIM shift+arrow-keys behavior (required in .vimrc)
125 let macvim_hig_shift_movement = 1
127 " % to bounce from do to end etc.
128 runtime! macros/matchit.vim
130 " Show (partial) command in the status line
133 " Include user's local vim config
134 if filereadable(expand("~/.vimrc.local"))
135 source ~/.vimrc.local
139 nmap <F8> :TagbarToggle<CR>
140 let g:tagbar_ctags_bin="/usr/local/bin/ctags"
146 call pathogen#infect()
149 set foldmethod=syntax
155 python from powerline.vim import setup as powerline_setup
156 python powerline_setup()
157 python del powerline_setup
159 " Fix CtrlP root folder and add some ignores
160 let g:ctrlp_working_path_mode = 0
161 let g:ctrlp_custom_ignore = '\v[\/](\.(git|hg|svn)|node_modules|DS_Store)$'
162 let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
165 autocmd FocusLost * :set norelativenumber
166 autocmd InsertEnter * :set norelativenumber
167 autocmd InsertLeave * :set relativenumber
168 autocmd CursorMoved * :set relativenumber
170 function! NumberToggle()
171 if(&relativenumber == 1)
178 nnoremap <C-n> :call NumberToggle()<cr>
181 let g:syntastic_javascript_checkers = ['eslint']
182 let g:syntastic_always_populate_loc_list = 1
183 let g:syntastic_check_on_open = 1
184 let g:syntastic_check_on_wq = 1
185 let g:syntastic_error_symbol = "✕"
186 let g:syntastic_warning_symbol = "⚠︎"
187 let g:syntastic_quiet_messages = {'level': 'warnings'}