summaryrefslogtreecommitdiff
path: root/.config/nvim
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim')
-rw-r--r--.config/nvim/plugin/autocmds.lua18
-rw-r--r--.config/nvim/plugin/options.lua1
2 files changed, 8 insertions, 11 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,
+})
diff --git a/.config/nvim/plugin/options.lua b/.config/nvim/plugin/options.lua
index ec56b43..91e745d 100644
--- a/.config/nvim/plugin/options.lua
+++ b/.config/nvim/plugin/options.lua
@@ -35,7 +35,6 @@ vim.opt.termguicolors = true
vim.opt.laststatus = 3 -- views can only be fully collapsed with the global statusline
vim.opt.splitkeep = 'screen' -- for edgy.nvim
vim.opt.inccommand = 'split' -- shows preview for commands like :%s/from/to
-vim.opt.formatoptions:remove('o') -- don't have `o` add a comment
-- Disable warnings for missing language providers
vim.g.loaded_node_provider = 0