summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohannst <stoelp@eit.uni-kl.de>2017-08-03 00:24:28 +0200
committerjohannst <stoelp@eit.uni-kl.de>2017-08-03 00:24:28 +0200
commit7abdbb5d222970229673484349a51ffc0cd21179 (patch)
tree85853d0f7dffabf5e94cd62671a0165c70b5a2ee
parenta4e75848c4f8054f0e2a923f171dfbd73da95740 (diff)
downloaddotfiles-7abdbb5d222970229673484349a51ffc0cd21179.tar.gz
dotfiles-7abdbb5d222970229673484349a51ffc0cd21179.zip
vimrc: added fullscreen toggle functionality, restoring fold state not solved
-rw-r--r--vimrc28
1 files changed, 26 insertions, 2 deletions
diff --git a/vimrc b/vimrc
index c83c462..8e1f728 100644
--- a/vimrc
+++ b/vimrc
@@ -352,12 +352,14 @@ set wildignore+=*.o,*.obj,.git,*.pyc,*~ " Ignore these files when completing
"}}}
"{{{ Save & Restore
-augroup aug:AutoSaveResore
+augroup aug:AutoSaveLastSession
autocmd!
"autocmd VimEnter * silent! source .vim_last_session
- "autocmd QuitPre * mksession! .vim_last_session
+ autocmd QuitPre * execute "mksession! " . $VIMHOME . "/session.last_quit"
augroup end
+nnoremap <F2> :execute "source " . $VIMHOME . "/session.last_quit"<CR>
+
"}}}
"{{{ QuickFix
@@ -571,8 +573,30 @@ if s:sandbox_enable
endfunction
command! CC call s:RemoveCStyleComments()
+ " TODO: correctly save/restore open/closed folds
+ let s:gIsFullScreen = 0
+ let s:gSessionFile = $VIMHOME . "/session." . getpid()
+ function! s:ToggelFullScreen()
+ if s:gIsFullScreen
+ let s:gIsFullScreen = 0
+ execute "source" s:gSessionFile
+ else
+ execute "mksession! " s:gSessionFile
+ execute "only"
+ let s:gIsFullScreen = 1
+ endif
+ endfunction
+ nnoremap <C-f> :call <SID>ToggelFullScreen()<CR>
+
+ augroup aug:CleanUpSessionFile
+ autocmd!
+ autocmd QuitPre * call delete(s:gSessionFile)
+ augroup end
+
+
endif
"}}}
"% vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1
+