2 set nocompatible " be iMproved, required
3 filetype off " required
5 " set the runtime path to include Vundle and initialize
6 set rtp+=~/.vim/bundle/Vundle.vim
9 " let Vundle manage Vundle, required
10 Plugin 'gmarik/Vundle.vim'
11 Plugin 'kien/rainbow_parentheses.vim'
12 "Plugin 'hsanson/vim-android'
13 Plugin 'scrooloose/nerdcommenter'
14 Plugin 'SirVer/ultisnips'
15 Plugin 'honza/vim-snippets'
16 "Plugin 'kien/ctrlp.vim'
17 "Plugin 'tacahiroy/ctrlp-funky'
18 Plugin 'Raimondi/delimitMate'
19 Plugin 'Yggdroot/indentLine'
20 "Plugin 'tpope/vim-fugitive'
21 Plugin 'airblade/vim-gitgutter'
22 "Plugin 'altercation/vim-colors-solarized'
23 Plugin 'terryma/vim-multiple-cursors'
24 "Plugin 'elzr/vim-json'
25 "Plugin 'lervag/vim-latex'
26 Plugin 'tpope/vim-surround'
27 call vundle#end() " required
30 " Use the Solarized Dark theme
32 "colorscheme solarized
34 " Make Vim more useful
36 " Use the OS clipboard by default (on versions compiled with `+clipboard`)
38 " Enhance command-line completion
40 " Allow cursor keys in insert mode
42 " Allow backspace in insert mode
43 set backspace=indent,eol,start
44 " Optimize for fast terminal connections
46 " Add the g flag to search/replace by default
48 " Use UTF-8 without BOM
49 set encoding=utf-8 nobomb
52 " Don’t add empty newlines at the end of files
55 " Centralize backups, swapfiles and undo history
56 set backupdir=~/.vim/backups
57 set directory=~/.vim/swaps
59 set undodir=~/.vim/undo
63 " Don’t create backups when editing files in certain directories
64 set backupskip=/tmp/*,/private/tmp/*
66 " Respect modeline in files
69 " Enable per-directory .vimrc files and disable unsafe commands in them
74 " Enable syntax highlighting
76 " Highlight current line
78 " Make tabs as wide as two spaces
80 " Show “invisible” characters
81 set lcs=tab:▸\ ,eol:\ \,nbsp:_
82 " set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
86 " Ignore case of searches
88 " Highlight dynamically as pattern is typed
90 " Always show status line
92 " Enable mouse in all modes
96 " Don’t reset cursor to start of line when moving around.
98 " Show the cursor position
100 " Don’t show the intro message when starting Vim
102 " Show the current mode
104 " Show the filename in the window titlebar
106 " Show the (partial) command as it’s being typed
108 " Use relative line numbers
109 if exists("&relativenumber")
111 au BufReadPost * set relativenumber
113 " Start scrolling three lines before the horizontal window border
116 " Strip trailing whitespace (,ss)
117 function! StripWhitespace()
118 let save_cursor = getpos(".")
119 let old_query = getreg('/')
121 call setpos('.', save_cursor)
122 call setreg('/', old_query)
124 noremap <leader>ss :call StripWhitespace()<CR>
125 " Save a file as root (,W)
126 noremap <leader>W :w !sudo tee % > /dev/null<CR>
130 " Enable file type detection
131 filetype plugin indent on
132 " Treat .json files as .js
133 autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
137 "execute pathogen#infect()
145 " relative line number stuff
146 function! NumberToggle()
147 if(&relativenumber == 1)
153 nnoremap <leader>n :call NumberToggle()<cr>
154 ":au FocusLost * :set number
155 ":au FocusGained * :set relativenumber
156 autocmd InsertEnter * :set number
157 autocmd InsertEnter * :set norelativenumber
158 autocmd InsertLeave * :set relativenumber
159 "autocmd InsertLeave * :set nonumber
161 " Rainbow Parantheses
162 au Syntax * RainbowParenthesesLoadRound
163 au Syntax * RainbowParenthesesLoadSquare
164 au Syntax * RainbowParenthesesLoadBraces
165 noremap <leader>m :RainbowParenthesesToggle<CR>
168 " ==== <UltiSnips> ====
169 " Trigger configuration. Do not use <tab> if you use
170 " https://github.com/Valloric/YouCompleteMe.
171 let g:UltiSnipsExpandTrigger="<tab>"
172 "let g:UltiSnipsJumpForwardTrigger="<c-b>"
173 let g:UltiSnipsJumpForwardTrigger="<tab>"
174 "let g:UltiSnipsJumpBackwardTrigger="<c-z>"
175 let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
176 " ==== </UltiSnips> ====
182 "let g:ctrlp_map = '<space>'
183 let g:ctrlp_map = '<leader>p'
184 set wildignore+=*/build/**
185 let g:android_sdk_path= '/Applications/Android\ Studio.app/sdk/'
186 let g:android_adb_tool= '/Applications/Android\ Studio.app/sdk/platform-tools/adb'
187 let gradle_path= '~/.gradle/'
188 let g:android_build_type= 'gradle'
190 let delimitMate_expand_space=1
191 let delimitMate_expand_cr=2
193 let g:indentLine_enabled=1
194 "let g:indentLine_color_term = 239
195 "let g:indentLine_color_gui = '#09AA08'
196 "let g:indentLine_char = '│'
197 let g:indentLine_char = '¦'
200 if isdirectory(expand("~/.vim/bundle/ctrlp.vim/"))
201 let g:ctrlp_working_path_mode = 'ra'
202 nnoremap <silent> <D-t> :CtrlP<CR>
203 nnoremap <silent> <D-r> :CtrlPMRU<CR>
204 let g:ctrlp_custom_ignore = {
205 \ 'dir': '\.git$\|\.hg$\|\.svn$',
206 \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' }
208 " On Windows use "dir" as fallback command.
210 let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""'
211 elseif executable('ack-grep')
212 let s:ctrlp_fallback = 'ack-grep %s --nocolor -f'
213 elseif executable('ack')
214 let s:ctrlp_fallback = 'ack %s --nocolor -f'
216 let s:ctrlp_fallback = 'find %s -type f'
218 let g:ctrlp_user_command = {
220 \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
221 \ 2: ['.hg', 'hg --cwd %s locate -I .'],
223 \ 'fallback': s:ctrlp_fallback
226 if isdirectory(expand("~/.vim/bundle/ctrlp-funky/"))
228 let g:ctrlp_extensions = ['funky']
231 nnoremap <Leader>fu :CtrlPFunky<Cr>
237 " change cursor shape based on mode
238 let &t_SI = "\<Esc>]50;CursorShape=1\x7"
239 let &t_EI = "\<Esc>]50;CursorShape=0\x7"
241 set pastetoggle=<leader>t
244 "let g:vim_json_syntax_conceal = 0
245 "let g:indentLine_noConcealCursor=""
246 " latex mode settings
247 let g:Tex_DefaultTargetFormat = "pdf"