oni icon indicating copy to clipboard operation
oni copied to clipboard

[Feature request] Go to Definition

Open samhh opened this issue 8 years ago • 7 comments

Oni Version: 0.3.4 Neovim Version (Linux only): 0.3.0 Operating System: Arch

In VSCode you can go directly to the definition of a symbol in some languages such as TypeScript. You can find a short description and screenshot of this feature here.

As far as I can tell this isn't yet supported in Oni. I'd really love for it to be implemented! Cheers :smiley:

samhh avatar Jun 14 '18 10:06 samhh

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot avatar Jun 14 '18 10:06 oni-bot

Hey!

Oni does that have this (when the LSP supports it, so TS/JS works out the box). By default its bound to F12, and its the command pallete as well, which is Ctrl-Shift-P.

CrossR avatar Jun 14 '18 10:06 CrossR

Also works with pyls for Python. gd also triggers the feature (and is easy to remember).

Closing, but if you are not satisfied with the answers, please reopen.

Cheers :)

TalAmuyal avatar Jun 14 '18 12:06 TalAmuyal

Thanks guys!

My only query is whether there's any way to make it open the definition in a new tab?

samhh avatar Jun 16 '18 21:06 samhh

The vim only way to trigger this is by <C-]>, if you have the tags ran for the current file.

I wonder if there's a way to remap this keybinding for a specific file if a LSP with Go to definition feature is enabled.

This way I would keep using ctags if there's no LSP and use an improved version is there's a LSP, and would not have to learn a new keybinding.

badosu avatar Jun 20 '18 13:06 badosu

My only query is whether there's any way to make it open the definition in a new tab?

Currently I don't think so, though it should be simple enough to change / add an option for it if needed?

CrossR avatar Jun 20 '18 13:06 CrossR

My only query is whether there's any way to make it open the definition in a new tab?

Currently I don't think so, though it should be simple enough to change / add an option for it if needed?

@SamHH Alternatively, after inspecting the definition you can type <C-^> to get back to the previous file.

badosu avatar Jun 20 '18 13:06 badosu