-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
263 lines (222 loc) · 6.54 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
"""""""""""""""""""""""""""""
"Vimrc by Spiros Baxevanakis"
"spirosbax.me"
"""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""
" Plugins
call plug#begin()
" Autocomplete
Plug 'roxma/vim-hug-neovim-rpc'
Plug 'https://github.com/roxma/nvim-yarp'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'ternjs/tern_for_vim', { 'do': 'npm install' }
" Snippets
Plug 'Shougo/neosnippet.vim'
Plug 'Shougo/neosnippet-snippets'
" General Programming Support
Plug 'ntpeters/vim-better-whitespace'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'jiangmiao/auto-pairs'
Plug 'vim-syntastic/syntastic'
Plug 'fatih/vim-go'
Plug 'tomlion/vim-solidity'
Plug 'dmdque/solidity.vim'
Plug 'nikvdp/ejs-syntax'
Plug 'posva/vim-vue'
Plug 'Shougo/context_filetype.vim'
Plug 'ap/vim-css-color'
Plug 'HerringtonDarkholme/yats.vim'
" use with caution, it will fill your project with large tag files
" Plug 'ludovicchabant/vim-gutentags'
Plug 'tpope/vim-fireplace'
Plug 'elixir-editors/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'Shougo/deoplete-clangx'
" not stop completion $ & /
setlocal iskeyword+=$
setlocal iskeyword+=-
function! BuildComposer(info)
if a:info.status != 'unchanged' || a:info.force
if has('nvim')
!cargo build --release
else
!cargo build --release --no-default-features --features json-rpc
endif
endif
endfunction
Plug 'euclio/vim-markdown-composer', { 'do': function('BuildComposer') }
" HTML
Plug 'alvan/vim-closetag'
" Motion
Plug 'wesQ3/vim-windowswap' "\ww to select window to swap
Plug 'easymotion/vim-easymotion' "\\<motion> search, it's awesome!
Plug 'terryma/vim-multiple-cursors'
Plug 'takac/vim-hardtime'
" Plug 'wincent/scalpel'
" Commands
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-repeat'
Plug 'qpkorr/vim-bufkill' " :BD :bd
Plug 'junegunn/fzf.vim'
" Plug '~/.fzf'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tacahiroy/ctrlp-funky'
Plug 'rhysd/vim-healthcheck'
" Git
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
" Interface
Plug 'scrooloose/nerdtree'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'junegunn/goyo.vim'
" Colorschemes
Plug 'rakr/vim-one'
Plug 'ajh17/Spacegray.vim'
Plug 'nanotech/jellybeans.vim'
Plug 'morhetz/gruvbox'
Plug 'AlessandroYorba/Sierra'
Plug 'altercation/vim-colors-solarized'
Plug 'junegunn/seoul256.vim'
Plug 'dracula/vim'
" Other
" Plug 'drmikehenry/vim-fixkey'
Plug 'kien/rainbow_parentheses.vim'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plug 'rstacruz/sparkup', {'rtp': 'vim/'}
call plug#end() " required
filetype plugin indent on " required
"""""""""""""""""""""""""""""
" Colors
syntax enable
set background:dark
let g:seoul256_background = 234
colorscheme seoul256
let g:airline_theme = 'deus'
set t_Co=16
"""""""""""""""""""""""""""""
" Key mappings
map <F4> ;NERDTreeToggle<CR>
map <F1> ;bprevious<Enter>
map <F2> ;bnext<Enter>
" fuzzy file searching using fzf
map <F3> ;CtrlPFunky<Enter>
map <c-p> ;Files<Enter>
" swap shift - ; to ; only in normal mode
" nnoremap ; :
" nnoremap : ;
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>
nnoremap <esc>^[ <esc>^[
nnoremap <A-j> :m .+1<CR>==
nnoremap <A-k> :m .-2<CR>==
inoremap <A-j> <Esc>:m .+1<CR>==gi
inoremap <A-k> <Esc>:m .-2<CR>==gi
vnoremap <A-j> :m '>+1<CR>gv=gv
vnoremap <A-k> :m '<-2<CR>gv=gv
inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
function! GoDef() abort
let wordUnderCursor = expand("<cword>")
execute "CtrlPFunky " . wordUnderCursor
call feedkeys("\<CR>")
endfunction
nnoremap <Leader>g :call GoDef()<CR>
aug QFClose
au!
au WinEnter * if winnr('$') == 1 && getbufvar(winbufnr(winnr()), "&buftype") == "quickfix"|q|endif
aug END
" custom function that moves the qf window
function! MoveQuickFix() abort
winc R
vertical resize -30
endfunction
autocmd FileType qf call MoveQuickFix()
"""""""""""""""""""""""""""""
set clipboard=unnamedplus
" make Esc happen without waiting for timeoutlen
" fixes Powerline delay
" augroup FastEscape
" autocmd!
" au InsertEnter * set timeoutlen=0
" au InsertLeave * set timeoutlen=1000
" augroup END
set number relativenumber " adds hybrid numbers
set statusline+=%{FugitiveStatusline()} " adds git info on the statusline
set scrolloff=15 " scroll when reaching end of page
" set autoindent
set smartindent
set softtabstop=4
set shiftwidth=4
set showtabline=4
set encoding=utf8
set noshowmode
set noruler
set laststatus=2
set expandtab "expand tabs into spaces
set ts=4 "set tabs to have 4 spaces
set cursorline "show a visual line under the cursor's current line
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
set hidden
set timeoutlen=1000
set ttimeoutlen=0
set wrap
set nocursorcolumn
" set cursorline
syntax sync minlines=256
set re=1
set nogdefault
set pyxversion=3
" rainbow_parentheses
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
" hard time conf
let g:hardtime_default_on = 0
let g:hardtime_ignore_quickfix = 1
let g:hardtime_ignore_buffer_patterns = ["NERD.*"]
" deoplete conf
let g:deoplete#enable_at_startup = 1
call deoplete#custom#option('min_pattern_length', 1)
call deoplete#custom#option('auto_complete_delay', 1)
" python-mode conf
let python_highlight_all = 1 "enable all Python syntax highlighting features
let g:pymode_python = 'python3'
let g:pymode_lint_cwindow = 0
" Goyo conf
" let g:goyo_linenr = 1
" Vim go conf
let g:syntastic_mode_map = { "mode" : "passive" }
" let g:move_key_modifier = "A"
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:closetag_filenames = "*.html, *.xhtml, *.phtml, *.php, *.jsx, *.js"
let g:multi_cursor_select_all_word_key = '<C-a>'
autocmd FileType vue setlocal shiftwidth=2 tabstop=2
autocmd FileType js setlocal shiftwidth=2 tabstop=2
autocmd FileType ejs setlocal shiftwidth=2 tabstop=2
autocmd FileType tsx setlocal shiftwidth=2 tabstop=2
autocmd BufNewFile,BufRead *.cu set filetype=cpp
let NERDTreeShowHidden=1
let g:ctrlp_map = ''
let g:ctrlp_cmd = 'CtrlPMixed'
let g:ctrlp_working_path_mode = 'c'
" Snippets conf
" Enable snipMate compatibility feature.
let g:neosnippet#enable_snipmate_compatibility = 1
" Tell Neosnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/custom-snippets'"
" rpt stuff
set rtp+=~/.fzf