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 issue that the vim config would always be reloaded on save
(jumping to the BOF; another TODO) even in non `*.vim` buffers, after a
vim file was opened once in the session.
Fix this by defining the autocmd only local to the current buffer.
See also :help autocmd-buflocal
Move all submodules that were under .config/ into .local/share/ (alias
XDG_DATA_HOME). I got convinced that they feel out of place in .config/.
Instead of updating the paths from which they are sourced (e.g.
`TMUX_PLUGIN_MANAGER_PATH` or `packpath`), keep a symlink in the old
location that points to the new one. This has the benefit that
everything related to one program remains mostly accessible from the
same place instead of spreading everything out.
I am still unsure if I really like the new location as I affiliate user
**data** more with something that has to be backed up as it is
non-recreatable. And moving them out of .config/ had the reasoning that
they are not my config files but rather data from the internet that
could be retrieved when deleting. But using XDG_CACHE_HOME seems
unreasonable as well.
We'll see.
Move the fzf-repo from ./local/bin/ to .local/share/.
Update all relative symlinks' (e.g. fzf) targets.
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.
I am a big supporter of the approach to indent with tabs and align with
spaces. (Read [here][1] f.e.) Thus at some places a simple `s/ {4}/\t/g`
(replace 4 with whatever fits) is not enough and a bit more thought is
needed. Because of that there are still places where I plan to
substitute the whitespace in the future.
This patch contains exclusively whitespace changes. Check for yourself
with `git diff --ignore-all-space`.
[1]: https://dmitryfrank.com/articles/indent_with_tabs_align_with_spaces
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.
> Sorting folds is not easily possible in vanilla vim. You could join
> all lines in a fold, sort and split them up again; however, it is time
> consuming and tedious.
>
> This little plugin solves that issue: It sorts a visually selected
> region while keeping closed folds intact. Since folds can be created
> in a variety of ways, it is therefore straight-forward to sort
> arbitrary groups of text based on their first line.
> This Vim plugin provides text objects for comments.
>
> `ac` selects a comment including the comment delimiters and `ic`
> selects just the comment content. (There's also a third text object,
> `aC`, which selects a comment including trailing or leading
> whitespace.) These mappings are available in Visual and
> Operator-pending mode.
>
> This plugin uses the `comments` and `commentstring` settings to
> determine what a comment looks like for a given filetype. It works
> with both `/* paired */` and `// simple` comment delimiters.
>
> This plugin depends on the textobj-user plugin.
- 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