Skip to content

Instantly share code, notes, and snippets.

@DanielFGray
Created July 8, 2015 05:51
Show Gist options
  • Save DanielFGray/3bf4849c2dee962f91ca to your computer and use it in GitHub Desktop.
Save DanielFGray/3bf4849c2dee962f91ca to your computer and use it in GitHub Desktop.
function! PromptQuit()
echo 'close current buffer?'
if nr2char(getchar())=~'y'
silent execute "normal \<esc>:Sayonara!\<cr>"
elseif nr2char(getchar())=~'Y'
silent execute "normal \<esc>:Sayonara\<cr>"
endif
silent! redraw!
endfunction
nnoremap <silent> Q <Esc>:call PromptQuit()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment