4 ms·
Vim goes back to 1988, publicly released in 1991. I've been using it for 29 years now. The last 20 years don't mean anything; the Vim codebase is too much of
by kazinator 3y ago
Vim goes back to 1988, publicly released in 1991.
I've been using it for 29 years now.
The last 20 years don't mean anything; the Vim codebase is too much of a dumpster fire for anything significant to happen in that time span.
They had to fork an entire parallel command set to implement "location lists" (new in Vim 7, I think) which are exactly like the "quickfix list". Most of the difference are that location list commands start with l, wheras quickfix list commands start with c. Your keybinding to go to the next quickfix item doesn't work in a location list because it uses :cn^M, but the location list wants :ln^M or whatever. The only explanation for this ridiculous state of affairs must be that it was too difficult to extend quickfix lists to do the things that location lists do. Once you get into the Vim codebase, that will not be surprising.
Vim's visual editing semantics assumes that you have a block cursor, and that that the character covered by the cursor is included in a visual selection. This is not so nice when you switch your terminal to an I-beam (or vertical line) cursor, which references between characters. If the cursor is to the left of the selection start, it includes the character to the left of the cursor too. I-beam semantics allows for a zero-length selection, whereas in block semantics, there is always at least one character in the selection, which is the one under the cursor. I-beam semantics is virtually what pretty much all GUI editors do, including the text widget in Firefox I'm using now to type this.
A bunch of years ago I looked into what it would take to have a flag in Vim to flip to I-beam semantics for selection. Gack! I estimated a month of full time work. Numerous places in the code would have to change in ways where you're not sure what side effect they will have elsewhere.
- pydave 3y ago> Your keybinding to go to the next quickfix item doesn't work in a location list because it uses :cn^M, but the location list wants :ln^M or whatever. Navigating quickfix and location lists is global, so a single common command wouldn't make sense (you can use `:cn` from any window -- even if the quickfix is not visible). However, you could use a `<buffer>` map to use the same key to navigate within loclist/quickfire windows. > The only explanation for this ridiculous state of affairs must be that it was too difficult to extend quickfix lists to do the things that location lists do. Their entire concept is to be what quickfix isn't: instead of a global list, it's a list that's tied to a window. I can't think of features that a loclists have but quickfix doesn't unrelated to their nonglobal nature. I can't claim vim's code is easy to understand, but this is not a fair complaint.
- lachlan_gray 3y agoYou could maybe switch to a block cursor when you’re in visual mode with let &t_SI = "\e[6 q" and let &t_EI = "\e[2 q" in some auto commands to sort of address this
- deleted 3y ago[deleted]
- kazinator 3y agoThis seems like a good compromise. Also, say, the r command which replaces the character under the cursor could also switch to a block cursor momentarily. E.g. a|b Type r, and b gets covered by a block cursor. Then type c, and b is replaced by c, and cursor goes back to bar.
- ykonstant 3y agoIndeed, I use block cursor in visual and normal mode, I beam in insert mode and underscore in replace mode.
- kazinator 3y agoWhat you don't have is semantics in visual selection that match an I-beam cursor; it's just games with cursor shape.