[Done] Keybind to Navigate to line in current file

We already have keybinds for navigation and this makes the editing a lot easier.

Two things that I still miss (since I use a lot of JetBrains’ softwares) is the navigate to function in fie and navigate to line number.

The first one I imagine it would be hard to implement, but the second one I think is needed.

Since a lot of my general components and modules come from another first-party dependency, a few times I need to navigate to specific files and specific lines (as shown in stacktracing on exceptions) and some of those files have a lot of lines of code.

It would be really usefull to have a keybind that opens a little popup for typing a number (like the Jump to File one) that moves the caret to that informed line.

2 Likes

Using the vim bindings would give you the line number navigation.

2 Likes

hum… Is there any downside of using the vim keybinds? Like something that is possible with the default, but not with vim?

And is there a list of keybinds that are available on both vim and anvil editor?

I’m probably not the person to ask. Vim key bindings became muscle memory a very long time ago!

What about adding a Line number input to the Ctrl+P / Jump To window?

1 Like

That was the next step hahaha.

Copying a line of error that says “python_file.py:24” and pasting into the Jump To window could navigate directly to that line in that file.

1 Like

I couldn’t resist. Here’s how I use neovim inside the anvil ide to navigate via treesitter:

nvim

(It looks better on the real screen than in this crappy gif, I promise)!

This looks awesome! I remember seeing a post about using neovim with anvil, but I don’t remember if there wasn’t an explanation of how to do it, or if I couln’t do it (or maybe I just didn’t had the time to try), but this looks like something I would love to use it!

1 Like

This is probably the post:

But if you want to know any more about my setup, just shout!

I’m still using firenvim to make neovim work in the browser, but my neovim setup if very different to what is was back then.

You can now use Ctrl + Alt + g (Cmd + Opt + g on mac)

to go to a specific line

3 Likes