1
0
mirror of https://github.com/bertptrs/vimconfig.git synced 2025-12-27 21:40:31 +01:00

Compare commits

...

25 Commits

Author SHA1 Message Date
c5ecd6c98d Fix memory reporting 2025-12-16 16:14:40 +01:00
a939dfe553 Alias I keep forgetting 2025-10-27 16:59:28 +01:00
47436ddc59 Missed modules 2025-05-30 13:23:31 +02:00
4bd7364423 Add PKGBUILD handling 2025-05-30 13:22:40 +02:00
7b2830d0f9 Remove auto-notify
It's too noisy
2025-03-30 00:25:01 +01:00
94a179c162 Better git settings
Source: https://blog.gitbutler.com/how-git-core-devs-configure-git/
2025-03-19 11:45:00 +01:00
9b03c61bf2 Pullall helper 2025-02-06 09:22:07 +01:00
97e6e79755 Enable zsh self-reporting 2025-02-05 21:28:22 +01:00
515f854701 Add repo checkout script 2024-08-10 23:34:01 +02:00
c71460b481 Update deps 2024-08-06 00:07:41 +02:00
804d6dab3c Slightly better ruby env 2024-08-06 00:01:49 +02:00
44cf9ba4b7 Am a packager now 2024-07-17 21:24:49 +02:00
671fa71ae3 Plugin updates 2024-05-14 14:10:03 +02:00
d43495f5e8 Nix completions v0.5.1 2024-05-14 14:01:56 +02:00
00f39b4fad SHLVL integration 2024-05-14 13:50:44 +02:00
5dbac71442 Better paste.rs ergonomics 2024-05-14 12:13:35 +02:00
4829a72892 Friendship with direnv ended 2024-05-14 12:13:10 +02:00
33f24fe6de Tmux now actually supports XDG 2024-04-25 14:42:53 +02:00
3ee484c706 Support gcr-provided ssh agent 2024-02-24 11:21:36 +01:00
a45519b90e Update zsh autosuggestions 2024-01-25 14:44:07 +01:00
4865d8f724 Minor improvements 2024-01-02 12:16:14 +01:00
73b9d8f001 Fix bat as a manpager 2023-10-27 08:57:31 +02:00
8f0fa8da4d Maybe fix Nix completion issues 2023-08-09 20:01:37 +02:00
7d8afc4f05 Ignore vscode files 2023-02-19 10:08:48 +01:00
4d2a907c05 Actually install to correct directory 2023-02-12 21:48:39 +01:00
16 changed files with 85 additions and 40 deletions

3
.gitmodules vendored
View File

@@ -61,3 +61,6 @@
[submodule "zsh/.config/zsh/plugins/zsh-auto-notify"]
path = zsh/.config/zsh/plugins/zsh-auto-notify
url = https://github.com/MichaelAquilina/zsh-auto-notify.git
[submodule "vim/.vim/pack/bundle/start/vim-pkgbuild"]
path = vim/.vim/pack/bundle/start/vim-pkgbuild
url = https://github.com/m-pilia/vim-pkgbuild.git

View File

@@ -19,9 +19,12 @@
[push]
default = simple
autoSetupRemote = true
followTags = true
[merge]
tool = vimdiff
conflictstyle = zdiff3
[help]
autocorrect = 10
@@ -45,9 +48,13 @@
[rebase]
autosquash = true
updaterefs = true
autoStash = true
[fetch]
prune = true
pruneTags = true
all = true
[sendemail]
smtpserver = charon.bertptrs.nl
@@ -69,3 +76,15 @@
# Mark any lines that were added in a skipped commit and can not be
# attributed with a `*`
markUnblamableLines = true
[branch]
sort = -committerdate
[diff]
algorithm = histogram
colorMoved = plain
mnemonicprefix = true
renames = true
[rerere]
enabled = true
autoupdate = true
[tag]
sort = version:refname

View File

@@ -18,3 +18,4 @@
# Exclude IDE files
.idea
cmake-build-*
.vscode

View File

@@ -1,10 +1,6 @@
#!/hint/bash
# Modify default build parameters to build native optimizations
CFLAGS="${CFLAGS/-mtune=generic/-mtune=native}"
CXXFLAGS="${CXXFLAGS/-mtune=generic/-mtune=native}"
# Enable rust to do the same
export RUSTFLAGS="-C target_cpu=native"
PACKAGER="Bert Peters <bertptrs@archlinux.org>"
GPGKEY="0x38100C24376CD5F6ED4FF4B46918400C2703040C"
# Do a parallel build and enable output combining
MAKEFLAGS="-j$(nproc) -Otarget -k"

View File

@@ -1,3 +1,2 @@
---
BUNDLE_PATH: "~/.gem"
BUNDLE_AUTO_INSTALL: "true"

View File

@@ -54,6 +54,7 @@ fun! StripTrailingWhitespace()
endfun
autocmd BufWritePre * call StripTrailingWhitespace()
autocmd filetype pkgbuild setlocal tabstop=2 shiftwidth=2 expandtab
" Keep backup files etc out of the way
set undofile

View File

@@ -38,9 +38,6 @@ fi
# Set up wine
export WINEPREFIX="$XDG_DATA_HOME/wine"
# Setup tmux
test -f "$XDG_CONFIG_HOME/tmux/tmux.conf" && alias tmux="tmux -f $XDG_CONFIG_HOME/tmux/tmux.conf"
# Set up Rubygems
if type gem &> /dev/null; then
path+="$HOME/.gem/bin"

View File

@@ -22,8 +22,12 @@ fi
unset -f want_multiplexer
# Check for service-managed keyring
if [[ -z $SSH_AUTH_SOCK ]] && [[ -S $XDG_RUNTIME_DIR/ssh-agent.socket ]]; then
if [[ -z $SSH_AUTH_SOCK ]]; then
if [[ -S $XDG_RUNTIME_DIR/ssh-agent.socket ]]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
elif [[ -S $XDG_RUNTIME_DIR/gcr/ssh ]]; then
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
fi
fi
#######################
@@ -46,7 +50,6 @@ plugins=(
zsh-autosuggestions/zsh-autosuggestions.zsh
zsh-you-should-use/you-should-use.plugin.zsh
nix-zsh-completions/nix-zsh-completions.plugin.zsh
zsh-auto-notify/auto-notify.plugin.zsh
)
for plugin in "${plugins[@]}"; do
@@ -57,24 +60,6 @@ done
fpath+=("$ZDOTDIR/plugins/nix-zsh-completions")
# Configure auto-notify
AUTO_NOTIFY_IGNORE+=(
"gcloud compute ssh"
"nix run"
"bash"
"sem debug"
"git "{commit,grep,log}
"journalctl"
"jekyll serve"
"sudoedit"
"ipython"{,3}
"sem "{attach,debug}
"psql"
"sqlite3"
"iotop"
)
## Autosuggest plugin configuration
# Consider autocomplete in completion
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
@@ -100,16 +85,27 @@ alias nrc='nix shell --file default.nix -c'
alias gcs='gcloud compute ssh --tunnel-through-iap'
alias gscp='gcloud compute scp --tunnel-through-iap'
alias gci='gcloud compute instances'
# This invocation is so much more complicated than it needs to be, but
# Google will only show mountain time otherwise.
alias gops='gcloud compute operations list --format=":(TIMESTAMP.date(tz=LOCAL))" --sort-by=TIMESTAMP'
# Not an alias but useful nonetheless.
function pasters() {
local file=${1:-/dev/stdin}
curl --data-binary @${file} https://paste.rs
# Explicitly write the newline because paste.rs doesn't and sakura
# gets confused.
curl --write-out "\n" --data-binary @${file} https://paste.rs
}
# Ensure we can make cheap copies on btrfs
alias cp='cp --reflink=auto'
function pullall() {
for repo in "$@"; do
echo "$repo"
done | xargs -P0 -I{} git -C {} pull
}
if (( $+commands[thefuck] ))
then
alias fuck='$(thefuck $(fc -ln -1))'
@@ -119,6 +115,11 @@ eval "$(dircolors)"
# Initialize the prompt
source "${ZDOTDIR:-$HOME}/.zshtheme"
# Report commands that take longer than ten seconds, or more than 10MB
# of RAM
REPORTTIME=10
REPORTMEMORY=10240
TIMEFMT='%J %U user %S system %P cpu %*E total; max RSS %MkB'
# Setup the CNF hook
if [[ -s /usr/share/doc/pkgfile/command-not-found.zsh ]]; then
@@ -294,6 +295,9 @@ if (( $+commands[bat] )); then
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# And replace cat while we're at it
alias cat='bat'
# According to upstream, "if you have problems add this." I have problems.
export MANROFFOPT="-c"
fi
# Source Nix if it's installed. Should be done by the WM, but it isn't
@@ -301,7 +305,30 @@ if [[ -f /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh ]]; then
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
fi
# Initialize direnv if available
if (($+commands[direnv])); then
eval "$(direnv hook zsh)"
fi
#####################
# Arch Linux things #
#####################
function arch-pkg-cd() {
# Inspired by Segaja: https://gitlab.com/Segaja/dotfiles_base/-/blob/main/distro_arch/.config/zsh/os.zsh#L118-133
local arch_repo_folder="${HOME}/projects/arch/packaging/packages"
if [[ ! -d "$arch_repo_folder/$1" ]]; then
if pacman -Si "$1" &> /dev/null; then
cd "$arch_repo_folder"
pkgctl repo clone "$1"
elif [[ "$2" = '-c' ]]; then
cd "$arch_repo_folder"
pkgctl repo create --clone "$1"
else
echo "Non-existent package, use -c to create" >&2
return 1
fi
cd "$1"
return 0
else
cd "$arch_repo_folder/$1"
pkgctl repo configure
git pull --rebase --autostash
fi
}

View File

@@ -53,6 +53,7 @@ function prompt_ps1() {
host="%S%B$host"
fi
local shlvl="%{$fg[black]%}%{$bg[magenta]%}\${(l:$SHLVL-1::>:)}%{$reset_color%}"
local prompt="%n@%{$fg[cyan]%}%m$rs %# "
ps1=(
"$host"
@@ -61,6 +62,7 @@ function prompt_ps1() {
$'\n'
'$(prompt_handle_virtualenv)'
'${vcs_info_msg_0_:+${vcs_info_msg_0_}\n}'
"$shlvl"
"$prompt"
)
echo "${(j::)ps1}"