-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
232 lines (199 loc) · 6.59 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
" Cancek VI compatibility
set nocompatible
let mapleader="\<Space>"
source ~/dotfiles/vim/plugins.vim
source ~/dotfiles/vim/functions.vim
source ~/dotfiles/vim/mappings.vim
source ~/dotfiles/vim/abbreviations.vim
"===============================================================================
" Plugins:
"===============================================================================
call plug#begin('~/.vim/plugged')
Plug 'qpkorr/vim-bufkill'
Plug 'itchyny/lightline.vim'
"Plug 'croaker/mustang-vim'
Plug 'kaicataldo/material.vim', { 'branch': 'main' }
Plug 'ctrlpvim/ctrlp.vim'
Plug 'Raimondi/delimitMate'
Plug 'Yggdroot/indentLine'
Plug 'scrooloose/nerdcommenter'
Plug 'godlygeek/tabular'
Plug 'lunaru/vim-less', { 'for': 'less' }
Plug 'christoomey/vim-tmux-navigator'
Plug 'vim-syntastic/syntastic'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
Plug 'kkoomen/vim-doge', { 'do': { -> doge#install() } } "doc generator
Plug 'docteurklein/php-getter-setter.vim', { 'for': 'php' }
Plug 'vim-vdebug/vdebug', { 'for': 'php' }
Plug 'alvan/vim-php-manual', { 'for': 'php' }
Plug 'arnaud-lb/vim-php-namespace', { 'for': 'php' }
Plug 'w0rp/ale'
Plug 'maximbaz/lightline-ale'
Plug 'mbbill/undotree', { 'on': 'UndotreeToggle' }
Plug 'eugen0329/vim-esearch'
Plug 'vim-scripts/taglist.vim', { 'on': 'TlistToggle' }
"Plug 'shawncplus/phpcomplete.vim', { 'for': 'php' }
Plug 'mtth/scratch.vim'
Plug 'wesQ3/vim-windowswap'
"Plug 'lifepillar/vim-mucomplete'
Plug 'pechorin/any-jump.vim'
Plug 'vimwiki/vimwiki'
"Plug 'phpactor/phpactor', {'for': 'php', 'branch': 'master'}
Plug 'ap/vim-css-color'
"Plug 'codota/tabnine-vim' " Extensive autocomplete
" Make sure you use single quotes
call plug#end()
"===============================================================================
" Options:
"===============================================================================
syntax enable " Syntax hightlight
set title " Update window title
set number " line number
set ruler " Display cursor position
set wrap " Wrap long line
set scrolloff=3 " Space aroun cursor on top / bottom
set t_Co=256 " 256 colors
set encoding=utf-8
set hi=500 " Command history
set guioptions-=m " remove menu bar
set guioptions-=T " remove toolbar
set guioptions-=r " remove right-hand scroll bar
set guioptions-=L " remove left-hand scroll bar
set autoread " Reload file on external change
" Specific behaviour for file (syntax, indent ...)
filetype on
filetype plugin on
filetype indent on
" Search
set ignorecase " Ignore case on serach
set smartcase " Search with case if case in search
set incsearch " Higligth search during search
set hlsearch " Higligth search
" Beep
" set visualbell " No beep
set noerrorbells " No beep
"convert tab to space
set expandtab
set tabstop=4
set shiftwidth=4
" Backspace normal behaviour
set backspace=indent,eol,start
" Allow buffer switch witouht be prompted 'save file'
set hidden
set undofile " Maintain undo history between sessions"
set undodir=~/dotfiles/vim/undodir
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
if has("win16") || has("win32")
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
else
set wildignore+=.git\*,.hg\*,.svn\*
endif
set splitright
" Fold
set foldmethod=indent
set foldlevel=1
"hi Folded ctermbg=235 ctermfg=7 guibg=#262626
"===============================================================================
" Appearence:
"===============================================================================
" Non text chars color
hi NonText ctermfg=7 guifg=gray
" colorscheme mustang
"set background=dark
set termguicolors
"let g:quantum_black=1
"colorscheme quantum
"colorscheme spacecamp_lite
let g:material_theme_style = 'palenight'
colorscheme material
if has("win32") || has("win16")
set guifont=Consolas:h10
else
if system('uname')=~'Darwin'
"OSX
set guifont=Menlo:h13
else
"Linux
set guifont=Monospace
endif
endif
" Show tab, nbsp and tailing spaces ,trail:\uB7
exec "set listchars=tab:\uBB\uBB,nbsp:~,trail:\uB7"
set list
" Colors in tmux
if exists('$TMUX')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
endif
"===============================================================================
" Autocommands:
"===============================================================================
"Stop color highlight on lines of 200+ characters (slow)
au BufNewFile,BufRead *.log set synmaxcol=200
" remember last position in file
" Deactivated > not cool into NERDTree
" au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal g'\"" | endif
" Files format
au BufNewFile,BufRead *.tpl :set ft=html " tpl are HTML
"TWIG coloration (use htmljinja a python template engine)
au BufRead,BufNewFile *.twig set ft=htmljinja
au BufRead,BufNewFile *.njk set ft=htmljinja
au BufRead,BufNewFile *.scala set ft=scala
au BufRead,BufNewFile *.json set ai ft=javascript
"HTML
au FileType html set omnifunc=htmlcomplete#CompleteTags
" Clean whitespace on save
au BufWritePre * call TrimWhiteSpace()
" enable spell check
au FileType gitcommit setlocal spell spelllang=en_us
au BufRead,BufNewFile *.md setlocal spell spelllang=en_us,fr
au BufRead,BufNewFile *.txt setlocal spell spelllang=en_us,fr
"===============================================================================
" Allow overriding these settings:
"===============================================================================
" Local override
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif
"
" Allow vim conf per projects
if filereadable(".project.vim")
source .project.vim
endif
"===============================================================================
" Tips:
"===============================================================================
" PHP class autocomplete ctrl-x ctrl-o (ctrl-n / ctrl-p to navigate)
"
" gs open Scratch window
"
" Invert window :
" <leader> ww " in a widow, <leader> ww into the other
"
" Last search :
" q/ q?
"
" Mark cursor position / go to
" mA 'A
"
" Move to next / previous position into jumplist
" ctrl-I, ctrl-O
"
" In visual mode (v) select line will increment number on each line
" g ctrl + a
"
" Re-select previous visual selection
" gv
"" During macro, do not redraw during macro
" set lazyredraw
"
" Execute command on line that matches regex (v is for exlude)
" :g/regex/command
" :g/popo/d > delete all lines with popo
" :v/popo/d > delete all lines without popo
"
" VimWiki : <leader> ws
"
" AnyJump : <leader> j