I have a Haskell file on VIM with a Haskell-style comment block:
When I select that comment block on visual mode...
And press gq
, I expected VIM to format my comment to something like:
But instead, this is what VIM does:
How can I fix it?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI have a Haskell file on VIM with a Haskell-style comment block:
When I select that comment block on visual mode...
And press gq
, I expected VIM to format my comment to something like:
But instead, this is what VIM does:
How can I fix it?
:set comments+=:--
This appends :--
to the value of comments
, which adds --
as a comment line indicator. The format of this option is described by :help format-comments
.
:set ft?
and:set comments?
. What's your Vim version? Do you have:filetype plugin indent on
in your vimrc ? – VanLaser Aug 10 '15 at 19:09"filetype plugin on
commented, I recall actively doing so for some reason I don't remember.set ft?
giveshaskell
, andset comments
givescomments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
(before Lithis's answer). – MaiaVictor Aug 10 '15 at 19:13filetype plugin
is what VIM uses for filetype based comments. – MaiaVictor Aug 10 '15 at 19:22