Added 'snapshot' command

This commit is contained in:
Talia 2018-01-30 19:21:50 +01:00
parent d92a7c0bfb
commit 2468075090

21
vimrc
View file

@ -311,6 +311,27 @@ function! s:unsaved()
endfun endfun
command! Unsaved call <sid>unsaved() command! Unsaved call <sid>unsaved()
function! s:snapshot()
let l:filetype = &filetype
let l:clipboard = @"
silent 1,$yank "
below new
set modifiable
silent put "
let &filetype = l:filetype
set nomodifiable
set buftype=nofile
set bufhidden=hide
silent exec "file ¬".expand("#:t")."@".strftime("%H:%M")
exec "normal \<C-w>k"
set foldlevel=999
let @" = l:clipboard
endfun
command! Snapshot call <sid>snapshot()
" === GENERAL KEY MAPPINGS === " === GENERAL KEY MAPPINGS ===
let mapleader = "\\" let mapleader = "\\"