tomlion / vim-solidity

Vim syntax file for solidity
MIT License
490 stars 321 forks source link

Improve handling of comments and doc comments #48

Open wchargin opened 3 years ago

wchargin commented 3 years ago

Doc comments are now properly formatted with gq and J. For example, on this input text:

/// one
/// two

pressing J on the top line used to result in /// one / two, and now results in /// one two. Conversely, on this input text:

/// this long line exceeds the text width

pressing gqgq with a textwidth of 20 now yields:

/// this long line
/// exceeds the text
/// width

instead of:

/// this long line
//exceeds the text
//width

Furthermore, adding a new line to an existing comment, by pressing o in normal mode or Enter in insert mode, now automatically inserts the appropriate comment leader (// or ///).

wchargin-branch: comment-doc-and-leader

chanhosuh commented 3 years ago

@wchargin how about also accommodating the /**.. **/ natspec style? ;)

wchargin commented 2 years ago

@wchargin how about also accommodating the /**.. **/ natspec style? ;)

Go for it! I personally don't use that natspec style and am not super familiar with this corner of Vim config, so I'm not going to implement this myself.

mhluongo commented 1 year ago

Hey @wchargin, I merged this PR in our maintained fork!