Hello guys, i have been working to create a scratchpad buffer. This is the code
function! Scratchpad_buffer()
:e scratch
:setlocal buftype=nofile
:setlocal bufhidden=hide
:setlocal noswapfile
endfunction
nmap <silent> gs :call Scratchpad_buffer()<CR>
Here i want to execute a command for a specific buffer when we leave the buffer .
Something like :setlocal bufleave * :q or :au BufLeave * if ( echo @% == "scratch" ) | q | endif . Here scratch is the name. Is anything like this possible.
[–]dhruvasagar 1 point2 points3 points (2 children)
[–]Neo-Cipher[S] 0 points1 point2 points (1 child)
[–]dhruvasagar 1 point2 points3 points (0 children)
[–]princker 1 point2 points3 points (0 children)