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

dotfiles

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

.vimrc (2037B)


      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 	\'tasks': [
     25 		\{
     26 			\'name': 'terminal',
     27 			\'cmd': ''
     28 		\},
     29 	\]
     30 \}
     31 
     32 " LSP
     33 Plug 'yegappan/lsp'
     34 let lspServers = [#{
     35 	\ 	name: 'pylsp',
     36 	\	filetype: ['python'],
     37 	\	path: '/usr/bin/pylsp',
     38 	\	args: []
     39 	\ },#{
     40 	\	name: 'ccls',
     41 	\	filetype: ['c', 'cpp'],
     42 	\	path: '/usr/bin/ccls',
     43 	\	args: []
     44 	\ },#{
     45 	\	name: 'rust-analyzer',
     46 	\	filetype: ['rust'],
     47 	\	path: '/usr/bin/rust-analyzer',
     48 	\	args: []
     49 	\ },#{
     50 	\	name: 'texlab',
     51 	\	filetype: ['latex', 'tex', 'plaintex'],
     52 	\	path: '/home/pollux/.cargo/bin/texlab',
     53 	\	args: []
     54 	\ }]
     55 autocmd User LspSetup call LspAddServer(lspServers)
     56 
     57 call plug#end()
     58 
     59 """ Misc AutoCMDs
     60 
     61 function OnStart()
     62 	if @% == ""
     63 		ProjectList
     64 	endif
     65 endfunction
     66 autocmd VimEnter * call OnStart()
     67 
     68 """ Settings
     69 set cc=80
     70 set incsearch
     71 set number
     72 set relativenumber
     73 
     74 set tabstop=8
     75 set shiftwidth=8
     76 set list
     77 set listchars=tab:>-,lead:.,trail:~,extends:>,precedes:<
     78 
     79 let g:netrw_keepdir = 0
     80 let g:netrw_banner = 0
     81 let g:netrw_liststyle = 3
     82 let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'
     83 let g:netrw_localcopydircmd = 'cp -r'
     84 
     85 
     86 """ Keybindings
     87 
     88 let mapleader = " "
     89 
     90 " LSP
     91 nmap ,D :LspGotoDefinition<CR>
     92 nmap ,dd :LspDiagCurrent<CR>
     93 nmap ,dn :LspDiagNextWrap<CR>
     94 nmap ,dp :LspDiagPrevWrap<CR>
     95 
     96 " Projects
     97 nmap ;; :ProjectList<CR>
     98 nmap ;g :ProjectFindInFiles<CR>
     99 nmap ;f :ProjectSearchFiles<CR>
    100 nmap ;r :ProjectRun<CR>
    101 
    102 " Misc
    103 nmap <C-n> :noh<CR>
    104 
    105 nmap <leader>e :if exists(':Rex')<cr>Rex<cr>else<cr>Ex<cr>endif<cr><cr>