more stuff

This commit is contained in:
ElKowar 2024-11-16 17:38:25 +01:00
parent ea60cff5cc
commit 0a9cfef2b7
17 changed files with 3004 additions and 0 deletions

View file

@ -0,0 +1,189 @@
# -*- conf -*-
# shell=$SHELL (if set, otherwise user's default shell from /etc/passwd)
# term=foot (or xterm-256color if built with -Dterminfo=disabled)
# login-shell=no
# app-id=foot
# title=foot
# locked-title=no
# font=APL386 Unicode:size=8
font=Fira Code Nerd Font:size=12
# font-bold=<bold variant of regular font>
# font-italic=<italic variant of regular font>
# font-bold-italic=<bold+italic variant of regular font>
# font-size-adjustment=0.5
# line-height=<font metrics>
# letter-spacing=0
# horizontal-letter-offset=0
# vertical-letter-offset=0
# underline-offset=<font metrics>
# underline-thickness=<font underline thickness>
# box-drawings-uses-font-glyphs=no
# dpi-aware=auto
# initial-window-size-pixels=700x500 # Or,
# initial-window-size-chars=<COLSxROWS>
# initial-window-mode=windowed
pad=15x15 center # optionally append 'center'
# resize-delay-ms=100
# notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}
# bold-text-in-bright=no
# word-delimiters=,│`|:"'()[]{}<>
# selection-target=primary
# workers=<number of logical CPUs>
# utempter=/usr/lib/utempter/utempter
[environment]
# name=value
[bell]
urgent=no
notify=no
command-focused=no
[scrollback]
lines=100000
# multiplier=3.0
# indicator-position=relative
# indicator-format=""
[url]
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
# protocols=http, https, ftp, ftps, file, gemini, gopher
# uri-characters=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+="'()[]
[cursor]
style=block
# color=<inverse foreground/background>
# blink=no
# beam-thickness=1.5
# underline-thickness=<font underline thickness>
[mouse]
hide-when-typing=yes
# alternate-scroll-mode=yes
[colors]
#background=1d2021
background=282828
foreground=ebdbb2
#regular0=282828
regular0=665c54
regular1=cc241d
regular2=98971a
regular3=d79921
regular4=458588
regular5=b16286
regular6=689d6a
regular7=a89984
bright0=928374
bright1=fb4934
bright2=b8bb26
bright3=fabd2f
bright4=83a598
bright5=d3869b
bright6=8ec07c
bright7=ebdbb2
# alpha=1.0
# background=002b36
# foreground=839496
## Misc colors
# selection-foreground=<inverse foreground/background>
# selection-background=<inverse foreground/background>
# jump-labels=<regular0> <regular3> # black-on-yellow
# scrollback-indicator=<regular0> <bright4> # black-on-bright-blue
# search-box-no-match=<regular0> <regular1> # black-on-red
# search-box-match=<regular0> <regular3> # black-on-yellow
# urls=<regular3>
[csd]
# preferred=server
# size=26
# font=<primary font>
# color=<foreground color>
# hide-when-typing=no
# border-width=0
# border-color=<csd.color>
# button-width=26
# button-color=<background color>
# button-minimize-color=<regular4>
# button-maximize-color=<regular2>
# button-close-color=<regular1>
[key-bindings]
# scrollback-up-page=Shift+Page_Up
# scrollback-up-half-page=none
# scrollback-up-line=none
# scrollback-down-page=Shift+Page_Down
# scrollback-down-half-page=none
# scrollback-down-line=none
# clipboard-copy=Control+Shift+c XF86Copy
# clipboard-paste=Control+Shift+v XF86Paste
# primary-paste=Shift+Insert
# search-start=Control+Shift+r
# font-increase=Control+plus Control+equal Control+KP_Add
# font-decrease=Control+minus Control+KP_Subtract
# font-reset=Control+0 Control+KP_0
# spawn-terminal=Control+Shift+n
# minimize=none
# maximize=none
# fullscreen=none
# pipe-visible=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-scrollback=[sh -c "xurls | fuzzel | xargs -r firefox"] none
# pipe-selected=[xargs -r firefox] none
# show-urls-launch=Control+Shift+u
# show-urls-copy=none
# show-urls-persistent=none
# prompt-prev=Control+Shift+z
# prompt-next=Control+Shift+x
# unicode-input=none
# noop=none
[search-bindings]
# cancel=Control+g Control+c Escape
# commit=Return
# find-prev=Control+r
# find-next=Control+s
# cursor-left=Left Control+b
# cursor-left-word=Control+Left Mod1+b
# cursor-right=Right Control+f
# cursor-right-word=Control+Right Mod1+f
# cursor-home=Home Control+a
# cursor-end=End Control+e
# delete-prev=BackSpace
# delete-prev-word=Mod1+BackSpace Control+BackSpace
# delete-next=Delete
# delete-next-word=Mod1+d Control+Delete
# extend-to-word-boundary=Control+w
# extend-to-next-whitespace=Control+Shift+w
# clipboard-paste=Control+v Control+Shift+v Control+y XF86Paste
# primary-paste=Shift+Insert
# unicode-input=none
[url-bindings]
# cancel=Control+g Control+c Control+d Escape
# toggle-url-visible=t
[text-bindings]
# \x03=Mod4+c # Map Super+c -> Ctrl+c
[mouse-bindings]
# selection-override-modifiers=Shift
# primary-paste=BTN_MIDDLE
# select-begin=BTN_LEFT
# select-begin-block=Control+BTN_LEFT
# select-extend=BTN_RIGHT
# select-extend-character-wise=Control+BTN_RIGHT
# select-word=BTN_LEFT-2
# select-word-whitespace=Control+BTN_LEFT-2
# select-row=BTN_LEFT-3
# vim: ft=dosini

View file

@ -0,0 +1,320 @@
input {
keyboard {
xkb {
layout "us"
options "grp:win_space_toggle,compose:ralt,ctrl:nocaps"
}
repeat-delay 280
repeat-rate 50
}
touchpad {
dwt
tap
natural-scroll
// accel-speed 0.2
}
mouse {
accel-speed -0.1
}
//warp-mouse-to-focus
focus-follows-mouse max-scroll-amount="20%"
workspace-auto-back-and-forth
}
cursor {
xcursor-theme "phinger-cursors-light"
xcursor-size 12
}
environment {
DISPLAY ":0"
// GDK_BACKEND "x11"
}
// {{ if eq .chezmoi.hostname "thinkix" }}
output "Philips Consumer Electronics Company PHL 345B1C 0x00008E7C" {
mode "3440x1440@60"
scale 1
transform "normal"
position x=0 y=0
}
output "DP-4" {
off
}
output "eDP-1" {
mode "1920x1080@60"
scale 1
transform "normal"
position x=0 y=1440
}
// {{end}}
// {{ else }}
output "DP-2" {
mode "3440x1440@99.982"
//variable-refresh-rate
scale 1
transform "normal"
position x=1440 y=0
}
output "HDMI-A-1" {
mode "2560x1440"
scale 1
position x=0 y=0
transform "270"
}
// {{ end }}
layout {
gaps 16
// center-focused-column "always" // - "never", "always" "on-overflow"
center-focused-column "on-overflow" // - "never", "always" "on-overflow"
// always-center-single-column
preset-column-widths {
proportion 0.33333
proportion 0.5
proportion 0.66667
}
default-column-width { proportion 0.33333; }
focus-ring {
width 2
active-color "#8ec07c"
inactive-color "#1d2021"
}
}
spawn-at-startup "bash" "-c" "eww -c ~/.config/eww-bar open-many bar_1 niri_scroller"
spawn-at-startup "xwayland-satellite"
spawn-at-startup "bash" "-c" "1password --silent"
spawn-at-startup "wl-paste" "--watch" "xclip -in -sel c"
spawn-at-startup "~/.config/niri/clipboardfix.sh"
spawn-at-startup "clipse -listen"
spawn-at-startup "wl-clip-persist" "--clipboard" "regular"
prefer-no-csd
screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png"
animations {
window-open {
duration-ms 200
curve "ease-out-quad"
custom-shader r"
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
vec4 open_color(vec3 coords_geo, vec3 size_geo) {
float cur = niri_clamped_progress;
if (coords_geo.x > cur) {
return vec4(0.0);
}
vec3 coord = vec3(map(coords_geo.x,0.0, cur, 0.0, 1.0 ), coords_geo.y, coords_geo.z);
return texture2D(niri_tex, (niri_geo_to_tex * coord).st);
}
"
}
window-close {
duration-ms 200
curve "ease-out-quad"
custom-shader r"
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
vec4 close_color(vec3 coords_geo, vec3 size_geo) {
float cur = 1.0-niri_clamped_progress;
if (coords_geo.x > cur) {
return vec4(0.0);
}
vec3 coord = vec3(map(coords_geo.x,0.0, cur, 0.0, 1.0), coords_geo.y, coords_geo.z);
return texture2D(niri_tex, (niri_geo_to_tex * coord).st);
}
"
}
}
window-rule {
match app-id=r#"^foot$"#
default-column-width { proportion 0.3333; }
}
// Example: block out two password managers from screen capture.
// (This example rule is commented out with a "/-" in front.)
window-rule {
match app-id=r#"1Password"#
match title=r#"[gG]mail"#
match app-id=r#".*[mM]ako.*"#
match title=r#".*[Ww]hats[aA]pp.*$"#
// opacity 0.5
block-out-from "screen-capture"
}
window-rule {
match app-id=r#"^[gG]edit$"#;
match app-id=r#"^[eE]og$"#;
// fake-fullscreen true
}
window-rule {
match title=r#"^.* is sharing your screen.$"#;
}
window-rule {
clip-to-geometry true
geometry-corner-radius 8
}
binds {
Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T { spawn "foot"; }
Mod+B { spawn "bash" "-c" "unset DISPLAY && google-chrome --ozone-platform-hint=auto --enable-features=VaapiVideoDecodeLinuxGL --enable-features=TouchpadOverscrollHistoryNavigation"; }
Mod+Shift+P { spawn "~/.config/rofi/launchers/type-2/launcher.sh"; }
Mod+Shift+B { spawn "firefox"; }
// Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked.
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
Mod+Shift+Q { close-window; }
Mod+H { focus-column-or-monitor-left; }
Mod+J { focus-window-down; }
Mod+K { focus-window-up; }
Mod+L { focus-column-or-monitor-right; }
Mod+Shift+H { move-column-left; }
Mod+Shift+J { move-window-down; }
Mod+Shift+K { move-window-up; }
Mod+Shift+L { move-column-right; }
Mod+Home { focus-column-first; }
Mod+End { focus-column-last; }
Mod+Ctrl+Home { move-column-to-first; }
Mod+Ctrl+End { move-column-to-last; }
Mod+Ctrl+H { focus-monitor-left; }
Mod+Ctrl+J { focus-monitor-down; }
Mod+Ctrl+K { focus-monitor-up; }
Mod+Ctrl+L { focus-monitor-right; }
Mod+Shift+Ctrl+H { move-window-to-monitor-left; }
Mod+Shift+Ctrl+J { move-window-to-monitor-down; }
Mod+Shift+Ctrl+K { move-window-to-monitor-up; }
Mod+Shift+Ctrl+L { move-window-to-monitor-right; }
Mod+Page_Down { focus-workspace-down; }
Mod+Page_Up { focus-workspace-up; }
Mod+U { focus-workspace-down; }
Mod+I { focus-workspace-up; }
//Mod+I { focus-workspace-up create-if-first=true; }
Mod+Ctrl+Page_Down { move-column-to-workspace-down; }
Mod+Ctrl+Page_Up { move-column-to-workspace-up; }
Mod+Shift+U { move-column-to-workspace-down; }
Mod+Shift+I { move-column-to-workspace-up; }
Mod+Shift+Page_Down { move-workspace-down; }
Mod+Shift+Page_Up { move-workspace-up; }
Mod+Ctrl+U { move-workspace-down; }
Mod+Ctrl+I { move-workspace-up; }
Mod+WheelScrollDown cooldown-ms=150 { focus-workspace-down; }
Mod+WheelScrollUp cooldown-ms=150 { focus-workspace-up; }
Mod+Ctrl+WheelScrollDown cooldown-ms=150 { move-column-to-workspace-down; }
Mod+Ctrl+WheelScrollUp cooldown-ms=150 { move-column-to-workspace-up; }
// Mod+Ctrl+Shift+WheelScrollDown { scroll-viewport-left amount=0.1; }
// Mod+Ctrl+Shift+WheelScrollUp { scroll-viewport-right amount=0.1; }
Mod+WheelScrollRight { focus-column-right; }
Mod+WheelScrollLeft { focus-column-left; }
Mod+Ctrl+WheelScrollRight { move-column-right; }
Mod+Ctrl+WheelScrollLeft { move-column-left; }
Mod+Shift+WheelScrollDown { focus-column-right; }
Mod+Shift+WheelScrollUp { focus-column-left; }
// Mod+Ctrl+Shift+WheelScrollDown { move-column-right; }
// Mod+Ctrl+Shift+WheelScrollUp { move-column-left; }
// Similarly, you can bind touchpad scroll "ticks".
// Touchpad scrolling is continuous, so for these binds it is split into
// discrete intervals.
// These binds are also affected by touchpad's natural-scroll, so these
// example binds are "inverted", since we have natural-scroll enabled for
// touchpads by default.
// Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; }
// Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; }
Mod+1 { focus-workspace 1; }
Mod+2 { focus-workspace 2; }
Mod+3 { focus-workspace 3; }
Mod+4 { focus-workspace 4; }
Mod+5 { focus-workspace 5; }
Mod+6 { focus-workspace 6; }
Mod+7 { focus-workspace 7; }
Mod+8 { focus-workspace 8; }
Mod+9 { focus-workspace 9; }
Mod+Ctrl+1 { move-column-to-workspace 1; }
Mod+Ctrl+2 { move-column-to-workspace 2; }
Mod+Ctrl+3 { move-column-to-workspace 3; }
Mod+Ctrl+4 { move-column-to-workspace 4; }
Mod+Ctrl+5 { move-column-to-workspace 5; }
Mod+Ctrl+6 { move-column-to-workspace 6; }
Mod+Ctrl+7 { move-column-to-workspace 7; }
Mod+Ctrl+8 { move-column-to-workspace 8; }
Mod+Ctrl+9 { move-column-to-workspace 9; }
// Alternatively, there are commands to move just a single window:
// Mod+Ctrl+1 { move-window-to-workspace 1; }
// Switches focus between the current and the previous workspace.
// Mod+Tab { focus-workspace-previous; }
Mod+Comma { consume-window-into-column; }
Mod+Period { consume-or-expel-window-right; }
//Mod+Period { expel-window-from-column; }
// There are also commands that consume or expel a single window to the side.
Mod+BracketLeft { consume-or-expel-window-left; }
Mod+BracketRight { consume-or-expel-window-right; }
Mod+R { switch-preset-column-width; }
Mod+Shift+R { reset-window-height; }
Mod+F { maximize-column; }
Mod+Shift+F { fullscreen-window; }
Mod+C { center-column; }
Mod+Minus { set-column-width "-10%"; }
Mod+Shift+Equal { set-column-width "+10%"; }
Mod+Equal { set-column-width "+10%"; }
Mod+Ctrl+Minus { set-window-height "-10%"; }
Mod+Ctrl+Equal { set-window-height "+10%"; }
Mod+Ctrl+Shift+Equal { set-window-height "+10%"; }
Mod+Shift+S { screenshot; }
Ctrl+Print { screenshot-screen; }
Alt+Print { screenshot-window; }
Mod+Shift+V { spawn "alacritty" "-e" "clipse"; }
Ctrl+Shift+Print {
spawn "sh" "-c" r#"
file=~/Videos/recordings/"$(date +%s)".mp4
wf-recorder -c h264_vaapi -r 60 --bframes 0 -g "$(slurp -b '#00000090' -w 0)" -f "$file"
wl-copy file:/"$file" -t text/uri-list
"#;
}
Ctrl+Escape { spawn "killall" "-s" "SIGINT" "wf-recorder"; }
Mod+Shift+E { quit; }
}

View file

@ -0,0 +1,13 @@
abbr cvim="cd ~/.config/nvim && nvim && cd -"
abbr cnt="cargo nextest run"
abbr cnix="cd ~/.config/nixpkgs && nvim && cd -"
abbr cxmonad="cd ~/.xmonad && nvim lib/Config.hs && cd -"
abbr ra="ranger"
abbr cr="cargo run -- "
abbr g="git "
abbr ga.="git add ."
abbr gaa="git add --all"
abbr gc="git commit"
abbr gr="git rebase "
abbr gs="git ss "

View file

@ -0,0 +1,4 @@
.zcompdump
.zcompcache
*.zwc
.zsh_sessions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,14 @@
# Function to determine the need of a zcompile. If the .zwc file
# does not exist, or the base file is newer, we need to compile.
# These jobs are asynchronous, and will not impact the interactive shell
zcompare() {
if [[ -s ${1} && ( ! -s ${1}.zwc || ${1} -nt ${1}.zwc) ]]; then
zcompile ${1}
fi
}
emulate zsh -o extended_glob -c "local files=($ZDOTDIR/*.zsh)"
for file in "${files[@]}"; do
zcompare $file
done
zcompare .zshrc

View file

@ -0,0 +1,4 @@
[ -f $HOME/.profile ] && . $HOME/.profile
# Added by OrbStack: command-line tools and integration
source ~/.orbstack/shell/init.zsh 2>/dev/null || :

View file

@ -0,0 +1,166 @@
# history config
HISTSIZE=50000
SAVEHIST=50000
HISTFILE="$HOME/.cache/zsh/history"
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
#setopt INC_APPEND_HISTORY
setopt EXTENDED_HISTORY
setopt SHARE_HISTORY
source "$ZDOTDIR/utils.zsh"
### Added by Zinit's installer
if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
print -P "%F{33} %F{34}Installation successful.%f%b" || \
print -P "%F{160} The clone has failed.%f%b"
fi
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit
# Load a few important annexes, without Turbo
# (this is currently required for annexes)
zinit light-mode for \
zdharma-continuum/zinit-annex-as-monitor \
zdharma-continuum/zinit-annex-bin-gem-node \
zdharma-continuum/zinit-annex-patch-dl \
zdharma-continuum/zinit-annex-rust
### End of Zinit's installer chunk
# some magic to run compinit stuff only once a day, which should speed up zsh startup a good bit
autoload -Uz compinit
for dump in $ZSHDOTDIR/.zcompdump(N.mh+24); do
compinit
done
compinit -C
# this would be the regular version of the above compinit code:
# compinit must be ran before fzf-tab, but fzf-tab must be before syntax highlighting etc
#autoload -Uz compinit
#compinit
zinit light "Aloxaf/fzf-tab"
zinit wait lucid for \
"zsh-users/zsh-history-substring-search" \
"zdharma-continuum/fast-syntax-highlighting" \
"zsh-users/zsh-autosuggestions" \
"olets/zsh-abbr" \
"sudosubin/zsh-github-cli" \
"wfxr/forgit" \
"pkulev/zsh-rustup-completion"
# clear the default keybinds, from utils.zsh
clear-keybinds
# load more stuff
source "$ZDOTDIR/fzf-tab.zsh"
source "$ZDOTDIR/keybinds.zsh"
unalias zi
eval "$(zoxide init zsh)"
# fzf keybindings
[ -f $HOME/.fzf/shell/key-bindings.zsh ] && . $HOME/.fzf/shell/key-bindings.zsh
# some more options
setopt NOBEEP
setopt INTERACTIVE_COMMENTS
# ET nvim as manpager
export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"'
autoload -Uz colors && colors
autoload -Uz promptinit && promptinit
# alias
if command -v lsd >/dev/null; then
alias ls="lsd"
elif command -v exa >/dev/null; then
alias ls="exa"
fi
alias dots="git -C $HOME/dots-of-war"
# load prompt
if command -v starship >/dev/null; then
eval "$(starship init zsh)"
else
source "$ZDOTDIR/prompt.zsh"
fi
if command -v direnv >/dev/null; then
eval "$(direnv hook zsh)"
fi
if command -v luarocks >/dev/null; then
eval "$(luarocks path)"
fi
export EDITOR=nvim
export VISUAL=nvim
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_NDK="$HOME/Android/Sdk/ndk/21.4.7075529"
export JAVA_HOME="/usr/lib/jvm/java-1.19.0-openjdk-amd64/"
if [ -d "$HOME/anaconda3" ]; then
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$("$HOME/anaconda3/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$HOME/anaconda3/etc/profile.d/conda.sh" ]; then
. "$HOME/anaconda3/etc/profile.d/conda.sh"
else
export PATH="$HOME/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
fi
export PATH="$HOME/.volta/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/.bun/bin:$PATH"
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
if [ -d "/Applications/WezTerm.app" ]; then
export PATH="/Applications/WezTerm.app/Contents/MacOS:$PATH"
fi
if command -v flutter >/dev/null; then
export PATH="$HOME/.pub-cache/bin:$PATH"
fi
[[ -d "$HOME/.deno/bin" ]] && export PATH="$HOME/.deno/bin:$PATH"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="$HOME/.sdkman"
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
if [ -f '~/Downloads/google-cloud-sdk/path.zsh.inc' ]; then . '~/Downloads/google-cloud-sdk/path.zsh.inc'; fi
if [ -f '~/Downloads/google-cloud-sdk/completion.zsh.inc' ]; then . '~/Downloads/google-cloud-sdk/completion.zsh.inc'; fi
[[ -f '/Applications/Tailscale.app/Contents/MacOS/Tailscale' ]] && alias tailscale="/Applications/Tailscale.app/Contents/MacOS/Tailscale"
command -v jless >/dev/null && alias yless="jless --yaml"

View file

@ -0,0 +1,19 @@
#!/usr/bin/env zsh
FZF_TAB_COMMAND=(
fzf
#--ansi
#--expect='$continuous_trigger' # For continuous completion
#'--color=hl:$(( $#headers == 0 ? 108 : 255 ))'
#--nth=2,3 --delimiter='\x00' # Don't search prefix
#--layout=reverse --height="''${FZF_TMUX_HEIGHT:=50%}"
#--tiebreak=begin -m --bind=tab:down,btab:up,change:top,ctrl-space:toggle --cycle
#'--query=$query' # $query will be expanded to query string at runtime.
#'--header-lines=$#headers' # $#headers will be expanded to lines of headers at runtime
)
zstyle ':fzf-tab:*' fzf-command "fzf"
#zstyle ':fzf-tab:*' fzf-command $FZF_TAB_COMMAND
zstyle ':completion:complete:*:options' sort false
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
zstyle ':fzf-tab:complete:_zlua:*' query-string input
zstyle ':fzf-tab:complete:*:*' fzf-preview '$HOME/scripts/preview.sh $realpath'

View file

@ -0,0 +1,76 @@
# This file is currently mostly stolen from https://github.com/druskus20/dots/blob/master/zsh/.config/zsh/modules/keybinds.zsh
# Vi mode {{{
bindkey -v
# https://superuser.com/questions/476532/how-can-i-make-zshs-vi-mode-behave-more-like-bashs-vi-mode
export KEYTIMEOUT=1 # Vi mode timeout for key sequences
bindkey -M vicmd '^[' undefined-key
# Remove keybinds that begin with esc (so ESC doesnt hang)
bindkey -M vicmd -r "^[OA" # up-line-or-history
bindkey -M vicmd -r "^[OB" # down-line-or-history
bindkey -M vicmd -r "^[OC" # vi-forward-char
bindkey -M vicmd -r "^[OD" # vi-backward-char
bindkey -M vicmd -r "^[[200~" # bracketed-paste
bindkey -M vicmd -r "^[[A" # up-line-or-history
bindkey -M vicmd -r "^[[B" # down-line-or-history
bindkey -M vicmd -r "^[[C" # vi-forward-char
bindkey -M vicmd -r "^[[D" # vi-backward-char
# Remove execute because Im dumb
bindkey -M vicmd -r ":" # execute
bindkey -rM viins '^X'
bindkey -M viins '^X,' _history-complete-newer \
'^X/' _history-complete-older \
'^X`' _bash_complete-word
# Don't use vi mode in backward delete word/char because it cannot delete
# characters on the left of position you were in insert mode.
bindkey "^?" backward-delete-char
# }}}
# Pipr thing {{{
_pipr_expand_widget() {
emulate -LR zsh
</dev/tty pipr --out-file /tmp/pipr_out --default "$LBUFFER" >/dev/null
LBUFFER=$(< /tmp/pipr_out)
}
zle -N _pipr_expand_widget
bindkey '\ea' _pipr_expand_widget
#}}}
# Keybindings
# delete word but break on slashes
my-backward-delete-word() {
local WORDCHARS=${WORDCHARS/\//}
zle backward-delete-word
}
zle -N my-backward-delete-word
bindkey "^[[1;5C" forward-word # C-ArrowRight
bindkey "^[[1;5D" backward-word # C-ArrowLeft
bindkey "\e[3~" delete-char # Del
bindkey "^E" end-of-line # C-E
bindkey "^[[F" end-of-line # END
bindkey "^[[4~" end-of-line # END
bindkey "^[[H" beginning-of-line # HOME
bindkey "^[[1~" beginning-of-line # HOME
bindkey "^A" beginning-of-line # C-A
bindkey '^W' my-backward-delete-word # C-w
bindkey '^H' my-backward-delete-word # C-backspace
bindkey "^[." insert-last-word # alt-.
bindkey "^[[3~" delete-char # DEL
bindkey "^R" history-incremental-search-backward # C-R
bindkey '^[[A' history-substring-search-up
bindkey '^[[B' history-substring-search-down
# C-Q to edit command in $EDITOR
autoload -U edit-command-line
zle -N edit-command-line
bindkey -M viins "^Q" edit-command-line
bindkey -M vicmd "^Q" edit-command-line
setopt NO_FLOW_CONTROL # Disable Ctrl+S and Ctrl+Q

View file

@ -0,0 +1,64 @@
#!/usr/bin/env zsh
local __bright_cyan="#8ec07c"
local __bright_white="#ebdbb2"
local __bright_green="#b8bb26"
local CUTOFF=3
# black magic that reruns prompt whenever the vi mode changes {{{
function zle-line-init zle-keymap-select {
case $KEYMAP in
vicmd) VI_INDICATOR="N";;
main|viins) VI_INDICATOR="─";;
esac
zle reset-prompt
}
zle -N zle-line-init
zle -N zle-keymap-select
# }}}
function get_dir() {
local IFS=/
local my_path=$(print -P '%~')
local p
for p in $my_path; do
printf %s "${s}${p[0,$CUTOFF]}"
local s=/
done
printf '%s\n' "${p:$CUTOFF}"
}
function git_status() {
local BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/*\s*\(.*\)/\1/' | tr -d ' ')
if [ ! -z $BRANCH ]; then
echo -n "(%F{$__bright_cyan}$BRANCH%F{$__bright_white}"
[ ! -z "$(git status --short)" ] && echo -n "*"
echo -n ")%f"
fi
}
function _my_prompt() {
local exit_code="$?"
echo -n "%F{$__bright_white}╭─$VI_INDICATOR"
#echo -n "%F{$__bright_white}╭───"
echo -n "%F{$__bright_cyan}$USER"
echo -n "%F{$__bright_white} in"
echo -n "%F{$__bright_green} $(get_dir)"
echo -n "%F{$__bright_white} $(git_status)"
if [ ! "$exit_code" = 0 ]; then
echo -n "%F{red} REEEEEEEEEEE $exit_code"
fi
echo
# %3{stuff%} tell's zsh that the characters are printed as 3 chars wide
echo -n "%F{$__bright_white}%3{╰─λ%} "
}
setopt prompt_subst
autoload -U colors && colors
PS1='$(_my_prompt)'

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,20 @@
# This part is stolen https://github.com/druskus20/dots/blob/master/zsh/.config/zsh/utils/utils.zsh
function do-nothing() {}
zle -N do-nothing do-nothing
# Disable default keybinds
function clear-keybinds() {
local key keys=(
"^A" "^B" "^D" "^E" "^F" "^N" "^O" "^P" "^Q" "^S" "^T" "^W" "^F" "^K"
"^X*" "^X=" "^X?" "^XC" "^XG" "^Xa" "^Xc" "^Xd" "^Xe" "^Xg" "^Xh" "^Xm" "^Xn"
"^Xr" "^Xs" "^Xt" "^Xu" "^X~" "^[ " "^[!" "^['" "^[," "^[-" "^[." "^[0" "^[1"
"^[2" "^[3" "^[4" "^[5" "^[6" "^[7" "^[8" "^[9" "^[<" "^[>" "^[?" "^[A" "^[B"
"^[C" "^[D" "^[F" "^[G" "^[L" "^[M" "^[N" "^[P" "^[Q" "^[S" "^[T" "^[U" "^[W"
"^[_" "^[a" "^[b" "^[c" "^[d" "^[f" "^[g" "^[l" "^[n" "^[p" "^[q" "^[s" "^[t"
"^[u" "^[w" "^[y" "^[z" "^[|" "^[~" "^[^I" "^[^J" "^[^_" "^[\"" "^[\$" "^X^B"
"^X^F" "^X^J" "^X^K" "^X^N" "^X^O" "^X^R" "^X^U" "^X^X" "^[^D" "^[^G")
for key in $keys; do
bindkey -r $key
done
}
zle -N clear-keybinds clear-keybinds