Compare commits

...

18 Commits

Author SHA1 Message Date
708daa10dc kitty: Disable cursor shell integration
It's super slow and I really don't need it. I'd prefer to have kitty
mess with my shell as little as possible.
2025-09-04 11:14:52 +02:00
6bd13a9b56 kitty: Open url with kitty_mod+f
Similar to zathura's `f` to follow links.
2025-09-04 11:14:45 +02:00
a34cdab694 vim:keys: Revert "Add <leader>g[pP] for system clipboard"
This reverts commit 2bceafeb4e.

`<leader>gp` conflicts with GitGutterPreviewHunk.
2025-09-03 15:01:57 +02:00
456f71d939 vim:keys:TODO: Add <leader>[h 2025-09-03 13:33:09 +02:00
2bceafeb4e vim:keys: Add <leader>g[pP] for system clipboard 2025-09-03 13:18:17 +02:00
af0d9e8fd1 vim:keys: Disable gp mapping for now
It conflicts with the default.
2025-09-03 13:18:17 +02:00
d57fbf0e66 vim:keys: Prepend fzf bindings with f
All fzf related bindings should start with `<leader>f`. This resolves
the clash between `GFiles` and the git actions targeting the full file.
2025-09-03 13:18:16 +02:00
a23159e50d vim:keys: Merge fzf mappings 2025-09-03 13:18:16 +02:00
e8a8f9637a vim:coc: Re-enable backup files
CoC disables backup files due to a problem with a typescript
language-server (it becoming slow when the backup file is written,
triggering a `structureChanged`). But:

1. I want backup files
2. I do not use that language server
3. If I would:
	1. I could disable backup files in a filetype plugin
	2. The linked issue is from 2019 - no idea if this is still
	   present today
4. I don't think this issue is even a thing with a `&backupdir` that
   does not include relative directories (which is the case for me)

So remove the lines disabling backups and go back to vim's defaults:
`nobackup` and `writebackup`.

Link: https://github.com/neoclide/coc.nvim/issues/649
2025-09-03 11:54:50 +02:00
0e5baf5e36 vim:coc: Add coc-go server 2025-09-03 11:36:27 +02:00
fced504674 tmux: Kill dead pane with Escape too 2025-09-03 10:07:53 +02:00
a49cbcae21 git:core.pager: Remove --quit-if-one-screen
The inconsistency annoys me.
2025-09-03 10:02:06 +02:00
9271a293cb git: Enable clone.filterSubmodules
> If a partial clone filter is provided (see --filter in
> git-rev-list(1)) and --recurse-submodules is used, also apply the
> filter to submodules.

I have never used --filter before, but it sounds as if I want this
enabled in the case that I do.
2025-09-03 10:00:48 +02:00
2e4086500d git: Disable rerere
I had this change sitting around so long that I forgot why exactly I
disabled it, but know that some problem arose from rerere. I think that
even though it is super cool, it brings a sneaky new layer of possible
errors. Maybe I'll re-enable it in the future.
2025-09-03 09:53:54 +02:00
ca15f2399e bin:no-ansi: Fix final byte range
Don't know why I put `z`, the range goes until `~` (i.e. 0x7E).
2025-09-01 16:50:03 +02:00
198069fac7 zsh:alias: Add -a to cp
Preserve all attributes (i.e. timestamps, permissions, etc.). This also
implies `--recursive` which I probably could have added already sooner.
2025-08-30 11:48:45 +02:00
4c12418b62 git:track: Fix unnecessary subshell launch
While at it, modify the formatting of the line above slightly.
2025-08-28 12:24:06 +02:00
5767210dce git:track: List remote refs only on request
List only the local heads by default and require the remote refs to be
passed as arguments. For example:

	git track origin

To make this easier, add support of an `--all` flag to list all remote
refs.
2025-08-28 12:24:02 +02:00
9 changed files with 52 additions and 41 deletions

View File

@@ -49,6 +49,8 @@
[branch]
autosetuprebase = always
sort = -committerdate
[clone]
filterSubmodules = yes
[color "status"]
added = 076
untracked = 014
@@ -65,8 +67,7 @@
[core]
abbrev = 12
#pager = delta
pager = diff-so-fancy \
| less --tabs=8 --RAW-CONTROL-CHARS --quit-if-one-screen
pager = diff-so-fancy | less --tabs=8 --RAW-CONTROL-CHARS
whitespace = trailing-spaces,space-before-tab,indent-with-non-tab
[delta]
navigate = true
@@ -114,7 +115,7 @@
[rebase]
autostash = true
[rerere]
enabled = true
enabled = false
[status]
submodulesummary = true
[submodule]

View File

@@ -1763,7 +1763,7 @@ close_on_child_death yes
#: special value of ask means that kitty will ask before opening the
#: link when clicked.
# shell_integration enabled
shell_integration no-cursor
#: Enable shell integration on supported shells. This enables features
#: such as jumping to previous prompts, browsing the output of the
@@ -2521,7 +2521,8 @@ map kitty_mod+shift+backspace change_font_size all 0
#: Open URL
map kitty_mod+e open_url_with_hints
# map kitty_mod+e open_url_with_hints
map kitty_mod+f open_url_with_hints
#:: Open a currently visible URL using the keyboard. The program used
#:: to open the URL is specified in open_url_with.

View File

@@ -361,10 +361,12 @@ bind S set -w synchronize-panes
set -g remain-on-exit on
if -F "#{>=:#{version},3.3}" {
bind -n C-d if -F "#{pane_dead}" { kill-pane } { send }
bind -n Escape if -F "#{pane_dead}" { kill-pane } { send }
bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send }
} {
# omitting the key argument was introduced in 3.3
bind -n C-d if -F "#{pane_dead}" { kill-pane } { send C-d }
bind -n Escape if -F "#{pane_dead}" { kill-pane } { send Escape }
bind -n Enter if -F "#{pane_dead}" { respawn-pane } { send Enter }
}

View File

@@ -15,8 +15,10 @@ endfor
" needs vim >= 8.1.1719 to support features like popup and text property as well
" as nodejs.
if ((has('patch-8.1.1719') || has('nvim')) && executable('node'))
let g:coc_global_extensions =
\ ['coc-clangd', 'coc-sh', 'coc-pyright', 'coc-vimtex', 'coc-vimlsp', 'coc-json']
let g:coc_global_extensions = [
\ 'coc-clangd', 'coc-sh', 'coc-pyright', 'coc-vimtex',
\ 'coc-vimlsp', 'coc-json', 'coc-go'
\ ]
let g:coc_config_home = $XDG_CONFIG_HOME .. "/vim"
packadd coc.nvim
endif

View File

@@ -6,10 +6,6 @@ if !exists('g:did_coc_loaded')
finish
endif
" Some servers have issues with backup files, see #649.
set nobackup
set nowritebackup
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
set signcolumn=yes

View File

@@ -91,17 +91,20 @@ elseif (has('terminal'))
nmap <leader><CR> <Cmd>terminal<CR>
endif
" Plugin specific bindings
if (get(g:, 'loaded_fzf'))
nmap <leader>f <Cmd>Files<CR>
nmap <leader>j <Cmd>Lines<CR>
nmap <leader>/ <Cmd>Lines<CR>
nmap <leader>h <Cmd>Helptags<CR>
" TODO: fix this?
if (get(g:, 'loaded_gutentags') || 1)
nmap <leader>t <Cmd>Tags<CR>
nmap <leader>bt <Cmd>BTags<CR>
endif
nmap <leader>ff <Cmd>Files<CR>
nmap <leader>fj <Cmd>Lines<CR>
nmap <leader>f/ <Cmd>Lines<CR>
nmap <leader>fh <Cmd>Helptags<CR>
nmap <leader>ft <Cmd>Tags<CR>
nmap <leader>fbt <Cmd>BTags<CR>
" git files that `git status` lists
nmap <leader>fgf <Cmd>GFiles?<CR>
" 'git log (log?)' and 'git log buffer '
map <leader>fgll <Cmd>Commits<CR>
map <leader>fglb <Cmd>BCommits<CR>
" TODO: <leader>fglb should restrict the log to all staged files when called
" in .git/COMMIT_EDITMSG, maybe with an ftplugin?
endif
" Search for selected text.
@@ -136,7 +139,8 @@ vmap <leader>/ <Esc><leader>v/
" Select last pasted text in same visual mode as it was selected (v, V, or ^V)
" Taken from: https://vim.fandom.com/wiki/Selecting_your_pasted_text
nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" TODO: I want the gp default back - find new mapping
" nnoremap <expr> gp '`[' . strpart(getregtype(), 0, 1) . '`]'
" Git bindings
@@ -153,10 +157,9 @@ nmap <leader>grc :let subject=system('git show -s --date=short --pretty="format:
nmap <leader>gso :r!git config --get user.name<CR>:r!git config --get user.email<CR>I<<ESC>A><ESC>kJISigned-off-by: <ESC>
" Add, stash or checkout the current file
" TODO: Conflict with <leader>gf
"nmap <leader>gfa <Cmd>!git add -- %<CR>
"nmap <leader>gfs <Cmd>!git stash -- %<CR>
"nmap <leader>gfu <Cmd>!git checkout -- %<CR>
nmap <leader>gfa <Cmd>!git add -- %<CR>
nmap <leader>gfs <Cmd>!git stash -- %<CR>
nmap <leader>gfu <Cmd>!git checkout -- %<CR>
if exists('g:loaded_fugitive')
" Interactive `git status`
@@ -191,19 +194,12 @@ if exists('g:loaded_gitgutter')
xmap ih <Plug>(GitGutterTextObjectInnerVisual)
xmap ah <Plug>(GitGutterTextObjectOuterVisual)
" Same for hunk navigation bindings + center line
" TODO: <leader>[h to jump between **all** hunks across all modified
" files. (similar to `add -p`)
nmap [h <Plug>(GitGutterPrevHunk)zz
nmap ]h <Plug>(GitGutterNextHunk)zz
endif
if (get(g:, 'loaded_fzf'))
" git files that `git status` lists
nmap <leader>gf <Cmd>GFiles?<CR>
" 'git log (log?)' and 'git log buffer '
map <leader>gll <Cmd>Commits<CR>
map <leader>glb <Cmd>BCommits<CR>
" TODO: <leader>glb should restrict the log to all staged files when called
" in .git/COMMIT_EDITMSG, maybe with an ftplugin?
endif
" Y should behave like D & C does
nnoremap Y y$

View File

@@ -1,6 +1,20 @@
#!/usr/bin/env zsh
git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes \
local idx="${@[(ei)--help]}"
local flags_end="${@[(ei)--]}"
if (( idx < flags_end )); then
printf "Usage: $0 [--all] [REMOTE]..."
return 0
fi
idx="${@[(ei)--all]}"
if (( idx < flags_end )); then
# Replace --all flag with empty string. Will be replaced with
# refs/remotes/ later so that all remotes are listed
set -- "${@[1,$((idx-1))]}" "" "${@[$((idx+1)),-1]}"
fi
git for-each-ref --format='%(upstream),%(refname)' refs/heads "${@/#/refs/remotes/}" \
| sort -d \
| sed -Ez '
s:(^|\n|,)refs/(heads|remotes/):\1:g
@@ -8,9 +22,8 @@ git for-each-ref --format='%(upstream),%(refname)' refs/heads refs/remotes \
s:,/:,:g
s:(^|\n)([^,]+),\n\2:\1\2:g
s:(^|\n)([^/,]*)([^\n]*\n\2(,|/))*:\n,\n&:g
s:\n,\n+$:\n:
' \
| (echo remote,local; cat) \
s:\n,\n+$:\n:' \
| { echo remote,local; cat; } \
| sed -E 's:(.*),(.*):\2,\1:g; s:^,: ,:; s:,$:, :' \
| column -ts, \
| sed '2d; 1{p;s/./―/g}'

View File

@@ -183,7 +183,7 @@ fi
# Default flags
add_flags ls --color=auto --group-directories-first -p -v
add_flags grep --color=auto --exclude-dir=.git --exclude=tags
add_flags cp -i
add_flags cp -ia
add_flags mv -i
# Only add flags if rm is not aliased to a different command (e.g. trash).
# NOTE: This also works if rm is not yet aliased.

View File

@@ -4,4 +4,4 @@
#
# Remove ANSI escape sequences.
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-z]//g'
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-~]//g'