-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
335 lines (276 loc) · 8 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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
" Jake's NEOVIM settings
" main rc for generic keybindings, settings, and plugin loading
" plugins
call plug#begin("~/.vim/plugged")
Plug 'folke/tokyonight.nvim', { 'branch': 'main' }
Plug 'ryanoasis/vim-devicons'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'scrooloose/nerdtree'
" Plug 'nvim-tree/nvim-tree.lua'
Plug 'preservim/nerdcommenter'
" Plug 'mhinz/vim-startify'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'kyazdani42/nvim-web-devicons' " Recommended (for coloured icons)
Plug 'romgrk/barbar.nvim'
Plug 'github/copilot.vim'
Plug 'junegunn/goyo.vim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
Plug 'nvim-tree/nvim-tree.lua'
" lean shit
Plug 'Julian/lean.nvim'
Plug 'neovim/nvim-lspconfig'
Plug 'nvim-lua/plenary.nvim'
Plug 'hrsh7th/nvim-cmp' " For LSP completion
Plug 'hrsh7th/vim-vsnip' " For snippets
Plug 'andrewradev/switch.vim' " For Lean switch support
Plug 'tomtom/tcomment_vim' " For commenting motions
" end lean shit
" latex shit
Plug 'lervag/vimtex'
" end latex shit
" CS3500 shit
Plug 'puremourning/vimspector'
" end CS3500 shit
call plug#end()
set nocompatible
filetype on
filetype plugin on
filetype indent on
" syntax on
syntax on
" num highlighting on
set number
set shiftwidth=4
set tabstop=4
set expandtab
set nobackup
set scrolloff=10
set nowrap
set incsearch
set ignorecase
set smartcase
set showcmd
set showmode
set showmatch
set hlsearch
set history=1000
set wildmenu
set wildmode=list:longest
set wildignore=*.docx,*.jpg,*.png,*gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.png
set noswapfile
set wildmode=longest,list
set cc=80
set colorcolumn=0
set t_Co=256
let s:fontsize = 12
" Clear highlighting on escape in normal mode
nnoremap <esc> :noh<return><esc>
nnoremap <esc>^[ <esc>^[
" update everything, faster completion
set updatetime=300
" auto signcolumn
set signcolumn=auto
" set terminal title to vim
set title
set titlestring=%(%{expand(\"%:~:h\")}%)#%(\ %t%)%(\ %M%)%(\ %)NVIM
" Italics
let &t_ZH="\e[3m"
let &t_ZR="\e[23m"
" File browser
let g:netrw_banner=0
let g:netrw_liststyle=0
let g:netrw_browse_split=4
let g:netrw_altv=1
let g:netrw_winsize=25
let g:netrw_keepdir=0
let g:netrw_localcopydircmd='cp -r'
" Defualt Clipboard
set clipboard+=unnamedplus
" true colors, needs patched urxvt or st to work right
set termguicolors
" set mouse on
set mouse=a
" https://stackoverflow.com/questions/34675677/disable-highlight-matched-parentheses-in-vim-let-loaded-matchparen-1-not-w
let loaded_matchparen = 1
set noshowmatch
inoremap {<CR? {<CR>}<C-o>O}
set splitright
set splitbelow
" auto file wrap for certain types of files
augroup Wrapline
autocmd!
autocmd FileType tex setlocal wrap
augroup END
" save file w/ ctrl+s
command -nargs=0 -bar Update if &modified
\| if empty(bufname('%'))
\| browse confirm write
\| else
\| confirm write
\| endif
\|endif
nnoremap <silent> <C-S> :<C-u>Update<CR>
inoremap <c-s> <Esc>:Update<CR>
" set relativenumber
set nu
" cursor blinkage
" set guicursor=v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait1700-blinkoff400-blinkon950-Cursor/lCursor,sm:block,n:block-blinkon0
set smarttab
set cindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
" always uses spaces instead of tab characters
set expandtab
" keep undos in a file
set undofile
set undodir=~/.local/share/nvim/cache
" lines to keep cursor vertically centered
set scrolloff=10
" remember cursor location
set viminfo='100,\"2500,:200,%,n~/.cache/.viminfo
" set encodings
set fileencodings=utf-8
set encoding=utf-8
" Map Ctrl-Backspace to delete the previous word in insert mode.
imap <C-BS> <C-W>
imap <C-H> <C-W>
" Set coc complete to be shift tab
inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
" set copilot complete to control shift tab
" inoremap <expr> <S-Tab> copilot#Accept("\<CR>")
" let g:copilot_no_tab_map = v:true
" imap <silent><script><expr> <C-[> copilot#Accept("\<CR>")
if &filetype ==# 'md' || &filetype ==# 'tex'
setlocal wrap
endif
" color theming
let g:tokyonight_style = "night"
let g:tokyonight_italic_functions = 1
let g:tokyonight_sidebars = [ "qf", "vista_kind", "terminal", "packer" ]
let g:tokyonight_colors = {
\ 'bg_dark': '#ff0000',
\ 'bg': '#0d0d0d',
\ 'fg': '#e3e1e1'
\ }
colorscheme tokyonight
" nerdtree stuff
" map <C-o> :NERDTreeToggle<CR>
" Tree
nnoremap <C-o> :NvimTreeToggle<CR>
let NERDTreeIgnore=['\.git$', '\.jpg$', '\.mp4$', '\.ogg$', '\.iso$', '\.pdf$', '\.pyc$', '\.odt$', '\.png$', '\.gif$', '\.db$', '\.class$']
" move between panes to left/bottom/top/right
nnoremap <C-j> <C-w>h
nnoremap <C-k> <C-w>j
nnoremap <C-i> <C-w>k
nnoremap <C-l> <C-w>l
" term toggle
map <C-t> :term<CR>
" exit terminal mode mapping
tnoremap <Esc> <C-\><C-n>
" nnoremap <silent> <C-q> <C-w>s<C-w>j:resize 20<CR>:terminal<CR><S-i>
" Focus commands
nnoremap <C-a>z :Goyo 80<CR>
nnoremap <C-a>q :Goyo!<CR>
let g:copilot_filetypes={
\ '*': v:false,
\ 'python': v:true,
\ 'rust': v:true,
\ 'cpp': v:true,
\ 'c': v:true,
\ 'java': v:true,
\ 'javascript': v:true,
\ 'typescript': v:true,
\ 'go': v:true,
\ 'pml': v:true
\ }
" Telescope
nnoremap <C-h>f :Telescope find_files<CR>
nnoremap <C-h>d :Telescope live_grep<CR>
nnoremap <C-h>u :Telescope lsp_definitions<CR>
nnoremap <C-h>e :Telescope<CR>git_
nnoremap <C-h>h :Telescope<CR>
fun! Start()
" Don't run if: we have commandline arguments, we don't have an empty
" buffer, if we've not invoked as vim or gvim, or if we'e start in insert mode
if argc() || line2byte('$') != -1 || v:progname !~? '^[-gmnq]\=vim\=x\=\%[\.exe]$' || &insertmode
return
endif
" Start a new buffer ...
enew
" ... and set some options for it
setlocal
\ bufhidden=wipe
\ buftype=nofile
\ nobuflisted
\ nocursorcolumn
\ nocursorline
\ nolist
\ nonumber
\ noswapfile
\ norelativenumber
" Now we can just write to the buffer, whatever you want.
" call append('$', "")
for line in split(system('cat /home/synchronous/.config/nvim/startscreen.vimstart'), '\n')
call append('$', '' . l:line)
endfor
" No modifications to this buffer
setlocal nomodifiable nomodified
" When we go to insert mode start a new buffer, and start insert
nnoremap <buffer><silent> e :enew<CR>
nnoremap <buffer><silent> i :enew <bar> startinsert<CR>
nnoremap <buffer><silent> o :enew <bar> startinsert<CR>
set syntax=off
" nmap <ScrollWheelUp> <nop>
" nmap <S-ScrollWheelUp> <nop>
" nmap <C-ScrollWheelUp> <nop>
" nmap <ScrollWheelDown> <nop>
" nmap <S-ScrollWheelDown> <nop>
" nmap <C-ScrollWheelDown> <nop>
" nmap <ScrollWheelLeft> <nop>
" nmap <S-ScrollWheelLeft> <nop>
" nmap <C-ScrollWheelLeft> <nop>
" nmap <ScrollWheelRight> <nop>
" nmap <S-ScrollWheelRight> <nop>
" nmap <C-ScrollWheelRight> <nop>
nmap <C-a> :enew <bar> startinsert <bar> :Goyo 80<CR>
endfun
" Run after doing all the startup stuff
autocmd VimEnter * call Start()
lua << EOF
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
require('nvim-tree').setup()
require('nvim-tree').setup({
sort_by = 'case_sensitive',
view = {
adaptive_size = false,
mappings = {
list = {
{ key = 'u', action = 'dir_up' },
},
},
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
exclude = {".git", ".jpg", ".mp4", ".ogg", ".iso", ".pdf", ".odt", ".png", ".gif", ".db", ".class"},
},
actions = {
open_file = {
resize_window = false
}
},
})
EOF
" " sourcing other rcs
source ~/.config/nvim/vimtex-rc.vim
source ~/.config/nvim/bufferline-rc.vim
source ~/.config/nvim/vimspector-rc.vim