-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
251 lines (232 loc) · 8.9 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
" --------------------------------
" Plugins
" --------------------------------
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim " PLUGIN MANAGER - to update Vim with plugins
" declared below use :PluginUpdate after reloading vim (or use :source %
" before). Plugins here are all linked from Github public repos. To remove
" a plugin just remove it from here and then run :PluginUpdate, same as with
" adding a new plugin.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
call vundle#begin()
" let Vundle manage Vundle, required
" DON'T have comments after Plugin declaration
" to disable plugin comment out the line
Plugin 'VundleVim/Vundle.vim'
" Plugins
Plugin 'adelarsq/vim-matchit'
Plugin 'tomtom/tlib_vim'
" Some utility functions for VIM
Plugin 'marcweber/vim-addon-mw-utils'
" vim: interpret a file by function and cache file automatically
Plugin 'tpope/vim-fugitive'
" Git wrapper package, enables :git ... to execute
" git commands from within vim and keeps a single instance of vim (for
" commits, diffs, etc.)
Plugin 'scrooloose/nerdtree'
" A tree explorer plugin for vim
Plugin 'roman/golden-ratio'
" Automatic resizing of Vim windows to the golden ratio
" Plugin 'chiel92/vim-autoformat'
" Provide easy code formatting in Vim by integrating existing code formatters
" ! Needs extermal formatting programs to do anything !
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'jeffkreeftmeijer/vim-numbertoggle'
" Toggle to absolute line number on inactive tabs
Plugin 'airblade/vim-gitgutter'
" Gives symbols for git diff
" Plugin 'townk/vim-autoclose'
" Auto closes parentheses etc. but it conflicts with UltiSips or YCM
Plugin 'alvan/vim-closetag'
" Auto closes HTML tags
" These are the file extensions where this plugin is enabled:
let g:closetag_filenames = '*.html,*.xhtml,*.phtml'
Plugin 'michaeljsmith/vim-indent-object'
" Text object (body of a function, sentence, paragraph etc.) but for
" levels of indentation, good for languages like Python, SASS, Pug etc.
" <count>ai An Indentation level and line above
" <count>ii Inner Indentation level (no line above)
" <count>aI An Indentation level and lines above/below
" <count>iI Inner Indentation level (no lines above/below)
Plugin 'christoomey/vim-sort-motion'
" ability to sort in Vim using text objects and motions
" type gs followed by a motion e.g.: 2j to sort down two lines
Plugin 'tpope/vim-surround'
" Allows commands in normal mode to manipulate
" enclosing paranthesis, quotes, tags, etc. e.g. 'cs{[' changes {} to []
" cs, ds, ys, and for visual mode S and type
" the enclosion e.g. S} or S{ for { ... } (whitespace between)
Plugin 'tpope/vim-commentary'
" gc to comment out
Plugin 'pangloss/vim-javascript'
" JS syntax and indentation support
Plugin 'ctrlpvim/ctrlp.vim'
" Fuzzy file, buffer, mru, tag, etc finder
let g:ctrlp_working_path_mode = 0
" make ctrlp work from current dir
Plugin 'vim-airline/vim-airline'
" status / tabline customization
Plugin 'vim-airline/vim-airline-themes'
let g:airline_theme='minimalist'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_close_button = 0
Plugin 'luochen1990/rainbow'
" Rainbow parantheses
Plugin 'matze/vim-move'
" Visual movement of selected text
" <A-k> Move current line/selection up
" <A-j> Move current line/selection down
" <A-h> Move current character/selection left
" <A-l> Move current character/selection right
" Simplify creating text objects in vim
Plugin 'kana/vim-textobj-user'
Plugin 'kana/vim-textobj-line'
Plugin 'kana/vim-textobj-entire'
""""""""""""""""""""""""""""""""""""""""
Plugin 'jiangmiao/auto-pairs'
" automatically handles pairs of parentheses
Plugin 'sheerun/vim-polyglot'
" syntax highlighting in most languages
" Plugin 'joshdick/onedark.vim'
" Atom-style dark theme
Plugin 'agude/vim-eldar'
Plugin 'ReplaceWithRegister'
" gr{motion} Replace {motion} text with the contents of register x
Plugin 'KabbAmine/zeavim.vim'
" Zeal (Dash the API documentation browser for Macanalog for Linux)
" <leader>z search for word under cursor
" <leader><leader>z prompts what to search for and where
Plugin 'craigemery/vim-autotag'
" Automatically discover and 'properly' update ctags files on save
Plugin 'mattn/emmet-vim'
" default: g:user_leader_key = <C-y><,>
Plugin 'godlygeek/tabular'
" required plugin for vim markdown
" Plugin 'plasticboy/vim-markdown'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'ap/vim-css-color'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'moll/vim-node'
Plugin 'elzr/vim-json'
Plugin 'lervag/vimtex'
" Snippets, autocompletion etc.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Plugin 'SirVer/ultisnips'
" Snippets are separated from the engine. Add this if you want them:
" Trigger configuration. You need to change this to something other than
" <tab> if you use one of the following:
" - https://github.com/Valloric/YouCompleteMe
" - https://github.com/nvim-lua/completion-nvim
let g:UltiSnipsExpandTrigger="<C-Space>"
let g:UltiSnipsJumpForwardTrigger="<C-Space>"
let g:UltiSnipsJumpBackwardTrigger="<C-Left>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
Plugin 'ycm-core/YouCompleteMe'
" let g:ycm_key_list_select_completion=[]
" let g:ycm_key_list_previous_completion=[]
Plugin 'honza/vim-snippets'
Plugin 'ckunte/latex-snippets-vim'
" Plugin 'garbas/vim-snipmate' " :SnipMateOpenSnippetFiles and see doc/SnipMate.txt to learn all SnipMate
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"A HUGE plugin for completion suggestions. It needs to be COMPILED
" and has several dependecies, so installation requires visiting its GitHub
" page.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" All of your Plugins must be added before the following line
call vundle#end()
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype plugin indent on
" --------------------------------
" Pretty things
" --------------------------------
syntax on
colorscheme eldar
" Set Airline bar theme
let g:airline_theme='bubblegum'
"rainbow Plugin Options (luochen1990/rainbow)
let g:rainbow_active = 1 " 0 if you want to enable it later via :RainbowToggle
" Colour at column 80
set colorcolumn=80
" --------------------------------
" Basic stuff
" --------------------------------
let g:mapleader = " " " Set leader to spacebar
set spelllang=en_gb
set spelllang+=pl
set backspace=indent,eol,start " Backspace works on indents, EOLs etc.
set number " Line numbers
set relativenumber " Relative line numbers
set hlsearch " Highlight whole word when searching
set ignorecase " Ignore case when searching...
set smartcase " ...except when serach query contains a capital letter
set autoread " Auto load files if they change on disc
" map <Leader>p :set paste<CR><esc>"*]p:set nopaste<cr>
" map <Leader>y "*y )
" map <Leader><Leader> :w<CR>
" inoremap jj <ESC>:w<CR>
" Pasting - indent last pasted
" nnoremap gz '[=']
" Disable highlight when <leader><cr> is pressed
map <silent> <leader><ESC> :noh<cr>
"Cursor
" if exists('$TMUX')
" let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
" let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
" else
" let &t_SI = "\<Esc>]50;CursorShape=1\x7"
" let &t_EI = "\<Esc>]50;CursorShape=0\x7"
" endif
" Open current file in a new vertical split with '='
nnoremap = :vsplit<cr>
" F2 and F3 to move between tabs
map <F2> <ESC>:tabp<CR>
map <F3> <ESC>:tabn<CR>
" Easy split navigation
map <C-j> <C-w>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" Simplify using tabs
" nnoremap ˙ gT
" nnoremap ¬ gt
" nnoremap T :tabnew<cr>
" Open new splits to right and bottom
set splitbelow
set splitright
"Tab completion
set wildmenu
set wildmode=list:longest,list:full
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <Tab> <c-r>=InsertTabWrapper()<cr>
inoremap <S-Tab> <c-n>
" Tab size
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Disable swap files
set noswapfile
" Disable arrow keys in Escape mode
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
" Disable recording in normal mode (accidental q is annoying)
nnoremap q <nop>