Remove comment when starting new line #305
-
Actually if I have a comment in Lua file for example -- comment.setup [myCursor] {} from that line when I press 'O' to start typing in insert mode next line i got this -- comment.setup {} instead I want to have -- comment.setup {} without adding comment to the next line, thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a builtin feature of nvim, you can control it by tweaking the It's common that this option is overwritten by filetype runtime plugins, in which case you'll need to change it back the way you want. " In ~/.config/nvim/after/ftplugin/lua.vim
" (to make sure it is run after $VIMRUNTIME/ftplugin/lua.vim which is loaded for every Lua file)
setlocal formatoptions-=o
|
Beta Was this translation helpful? Give feedback.
This is a builtin feature of nvim, you can control it by tweaking the
formatoptions
option, see:h formatoptions
and:h fo-table
.It's common that this option is overwritten by filetype runtime plugins, in which case you'll need to change it back the way you want.
For example for Lua, you can get your behavior like this: