home | blog | art | now | git gpg | email | rss

dotfiles

My personal dotfiles.
git clone git://pollux.codes/git/dotfiles.git
Log | Files | Refs
commit 57833ab5ebd7f7cde94d3a618245a2062da0e022
Author: Pollux <pollux@pollux.codes>
Date:   Thu, 17 Jul 2025 17:12:36 -0500

Add .vimrc

Signed-off-by: Pollux <pollux@pollux.codes>

Diffstat:
A.vimrc | 122+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 122 insertions(+), 0 deletions(-)

diff --git a/.vimrc b/.vimrc @@ -0,0 +1,122 @@ +""" 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>" + +" Project Management/Search +Plug 'leafOfTree/vim-project' +let g:vim_project_config = { + \'auto_load_on_start': 1, + \'tasks': [ + \{ + \'name': 'terminal', + \'cmd': '' + \}, + \], + \'new_tasks': [ + \{ + \'name': 'empty', + \'cmd': 'mkdir', + \}, + \], + \'new_tasks_post_cmd': 'touch README.md && cp /var/db/repos/gentoo/licenses/GPL-3 LICENSE && git init && git add . && git commit -s -m "Initial commit"' +\} + +" LSP +Plug 'yegappan/lsp' +let lspServers = [#{ + \ name: 'pylsp', + \ filetype: ['python'], + \ path: '/usr/bin/pylsp', + \ args: [] + \ },#{ + \ name: 'clangd', + \ filetype: ['c', 'cpp'], + \ path: '/usr/lib/llvm/20/bin/clangd', + \ args: ['--background-index', '--clang-tidy'] + \ },#{ + \ name: 'gopls', + \ filetype: ['go'], + \ path: '/usr/bin/gopls', + \ 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() + +""" Misc AutoCMDs + +function OnStart() + if @% == "" + ProjectList + endif +endfunction +autocmd VimEnter * call OnStart() + +""" Settings +set cc=80 +set incsearch +set number +set relativenumber + +set tabstop=8 +set shiftwidth=8 +set list +set listchars=tab:>-,lead:.,trail:~,extends:>,precedes:< + +let g:netrw_banner = 0 +let g:netrw_liststyle = 3 +let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+' +let g:netrw_localcopydircmd = 'cp -r' + +""" Keybindings + +let mapleader = " " + +" Buffer Stuff +nmap <C-b>n :bnext!<CR> +nmap <C-b>l :buffers<CR>:b! + +" LSP +nmap ,D :LspGotoDefinition<CR> +nmap ,r :LspRename<CR> +nmap ,dd :LspDiagCurrent<CR> +nmap ,dn :LspDiagNextWrap<CR> +nmap ,dp :LspDiagPrevWrap<CR> + +" Projects +nmap ;; :ProjectList<CR> +nmap ;g :ProjectFindInFiles<CR> +nmap ;f :ProjectSearchFiles<CR> +nmap ;r :ProjectRun<CR> +nmap ;c :ProjectConfig<CR> + +" Misc +nmap <C-n> :noh<CR> + +nmap <leader>e :if exists(':Rex')<cr>Rex<cr>else<cr>Ex<cr>endif<cr><cr>