Add rofi, update fish cfg/scripts, update nvim cfg, update wezterm cfg

This commit is contained in:
mitchell 2024-07-04 18:25:22 -04:00
parent e801f0a680
commit 6e8bb638ee
24 changed files with 104 additions and 77 deletions

View file

@ -13,6 +13,7 @@ function configure_fish
ssh_agent_startup
starship init fish | source
zoxide init fish | source
fzf --fish | source
end
configure_fish

View file

@ -8,20 +8,21 @@ function define_global_variables -d 'Defines all and exclusively globally export
set -gx BROWSER firefox
set -gx DIFFPROG nvim -d
set -gx FZF_CTRL_T_COMMAND 'ag --hidden --ignore .git -g ""'
set -gx FZF_DEFAULT_COMMAND 'ag --hidden --ignore .git -g ""'
set -gx FZF_CTRL_T_COMMAND 'fd --type f --type d --hidden --exclude ".git/"'
set -gx FZF_DEFAULT_COMMAND 'fd --type f --type d --hidden --exclude ".git/"'
set -gx FZF_ALT_C_COMMAND 'fd --type d --hidden --exclude ".git/"'
set -gx GOPATH $HOME/code/go
set -gx GOBIN $GOPATH/bin
set -gx GTK_THEME Kanagawa-BL
set -gx BUN_INSTALL $HOME/.bun
set -gx LIBVIRT_DEFAULT_URI 'qemu:///system'
set -gx ANDROID_HOME $HOME/Android/Sdk
set -gx LIBVA_DRIVER_NAME nvidia
fish_add_path $GOBIN \
$HOME/.local/bin \
$HOME/.pub-cache/bin \

View file

@ -1,10 +1,12 @@
function fish_user_key_bindings
bind --mode insert jj "if commandline -P; commandline -f cancel; else; set fish_bind_mode default; commandline -f backward-char repaint-mode; end"
bind --mode insert ,a 'ssh_add; commandline -f repaint'
bind --mode insert ,j 'joplin; commandline -f repaint'
bind --mode insert ,p 'nvim +"Telescope git_files"; commandline -f repaint'
bind --mode insert ,f 'nvim +"Telescope find_files"; commandline -f repaint'
bind --mode insert ,n 'nvim +Neotree; commandline -f repaint'
bind --mode insert ,v 'neovide; commandline -f repaint'
bind --mode insert ,s 'sysz; commandline -f repaint'
bind --mode insert ,z 'zi; commandline -f repaint'
bind --mode insert ,t 'fzf-file-widget'
bind --mode insert ,r 'fzf-history-widget'
bind --mode insert ,c 'fzf-cd-widget'
end

View file

@ -1,8 +0,0 @@
function glance -d 'Open glances on a preset of machines'
tmux new -s glance mosh arch@khetanna.lan -- glances --disable-process --sparkline\; \
neww mosh arch@kamino.lan -- glances --disable-process --sparkline\; \
neww mosh arch@marauder.lan -- glances --disable-process --sparkline\; \
neww mosh serenity.lan -- glances --sparkline\; \
neww mosh venator.lan -- glances --sparkline
or tmux attach-session -t glance
end

View file

@ -1,4 +1,9 @@
function jmpv -d 'Open jellyfin-mpv-shim in a tmux session of its own'
if command --query prime-run
set --function --export __NV_PRIME_RENDER_OFFLOAD 1
set --function --export __GLX_VENDOR_LIBRARY_NAME nvidia
end
tmux new-session -s jmpv jellyfin-mpv-shim
or tmux attach-session -t jmpv
end

View file

@ -0,0 +1,8 @@
function m --wraps yazi
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
cd -- "$cwd"
end
rm -f -- "$tmp"
end

View file

@ -1,36 +0,0 @@
# Rename this file to match the name of the function
# e.g. ~/.config/fish/functions/n.fish
# or, add the lines to the 'config.fish' file.
function n --wraps nnn --description 'support nnn quit and change directory'
# Block nesting of nnn in subshells
if test -n "$NNNLVL" -a "$NNNLVL" -ge 1
echo "nnn is already running"
return
end
# The behaviour is set to cd on quit (nnn checks if NNN_TMPFILE is set)
# If NNN_TMPFILE is set to a custom path, it must be exported for nnn to
# see. To cd on quit only on ^G, remove the "-x" from both lines below,
# without changing the paths.
if test -n "$XDG_CONFIG_HOME"
set -x NNN_TMPFILE "$XDG_CONFIG_HOME/nnn/.lastd"
else
set -x NNN_TMPFILE "$HOME/.config/nnn/.lastd"
end
# Unmask ^Q (, ^V etc.) (if required, see `stty -a`) to Quit nnn
# stty start undef
# stty stop undef
# stty lwrap undef
# stty lnext undef
# The command function allows one to alias this function to `nnn` without
# making an infinitely recursive alias
command nnn $argv
if test -e $NNN_TMPFILE
source $NNN_TMPFILE
rm $NNN_TMPFILE
end
end

View file

@ -1,6 +1,12 @@
function ytmpv -d 'A script to help queue youtube videos on MPV'
set -l queue ~/.ytmpv_queue
if command --query prime-run
set --function --export __NV_PRIME_RENDER_OFFLOAD 1
set --function --export __GLX_VENDOR_LIBRARY_NAME nvidia
end
if not test -f $queue
touch $queue
end
@ -54,6 +60,9 @@ function ytmpv -d 'A script to help queue youtube videos on MPV'
(cat $queue) \
best
break
case dwl destroy-watch-later
rm -r ~/.local/state/mpv/watch_later/
break
case '*'
if test -z "$video"
tmux attach -t ytmpv