call plug#begin(stdpath('data') . '/plugged') "Timmy Popester Plug 'tpope/vim-surround' Plug 'tpope/vim-repeat' Plug 'tpope/vim-commentary' Plug 'tpope/vim-fugitive' Plug 'jiangmiao/auto-pairs' " Nav Plug 'rhysd/clever-f.vim' Plug 'easymotion/vim-easymotion' " Utilities " Plug 'Yggdroot/LeaderF', { 'do': ':LeaderfInstallCExtension' } Plug 'mhinz/vim-startify' Plug 'mbbill/undotree' Plug 'junegunn/vim-easy-align' Plug 'famiu/nvim-reload' Plug 'kyazdani42/nvim-web-devicons' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-lua/popup.nvim' Plug 'nvim-telescope/telescope.nvim' " Languages Plug 'dag/vim-fish', { 'for' : 'fish' } " Stuff to maybe install later Plug 'airblade/vim-gitgutter' " This one is going to depend on whether vim still remains snappy " Plug 'ionide/Ionide-vim', { " Are we really going to try and develop on vim? " \ 'do': 'make fsautocomplete', " \} " Plug 'autozimu/LanguageClient-neovim', { 'branch': 'next', 'do': 'bash install.sh' } call plug#end() set number set relativenumber set autochdir set splitbelow set splitright set tabstop=4 set tw=80 set ft+=t set shiftwidth=4 set expandtab set softtabstop=4 set nowrap set ignorecase set smartcase set noswapfile set nobackup set hidden set wildmenu set clipboard=unnamedplus set shell=/bin/bash if exists('g:fvim_loaded') nnoremap :set guifont=+ nnoremap :set guifont=- FVimCursorSmoothMove v:false FVimCursorSmoothBlink v:true FVimFontAutoSnap v:true endif let mapleader = " " nnoremap Y y$ nnoremap vv ^vg_ noremap \ q noremap $ g_ nnoremap ' ` nnoremap ` ' nnoremap - :Ex map , (easymotion-prefix) nnoremap / :nohlsearch nnoremap w :w nnoremap rl :so $MYVIMRC:echo 'init.vim Reloaded!' nnoremap ei :e $MYVIMRC nnoremap bk :bd nnoremap bb :b# " nnoremap q :call DeleteBuffer() nnoremap q :q nnoremap o :call MaximizeToggle() nnoremap :e term://fish nnoremap v :vsplit term://fish nnoremap s :split term://fish nnoremap t :tabnew term://fish tnoremap tnoremap h tnoremap j tnoremap k tnoremap l inoremap h inoremap j inoremap k inoremap l nnoremap h nnoremap j nnoremap k nnoremap l noremap :tabprev noremap :tabnext tnoremap :tabprev tnoremap :tabnext inoremap :tabprev inoremap :tabnext noremap :tabm -1 noremap :tabm +1 noremap :vert resize -3 noremap :vert resize +3 noremap :resize +3 noremap :resize -3 nnoremap n :tabnew nnoremap k :tabclose nnoremap pi :w:so $MYVIMRC:PlugInstall nnoremap pc :w:so $MYVIMRC:PlugClean augroup terminal_settings autocmd! autocmd BufWinEnter,WinEnter term://* startinsert | setlocal norelativenumber nonumber nocursorcolumn nocursorline autocmd BufLeave term://* stopinsert " Ignore various filetypes as those will close terminal automatically " Ignore fzf, ranger, coc autocmd TermClose term://* \ if (expand('') !~ "fzf") && (expand('') !~ "ranger") && (expand('') !~ "coc") | \ call nvim_input('') | \ endif augroup END " Plugins " Clever-F let g:clever_f_fix_key_direction = 1 " EasyMotion let g:EasyMotion_startofline = 0 let g:EasyMotion_keys = 'asdfjklhgwueiroxnmvczqp' " LeaderF let g:Lf_ShortcutF = '' let g:Lf_ShortcutB = '' let g:Lf_WindowPosition = 'popup' let g:Lf_PreviewInPopup = 1 noremap ;f :Leaderf file noremap ;b :Leaderf buffer noremap ;m :Leaderf mru noremap ;c :Leaderf command noremap ;h :Leaderf help noremap ;l :Leaderf line noremap ;w :Leaderf window noremap ;a :Leaderf self " Easy Align xmap ga (EasyAlign) nmap ga (EasyAlign) " Custom Functions function! MaximizeToggle() if exists("s:maximize_session") exec "source " . s:maximize_session call delete(s:maximize_session) unlet s:maximize_session let &hidden=s:maximize_hidden_save unlet s:maximize_hidden_save else let s:maximize_hidden_save = &hidden let s:maximize_session = tempname() set hidden exec "mksession! " . s:maximize_session only endif endfunction function! DeleteBuffer() let l:buflisted = getbufinfo({'buflisted': 1}) let [l:cur_winnr, l:cur_bufnr] = [winnr(), bufnr()] " There's a bug where if it's a help window, it'll kill everything, so " remove this for now " if len(l:buflisted) < 2 | confirm qall | return | endif for l:winid in getbufinfo(l:cur_bufnr)[0].windows execute(win_id2win(l:winid) . 'wincmd w') if l:cur_bufnr == l:buflisted[-1].bufnr | bp | else | bn | endif endfor execute(l:cur_winnr . 'wincmd w') let l:is_terminal = getbufvar(l:cur_bufnr, '&buftype') == 'terminal' if l:is_terminal | bd! # | else | silent! confirm bd # | endif endfunction