dotfiles/symlinks/config/nvim/plugin/scratch_buffer.vim

20 lines
612 B
VimL
Raw Permalink Normal View History

2021-02-23 11:27:32 +00:00
" -----------------------------------------------------------------------------
" - Scratch buffer -
" Creates a basic scratch buffer
" Adopted from https://github.com/hagsteel/vimconf/blob/master/vimrc
" -----------------------------------------------------------------------------
functio CreateScratchBuffer(vertical)
if a:vertical == 1
:vnew
else
:new
endif
:setlocal buftype=nofile
:setlocal bufhidden=hide
:setlocal noswapfile
:set ft=scratch
endfunction
:command! Scratch call CreateScratchBuffer(1)
:command! Scratchh call CreateScratchBuffer(0)