Added 'snapshot' command
This commit is contained in:
parent
d92a7c0bfb
commit
2468075090
1 changed files with 21 additions and 0 deletions
21
vimrc
21
vimrc
|
@ -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 = "\\"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue