coc.nvim icon indicating copy to clipboard operation
coc.nvim copied to clipboard

Add support for object movement

Open JS-Zheng opened this issue 1 year ago • 3 comments

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.

JS-Zheng avatar Oct 19 '22 17:10 JS-Zheng