- Combine one `exists` call with an implicit `get` into a `get` with an
empty default
- Do not stop any timer in the `Highlight*` functions as this done
already by `ClearHighlights`
- Get rid of the check for existence of `w:*_timer_id` since I believe
that there is no way of it being unset in the current state. The
`_Highlight*` functions are only called via the timer so there should
always be the variable. I could also not reproduce the description in
the comment - this might have been true in a previous revision.
- Make sure that the visual selection itself is not matched. This
actually increased the performance a lot while also looking like
normally (there were some subtle differences between the highlight by
visual mode and `CursorColumn`)
This way better solution using the `(A)` flag was given to me in the
zsh-users mailing list back in 2022 but I forgot to apply it.
See zshexpn(1):
> Convert the substitution into an array expression, even if it
> otherwise would be scalar.
Thanks Mikael!
Link: https://www.zsh.org/mla/users/2022/msg00668.html
The default setting of `g:loaded_nrrw_rgn` is `topleft` which opens the
split at the very top/far left and makes the window have full
width/height. This is very annoying when narrowing multiple splits.
> This plugin is inspired by the Narrowing feature of Emacs and means to
> focus on a selected region while making the rest inaccessible. You
> simply select the region, call :NR and the selected part will open in
> a new split window while the rest of the buffer will be protected.
> Once you are finished, simply write the narrowed window (:w) and all
> the changes will be moved back to the original buffer.
I want this to be able to diff two portions of a file without the need
of creating temporary files. (And the ability to automatically bring
back changes sounds nice too.)
Link: https://github.com/chrisbra/NrrwRgn
I just checked on an open shell and noticed that LESS contained what I
meant to put in thrice. Don't know if that has something to do with
tmux, but apparently the zprofile is sourced multiple times? - good to
know.
I assumed that the selection will always be one character long when the
ModeChanged event is triggered. This is not the case when entering
linewise visual mode.
Fixes: b0688da69e ("vim:aucmd: Do not highlight selection on
ModeChanged")
TODO: There are more ways of triggering ModeChanged to visual mode with
a selection of more than one character (e.g. `[count]v`).
This makes it a lot easier to restrict the search (besides searching in
visual selection, which is quite limited). The cursor will still land on
the closed fold but only once, independent of the number of hits inside
of the fold.
There are operations that change the visual selection without moving the
cursor (e.g. `viw` when on the last character). These do not trigger
CursorMoved so the highlighting also does not change.
TODO: <COMMIT>
Do not call HighlightVisualSel when the mode changes to visual mode, as
then the selection is still only one character long, which I rarely want
to highlight. If I do I can still move the cursor forth and back once.
TODO: Are there situation where ModeChanged is triggered and the
selection is immediately longer than one char without triggering
CursorMoved?
I found this in feh's .desktop file and liked the idea:
With `--start-at` feh will load all files from the directory of the
given file and start the filelist at the given one.
This of course breaks easily if I want to pass more flags before the
file argument, but is easily fixed by first specifying the argument to
`--start-at` and continuing with the rest. I also rarely use any flag
besides the one already defined in the alias.
This is more than often annoying. For example when switching from a fzf
pane to a vim pane (i.e. needing these bindings instead of `C-[hjkl]`)
and then trying to move the cursor.
Reverts: 048933e67d ("tmux: Make `<prefix>[hjkl]` bindings repeatable")
Setting `&spellfile` from the modeline is not allowed and will result in
an `E523: not allowed here` error. Fix the updating of the file by
additionally having an autocommand on BufWinEnter (i.e. after the
modeline was read).
TODO: Also get rid of the error message when rereading the modeline (:e)
Similar to everywhere else, paste the primary X selection (XA_PRIMARY)
instead of the most recent tmux paste buffer.
TODO: Forward event to 'root' key-table to prevent code duplication
The copy command should only be executed when not in a mode (i.e.
alternate?). This gets rid of the error message "Not in a mode" when
double/triple clicking inside of vim etc..
When switching to the 'SecondClick' event in 4b8e877305 ("tmux: Use
SecondClick instead of DoubleClick event"), I forgot to add an `unbind`
of the default binding that was previously overwritten. Since I just
resourced my config I didn't notice.