From 24680750906634f695ad042fe8c3be3c5c873232 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 30 Jan 2018 19:21:50 +0100 Subject: [PATCH] Added 'snapshot' command --- vimrc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/vimrc b/vimrc index ff3f4e7..111f30d 100644 --- a/vimrc +++ b/vimrc @@ -311,6 +311,27 @@ function! s:unsaved() endfun command! Unsaved call 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 \k" + set foldlevel=999 + + let @" = l:clipboard +endfun +command! Snapshot call snapshot() + " === GENERAL KEY MAPPINGS === let mapleader = "\\"