From a25edaf163fde020da4cb334bfd8204e27123e01 Mon Sep 17 00:00:00 2001 From: xerus2000 <27jf@pm.me> Date: Sat, 14 Nov 2020 02:08:50 +0100 Subject: [PATCH] config/nvim: enable backups & small fixes --- .config/nvim/init/general.vim | 8 ++++++++ .config/nvim/init/keys.vim | 5 +++-- .config/nvim/init/plug.vim | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init/general.vim b/.config/nvim/init/general.vim index be2e54b..8cc6825 100644 --- a/.config/nvim/init/general.vim +++ b/.config/nvim/init/general.vim @@ -1,7 +1,15 @@ set termguicolors set mouse=a " Enable mouse in all modes +" persist undo & backup files set undofile +set backup +let &backupdir=expand(stdpath('data') . '/backup') +if !isdirectory(&backupdir) + execute "!mkdir " . &backupdir +endif +let &backupext="_" . strftime("%y%m%dT%H%M") + set wildmode=longest,list,full " Auto-completion for cmdline set clipboard+=unnamedplus " Merge with system clipboard diff --git a/.config/nvim/init/keys.vim b/.config/nvim/init/keys.vim index ee53aa2..b83c53d 100644 --- a/.config/nvim/init/keys.vim +++ b/.config/nvim/init/keys.vim @@ -7,15 +7,16 @@ command! WS write source $MYVIMRC command! FormatJSON %!python -m json.tool command! DiffSwap :diffsp % " Diff for swap - replaced by 'chrisbra/Recover.vim' +"command! for dictcc " Sane yanking map Y y$ " Disable Ex mode - https://vi.stackexchange.com/q/457 nnoremap Q @q - + let mapleader=" " -nnoremap " ysiW" +nmap " ysiW" " Alias write and quit to leader nnoremap q :wq diff --git a/.config/nvim/init/plug.vim b/.config/nvim/init/plug.vim index 1797eeb..7ced358 100644 --- a/.config/nvim/init/plug.vim +++ b/.config/nvim/init/plug.vim @@ -38,6 +38,7 @@ Plug 'junegunn/fzf' " File selection with :FZF " Browse Plug 'tyru/open-browser.vim' " :OpenBrowser, :OpenBrowserSearch Plug 'tyru/open-browser-github.vim' +Plug 'KabbAmine/zeavim.vim' " Integrate with Zeal (Dash) offline documentation " QOL Plug 'farmergreg/vim-lastplace' " Automatically jump to last edit position