Commit Graph

1190 Commits

Author SHA1 Message Date
b7dcc1f79c vim:keys: Map real <C-BS> to delete one word
Map <C-BS> (i.e. Ctrl-Backspace) to delete one word in insert mode & co.
as it is properly recognized in some terminals implementing [fixterm][1]
(e.g. kitty and patched st).

Keep the <C-H> mapping for other terminals but reuse the <C-BS> mapping.

[1]: http://www.leonerd.org.uk/hacks/fixterms/
2023-02-15 14:30:52 +01:00
a05d99df95 vim:keys: Add <leader>v/ as vmap too
Just escape visual mode and reuse the existing normal-mode mapping.
2023-02-15 14:28:35 +01:00
1d58eb729d vim:keys: Add <leader>* vmap to ripgrep selection
Similar to <leader>* in normal mode, set the search pattern to the
visual selection and start a ripgrep search.

To not mess up the commandline, potential quotes that are the same as
the ones used around the string need to be escaped. As this is only
possible with double quotes, a second layer of backslash escaping is
needed as well.

Because of that, **before** escaping backslashes and double quotes, all
backslashes need to be escaped a second time. The other way around would
result in two backslashes in front of each double quote, which would
miss the whole point entirely.

In addition GetVisualSelection needed to be expanded to first reselect
the visual selection for it to work in the new mapping.
2023-02-15 14:26:05 +01:00
1933218756 vim:keys: Center search results after N too
Forgot that one.
2023-02-15 11:37:07 +01:00
8e71a3f12e vim:keys:vmap *: Center search results
Center search results by further evaluating mappings in {rhs}.
2023-02-15 11:37:00 +01:00
9f3b9ac79a vim:keys: Save unnamed reg when getting selection
Fix that the mappings modified the unnamed register.
2023-02-15 11:35:50 +01:00
647a022782 vim:keys: Group together * mappings in the code 2023-02-15 10:52:06 +01:00
10824feb74 git:checkout-worktree: Make errc variable local 2023-02-13 17:18:25 +01:00
28f60004de git:checkout-worktree: Fix unset ret variable 2023-02-13 17:17:49 +01:00
0625fdbd94 git:last-changed: Fix handling of weird filenames
Make sure that `git-log` does not misunderstand the file name.
2023-02-13 17:13:41 +01:00
0a749cd6f5 git:last-changed: Equalize ANSI sanitization regex
Don't know why I used two different patterns.
2023-02-13 17:08:16 +01:00
e2a133a29b vim:ftplugin:markdown: Fold by sections 2023-02-13 16:50:50 +01:00
295f33e62c vim:ftplugin: Set options locally
I only want to set the wrap settings for the current buffer/window.
2023-02-13 16:43:30 +01:00
b489fdbe4b polybar:vpn: Parse mullvad status 2023-02-13 16:39:04 +01:00
25243e5ee6 git:last-changed: Fix execution in subdir
git aliases are executed in the repository root.

Fix the output of git-last-changed by first cd-ing into the current
working directory.
2023-02-13 16:37:05 +01:00
f8519555f7 vim:setts: Deactivate 'relativenumber'
I rarely use them and are more an annoyance.

For the case that I want to enable them in a session, move the
numbertoggle augroup into a function and add an autocommand on
`OptionSet relativenumber`.
2023-02-13 15:32:53 +01:00
db6a7e2984 vim:setts: Reactivate 'cursorline' 2023-02-13 15:15:34 +01:00
be763b9ff2 vim:keys: Center search on <CR> too
In addition to center the cursor-line on `n` do it right after accepting
the search as well.
2023-02-13 15:14:30 +01:00
11fc486768 vim:keys: Fix search result centering mapping
The cursor should be vertically centered **after** we moved to the next
search result.
2023-02-13 14:55:41 +01:00
226f09b046 zsh:mvln(): Create relative symlinks
When using ln's `-a` flag, absolute paths are not necessary.
2023-02-09 17:08:49 +01:00
7739d0a9c3 zsh:mvln(): Refactor to fewer lines and zshisms 2023-02-09 17:08:48 +01:00
69f8bd8631 zsh:mvln(): Make variables local 2023-02-09 17:08:42 +01:00
fc04a6a682 vim:keys: Add leader mappings to switch the case
I find myself quite often to type `gUl` but find that it has quite some
brain overhead. We will see, if these mappings aid in this regard.
2023-02-09 14:32:15 +01:00
78a7b0d809 git:glog:TODO: Depend preview function on --stat 2023-02-09 13:22:19 +01:00
8baaaf0e94 git:glog:TODO: Display ... in patch-stat 2023-02-09 13:21:00 +01:00
9449b7fecd git:glog: Respect file arguments when previewing
When file arguments were passes behind `--`, show only these files in
the patch preview. This mimics the behaviour of `git log -up --
<files>`.

The full patch can still be displayed with ctrl-p.
2023-02-09 13:17:32 +01:00
1b365be8e7 vim:aucmd: Underline old cursor position
Underline old cursor position for better readability. Reusing
`TermCursor` made me confuse the current window many times.

My favorite solution would be an empty box around the position similar
to how terminals do it when focus is lost. But I fear that this is not
possible with a simple highlighting group.
2023-02-09 12:02:03 +01:00
83b79aab10 vim:opts: Set GLOB_COMPLETE 2023-01-27 00:25:01 +01:00
74b3d98b67 meta:envrc: Add modeline to set proper filetype 2023-01-27 00:06:34 +01:00
2afafef362 meta:envrc: Generate vim helptags when entering
Move the commands into a function, so that the function can be run in
the background.
2023-01-27 00:06:26 +01:00
e1b46bddc3 zsh,git: Add completion for git-https-and-ssh
Complete remotes.

Also remove redundant compdef lines. The _git-<command> functions are
used automatically.
2023-01-25 03:19:11 +01:00
47e13d36a6 git:https-and-ssh: Support passing custom remote 2023-01-25 03:06:57 +01:00
6a48ee8adc firefox: Insert new tabs after the current one
Insert new and related tabs after the current one.
`insertRelatedAfterCurrent` is already set by default, but related and
wanted so I still added it.
2023-01-24 02:57:31 +01:00
6930d9b2d9 vim:keys: Fix <leader>grc when on end of hash
When the cursor is on the last character of the hash (e.g. after
pasting), the mapping would break and insert the commit subject behind
the next word.

Fix this by using `viw<Esc>` which places the cursor on the end of the
current word independent of the placement of the cursor.
2023-01-23 19:52:07 +01:00
5d750e5962 zsh:pdfunite(): Fix execution through missing $0
I don't know what happened there. Apparently I just checked that the
early-abort condition works.
2023-01-23 01:25:39 +01:00
a205a7c5ce zsh:opts: Disable CDABLE_VARS
It annoys me more than it helps me.
2023-01-21 12:40:17 +01:00
93e8517ab2 vim:keys: Center next search result on n 2023-01-21 02:01:57 +01:00
e9a82452fd zsh:psofof(): Remove duplicates 2023-01-21 02:00:59 +01:00
884d12d237 zsh:funcs: Add psofof to list pids from lsof 2023-01-21 01:59:23 +01:00
3b3ec03d01 zsh:alias: Add gca for git commit --amend 2023-01-21 01:58:32 +01:00
c8b634b81f git:https-and-ssh: Use shorter variant to get url 2023-01-21 01:57:37 +01:00
f0194794f9 zsh:alias: Add gcl for git commit-last-msg 2023-01-21 01:56:30 +01:00
401fc939ea zsh:alias: Add more possibilities for glog-aliases
It kind of follows a pattern: `a` for `all` (i.e. --branches --remotes)
and `g` for `graph` (but adding another `l` is ok too).
2023-01-20 12:57:40 +01:00
feab64f566 vim:highNonASCII: Use shorter syntax to compare 2023-01-19 22:14:50 +01:00
2d497c6363 vim:highNonASCII: Support extension of ignore_char 2023-01-19 22:11:36 +01:00
b35ef3603f zsh:alias: Add gla for glog --branches --remotes
Sometimes I want to see other branches but the repository is too big for
`--graph`.

Add `gla` as alias to `glog --branches --remotes` similar to `glll`.

Add `glla` as further alias to `glll` and make the brace expansion more
verbose for better readability.
2023-01-19 03:16:33 +01:00
0d39158b7c zsh:compl: Add TODO for git-completion for-loop 2023-01-17 16:49:38 +01:00
a88ce81b92 zsh:compl: Remove unused git-signoff completion
The shell function git-signoff was replaced with gits builtin
functionality in 09ef4d4d93 ("git: Replace git-signoff with `rebase
--signoff`").

Also adjust the example in the new commment.
2023-01-17 16:48:32 +01:00
5a0c6cdefb git: Fix completion for aliases to shell functions
When only linking the completion function, the completion works for the
shell functions, but not when using a git alias to those functions.

Fix that by defining own completion functions for each that call the
existing/copied ones.
2023-01-17 16:42:34 +01:00
805180be5d git:alias: Reorder auto{squash,fixup}
As the flag is called `--autosquash`, the order makes more sense like
this.
2023-01-17 16:34:05 +01:00