Eclipse-like comment formatting in IntelliJ IDEA?

前端 未结 7 1578
南方客
南方客 2020-12-11 00:38

In Eclipse, I can format comments by selecting them and pressing Shift + Ctrl + F. For example, when I select a method comment like this:

/**
 *         


        
7条回答
  •  有刺的猬
    2020-12-11 00:47

    The JetBrains plugin Wrap to Column is made for this:

    From the overview:

    Wraps text to the specified column width. Similar to the Emacs command 'Fill Paragraph' and Vim's gq (format lines) command. This is a replacement for the native Intellij Fill Paragraph command, which doesn't work quite how I need it to.

    This plugin provies two IDE actions:

    • Wrap Line to Column: Wraps selected text or the current line if no text is selected. This is useful for IdeaVim users who wish to pair the command with motions like vip (select current paragraph).
    • Wrap Paragraph to Column: Wraps the paragraph (multiple lines) in which the cursor appears. No selection is needed, and will be ignored.

提交回复
热议问题