commit b981914c790684b4a3599a860f2c1a7e0306f05b
Author: Pollux <pollux@pollux.codes>
Date: Mon, 26 May 2025 21:04:55 -0500
vim: add vim configuration
Signed-off-by: Pollux <pollux@pollux.codes>
Diffstat:
A | .vimrc | | | 74 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 74 insertions(+), 0 deletions(-)
diff --git a/.vimrc b/.vimrc
@@ -0,0 +1,74 @@
+""" Plugins
+let data_dir = '~/.vim'
+if empty(glob(data_dir . '/autoload/plug.vim'))
+ silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
+endif
+
+autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
+ \| PlugInstall --sync
+ \| endif
+
+call plug#begin()
+
+" Colorscheme
+Plug 'dylanaraps/wal.vim'
+autocmd VimEnter * colorscheme wal
+
+" Snippets Engine
+Plug 'SirVer/ultisnips'
+let g:UltiSnipsExpandTrigger="<tab>"
+
+" Fuzzyfind
+Plug 'junegunn/fzf.vim'
+
+" LSP
+Plug 'yegappan/lsp'
+let lspServers = [#{
+ \ name: 'pylsp',
+ \ filetype: ['python'],
+ \ path: '/usr/bin/pylsp',
+ \ args: []
+ \ },#{
+ \ name: 'ccls',
+ \ filetype: ['c', 'cpp'],
+ \ path: '/usr/bin/ccls',
+ \ args: []
+ \ },#{
+ \ name: 'rust-analyzer',
+ \ filetype: ['rust'],
+ \ path: '/usr/bin/rust-analyzer',
+ \ args: []
+ \ },#{
+ \ name: 'texlab',
+ \ filetype: ['latex', 'tex', 'plaintex'],
+ \ path: '/home/pollux/.cargo/bin/texlab',
+ \ args: []
+ \ }]
+autocmd User LspSetup call LspAddServer(lspServers)
+
+call plug#end()
+
+""" Settings
+set incsearch
+set relativenumber
+
+let g:netrw_keepdir = 0
+let g:netrw_banner = 0
+let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'
+let g:netrw_localcopydircmd = 'cp -r'
+
+
+""" Keybindings
+
+let mapleader = " "
+
+" LSP
+nmap ,D :LspGotoDefinition<CR>
+nmap ,dd :LspDiagCurrent<CR>
+nmap ,dn :LspDiagNextWrap<CR>
+nmap ,dp :LspDiagPrevWrap<CR>
+
+" Misc
+nmap <C-n> :noh<CR>
+
+nmap <leader>e :if exists(':Rex')<cr>Rex<cr>else<cr>Ex<cr>endif<cr><cr>