set nu set ff=unix set colorcolumn=80 set list set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:» set cmdheight=2 if has('win32') source $VIMRUNTIME/mswin.vim endif "let g:python3_host_prog='D:/Progams/Python/python.exe' call plug#begin('~/.vim/plugged') "Formatting and navigation Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'scrooloose/nerdcommenter' Plug 'godlygeek/tabular' "Git Plug 'xuyuanp/nerdtree-git-plugin' Plug 'tpope/vim-fugitive' "Fuzzy file search Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' "tab completion Plug 'Shougo/denite.nvim' Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'Shougo/echodoc.vim' Plug 'deoplete-plugins/deoplete-jedi' Plug 'raimon49/requirements.txt.vim' " Scala tab completion Plug 'nvim-lua/plenary.nvim' Plug 'scalameta/nvim-metals' " CSV formatting Plug 'chrisbra/csv.vim' "Plug 'xolox/vim-misc' "Plug 'xolox/vim-lua-ftplugin' "Plug 'VaiN474/vim-etlua' "Plug 'leafo/moonscript-vim' "Plug 'teal-language/vim-teal' "Plug 'whonore/Coqtail' "Color schemes "Plug 'mhartington/oceanic-next' "Plug 'vim-scripts/Wombat' "Plug 'zeis/vim-kolor' "Plug 'alessandroyorba/despacio' "Plug 'alessandroyorba/alduin' "Plug 'tomasr/molokai' "Plug 'sainnhe/vim-color-forest-night' "Plug 'sts10/vim-pink-moon' "Plug 'severij/vadelma' "Plug 'kkpmw/sacredforest-vim' "Plug 'jsit/toast.vim' "Plug 'henrynewcomer/vim-theme-papaya' "Plug 'sainnhe/edge' "Plug 'kjssad/quantum.vim' "Plug 'kyoz/purify' "Plug 'sainnhe/vim-color-atlantis' "Plug 'jonathanfilip/vim-lucius' Plug 'joshdick/onedark.vim' "Plug 'cocopon/iceberg.vim' "Plug 'wolf-dog/sceaduhelm.vim' "Plug 'danilo-augusto/vim-afterglow' "Plug 'kamwitsta/mythos' "Plug 'softmotions/vim-dark-frost-theme' "Plug 'sainnhe/vim-color-grimoire' "Plug 'ghifarit53/tokyonight-vim' call plug#end() colorscheme onedark "deoplete let g:deoplete#enable_at_startup = 1 inoremap pumvisible() ? "\" : "\" "autocmd CompleteDone * if pumvisible() == 0 | silent! pclose | endif " echodoc let g:echodoc#enable_at_startup=1 let g:echodoc#type="floating" highlight link EchoDocFloat Pmenu "python "let g:deoplete#sources#jedi#python_path='python3' let g:deoplete#sources#jedi#enable_short_types=1 let g:deoplete#sources#jedi#show_docstring=1 call deoplete#custom#source('jedi','max_info_width',0) "set completeopt-=preview "lua let g:lua_compiler_name='lua' "let g:lua_compiler_name='lua' let g:lua_complete_dynamic=1 au BufReadPost *.busted set syntax=lua au BufReadPost *.spec set syntax=lua au BufReadPost *.etlua set syntax=html "Overwrite xolox:ftplugin's "Help" with shift-k au BufReadPost *.lua nunmap K "scala augroup lsp au! au FileType java,scala,sbt lua m=require("metals"); mc=m.bare_config(); mc.init_options.statusBarProvider="on"; m.initialize_or_attach(mc) augroup end "NERDTree config autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | \ quit | endif nnoremap :NERDTreeToggle nnoremap :NERDTreeFind let NERDTreeMapHelp='y' let NERDTreeMapJumpLastChild='y' let NERDTreeMapJumpFirstChild='y' "NERDCommenter config nnoremap :call NERDComment('x', 'toggle') "Fuzzy file search let g:fzf_layout = { 'window': {'width': 0.9, 'height': 0.6} } noremap π :call fzf#run(fzf#wrap({'sink': 'tabe', 'left': '20%', 'source': 'git ls-files'})) noremap :call fzf#run(fzf#wrap({'sink': 'vsplit', 'left': '50%', 'source': 'git ls-files'})) noremap å :call fzf#run(fzf#wrap({'sink':'tabe', 'left': '20%', 'source': 'git ls-files'})) command! -bang -nargs=* GAg \ call fzf#vim#ag( \ , \ fzf#vim#with_preview(), \ 0 \) "Fuzzy git checkout branch noremap :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'20%', 'source': 'git branch --format "%(refname:short)"'})) noremap :call fzf#run(fzf#wrap({'sink': 'Git checkout', 'left':'50%', 'source': 'ag --nogroup --column --color --', 'preview-window':'up','preview':expand(':p:h:h:h').'/bin/preview.sh'})) "Fuzzy sbt function! s:VTerm(command) vsplit termopen(a:command) endfunction "ctrl+s saves nmap :w "For some reason this is different between linux and windows if has('win32') vmap c else vmap c endif "Set leader let mapleader=";" "Shortcut to modify vim config nnoremap ec :tabe $MYVIMRC "Move around quickly nnoremap J 5j nnoremap K 5k nnoremap H 5h nnoremap L 5l "Navigate splits tnoremap ˙ h tnoremap ∆ j tnoremap ˚ k tnoremap ¬ l nnoremap ˙ h nnoremap ∆ j nnoremap ˚ k nnoremap ¬ l "Resize splits "noremap :vertical resize -5 "noremap :vertical resize +5 "noremap :res +5 "noremap :res -5 function! s:HasNeighbor(direction) return winnr() != winnr(a:direction) endfunction function! s:PushResize(direction, amount) if a:direction == 'l' || a:direction == 'h' let l:cmd = 'vertical resize' else let l:cmd = 'resize' endif if s:HasNeighbor(a:direction) let l:amount = '+'.a:amount else let l:amount = '-'.a:amount endif echo l:cmd . ' ' . l:amount execute l:cmd . ' ' . l:amount endfunction nnoremap :call PushResize('h',5) nnoremap :call PushResize('j',5) nnoremap :call PushResize('k',5) nnoremap :call PushResize('l',5) "Navigate tabs noremap ‘ gt noremap “ gT "Add a semicolon at the end of the line vnoremap :'<,'>s/\([^;]\)$/\1;/g "Build in a vertical split noremap :vsplit term://make "Start a terminal noremap :vsplit:terminal "Find and open in a new tab noremap :Ag "Restart vim (alt+1) noremap ¡ :source ~/.config/nvim/init.vim \| :PlugInstall filetype plugin indent on syntax enable