News for hackers. Stuff that matters.
Re:Nvui: A NeoVim GUI written in C++ and Qt by da39a3ee on Monday August 30, 2021 @08:13AM (#28354850)
If you run your editor in a terminal, how do you do things like ctrl+click on a compiler error in the terminal and have the file opened in your editor at the correct line?
Re:Nvui: A NeoVim GUI written in C++ and Qt by sagarm on Monday August 30, 2021 @08:41AM (#28355032)
People who prefer the terminal don't click on things much.

Vanilla Vi users would use :make to populate the location list, and then :cn or :cp to navigate back and forth. :cope to open up the quick fix window where you can use all your regular VI keybindings to navigate. Enter opens the location under the cursor in your previous VIM split.

There are also plenty of plugins that add inline diagnostics. It's common to use bindings for navigating these that ape the spell check navigation bindings ]s and [s.

Re:Nvui: A NeoVim GUI written in C++ and Qt by da39a3ee on Monday August 30, 2021 @12:23PM (#28357329)
If I'm understanding you correctly that means you have to do your compilation from within vim. Isn't that constraining at times?
Re:Nvui: A NeoVim GUI written in C++ and Qt by sagarm on Monday August 30, 2021 @01:36PM (#28358454)
I don't always use :make. Navigating manually is fast: Specific lines is just :NN, jumping to an open buffer is just :b substr<tab><enter>.

Or, :tag FunctionName (which has completion) to jump to a symbol.

Or, forward incremental search to jump to a string in a file.

I also have a plugin to invoke fzf, (\tb to search buffers and \t to search for files by name), but I don't use it that often.

VIM has many tools to navigate through text. Everyone's got their own preferred methods.

Re:Nvui: A NeoVim GUI written in C++ and Qt by da39a3ee on Monday August 30, 2021 @01:47PM (#28358598)
So if you issue a compile command in a terminal, outside vim, and the compiler emits something like `myfile:17:7` to stdout, how do you then open vim on line 17 of myfile?
Re:Nvui: A NeoVim GUI written in C++ and Qt by sagarm on Monday August 30, 2021 @08:04PM (#28362449)
Often I already have the file in question open, so it's just :17 to jump to line 17.

If I don't have the file active but it's open (very likely if I have a compile error for it), then I can foreground the buffer with :b myfile<CR>. Then :17 to jump to line 17.

If the file isn't open at all, either fzf (\t myfile) or just :e path/to/myfile.

Re:Nvui: A NeoVim GUI written in C++ and Qt by da39a3ee on Monday August 30, 2021 @10:00PM (#28363173)
OK cool. I'm certainly a huge terminal user myself and no advocate of increasing mouse usage in general, but for working through things like compiler errors / stack traces etc, wouldn't you agree that, seeing as all the file path and line number is present, we should be able to invoke the appropriate handler with a single UI action (where appropriate handler means "open file at this line")? The number 17 isn't itself of interest, and it shouldn't have to pass through our brains IMO. The semantics should be "open editor at this error" not "open editor at line 17".
Re:Nvui: A NeoVim GUI written in C++ and Qt by sagarm on Tuesday August 31, 2021 @12:47PM (#28370377)
Yeah, :make gives you that, as do various LSP integration plugins.

The main downside of :make is that it's synchronous, which is why I sometimes build in a separate tmux pane.

Re:Nvui: A NeoVim GUI written in C++ and Qt by gnubison on Monday August 30, 2021 @12:51PM (#28357744)
Vanilla vi users don’t have :make, :cn, :cp, or :cope.
Re:Nvui: A NeoVim GUI written in C++ and Qt by sagarm on Monday August 30, 2021 @01:30PM (#28358374)
Vanilla VIM, sorry.
Re:Nvui: A NeoVim GUI written in C++ and Qt by bjoli on Monday August 30, 2021 @08:38AM (#28355002)
I focus the interaction window and press the keyboard shortcut for opening the editor at the point of the error? You don't need a mouse to navigate text.

I updated some Emacs package recently and now it opens any errors in a list buffer.