1 "set nocompatible " be iMproved, required
2 "filetype off " required
4 call plug#begin('~/.vim/plugged')
6 Plug 'kien/rainbow_parentheses.vim'
7 "Plug 'hsanson/vim-android'
8 Plug 'scrooloose/nerdcommenter'
9 Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
10 "Plug 'kien/ctrlp.vim'
11 "Plug 'tacahiroy/ctrlp-funky'
12 Plug 'Raimondi/delimitMate'
13 Plug 'Yggdroot/indentLine'
14 "Plug 'tpope/vim-fugitive'
15 Plug 'airblade/vim-gitgutter'
16 "Plug 'altercation/vim-colors-solarized'
17 Plug 'terryma/vim-multiple-cursors'
19 "Plug 'lervag/vim-latex'
20 Plug 'tpope/vim-surround'
21 Plug 'rust-lang/rust.vim'
22 Plug 'phildawes/racer'
23 Plug 'whatyouhide/vim-gotham'
24 "Plug 'tpope/vim-repeat' | Plug 'svermeulen/vim-easyclip'
29 " Use the Solarized Dark theme
33 " Make Vim more useful
35 " Use the OS clipboard by default (on versions compiled with `+clipboard`)
36 set clipboard=unnamedplus
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 ":au FocusLost * :set number
145 ":au FocusGained * :set relativenumber
146 "autocmd InsertEnter * :set number
147 "autocmd InsertEnter * :set norelativenumber
148 "autocmd InsertLeave * :set relativenumber
149 "autocmd InsertLeave * :set nonumber
151 " Rainbow Parantheses
152 au Syntax * RainbowParenthesesLoadRound
153 au Syntax * RainbowParenthesesLoadSquare
154 au Syntax * RainbowParenthesesLoadBraces
155 noremap <leader>m :RainbowParenthesesToggle<CR>
158 " ==== <UltiSnips> ====
159 " Trigger configuration. Do not use <tab> if you use
160 " https://github.com/Valloric/YouCompleteMe.
161 let g:UltiSnipsExpandTrigger="<tab>"
162 "let g:UltiSnipsJumpForwardTrigger="<c-b>"
163 let g:UltiSnipsJumpForwardTrigger="<tab>"
164 "let g:UltiSnipsJumpBackwardTrigger="<c-z>"
165 let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
166 " ==== </UltiSnips> ====
172 let g:ctrlp_map = '<space>'
173 "let g:ctrlp_map = '<leader>p'
174 set wildignore+=*/build/**
175 let g:android_sdk_path= '/Applications/Android\ Studio.app/sdk/'
176 let g:android_adb_tool= '/Applications/Android\ Studio.app/sdk/platform-tools/adb'
177 let gradle_path= '~/.gradle/'
178 let g:android_build_type= 'gradle'
180 let delimitMate_expand_space=1
181 let delimitMate_expand_cr=2
183 let g:indentLine_enabled=1
184 "let g:indentLine_color_term = 239
185 "let g:indentLine_color_gui = '#09AA08'
186 "let g:indentLine_char = '│'
187 let g:indentLine_char = '¦'
190 if isdirectory(expand("~/.vim/bundle/ctrlp.vim/"))
191 let g:ctrlp_working_path_mode = 'ra'
192 nnoremap <silent> <D-t> :CtrlP<CR>
193 nnoremap <silent> <D-r> :CtrlPMRU<CR>
194 let g:ctrlp_custom_ignore = {
195 \ 'dir': '\.git$\|\.hg$\|\.svn$',
196 \ 'file': '\.exe$\|\.so$\|\.dll$\|\.pyc$' }
198 " On Windows use "dir" as fallback command.
200 let s:ctrlp_fallback = 'ag %s --nocolor -l -g ""'
201 elseif executable('ack-grep')
202 let s:ctrlp_fallback = 'ack-grep %s --nocolor -f'
203 elseif executable('ack')
204 let s:ctrlp_fallback = 'ack %s --nocolor -f'
206 let s:ctrlp_fallback = 'find %s -type f'
208 let g:ctrlp_user_command = {
210 \ 1: ['.git', 'cd %s && git ls-files . --cached --exclude-standard --others'],
211 \ 2: ['.hg', 'hg --cwd %s locate -I .'],
213 \ 'fallback': s:ctrlp_fallback
216 if isdirectory(expand("~/.vim/bundle/ctrlp-funky/"))
218 let g:ctrlp_extensions = ['funky']
221 nnoremap <Leader>fu :CtrlPFunky<Cr>
227 " change cursor shape based on mode
228 if &term =~ "xterm\\|rxvt"
229 " use a solid vertical bar in insert mode
230 let &t_SI .= "\<Esc>[6 q"
231 " use a solid block otherwise
232 let &t_EI .= "\<Esc>[2 q"
234 " eliminite the delay when switching modes
237 set pastetoggle=<leader>p
240 "let g:vim_json_syntax_conceal = 0
241 "let g:indentLine_noConcealCursor=""
242 " latex mode settings
243 let g:Tex_DefaultTargetFormat = "pdf"
246 let g:racer_cmd = "racer"
247 let $RUST_SRC_PATH=expand('~/misc/rs/rust/src/')