neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

feat(commands): Go to Source Definition #384

Closed fannheyward closed 1 year ago

fannheyward commented 2 years ago

tsserver.goToSourceDefinition, close #383

sandrodz commented 2 years ago

This is awesome, hopefully it gets in soon.

sandrodz commented 1 year ago

@fannheyward how do we make this work with vim's gd (for TS only)?

My current bindings are

" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
chemzqm commented 1 year ago

You can create buffer key-mappings :h map-buffer

powext commented 1 year ago

Hi! Vim noob here, I've some difficulties trying to map this command 😅

EDIT: resolved with nmap <silent> gd :CocCommand tsserver.goToSourceDefinition<CR>