From 6dc5cda0d8817f83b8b03c92ced5aeb2eb559ddf Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Tue, 6 Oct 2020 13:14:56 +0100 Subject: [PATCH] VIM: Makes vim auto-add comment character It will do this in insert mode when pushing or when in normal mode when pushing o or O --- nvim/.config/nvim/plugin/settings.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nvim/.config/nvim/plugin/settings.vim b/nvim/.config/nvim/plugin/settings.vim index fba63d12..640a3940 100644 --- a/nvim/.config/nvim/plugin/settings.vim +++ b/nvim/.config/nvim/plugin/settings.vim @@ -38,3 +38,8 @@ set linebreak " Sets tool for opening non-text files with gx " If in netrw, this is run with just x let g:netrw_browsex_viewer = "opout" + +" Automatically insert comment leader after hitting enter +set formatoptions+=r +" Automatically insert comment leader after hitting o or O +set formatoptions+=o