-
Notifications
You must be signed in to change notification settings - Fork 77
/
.nvimrc
211 lines (177 loc) · 5.45 KB
/
.nvimrc
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
call plug#begin('~/.local/share/nvim/plugged')
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash install.sh',
\ }
" (Optional) Multi-entry selection UI.
Plug 'junegunn/fzf'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'randy3k/wombat256.vim'
Plug 'godlygeek/tabular'
Plug 'LaTeX-Box-Team/LaTeX-Box'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'kien/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'kassio/neoterm'
Plug 'scrooloose/nerdcommenter'
Plug 'JuliaEditorSupport/julia-vim'
" Plug 'epeli/slimux'
" Plug 'terryma/vim-multiple-cursors'
" Plug 'jalvesaq/Nvim-R'
call plug#end()
set completefunc=LanguageClient#complete
set formatexpr=LanguageClient#textDocument_rangeFormatting()
" let g:LanguageClient_loggingFile = expand('/tmp/LanguageClient.log')
" let g:LanguageClient_loggingLevel = 'DEBUG'
let g:LanguageClient_autoStart = 1
let g:LanguageClient_diagnosticsEnable = 1
let g:LanguageClient_serverCommands = {}
let g:LanguageClient_serverCommands.r = ['R', '--quiet', '--slave', '-e', 'languageserver::run(debug = TRUE)']
let g:LanguageClient_serverCommands.rmd = ['R', '--quiet', '--slave', '-e', 'languageserver::run(debug = TRUE)']
let g:LanguageClient_serverCommands.python = ['/Users/Randy/miniconda3/bin/pyls']
nnoremap <silent> K :call LanguageClient_textDocument_hover()<CR>
nnoremap <silent> gd :call LanguageClient_textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient_textDocument_rename()<CR>
" let R_source_args = "bracketed paste"
let g:R_app = "rice"
let g:R_cmd = "R"
let g:R_hl_term = 0
let g:R_bracketed_paste = 1
let g:R_args = [] " if you had set any
syntax enable
filetype plugin on
filetype indent on
set mouse=a
set wildignorecase
if &buftype != 'terminal'
set number
end
set tabstop=4
set shiftwidth=4
set expandtab
set cursorline
set backspace=2
set clipboard=unnamed
" set notimeout
" set ttimeout
if has("gui_vimr")
set termguicolors
endif
let g:terminal_color_0 = '#000000'
let g:terminal_color_1 = '#ffa083'
let g:terminal_color_2 = '#acdf00'
let g:terminal_color_3 = '#ffd787'
let g:terminal_color_4 = '#88b6e0'
let g:terminal_color_5 = '#c99fff'
let g:terminal_color_6 = '#cfe58b'
let g:terminal_color_7 = '#e5e5e5'
let g:terminal_color_8 = '#676767'
let g:terminal_color_9 = '#ffa083'
let g:terminal_color_10 = '#acdf00'
let g:terminal_color_11 = '#ffd787'
let g:terminal_color_12 = '#88b6e0'
let g:terminal_color_13 = '#c99fff'
let g:terminal_color_14 = '#cfe58b'
let g:terminal_color_15 = '#feffff'
color wombat256mod
let g:airline_theme='wombat'
let g:airline_powerline_fonts=1
set laststatus =2
set ttimeoutlen=50
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
let mapleader = " "
let g:NERDSpaceDelims = 1
noremap <C-f> <C-d>
noremap <C-b> <C-u>
" tnoremap <esc> <C-\><C-n>
tnoremap jk <C-\><C-n>
inoremap jk <esc>
cnoremap jk <C-c>
nnoremap <tab> <C-w>w
nnoremap <S-tab> <C-w>W
let g:neoterm_autoscroll = 1
augroup neoterm_keybinds
autocmd!
" autocmd filetype r,python inoremap <buffer> <silent> <C-j> <esc>:TREPLSendLine<CR>jI
autocmd filetype r,python,julia nnoremap <buffer> <silent> <C-j> :TREPLSendLine<CR>j
autocmd filetype r,python,julia vnoremap <buffer> <silent> <C-j> :TREPLSendSelection<CR>gv
augroup end
nnoremap <C-k> <Up>
nnoremap <C-l> <Right>
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
cnoremap <C-h> <Left>
cnoremap <C-j> <Down>
cnoremap <C-k> <Up>
cnoremap <C-l> <Right>
" sudo write
cnoremap sudow w !sudo tee % >/dev/null
" disable ctrlp default keybind
let g:ctrlp_map = ''
autocmd! VimEnter * call s:fcy_nerdcommenter_map()
function! s:fcy_nerdcommenter_map()
nmap <leader>cc <plug>NERDCommenterToggle
vmap <leader>cc <plug>NERDCommenterToggle gv
endfunction
" spacemacs like keybinds
" zoom / restore window
function! s:ZoomToggle() abort
if exists('t:zoomed') && t:zoomed
exec t:zoom_winrestcmd
let t:zoomed = 0
else
let t:zoom_winrestcmd = winrestcmd()
resize
vertical resize
let t:zoomed = 1
endif
endfunction
command! ZoomToggle call s:ZoomToggle()
function! s:WinLayoutToggle() abort
if exists('t:horizonal') && t:horizonal
let t:horizonal = 0
execute "windo wincmd K"
else
let t:horizonal = 1
execute "windo wincmd H"
endif
endfunction
command! WinLayoutToggle call s:WinLayoutToggle()
nmap <Leader>bb :buffers<CR>
nmap <Leader>bd :bdelete<CR>
nmap <Leader>bn :bn<CR>
nmap <Leader>bp :bp<CR>
nmap <Leader>br :e<CR>
nmap <Leader>rc :e ~/.nvimrc<CR>
nmap <Leader>rr :source ~/.nvimrc<CR>
nmap <Leader>ff :CtrlPCurFile<CR>
nmap <Leader>fr :CtrlPMRU<CR>
nmap <Leader>fs :w<CR>
nmap <Leader>fS :wa<CR>
nmap <Leader>ft :NERDTreeToggle<CR>
nmap <Leader>tn :set number!<CR>
nmap <Leader>tl :set wrap!<CR>
nnoremap <silent> <Leader>l :nohlsearch<CR><C-l>
nmap <Leader>w- :sp<CR>
nmap <Leader>w\ :vsp<CR>
nmap <Leader>w<Bar> :vsp<CR>
nmap <Leader>w= <C-w>=
nmap <Leader>w+ :ZoomToggle<CR>
nmap <Leader>wt :WinLayoutToggle<CR>
nmap <Leader>wc :q<CR>
nmap <Leader>wh <C-w>h
nmap <Leader>wH <C-w>H
nmap <Leader>wj <C-w>j
nmap <Leader>wk <C-w>k
nmap <Leader>wl <C-w>l
nmap <Leader>wL <C-w>L
nmap <Leader>w<left> <C-w><
nmap <Leader>w<right> <C-w>>
nmap <Leader>ws <C-w>s
nmap <Leader>wv <C-w>v
nmap <Leader>ww <C-w><C-w>