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

dotfiles

My personal dotfiles.
git clone git://pollux.codes/git/dotfiles.git
Log | Files | Refs

.vimrc (2525B)


      1 """ Plugins
      2 let data_dir = '~/.vim'
      3 if empty(glob(data_dir . '/autoload/plug.vim'))
      4 	silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
      5 endif
      6 
      7 autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
      8 	\| PlugInstall --sync
      9 	\| endif
     10 
     11 call plug#begin()
     12 
     13 " Colorscheme
     14 Plug 'dylanaraps/wal.vim'
     15 autocmd VimEnter * colorscheme wal
     16 
     17 " Snippets Engine
     18 Plug 'SirVer/ultisnips'
     19 let g:UltiSnipsExpandTrigger="<tab>"
     20 
     21 " Project Management/Search
     22 Plug 'leafOfTree/vim-project'
     23 let g:vim_project_config = {
     24 	\'auto_load_on_start': 1,
     25 	\'tasks': [
     26 		\{
     27 			\'name': 'terminal',
     28 			\'cmd': ''
     29 		\},
     30 	\],
     31 	\'new_tasks': [
     32 		\{
     33 			\'name': 'empty',
     34 			\'cmd': 'mkdir',
     35 		\},
     36 	\],
     37 	\'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"'
     38 \}
     39 
     40 " LSP
     41 Plug 'yegappan/lsp'
     42 let lspServers = [#{
     43 	\ 	name: 'pylsp',
     44 	\	filetype: ['python'],
     45 	\	path: '/usr/bin/pylsp',
     46 	\	args: []
     47 	\ },#{
     48 	\	name: 'clangd',
     49 	\	filetype: ['c', 'cpp'],
     50 	\	path: '/usr/lib/llvm/20/bin/clangd',
     51 	\	args: ['--background-index', '--clang-tidy']
     52 	\ },#{
     53 	\	name: 'gopls',
     54 	\	filetype: ['go'],
     55 	\	path: '/usr/bin/gopls',
     56 	\	args: []
     57 	\ },#{
     58 	\	name: 'rust-analyzer',
     59 	\	filetype: ['rust'],
     60 	\	path: '/usr/bin/rust-analyzer',
     61 	\	args: []
     62 	\ },#{
     63 	\	name: 'texlab',
     64 	\	filetype: ['latex', 'tex', 'plaintex'],
     65 	\	path: '/home/pollux/.cargo/bin/texlab',
     66 	\	args: []
     67 	\ }]
     68 autocmd User LspSetup call LspAddServer(lspServers)
     69 
     70 call plug#end()
     71 
     72 """ Misc AutoCMDs
     73 
     74 function OnStart()
     75 	if @% == ""
     76 		ProjectList
     77 	endif
     78 endfunction
     79 autocmd VimEnter * call OnStart()
     80 
     81 """ Settings
     82 set cc=80
     83 set incsearch
     84 set number
     85 set relativenumber
     86 
     87 set tabstop=8
     88 set shiftwidth=8
     89 set list
     90 set listchars=tab:>-,lead:.,trail:~,extends:>,precedes:<
     91 
     92 let g:netrw_banner = 0
     93 let g:netrw_liststyle = 3
     94 let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'
     95 let g:netrw_localcopydircmd = 'cp -r'
     96 
     97 """ Keybindings
     98 
     99 let mapleader = " "
    100 
    101 " Buffer Stuff
    102 nmap <C-b>n :bnext!<CR>
    103 nmap <C-b>l :buffers<CR>:b! 
    104 
    105 " LSP
    106 nmap ,D :LspGotoDefinition<CR>
    107 nmap ,r :LspRename<CR>
    108 nmap ,dd :LspDiagCurrent<CR>
    109 nmap ,dn :LspDiagNextWrap<CR>
    110 nmap ,dp :LspDiagPrevWrap<CR>
    111 
    112 " Projects
    113 nmap ;; :ProjectList<CR>
    114 nmap ;g :ProjectFindInFiles<CR>
    115 nmap ;f :ProjectSearchFiles<CR>
    116 nmap ;r :ProjectRun<CR>
    117 nmap ;c :ProjectConfig<CR>
    118 
    119 " Misc
    120 nmap <C-n> :noh<CR>
    121 
    122 nmap <leader>e :if exists(':Rex')<cr>Rex<cr>else<cr>Ex<cr>endif<cr><cr>