-
|
I noticed something inconvenient recently. I have the following lines in my vimrc: (my neovim config is extended from vim's) Whenever I run So the result is that both the This is not the case in vim, which reads in Now I'm just curious on the reason(s) we're diverging from vim here? Wouldn't the original behaviour more flexible(and maybe more safe?) since we can control whether or not the two will be created? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
sprinkling files randomly in CWD isn't usually what most people want... same for 'directory' and 'backupdir' |
Beta Was this translation helpful? Give feedback.
-
|
The divergence comes from one sentence Nvim added to Nvim (
Vim ( The reason it exists is tied to the changed default. Vim's default The catch is that the rule keys off your list, not off You can keep your local-undodir setup and just opt those buffers out. Git commit-message files ( autocmd FileType gitcommit,gitrebase setlocal noundofileIf you'd rather not depend on filetype, match the path instead: autocmd BufRead,BufNewFile .git/COMMIT_EDITMSG,*/.git/COMMIT_EDITMSG setlocal noundofileOr, to get back Vim's "only write if the dir already exists" feel everywhere, prepend set undodir=./.vim/undo//,~/.local/state/nvim/undo//With a |
Beta Was this translation helpful? Give feedback.
The divergence comes from one sentence Nvim added to
'undodir'that Vim doesn't have. Compare the two docs:Nvim (
:h 'undodir'):Vim (
:h 'undodir') stops at "...will be used for writing." with no auto-create.The reason it exists is tied to the changed default. Vim's default
'undodir'is., so an undo file only ever lands next to the file you edit. Nvim's default is$XDG_STATE_HOME/nvim/undo//(a single dir that won't exist on a fresh install), so without auto-creationset …