-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
310 lines (245 loc) · 6.95 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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
set encoding=utf-8
" utilisation de vim plug
" https://github.com/junegunn/vim-plug
call plug#begin('~/.vim/plugged')
" Navigateur de fichiers
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" raccourcis pour gérer les " et '
Plug 'tpope/vim-surround'
" affichages des couleurs dans leur couleur
Plug 'lilydjwg/colorizer'
" Barre de status
Plug 'itchyny/lightline.vim'
" Contrôle de la syntaxe des langages de programmation
" http://vimawesome.com/plugin/syntastic
Plug 'scrooloose/syntastic'
" Plugin emmet coding
" http://vimawesome.com/plugin/emmet-vim
Plug 'mattn/emmet-vim'
" delte buffer without close windows
" https://vimawesome.com/plugin/vim-bbye
Plug 'gwww/vim-bbye'
" Amélioration des commentaires
" https://vimawesome.com/plugin/the-nerd-commenter
Plug 'scrooloose/nerdcommenter'
" _____ _______ ___
" / ___|_ _\ \ / / |
" \ `--. | | \ V /| |
" `--. \ | | \ / | |
" /\__/ / | | | | | |____
" \____/ \_/ \_/ \_____/
Plug 'morhetz/gruvbox'
"Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' }
" _ ___ _ _ _____
" | | / _ \ | \ | | __ \
" | | / /_\ \| \| | | \/
" | | | _ || . ` | | __
" | |____| | | || |\ | |_\ \
" \_____/\_| |_/\_| \_/\____/
Plug 'tpope/vim-haml' " Language haml sass scss
"Plug 'kchmck/vim-coffee-script' " CoffeScript
"Plug 'wavded/vim-stylus' " Stylus
"Plug 'evidens/vim-twig' " Twig
"Plug 'kylef/apiblueprint.vim' " API blueprint
Plug 'posva/vim-vue' " VueJs https://vimawesome.com/plugin/vim-vue-fearless
Plug 'hashivim/vim-terraform' " Terraform
Plug 'http://git.doublepsi.fr/gen3se/ver8e.vim.git' " Ver8e
Plug 'cespare/vim-toml' " toml
" ______
" | _ \
" | | | |_____ __
" | | | / _ \ \ / /
" | |/ / __/\ V /
" |___/ \___| \_/
Plug 'shawncplus/phpcomplete.vim', {'for':'php'}
" display ctags
Plug 'majutsushi/tagbar' "https://vimawesome.com/plugin/tagbar
" Autocomplétion via tab
Plug 'ervandew/supertab'
"Plug 'valloric/youcompleteme'
" _____ _____ _____ _
" |_ _| _ || _ | |
" | | | | | || | | | |
" | | | | | || | | | |
" | | \ \_/ /\ \_/ / |____
" \_/ \___/ \___/\_____/
Plug 'bgrohman/vim-bg-tables'
Plug 'godlygeek/tabular' " https://vimawesome.com/plugin/tabular
Plug 'jceb/vim-orgmode', {'for':'org'} " https://vimawesome.com/plugin/vim-orgmode
Plug 'tpope/vim-speeddating', {'for':'org'} " https://vimawesome.com/plugin/speeddating-vim
Plug 'mattn/calendar-vim', {'for':'org'}
" DistractionFree
" http://vimawesome.com/plugin/goyo-vim
Plug 'junegunn/goyo.vim'
" Focus on current text
" https://vimawesome.com/plugin/limelight-vim
Plug 'junegunn/limelight.vim'
" Snippets
" http://vimawesome.com/plugin/ultisnips-forever-and-always
"Plug 'SirVer/ultisnips'
"Plug 'honza/vim-snippets'
" icons
" https://vimawesome.com/plugin/vim-devicons
" MUST be the last called plugin
Plug 'ryanoasis/vim-devicons'
call plug#end()
" orgMod configuration
let maplocalleader = "="
let g:org_todo_keywords = [
\ ['TODO(t)', '|', 'DONE(d)'],
\ ['REPORT(r)', 'BUG(b)', 'KNOWNCAUSE(k)', '|', 'FIXED(f)'],
\ ['CANCELED(c)'],
\ ['ASK(a)', '|', 'SENDED(s)', 'ANSWERED']
\]
" Paramétrage du theme gruvbox
"let g:gruvbox_italic=1
set background=dark
let g:gruvbox_contrast_dark='medium'
let g:gruvbox_italicize_comments=0
"let g:challenger_deep_termcolors=16
"set termguicolors
colorscheme gruvbox
set history=1000
set autochdir
syntax on " Enable syntax highlighting
filetype plugin indent on " Enable filetype detection, plugins, and indentation
let g:lightline = {
\ 'colorscheme': 'gruvbox',
\ 'active': {
\ 'left' : [ [ 'mode', 'paste' ] ],
\ 'right' : [ [ 'lineinfo' ], [ 'percent' ] ]
\ },
\ }
" disable background color
hi Normal ctermbg=none guibg=none
set laststatus=2 " Affichage en permanence de la statusline
set noshowmode
set hidden " allow hidden buffers
set wildmenu
set wildmode=list:longest,full
set backupdir=~/.local/share/vim
set directory=~/.local/share/vim
set nobackup
set nowritebackup
set noswapfile
set nocompatible
set number " numérotation des lignes
set mouse=r " Let the mouse work in the console
set showmatch
set ruler " Always show cursor
set cursorline " Met en surbrillance la ligne courante
set noeb vb t_vb= " Suppression de ce putain de bip
set showcmd
" case-insensitive searches, unless caps are involved
set ignorecase
set smartcase
set foldmethod=indent
set foldlevel=99
set shortmess=atI
set autoread
set equalalways
set magic
set so=7
set clipboard=unnamed
" tabs -> spaces
set expandtab
set shiftwidth=4
set softtabstop=4
set tabstop=4
set shiftround
set cindent
set smartindent
set autoindent
" folding manual
set foldmethod=indent
" terraform
let g:terraform_fold_sections=1
let g:terraform_align=1
let g:terraform_remap_spacebar=1
let g:terraform_fmt_on_save=1
set hlsearch
set incsearch
" Affichage des espaces en fin de ligne et des tabulations
set listchars=tab:→\ ,trail:·
set list
set colorcolumn=80
" ## Mapping !
" NERDTree
map <F2> :silent NERDTreeToggle<CR>
" Toggle relative/absolute numbers
map <F3> :call NumberToggle()<CR>
map j gj
map k gk
let mapleader = "&"
imap <leader>; <Esc>$a;
imap <leader>: <Esc>$a:
imap <leader>. <Esc>$a.
imap <leader>, <Esc>$a,
imap <leader>) <Esc>$a)
imap <leader>- <Esc>$a->
imap <leader>= <Esc>$a=>
imap <leader>' <Esc>$a{
imap <leader>$ $this->
imap <leader>f function
if has('nvim')
" remap sortie du terminal par <Esc>
tnoremap <Esc> <C-\><C-n>
endif
if exists(":Tabularize")
vmap <leader>t= :Tabularize /=<CR>
vmap <leader>t: :Tabularize /:\zs<CR>
vmap <leader>t\ :Tabularize /\ \zs<CR>
endif
set pastetoggle=<leader>p
set confirm
" when ~/.vimrc is changed, autoload
"autocmd! BufWritePost .vimrc source %
" autorun files
set autowrite
command! -buffer W make
au BufNewFile,BufRead *.md set filetype=markdown
" indentation only
" no indentation
autocmd! FileType asciidoc set nospell nocindent noautoindent
" 4-space explicit
autocmd! FileType arduino,php,xml set nospell shiftwidth=4 softtabstop=4 tabstop=4
" 2-space
autocmd! FileType vhdl,javascript,scss,css,html,xhtml,yaml,stylus,vue set nospell shiftwidth=2 softtabstop=2 tabstop=2
" 8-space
" emmet coding configuration
let g:user_emmet_install_global = 0
autocmd FileType html EmmetInstall
autocmd FileType php EmmetInstall
" Switch entre numérotation relative et absolue
function! NumberToggle()
if(&relativenumber == 1)
let &relativenumber = 0
set number
else
let &relativenumber = 1
set relativenumber
endif
endfunction
" Limelight
let g:limelight_conceal_ctermfg = 240
" Goyo
function! s:goyo_enter()
silent !tmux set status off
set lbr
Limelight
set noshowmode
set noshowcmd
set scrolloff=999
set cursorline!
endfunction
function! s:goyo_leave()
silent !tmux set status on
set nolbr
set showmode
set showcmd
Limelight!
set scrolloff=5
set cursorline
endfunction
autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave()