Hello all,

How do I prevent the jumplist from getting modified in a scratch window 
(buftype = nofile)? I can remap all of the keys that cause the jumplist to be 
modified like this:

  for k in ["G", "n", "N", "L", "M", "H"]
    exec "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<cr>"
  endfor

But that will not work for '/' or '?'.

Second question: does it even make sense for vim to add cursor movements to the 
jumplist for a scratch buffer type? When the scratch buffer is closed and the 
user types <C-O> the cursor tries to move back to the buffer that no longer 
exists and generates an error. Perhaps when the scratch buffer is closed, vim 
should automatically delete all the jumps for that buffer?

David

Reply via email to