-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
193 lines (155 loc) · 4.3 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
set nocompatible
set termguicolors
syntax on
filetype on
filetype plugin on
filetype plugin indent on
set encoding=utf-8
colorscheme desert
set signcolumn=auto
set tabstop=4
set shiftwidth=4
set softtabstop=4
set colorcolumn=80
set autoindent
set expandtab
set noshowmatch
set showcmd
set incsearch
set hlsearch
set smartcase
set backspace=2
set backspace=indent,eol,start
set nu
set completeopt=longest,menuone,noselect
"set textwidth=80
set nofixendofline
set updatetime=300
if has('gui_running')
set guifont=Monospace\ 8
endif
hi Pmenu ctermbg=darkgray guibg=#0f0f0f
hi PmenuSel ctermbg=lightgray guibg=#303030
set list
set listchars=tab:»\ ,extends:»,precedes:«,trail:·
set statusline=%<%f\ %y%h%m%r\ %{coc#status()}\ %{get(b:,'coc_current_function','')}%=%-24.(%o\ %l/%L\ %c%V%)\ %P
set laststatus=2
set wildmenu
set wildmode=longest,list
let maplocalleader = "\\"
let no_ocaml_maps=1
nnoremap <C-Up> <c-w>k
nnoremap <C-Down> <c-w>j
nnoremap <C-Left> <c-w>h
nnoremap <C-Right> <c-w>l
nnoremap <ESC>+ <c-w>+
nnoremap <ESC>- <c-w>-
nnoremap <ESC>/ <c-w><
nnoremap <ESC>* <c-w>>
nnoremap <C-k> :cn<CR>
nnoremap <C-j> :cp<CR>
" <Ctrl-l> redraws the screen and removes any search highlighting.
nnoremap <silent> <C-l> :nohl<CR><C-l>
au BufNewFile,BufRead *.tex set filetype=tex
runtime autoload/vim-plug/plug.vim
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'vim-syntastic/syntastic'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'junegunn/vim-easy-align'
Plug 'embear/vim-localvimrc'
Plug 'jeetsukumaran/vim-buffergator'
Plug 'solarnz/thrift.vim', {'for': 'thrift'}
Plug 'lervag/vimtex', {'for': 'tex'}
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'rust-lang/rust.vim'
Plug 'Yggdroot/indentLine'
"Plug 'thaerkh/vim-indentguides'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'liuchengxu/vista.vim'
Plug 'kevinoid/vim-jsonc'
Plug 'leafgarland/typescript-vim'
Plug 'peitalin/vim-jsx-typescript'
Plug 'tikhomirov/vim-glsl'
" Initialize plugin system
call plug#end()
"""""""""
" CtrlP "
"""""""""
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.(git|hg|svn))|node_modules$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': 'some_bad_symbolic_links',
\ }
"""""""
" CoC "
"""""""
autocmd CursorHold * silent call CocActionAsync('highlight')
nnoremap <F5> <Plug>(coc-codeaction)
nmap <leader>gt <Plug>(coc-definition)
nmap <leader>gi <Plug>(coc-implementation)
nmap <leader>gd <Plug>(coc-declaration)
nmap <leader>gf <Plug>(coc-references)
nmap <leader>gy <Plug>(coc-type-definition)
nmap <leader>a <Plug>(coc-codeaction)
nmap <leader>F <Plug>(coc-format)
nmap <leader>f <Plug>(coc-format-selected)
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>k :call CocAction('doHover')<CR>
nmap <leader>rn <Plug>(coc-rename)
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<cr>"
set completeopt=menuone,preview
"""""""""""""
" Syntastic "
"""""""""""""
" Use passive mode for haskell
let g:syntastic_mode_map = {
\ "mode": "active",
\ "passive_filetypes": ["haskell"] }
let g:syntastic_python_checkers = []
let g:syntastic_ocaml_checkers = ['merlin']
let g:syntastic_c_checkers = []
let g:syntastic_cpp_checkers = []
let g:syntastic_rust_checkers = []
let g:syntastic_javascript_checkers = ['eslint']
"""""""""""""
" EasyAlign "
"""""""""""""
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" / align for C++ comments
let g:easy_align_delimiters = {
\ '/': {
\ 'pattern': '//\+\|/\*\|\*/',
\ 'delimiter_align': 'l',
\ 'ignore_groups': ['!Comment']
\ }
\ }
"""""""""
" Vista "
"""""""""
let g:vista_default_executive = 'coc'
let g:vista_fzf_preview = ['right:50%']
let g:vista_stay_on_open = 0
" Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind.
let g:vista#renderer#enable_icon = 0
nmap <F8> :Vista<CR>
""""""""""
" vim-go "
""""""""""
let g:go_gopls_enabled = 0
""""""""""""""
" indentLine "
""""""""""""""
let g:indentLine_char = '┆'
""""""""""""""
" localvimrc "
""""""""""""""
let g:localvimrc_sandbox = 0
let g:localvimrc_whitelist = [
\ ]