-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.vim
236 lines (197 loc) · 5.38 KB
/
init.vim
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
call plug#begin()
Plug 'preservim/nerdtree' |
\ Plug 'Xuyuanp/nerdtree-git-plugin'
" Themes
Plug 'morhetz/gruvbox'
" Icons
Plug 'ryanoasis/vim-devicons'
" plugin of auto complete
Plug 'maralla/completor.vim'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
" Plug 'cohama/lexima.vim'
" Plug 'tpope/vim-surround'
" Plug 'tommcdo/vim-lion'
Plug 'lewis6991/spellsitter.nvim'
" Copy outside of vim <cp>
Plug 'christoomey/vim-system-copy'
" Compile the code and give warnings
Plug 'dense-analysis/ale'
" Tabline status
Plug 'powerline/powerline'
Plug 'itchyny/lightline.vim'
Plug 'tribela/vim-transparent'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'sakhnik/nvim-gdb', { 'do': ':!./install.sh' }
Plug 'kyazdani42/nvim-web-devicons'
Plug 'mhinz/vim-startify'
"Plug 'romgrk/barbar.nvim'
Plug 'akinsho/toggleterm.nvim'
Plug 'universal-ctags/ctags'
Plug 'sheerun/vim-polyglot'
Plug 'rust-lang/rust.vim'
Plug 'preservim/tagbar'
Plug '42Paris/42header'
"Plug 'vim-syntastic/syntastic'
"Plug 'Shirk/vim-gas'
call plug#end()
autocmd!
" Theme
set background=dark
colorscheme gruvbox
" true color
if exists("&termguicolors") && exists("&winblend")
syntax enable
set termguicolors
set winblend=0
set wildoptions=pum
set pumblend=5
set background=dark
" Use gruvbox
let g:gruvbox_contrast_dark = ''
colorscheme gruvbox
endif
"}}}
" auto complete
au FileType php setl ofu=phpcomplete#CompletePHP
au FileType ruby,eruby setl ofu=rubycomplete#Complete
au FileType html,xhtml setl ofu=htmlcomplete#CompleteTags
au FileType c setl ofu=ccomplete#CompleteCpp
au FileType css setl ofu=csscomplete#CompleteCSS
" folding
set foldmethod=syntax
set foldmethod=indent
set foldlevel=99
set nofoldenable
" smart indent
filetype indent on
set filetype=html
set smartindent
"add costume rules to lexima
" call lexima#add_rule({'char': '$', 'input_after': '$', 'filetype': 'latex'})
" call lexima#add_rule({'char': '$', 'at': '\%#\$', 'leave': 1, 'filetype': 'latex'})
" call lexima#add_rule({'char': '<BS>', 'at': '\$\%#\$', 'delete': 1, 'filetype': 'latex'})
" Syntax highlighting
syntax on
" Position in code
set number
set ruler
" Don't make noise
set visualbell
" default file encoding
set encoding=UTF-8
" Line wrap
set wrap
set laststatus=2
" Highlight search results
set hlsearch
set incsearch
set showcmd
set cmdheight=1
set laststatus=2
set scrolloff=10
set expandtab
set lazyredraw
set ignorecase
set smarttab
set rnu
syntax enable
set fileencodings=utf-8,sjis,euc-jp,latin
set title
set autoindent
set nocompatible
set nohlsearch
" Add asterisks in block comments
set formatoptions+=r
" auto + smart indent for code
set autoindent
set smartindent
set t_Co=256
" Mouse support
set mouse=a
" Map F8 to Tagbar
nmap <F8> :TagbarToggle<CR>
map <F2> :NERDTreeToggle<CR>
" CTags config
let g:Tlist_Ctags_Cmd='/usr/local/Cellar/ctags/5.8_1/bin/ctags'
" disable backup files
set nobackup
set nowritebackup
" no delays!
set updatetime=300
set cmdheight=1
set shortmess+=c
set signcolumn=yes
let NERDTreeMinimalUI = 1
let NERDTreeDirArrows = 1
" add cocstatus into lightline
let g:lightline = {
\ 'colorscheme': 'powerline',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Splits and Tabbed Files
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set splitbelow splitright
" Change between places of window CTRL+w big R
" vs filename
" sp filename
" vs or sp | terminal
" Remap splits navigation to just CTRL + hjkl
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
tnoremap <Esc> <C-\><C-n>
" autocmd TermOpen * startinsert
" Make adjusing split sizes a bit more friendly
noremap <silent> <C-Left> :vertical resize +3<CR>
noremap <silent> <C-Right> :vertical resize -3<CR>
noremap <silent> <C-Up> :resize +3<CR>
noremap <silent> <C-Down> :resize -3<CR>
" Change 2 split windows from vert to horiz or horiz to vert
map <Leader>th <C-w>t<C-w>H
map <Leader>tk <C-w>t<C-w>K
" Removes pipes | that act as seperators on splits
set fillchars+=vert:█
let g:startify_lists = [
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'header': [' Bookmarks'], 'type': 'bookmarks' },
\ { 'header': [' MRU'], 'type': 'files' },
\ { 'header': [' MRU '. getcwd()], 'type': 'dir' },
\ ]
augroup ScrollbarInit
autocmd!
autocmd WinScrolled,VimResized,QuitPre * silent! lua require('scrollbar').show()
autocmd WinEnter,FocusGained * silent! lua require('scrollbar').show()
autocmd WinLeave,BufLeave,BufWinLeave,FocusLost * silent! lua require('scrollbar').clear()
augroup end
let g:completor_clang_binary = '/usr/bin/clang'
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-b>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsEditSplit="vertical"
" Imports "{{{
" ---------------------------------------------------------------------
runtime ./plug.vim
if has("unix")
let s:uname = system("uname -s")
" Do Mac stuff
if s:uname == "Darwin\n"
runtime ./macos.vim
endif
endif
if has('win32')
runtime ./windows.vim
endif
runtime ./maps.vim
"}}}
let g:user42 = 'hkaddour'
let g:mail42 = '[email protected]'