Skip to content

Add support for object movement #4308

@JS-Zheng

Description

@JS-Zheng

Is your feature request related to a problem? Please describe.
I'm always frustrated on object (e.g., function, method, class) movements in Vim,
Vim has ]], [[,..., ]m mappings; however it's very weak and only suit on some limited cases.
I know CoC provides :CocCommand document.jumpToPrevSymbol, but it only works on variable-like symbols.

Describe the solution you'd like
Provide some commands or actions or mappings to jump to next object, for example:

" users may map to `]f`
:CocCommand document.jumpToNextFunction

" users may map to `]m` 
" (I think CoC can provide better version than Vim's)
:CocCommand document.jumpToNextMethod 

" users may map to `]c`
:CocCommand document.jumpToNextClass

" users may map to `]n`
:CocCommand document.jumpToNextNamespace

I thinks it will be very useful and more convenient than moving by outline list/window.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions