[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fedora-list
Subject:    Re: vim question - how to stop auto comments
From:       Chris Adams <linux () cmadams ! net>
Date:       2023-01-31 18:45:35
Message-ID: 20230131184535.GA4930 () cmadams ! net
[Download RAW message or body]

Once upon a time, Sbob <sbob@quadratum-braccas.com> said:
> Anyone know how to disable the vim feature where it auto comments
> all lines after a comment, meaning if I add a comment line and then
> hit enter for a new line I do not want the new line to automatically
> hace a comment (#) char... it's driving me nuts!

What you want is "set formatoptions-=o"..., but it's actually a little
tricky to change this behavior, because of how vim loads config (file
type config comes after ~/.vimrc, and after ~/.vim/after/* files).  The
most common way is to use an autocmd, so something like:

   autocmd FileType * set formatoptions-=o

in ~/.vimrc.
-- 
Chris Adams <linux@cmadams.net>
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic