lemmy-help icon indicating copy to clipboard operation
lemmy-help copied to clipboard

Compact layout for vimdoc

Open numToStr opened this issue 3 years ago • 0 comments

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.

numToStr avatar Sep 20 '22 10:09 numToStr