I wrote this line into my .vimrc today:

nnoremap <leader>rtp :below new \| execute append(0, &runtimepath) \| s/,/\r/ <CR>

to display my runtimepath in a new buffer with one path per line.

It works fine, but prompts me with 'No write since last change' when I've finished with it and want to close it. Is there any way to mark that buffer as temporary and not intended to be saved? Or is there a better way of doing this (eg. something other than below new)?

1 Answer 1


Found the answer in the very last "related question". Changing the mapping to:

nnoremap <leader>rtp :below new \| execute append(0, &runtimepath) \| s/,/\r/ \| setlocal buftype=nofile<CR>

fixes the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.