Live data from Hacker News

Ask HN: How Do You Navigate Code?

news.ycombinator.com

21–30 of 39 posts

Re: Ask HN: How Do You Navigate Code?

#21

NeoVim + language servers + global search with rg + a bunch of keyboard shortcuts: - gd = go to definition - gr = open a hovering window filled with references to symbol This is enough to get through every codebase I've yet encountered (Go, Typescript, Python, Java, C++). I also like to use and in vim which allows you to jump between the most recently viewed locations. For keeping context, I just write everything dow…

Are those keyboard shortcuts part of the LSP server?

Nope, you have to map them but they are very easy to do. You can use the suggested keymaps from nvim-lsp GitHub too (still need to copy pasta).

Re: Ask HN: How Do You Navigate Code?

#23
I’ll follow a lot of the vscode tips in this thread plus a helping of running Doxygen on the project. Even without the specific Doxygen markup in the headers, running Doxygen can help with the call graphs and object hierarchies with a browsable interface.

Re: Ask HN: How Do You Navigate Code?

#25

NeoVim + language servers + global search with rg + a bunch of keyboard shortcuts: - gd = go to definition - gr = open a hovering window filled with references to symbol This is enough to get through every codebase I've yet encountered (Go, Typescript, Python, Java, C++). I also like to use and in vim which allows you to jump between the most recently viewed locations. For keeping context, I just write everything dow…

Are those keyboard shortcuts part of the LSP server?

No, but defining one is as easy as one magic incantation in your .vimrc:

  nnore gd :LspGoToDefinition 
...or something like that. I haven't touched the config in a few months.

Re: Ask HN: How Do You Navigate Code?

#27

I use VSCode and mostly navigate via: F12: Go to definition Shift+F12: Go to usages Ctrl+-: Go back Ctrl+Shift+-: Go forward Once you get used to it, it's as easy as browsing the web. Since I started using VSCode I did not have to work with codebases that were complex enough to make these features valuable but some VSCode language extensions support tree views of call hierarchies and type hierarchies. Here's the docu…

Ctrl+- is reduce font size Ctrl+Shift+- is a no-op

What version of VScode are you using?

Re: Ask HN: How Do You Navigate Code?

#30
post #27

I use VSCode and mostly navigate via: F12: Go to definition Shift+F12: Go to usages Ctrl+-: Go back Ctrl+Shift+-: Go forward Once you get used to it, it's as easy as browsing the web. Since I started using VSCode I did not have to work with codebases that were complex enough to make these features valuable but some VSCode language extensions support tree views of call hierarchies and type hierarchies. Here's the docu…

Ctrl+- is reduce font size Ctrl+Shift+- is a no-op What version of VScode are you using?

Ctrl+Alt+-

I guess Ctrl+Shift+- is a no op if you haven't first gone back.

Post reply on HN