-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
176 lines (164 loc) · 4.74 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" YouCompleteMe
Plugin 'Valloric/YouCompleteMe'
" EasyMotion
Plugin 'Lokaltog/vim-easymotion'
" Vim Sandwich
Plugin 'machakann/vim-sandwich'
" Auto-format everything
Plugin 'chiel92/vim-autoformat'
" PyFlakes
Plugin 'kevinw/pyflakes-vim'
" CSV files
Plugin 'chrisbra/csv.vim'
" Nerdtree
Plugin 'scrooloose/nerdtree'
" jq support
Plugin 'vito-c/jq.vim'
" Scala support
Plugin 'derekwyatt/vim-scala'
" Better status line
Plugin 'vim-airline/vim-airline'
" Git integration
Plugin 'tpope/vim-fugitive'
" Tagbar
Plugin 'majutsushi/tagbar'
" Julia support
Plugin 'JuliaEditorSupport/julia-vim'
" Typescript syntax highlighting
Plugin 'leafgarland/typescript-vim'
" Ctrl P
Plugin 'ctrlpvim/ctrlp.vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" So that YouCompleteMe checks for compilation errors in C/C++ files
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_python_binary_path = 'python'
map <leader>c :YcmCompleter FixIt<CR>
let g:formatter_yapf_style = 'pep8'
let g:airline_powerline_fonts = 1
let g:sandwich#recipes = deepcopy(g:sandwich#default_recipes)
" runtime macros/sandwich/keymap/surround.vim
" Ctrl P config
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" Ignore build files from Rust and Java. (Borrowed from Shoumik)
set wildignore+=*/target/debug/*,*/target/release/*,*/target/doc/*,*.class,*.jar
map <C-z> :NERDTreeToggle<CR>
map <leader>c :YcmCompleter FixIt<CR>
nmap <F5> :TagbarToggle<CR>
map <leader>c :YcmCompleter FixIt<CR>
" My own stuff
set pastetoggle=<F2>
set tags=~/tags
set clipboard=unnamed
let mapleader = ','
set encoding=utf-8
set nu
set binary
set term=xterm-256color
colorscheme mustang
set bg=dark
set showcmd
set foldenable
set foldmethod=indent
set foldlevelstart=99
set autoindent
set softtabstop=2
set shiftwidth=2
set expandtab
set mouse=a
syntax on
set history=1000
set undolevels=1000
set backspace=indent,eol,start
set ruler
set cursorline
set cursorcolumn
set showmatch
set matchtime=3
set wildmenu
set wildmode=list:longest,full
set wildignore=*.swp,*.bak,*.pyc,*.class,*.a,*.o,*.aux,*.out
set showbreak=>
set incsearch
set hlsearch
set ignorecase
set smartcase
set hidden
set switchbuf=useopen
set scrolljump=5
set scrolloff=3
set gdefault " Use global replace by default
set shell=bash\ --login
" 'fj' exits INSERT and VISUAL modes
vmap fj <ESC>
imap fj <ESC>
" ,t -> jump between matching paren, bracket, etc.
nnoremap <leader>t %
" ; -> command
nnoremap ; :
" Handle lines that wrap around correctly
nnoremap j gj
nnoremap k gk
nnoremap gJ J
nnoremap J gJ
" Navigate between words (+ whitespace) using Tab and Back-slash
nnoremap <Tab> W
vnoremap <Tab> W
nnoremap \ B
vnoremap \ B
" ,cv -> open .vimrc
nmap <silent> <leader>cv :e $MYVIMRC<CR>
" ,sv -> source .vimrc to reload changes
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" Hide search results
nmap <silent> <leader>/ :nohlsearch<CR>
" Check spelling in text files and tex files, highlight in red
autocmd BufReadPre *.txt setlocal spell
autocmd BufReadPre *.tex setlocal spell
autocmd BufReadPre *.md setlocal spell
highlight SpellBad term=underline gui=undercurl guisp=Orange
" Automatically toggle/untoggle paste when
" pasting something into vim (borrowed from: https://coderwall.com/p/if9mda)
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction
" Navigate Vim's command-line using
" normal Bash shortcuts (borrowed from: http://statico.github.io/vim.html)
:cnoremap <C-a> <Home>
:cnoremap <C-b> <Left>
:cnoremap <C-f> <Right>
:cnoremap <C-d> <Delete>
:cnoremap <M-b> <S-Left>
:cnoremap <M-f> <S-Right>
:cnoremap <M-d> <S-right><Delete>
:cnoremap <Esc>b <S-Left>
:cnoremap <Esc>f <S-Right>
:cnoremap <Esc>d <S-right><Delete>
:cnoremap <C-g> <C-c>