0

I sometimes use vim for brainstorming and writing first drafts and would like to be able to temporarily disable the ability to delete or edit what I write down. Is there anyway to do this natively in vim?

1
  • 1
    "Disable the ability to delete or edit what your write"? You mean that you want Vim to behave as if you only had Insert mode without Backspace key?
    – Quasímodo
    Aug 1 '20 at 12:12
3

You are looking for :set nomodifiable which disables any changes which you will try to do in some buffer. Look here, :h modifiable.

1
  • And :set modifiable! toggles between the two values; useful for key mappings: nnoremap <Leader>n :set modifiable!<CR>:set modifiable?<CR> (that second :set is to show the setting after pressing the key). Aug 1 '20 at 9:54

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