-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.vim
More file actions
230 lines (193 loc) · 6.21 KB
/
init.vim
File metadata and controls
230 lines (193 loc) · 6.21 KB
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
set nocompatible
set cmdheight=2
" Plugins:
call plug#begin('~/.vim/plugged')
" additional languages
Plug 'rust-lang/rust.vim'
Plug 'tshirtman/vim-cython'
" Tools
Plug 'pearofducks/ansible-vim'
Plug 'hashivim/vim-hashicorp-tools'
Plug 'ekalinin/Dockerfile.vim'
" Fuzzy search
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Autocomplete
Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-tmux'
Plug 'Shougo/neco-syntax'
Plug 'Shougo/echodoc.vim'
Plug 'ncm2/ncm2-syntax'
Plug 'ncm2/ncm2-tagprefix'
Plug 'prabirshrestha/async.vim'
Plug 'prabirshrestha/vim-lsp'
Plug 'ncm2/ncm2-vim-lsp'
"Linting"
Plug 'w0rp/ale'
" Rest"
Plug 'ervandew/supertab'
Plug 'Konfekt/FastFold'
Plug 'tmhedberg/SimpylFold'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'jacoborus/tender.vim'
Plug 'NLKNguyen/papercolor-theme'
" Plug 'kien/rainbow_parentheses.vim'
Plug 'tpope/vim-surround'
Plug 'jiangmiao/auto-pairs'
Plug 'majutsushi/tagbar'
Plug 'tomtom/tcomment_vim'
Plug 'jreybert/vimagit'
call plug#end()
" General
set splitbelow
set splitright
set hidden
set path+=**
set visualbell
" Apperiance
set number
set nowrap
set cursorline
set showmode
set showcmd
set t_Co=256 " This is may or may not needed.
set background=light
" colorscheme PaperColor
colorscheme tender
" let g:airline_theme = 'papercolor'
let g:airline_left_sep=''
let g:airline_right_sep=''
" let g:airline#extensions#tabline#enabled = 1
let g:python3_host_prog = '/home/linuxbrew/.linuxbrew/bin/python3'
let g:python_host_prog = '/home/linuxbrew/.linuxbrew/bin/python'
"" Enable folding
" Enable folding with the spacebar
nnoremap <space> za
let g:SimpylFold_docstring_preview=1
set foldmethod=indent
set foldlevel=99
nmap zuz <Plug>(FastFoldUpdate)
let g:fastfold_savehook = 1
let g:fastfold_fold_command_suffixes = ['x','X','a','A','o','O','c','C']
let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk']
" Search
set hlsearch
set incsearch
set ignorecase
set smartcase
set showmatch
" Plugins
"let g:easytags_async = 1
"let g:ctrlp_map = '<c-p>'
"let g:ctrlp_cmd = 'CtrlP'
set completeopt=noinsert,menuone,noselect
autocmd BufEnter * call ncm2#enable_for_buffer()
let g:tagbar_type_rust = {
\ 'ctagstype' : 'rust',
\ 'kinds' : [
\'T:types,type definitions',
\'f:functions,function definitions',
\'g:enum,enumeration names',
\'s:structure names',
\'m:modules,module names',
\'c:consts,static constants',
\'t:traits,traits',
\'i:impls,trait implementations',
\]
\}
" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
let g:SuperTabDefaultCompletionType = '<C-n>'
let g:lsc_server_commands = {'dart': 'dart_language_server'}
" better key bindings for UltiSnipsExpandTrigger
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
" Normal mode mappings
" Just use default now
" 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 <c-q> :close<CR>
nnoremap <C-PAGEUP> :tabprevious <CR>
nnoremap <C-PAGEDOWN> :tabnext <CR>
nnoremap <C-Left> :tabprevious <CR>
nnoremap <C-Right> :tabnext <CR>
nnoremap <C-p>f :FZF<CR>
nnoremap <C-p>b :Buffers <CR>
nnoremap <C-p>s :Rg<CR>
nnoremap <C-p>g :GFiles<CR>
nnoremap <C-p>t :Tags<CR>
nnoremap <C-p>T :TagbarToggle<CR>
nnoremap <C-p>w :Windows<CR>
nnoremap <C-p>w :Marks<CR>
" Leader:
let mapleader = ","
" map <leader>l :set list!<CR> "show hidden
" Commands:
command! MakeTags !ctags -R --python-kinds=-i .
" no tabs
set tabstop=2
set shiftwidth=2
set expandtab
" Filetypes:
autocmd BufWritePre * :%s/\s\+$//e
autocmd BufRead,BufNewFile *.zcml setlocal filetype=xml
autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab " No spaces
autocmd FileType go set tabstop=4|set shiftwidth=4|set expandtab " No spaces
autocmd FileType html,css EmmetInstall
autocmd FileType c set foldmethod=syntax
autocmd FileType haskell set foldmethod=indent
" let g:lsp_diagnostics_enabled = 1 " disable diagnostics support
" let g:lsp_signs_enabled = 1 " enable signs
" let g:lsp_diagnostics_echo_cursor = 1 " enable echo under cursor when in normal mode
"
" let g:lsp_signs_error = {'text': '✗'}
" let g:lsp_signs_warning = {'text': '‼'} " icons require GUI
" let g:lsp_signs_hint = {'test': '?'} " icons require GUI
"
if executable('pyls')
" pip install python-language-server
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
if executable('typescript-language-server')
au User lsp_setup call lsp#register_server({
\ 'name': 'typescript-language-server',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'typescript-language-server --stdio']},
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'tsconfig.json'))},
\ 'whitelist': ['typescript'],
\ })
endif
if executable('docker-langserver')
au User lsp_setup call lsp#register_server({
\ 'name': 'docker-langserver',
\ 'cmd': {server_info->[&shell, &shellcmdflag, 'docker-langserver --stdio']},
\ 'whitelist': ['dockerfile'],
\ })
endif
if executable('flow')
au User lsp_setup call lsp#register_server({
\ 'name': 'flow',
\ 'cmd': {server_info->['flow', 'lsp']},
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), '.flowconfig'))},
\ 'whitelist': ['javascript', 'javascript.jsx'],
\ })
endif
if executable('rls')
au User lsp_setup call lsp#register_server({
\ 'name': 'rls',
\ 'cmd': {server_info->['rls']},
\ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'Cargo.toml'))},
\ 'whitelist': ['rust'],
\ })
endif