Skip to content

Compact layout for vimdoc #40

@numToStr

Description

@numToStr

Current layout

In current layout, because of alignment, horizontal space becomes very less for description if the <type> signature is complex enough. This is very noticeable with ---@field (shown below) and ---@param.

CommentConfig                                                    *CommentConfig*
    Plugin's configuration

    Fields: ~
        {padding}    (boolean|fun():boolean)  Controls space between the comment
                                              and the line (default: 'true')
        {sticky}     (boolean)                Whether cursor should stay at the
                                              same position. Only works in NORMAL
                                              mode mappings (default: 'true')
        {ignore}     (string|fun():string)    Lua pattern used to ignore lines
                                              during (un)comment (default: 'nil')
        {mappings}   (Mappings|false)         Enables |comment.keybindings|
                                              NOTE: If given 'false', then the
                                              plugin won't create any mappings
        {pre_hook}   (fun(ctx):string)        Function to call before (un)comment.
                                              It is called with a {ctx} argument
                                              of type |comment.utils.CommentCtx|
                                              (default: 'nil')
        {post_hook}  (fun(ctx))               Function to call after (un)comment.
                                              It is called with a {ctx} argument
                                              of type |comment.utils.CommentCtx|
                                              (default: 'nil')

Compact Layout

With compact layout we could squeeze some horizontal space if <type> [desc] is rendered continuously.

CommentConfig                                                    *CommentConfig*
    Plugin's configuration

    Fields: ~
        {padding}    (boolean|fun():boolean) Controls space between the comment
                        and the line (default: 'true')
        {sticky}     (boolean) Whether cursor should stay at the same position.
                        Only works in NORMAL mode mappings (default: 'true')
        {ignore}     (string|fun():string) Lua pattern used to ignore lines
                        during (un)comment (default: 'nil')
        {mappings}   (Mappings|false) Enables |comment.keybindings|. If given
                        'false', then the plugin won't create any mappings
        {pre_hook}   (fun(ctx):string) Function to call before (un)comment. It
                        is called with a {ctx} argument of type
                        |comment.utils.CommentCtx| (default: 'nil')
        {post_hook}  (fun(ctx)) Function to call after (un)comment. It is called
                        with a {ctx} argument of type |comment.utils.CommentCtx|
                        (default: 'nil')

NOTE: Even in Compact Layout, text wrapping needs to be done manually.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions