Check that the current word under the cursor exists (not empty) before
adding it as match.
Fix the disappearing of the welcome screen after a short time when
opening vim without file as argument.
I sometimes have the situation that I want to create empty lines but
they contain either whitespace from keeping the indentation and/or the
comment string (`o` on a comment line). My current workflow is to either
delete it and recreate it properly (e.g. from the 'other side' i.e. a
non-comment line) or clear it with `cc`. Both ways are a bit awkward.
Add a mapping that clears a line but stays in normal mode.
Also remove the `<leader>d` mapping that deletes and puts the content
into the system clipboard as I rarely use this one.
Step by step I want to restructure the vim files. The approach to
cleanly divide the config by topics works in zsh pretty well, but is too
vague in vim for my liking.
Especially (the very small) functions and autocommands that have the
purpose of setting options or mapping keys or the interplay of multiple
categories together, make it difficult to decide in which file the
snippets should lay.
As I started to type on the international US layout I don't need any
extra bindings for special characters in vim.
Move the update of `spellfile` into xdg.vim, as it was the only
remaining body of `NewSpellLang()` and fits thematically.
Fix a small but stupid bug that the result of `timer_start` (i.e. the
timer ID) was evaluated as Ex command. This would lead to a jump to the
top of the file, every time the vimrc was reloaded (i.e. when a .vim is
saved).
Use `call` instead of `execute`, to fix this.
Apply the following:
1. Switch to `matchadd` as `match` can only be used for **one**
highlight
2. Use an autocommand group for better behaviour when reloading the
vimrc.
3. Use just one pattern as it seems to work always. (Apparently `\%#` is
not matched in normal mode)
Neovim does not make `has('clipboard')` obsolete. It only simplifies
clipboard support but `has('clipboard')` will still return `0` if no
supported clipboard program is installed.
See `:help clipboard`
Nvim has no direct connection to the system clipboard. Instead it
depends on a |provider| which transparently uses shell commands to
communicate with the system clipboard or any other clipboard
"backend".
and `:help clipboard-tool`
The presence of a working clipboard tool implicitly enables the '+'
and '*' registers. Nvim looks for these clipboard tools, in order of
priority:
- |g:clipboard|
- pbcopy, pbpaste (macOS)
- wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
- xclip (if $DISPLAY is set)
- xsel (if $DISPLAY is set)
- lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH)
http://www.chiark.greenend.org.uk/~sgtatham/doit/
- win32yank (Windows)
- termux (via termux-clipboard-set, termux-clipboard-set)
- tmux (if $TMUX is set)
As relative line numbers are only really needed in normal mode and in
the current buffer, disable them in insert mode or when the
buffer/window is not focused.
Fix the commit reference mapping `<leader>grc` in the case that nothing
follows the commit hash on the line. In that case the join would add a
trailing space.
`gJ` is not suitable as that would break in the other case that text
follows. When splitting the line behind the commit hash, the space in
front of whatever follows is deleted. Thus when joining everything
together at the end, there would be no space between the closing
parentheses and the rest.
Using the `system()` was the only solution I found to insert the subject
directly behind the hash without destroying the formatting and the text
behind it.
For this to work the trailing newline had to be cut off of git's output.
Use `gitgutter`'s `foldtext()` to display an indicator if a fold
contains lines that have been changed.
This is necessary as {,neo}vim does not display signs next to folded
lines.
[vim-tmux-navigator][1]:
> Seamless navigation between tmux panes and vim splits
Add the hybrid vim/tmux plugin `vim-tmux-navigator` to switch between
tmux panes and vim splits with `C-[hjkl]`.
Add vim-tmux-navigator as a submodule in tmux/plugins and create a
symlink from vim/pack/plugins/start.
Get rid of similar switching keymappings in the vim and tmux configs.
[1]: https://github.com/christoomey/vim-tmux-navigator
The checktime command is not available in the command line window. As
the `CheckTime` function runs every second, the command line window
spits out an error message every second making it practically unusable.
This patch silences the `checktime` call to fix this.
- Drop the mapping for `:Gcd` as I rarely use it and prefer to commit
with one keystroke less.
- Add the current file instead of calling `git add -p` for the whole
repository. If I want to add hunks I can do that with the gitgutter
mappings.
- Add mappings to stash and checkout the current file.
- Use mnemonic 'add' instead of 'stage' for `GitGutterStageHunk`
mappings.
TODO: Extend gitgutter for a `GitGutterStashHunk` function
Do not automatically restore missing <EOL> at EOF when writing.
This is rarely a change worth committing and I'd rather prefer vim to
not touch stuff I did not actively modify myself.