4 ms·
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
by da39a3ee 5y ago
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?
- sagarm 5y agoOften 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.
- da39a3ee 5y agoOK 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".
- sagarm 5y agoYeah, :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.