-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
284 lines (227 loc) · 5.93 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
" Vundle settings and plugins
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-sensible'
Plugin 'xolox/vim-misc'
Plugin 'xolox/vim-reload'
Plugin 'w0ng/vim-hybrid'
Plugin 'vim-scripts/vimwiki'
Plugin 'kien/ctrlp.vim'
Plugin 'vim-scripts/Align'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'nvie/vim-flake8'
Plugin 'scrooloose/syntastic'
Plugin 'ajh17/VimCompletesMe'
Plugin 'ivanov/vim-ipython'
Plugin 'groenewege/vim-less'
"Plugin 'davidhalter/jedi-vim'
Plugin 'chriskempson/base16-vim'
Plugin 'hdima/python-syntax'
Plugin 'rust-lang/rust.vim'
Plugin 'benmills/vimux'
Plugin 'vim-latex/vim-latex'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'gabrielelana/vim-markdown'
Plugin 'morhetz/gruvbox'
Plugin 'drewtempelmeyer/palenight.vim'
Plugin 'joshdick/onedark.vim'
Plugin 'sheerun/vim-polyglot'
Plugin 'arcticicestudio/nord-vim'
Plugin 'fatih/vim-go'
call vundle#end()
filetype plugin indent on
set noswapfile
let mapleader = "\<Space>"
vmap <Leader>y "+y
vmap <Leader>d "+d
nmap <Leader>p "+p
nmap <Leader>P "+P
vmap <Leader>p "+p
vmap <Leader>P "+P
noremap <Leader><Leader> V
noremap <Leader>w :w<CR>
noremap <Leader>e :q!<CR>
vnoremap <Leader>s :sort<CR>
vnoremap < <gv
vnoremap > >gv
set modelines=0
set shell=/bin/sh
set directory=$HOME/.vim/tmp
set hi=1000
set visualbell
if executable("ag")
set grepprg=ag\ --nogroup\ --nocolor\ --ignore-case\ --column
set grepformat=%f:%l:%c:%m,%f:%l:%m
endif
"set grepprg=ack
set nojoinspaces
set shortmess+=I
set clipboard=unnamed
set hlsearch
set scrolloff=7
"""""""""""""""""""""""""""""""""""Colors and fonts
" Add for base16
"Adding for vim according to base-16 shell
"if filereadable(expand("~/.vimrc_background"))
"source ~/.vimrc_background
"endif
"
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set background=dark
set t_Co=256
colorscheme nord
"set termguicolors
" set base16colorspace=256
" colorscheme gruvbox
" https://browntreelabs.com/base-16-shell-and-why-its-so-awsome/
"if filereadable(expand("~/.vimrc_background"))
"let base16colorspace=256
"source ~/.vimrc_background
"endif
"colorscheme base16-ocean
"colorscheme base16-eighties
"colorscheme one
"let g:hybrid_reduced_constrast = 1
"colorscheme base16-twilight
"colorscheme hybrid "Better colorscheme for Java
"filetype plugin on
"filetype indent on
" This fucker needs to be set to get tmux working. Turn on
"for alactrictty, turn off for iterm2. Stupid, and yes I am bitter.
"
"set termguicolors
"set background=dark
"set t_Co=16
"let g:onedark_termcolors=16
"silent! colorscheme nord
"Non base16-color
"set t_Co=256
syntax on
syntax enable
"let g:hybrid_custom_term_colors = 1
"
"Base16 stuff again ISO-8613-3 compatible
"set termguicolors
"
"Palenight stuff
"if (has("nvim"))
"let $NVIM_TUI_ENABLE_TRUE_COLOR=1
"endif
"if (has("termguicolors"))
"set termguicolors
"endif
"""""""" Added for column border of 79 characters
set colorcolumn=79
highlight ColorColumn ctermbg=4
highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%80v.*/
set number
set ruler
set nowrap
set cursorline
""""""""""""""""""""""""""""""Added extensions for copy and paste to clipboard
function! SetColors()
set background=dark
highlight clear CursorLine
highlight CursorLine term=underline cterm=underline
endfunction
au BufEnter * call SetColors()
"Show whitespace
"Source vimrc automatically once we save buffer
set pastetoggle=<F2>
set mouse=a
set bs=2
"map for saving and quitting and sorting
" Enter visual line mode with <Space><Space>
set tabstop=4
set shiftwidth=4
set softtabstop=4
set shiftround
set expandtab
set autoindent
set smartindent
set backspace=eol,start,indent
set whichwrap+=<,>h,l
"highlighting
"Discover text search object
vnoremap <silent> s //e<C-r>=&selection=='exclusive'?'+1':''<CR><CR>
\:<C-u>call histdel('search',-1)<Bar>let @/=histget('search',-1)<CR>gv
omap s :normal vs<CR>
" setting up my own statusline
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
"vim-airline config
"let g:airline_theme="gruvbox"
"let g:airline_theme="base16"
"set laststatus=2
set nofoldenable
"Syntastic
let g:syntastic_python_checkers = ['flake8']
"better-whitespace
function! StripTrailingWhitespace()
if !&binary && &filetype != 'diff'
normal mz
normal Hmy
%s/\s+$//e
normal 'yz<CR>
normal `z
endif
endfunction
"Jedi-Vim
let g:jedi#use_splits_not_buffers = "left"
let g:jedi#usages_command = "<leader>z"
let g:jedi#popup_on_dot = 0
let g:jedi#popup_select_first = 0
let g:jedi#completions_command = "<C-Space>"
map <Leader>b import ipdb;ipdb.set_trace()
"Settings for ctrlp
let g:ctrlp_max_height = 30
set wildignore+=*.pyc
set wildignore+=*_build/
set wildignore+=*/coverage/*
function! OmniPopup(action)
if pumvisible()
if a:action == 'j'
return "\<C-N>"
elseif a:action == 'k'
return "\<C-P>"
endif
endif
return a:action
endfunction
autocmd! bufwritepost .vimrc source %
" Taking advice to break some nasty habits
" http://vimcasts.org/blog/2013/02/habit-breaking-habit-making/
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
noremap j <NOP>
noremap k <NOP>
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Split panes
nnoremap <silent> vv <C-w>v
" split opening
set splitbelow
set splitright
" Vimux
map <Leader>vp :VimuxPromptCommand<CR>
map <Leader>vl :VimuxRunLastCommand<CR>
map <Leader>vi :VimuxInspectRunnner<CR>
map <Leader>vz :VimuxZoomRunner<CR>
let g:VimuxUseNearest = 0
" Vim-latex - settings needed for this found in next url
" http://vim-latex.sourceforge.net/documentation/latex-suite/recommended-settings.html
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
"Python-Syntax
let python_highlight_all = 1
let g:python_pep8_indent_multiline_string=1