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 call vundle#end() " required
29 " Use the Solarized Dark theme
31 "colorscheme solarized
33 " Make Vim more useful
35 " Use the OS clipboard by default (on versions compiled with `+clipboard`)
37 " Enhance command-line completion
39 " Allow cursor keys in insert mode
41 " Allow backspace in insert mode
42 set backspace=indent,eol,start
43 " Optimize for fast terminal connections
45 " Add the g flag to search/replace by default
47 " Use UTF-8 without BOM
48 set encoding=utf-8 nobomb
51 " Don’t add empty newlines at the end of files
54 " Centralize backups, swapfiles and undo history
55 set backupdir=~/.vim/backups
56 set directory=~/.vim/swaps
58 set undodir=~/.vim/undo
62 " Don’t create backups when editing files in certain directories
63 set backupskip=/tmp/*,/private/tmp/*
65 " Respect modeline in files
68 " Enable per-directory .vimrc files and disable unsafe commands in them
73 " Enable syntax highlighting
75 " Highlight current line
77 " Make tabs as wide as two spaces
79 " Show “invisible” characters
80 set lcs=tab:▸\ ,eol:\ \,nbsp:_
81 " set lcs=tab:▸\ ,trail:·,eol:¬,nbsp:_
85 " Ignore case of searches
87 " Highlight dynamically as pattern is typed
89 " Always show status line
91 " Enable mouse in all modes
95 " Don’t reset cursor to start of line when moving around.
97 " Show the cursor position
99 " Don’t show the intro message when starting Vim
101 " Show the current mode
103 " Show the filename in the window titlebar
105 " Show the (partial) command as it’s being typed
107 " Use relative line numbers
108 if exists("&relativenumber")
110 au BufReadPost * set relativenumber
112 " Start scrolling three lines before the horizontal window border
115 " Strip trailing whitespace (,ss)
116 function! StripWhitespace()
117 let save_cursor = getpos(".")
118 let old_query = getreg('/')
120 call setpos('.', save_cursor)
121 call setreg('/', old_query)
123 noremap <leader>ss :call StripWhitespace()<CR>
124 " Save a file as root (,W)
125 noremap <leader>W :w !sudo tee % > /dev/null<CR>
129 " Enable file type detection
130 filetype plugin indent on
131 " Treat .json files as .js
132 autocmd BufNewFile,BufRead *.json setfiletype json syntax=javascript
136 "execute pathogen#infect()
144 " relative line number stuff
145 function! NumberToggle()
146 if(&relativenumber == 1)
152 nnoremap <leader>n :call NumberToggle()<cr>
153 ":au FocusLost * :set number
154 ":au FocusGained * :set relativenumber
155 autocmd InsertEnter * :set number
156 autocmd InsertEnter * :set norelativenumber
157 autocmd InsertLeave * :set relativenumber
158 "autocmd InsertLeave * :set nonumber
160 " Rainbow Parantheses
161 au Syntax * RainbowParenthesesLoadRound
162 au Syntax * RainbowParenthesesLoadSquare
163 au Syntax * RainbowParenthesesLoadBraces
164 noremap <leader>m :RainbowParenthesesToggle<CR>
167 " ==== <UltiSnips> ====
168 " Trigger configuration. Do not use <tab> if you use
169 " https://github.com/Valloric/YouCompleteMe.
170 let g:UltiSnipsExpandTrigger="<tab>"
171 "let g:UltiSnipsJumpForwardTrigger="<c-b>"
172 let g:UltiSnipsJumpForwardTrigger="<tab>"
173 "let g:UltiSnipsJumpBackwardTrigger="<c-z>"
174 let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
175 " ==== </UltiSnips> ====
181 "let g:ctrlp_map = '<space>'
182 let g:ctrlp_map = '<leader>p'
183 set wildignore+=*/build/**
184 let g:android_sdk_path= '/Applications/Android\ Studio.app/sdk/'
185 let g:android_adb_tool= '/Applications/Android\ Studio.app/sdk/platform-tools/adb'
186 let gradle_path= '~/.gradle/'
187 let g:android_build_type= 'gradle'
189 let delimitMate_expand_space=1
190 let delimitMate_expand_cr=2
192 let g:indentLine_enabled=1
193 "let g:indentLine_color_term = 239
194 "let g:indentLine_color_gui = '#09AA08'
195 "let g:indentLine_char = '│'
196 let g:indentLine_char = '¦'
199 if isdirectory(expand("~/.vim/bundle/ctrlp.vim/"))
200 let g:ctrlp_working_path_mode = 'ra'
201 nnoremap <silent> <D-t> :CtrlP<CR>
202 nnoremap <silent> <D-r> :CtrlPMRU<CR>
203 let g:ctrlp_custom_ignore = {
204 \ 'dir': '\.git$\|\.hg$\|\.svn$',
205 \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' }
207 " On Windows use "dir" as fallback command.
209 let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""'
210 elseif executable('ack-grep')
211 let s:ctrlp_fallback = 'ack-grep %s --nocolor -f'
212 elseif executable('ack')
213 let s:ctrlp_fallback = 'ack %s --nocolor -f'
215 let s:ctrlp_fallback = 'find %s -type f'
217 let g:ctrlp_user_command = {
219 \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
220 \ 2: ['.hg', 'hg --cwd %s locate -I .'],
222 \ 'fallback': s:ctrlp_fallback
225 if isdirectory(expand("~/.vim/bundle/ctrlp-funky/"))
227 let g:ctrlp_extensions = ['funky']
230 nnoremap <Leader>fu :CtrlPFunky<Cr>
236 " change cursor shape based on mode
237 let &t_SI = "\<Esc>]50;CursorShape=1\x7"
238 let &t_EI = "\<Esc>]50;CursorShape=0\x7"
240 set pastetoggle=<leader>t
243 "let g:vim_json_syntax_conceal = 0
244 "let g:indentLine_noConcealCursor=""