diff options
author | Xiao Pan <gky44px1999@gmail.com> | 2024-05-25 16:18:30 -0700 |
---|---|---|
committer | Xiao Pan <gky44px1999@gmail.com> | 2024-05-25 16:18:30 -0700 |
commit | e6d47b32a74f458a0ee3200844e29b1d820857c2 (patch) | |
tree | 270b8a1c6ccc9898f14e6a3760c9f64485831dcc /home/xyz/.config/nvim | |
parent | 3a5a9bd46c61e83ae2b9bdbf94a30a70bf722f34 (diff) |
nvim config to open readonly if file already been opened
Diffstat (limited to 'home/xyz/.config/nvim')
-rw-r--r-- | home/xyz/.config/nvim/init.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/home/xyz/.config/nvim/init.vim b/home/xyz/.config/nvim/init.vim index 64cdd4d9..fd368ebe 100644 --- a/home/xyz/.config/nvim/init.vim +++ b/home/xyz/.config/nvim/init.vim @@ -97,6 +97,15 @@ augroup mycmd autocmd FileType mail,gitcommit setlocal colorcolumn=72 " https://github.com/tinted-theming/base16-vim?tab=readme-ov-file#customization autocmd ColorScheme * call s:base16_customize() + " open file readonly if it already been open + " nvim seems change default from '' to 'e', but I prefer 'o' + " :h w325 e325 SwapExists swapchoice default-autocmds + " https://vi.stackexchange.com/questions/21784/vim-edit-anyway-without-prompting + " https://github.com/neovim/neovim/pull/25336 + " https://github.com/neovim/neovim/commit/29fe883aa9166bdbcae3f935523c75a8aa56fe45 + " remove nvim_swapfile autocmd is more correct, without also works but I think it change to 'e' then to 'o' which is not ideal, also it will echo "W325: ..." which is not what I want + autocmd! nvim_swapfile + autocmd SwapExists * let v:swapchoice = 'o' augroup END " :h markdown, for vim default tpope/vim-markdown |