4 ms·
> I do at least try to use the quickfix stuff; that's a pretty big productivity boost over manually going to the right file and line to fix an error spotted by
by dllthomas 6y ago
> I do at least try to use the quickfix stuff; that's a pretty big productivity boost over manually going to the right file and line to fix an error spotted by my compiler.
I've mapped cnext and cprev to tab and shift-tab, to make it easy to bounce through things.
Also, in my shell I have defined
alias cbuf='vim - -c cbuffer!'
which lets me do things like "make | cbuf" or "git grep -n foo | cbuf", which is great.
Tangentially, all of this plays well with some things I've built out for dealing with diffs (https://github.com/dlthomas/diff-kit https://github.com/dlthomas/diff-kit) - dklocs will turn a unified diff into location-prefixed changed lines, dkcov will find the intersection of a diff and a coverage report (very useful for answering the question "how did I break that test?"), either of which can be piped right into cbuf.
- scottlamb 6y agoI like that mapping. Typing ":cnext" and ":cprev" is quite awkward. Next time I use vim's quickfix list I'll try tab + shift-tab. I've been using VS Code + its Vim plugin recently anyway because I wanted to try out rust-analyzer and couldn't get it to work well with vim. (iirc I tried both YouCompleteMe and coc.nvim. Despite the name, the latter on classic vim; I haven't tried neovim yet. I thought they were supposed to be async, but at least one of them made vim hang for a long time when opening a fresh project, which drove me nuts.) Neat idea also with the alias. Do you also have alias make='make 2>&1' or something? [edit: maybe make() { /path/to/make "$@" 2>&1 }] It doesn't work for me otherwise since compiler/make errors go to stderr (as they should).
- dllthomas 6y ago> Do you also have alias make='make 2>&1' or something? Ah, no, I probably just did `make 2>&1 | cbuf`; haven't actually been on a project using make in a while.