diff options
| author | Kyren223 <ulmliad223@gmail.com> | 2024-07-08 16:54:29 +0300 |
|---|---|---|
| committer | Kyren223 <ulmliad223@gmail.com> | 2024-07-08 16:54:29 +0300 |
| commit | 8be8d60510dbf5f328587c4fee9ceb36b83eb0a7 (patch) | |
| tree | 8927f8d67bf0ad64c701f94212d5fb1b989ea2f3 /.config/nvim/plugin/autocmds.lua | |
| parent | dbbbb97b715f022251e2d1826967222b5865a949 (diff) | |
Neovim: fixed comments on newlines issue
Diffstat (limited to '.config/nvim/plugin/autocmds.lua')
| -rw-r--r-- | .config/nvim/plugin/autocmds.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/.config/nvim/plugin/autocmds.lua b/.config/nvim/plugin/autocmds.lua index 5272029..a9a9dc0 100644 --- a/.config/nvim/plugin/autocmds.lua +++ b/.config/nvim/plugin/autocmds.lua @@ -6,13 +6,11 @@ vim.api.nvim_create_autocmd('TextYankPost', { end, }) --- vim.api.nvim_create_autocmd('FileType', { --- group = vim.api.nvim_create_augroup('disable-auto-comment', { clear = true }), --- pattern = '*', --- callback = function() --- -- c - autowrap using textwidth | r - enter in insert mode | o - o/O in normal mode --- -- vim.opt.formatoptions:remove({ 'c', 'r', 'o' }) --- vim.opt.formatoptions:remove('o') --- -- vim.cmd('set formatoptions-=o') --- end, --- }) +vim.api.nvim_create_autocmd('BufEnter', { + desc = 'Disable newlines on commented lines from continuing the comment', + group = vim.api.nvim_create_augroup('disable-comments-continuation', { clear = true }), + callback = function() + -- vim.opt_local.formatoptions:remove('r') -- no comments on enter + vim.opt_local.formatoptions:remove('o') -- no comments on `o` or `O` + end, +}) |
