Remove comment when starting new line #305
Answered
by
bew
kasshedi117
asked this question in
Q&A
|
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. |
Answered by
bew
Feb 7, 2023
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
|
1 reply
Answer selected by
numToStr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a builtin feature of nvim, you can control it by tweaking the
formatoptionsoption, see:h formatoptionsand: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: