From ca6aaafb0b1ccf3b0c5bb1ccb2f811498b701cc0 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Mon, 11 Jun 2018 11:52:27 -0600 Subject: Add session save/restore. fzf buffers jumps instead of opening --- plugin/vim-options.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'plugin') diff --git a/plugin/vim-options.vim b/plugin/vim-options.vim index 6f0634b..893d10d 100644 --- a/plugin/vim-options.vim +++ b/plugin/vim-options.vim @@ -16,6 +16,8 @@ set splitbelow " New windows split below the current one set completeopt-=preview " Hide the preview/scratch window set path=** " Allow commands like 'gf' to find files set wildignore=*/app/cache,*/vendor,*/env,*.pyc,*/venv,*/__pycache__,*/venv " Ignore folders +set sessionoptions+=globals " Append global variables to the default session options (Window Names) + " Custom status line set statusline= @@ -104,6 +106,13 @@ noremap f fH noremap ] vH " Run isort on file noremap ei :!isort % +" Session saving +function! SaveSession() + :mksession! $SessionDir/session.vim + :echo 'Session Saved!' +endfunction +nnoremap ess :call SaveSession() +nnoremap esr :source $SessionDir/session.vim @@ -173,6 +182,8 @@ if !empty(glob($EditorDir.'plugged/fzf.vim/plugin/fzf.vim')) nnoremap fg :GFiles? " Enable C-N and C-P to go backwards in history let g:fzf_history_dir = $HOME.'.local/share/fzf-history' + " [Buffers] Jump to the existing window if possible + let g:fzf_buffers_jump = 1 endif "----------------------------------------------------------------------------------------------------------------------- -- cgit v1.2.3