Compare commits

...

8 commits

53 changed files with 302 additions and 1417 deletions

View file

@ -1,99 +0,0 @@
#!/bin/bash
#
# This file echoes a bunch of 24-bit color codes
# to the terminal to demonstrate its functionality.
# The foreground escape sequence is ^[38;2;<r>;<g>;<b>m
# The background escape sequence is ^[48;2;<r>;<g>;<b>m
# <r> <g> <b> range from 0 to 255 inclusive.
# The escape sequence ^[0m returns output to default
setBackgroundColor()
{
echo -en "\x1b[48;2;$1;$2;$3""m"
}
resetOutput()
{
echo -en "\x1b[0m\n"
}
# Gives a color $1/255 % along HSV
# Who knows what happens when $1 is outside 0-255
# Echoes "$red $green $blue" where
# $red $green and $blue are integers
# ranging between 0 and 255 inclusive
rainbowColor()
{
let h=$1/43
let f=$1-43*$h
let t=$f*255/43
let q=255-t
if [ $h -eq 0 ]
then
echo "255 $t 0"
elif [ $h -eq 1 ]
then
echo "$q 255 0"
elif [ $h -eq 2 ]
then
echo "0 255 $t"
elif [ $h -eq 3 ]
then
echo "0 $q 255"
elif [ $h -eq 4 ]
then
echo "$t 0 255"
elif [ $h -eq 5 ]
then
echo "255 0 $q"
else
# execution should never reach here
echo "0 0 0"
fi
}
for i in `seq 0 127`; do
setBackgroundColor $i 0 0
echo -en " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor $i 0 0
echo -en " "
done
resetOutput
for i in `seq 0 127`; do
setBackgroundColor 0 $i 0
echo -n " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor 0 $i 0
echo -n " "
done
resetOutput
for i in `seq 0 127`; do
setBackgroundColor 0 0 $i
echo -n " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor 0 0 $i
echo -n " "
done
resetOutput
for i in `seq 0 127`; do
setBackgroundColor `rainbowColor $i`
echo -n " "
done
resetOutput
for i in `seq 255 128`; do
setBackgroundColor `rainbowColor $i`
echo -n " "
done
resetOutput

View file

@ -1,163 +0,0 @@
# This is terribly complicated
# It's because:
# 1. bun run has to have dynamic completions
# 2. there are global options
# 3. bun {install add remove} gets special options
# 4. I don't know how to write fish completions well
# Contributions very welcome!!
function __fish__get_bun_bins
string split ' ' (bun getcompletes b)
end
function __fish__get_bun_scripts
set -lx SHELL bash
set -lx MAX_DESCRIPTION_LEN 40
string trim (string split '\n' (string split '\t' (bun getcompletes z)))
end
function __fish__get_bun_packages
if test (commandline -ct) != ""
set -lx SHELL fish
string split ' ' (bun getcompletes a (commandline -ct))
end
end
function __history_completions
set -l tokens (commandline --current-process --tokenize)
history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' '
end
function __fish__get_bun_bun_js_files
string split ' ' (bun getcompletes j)
end
function bun_fish_is_nth_token --description 'Test if current token is on Nth place' --argument-names n
set -l tokens (commandline -poc)
set -l tokens (string replace -r --filter '^([^-].*)' '$1' -- $tokens)
test (count $tokens) -eq "$n"
end
function __bun_command_count --argument-names n
set -l cmds (commandline -poc)
test (count cmds) -eq "$n"
end
function __bun_last_cmd --argument-names n
set -l cmds (commandline -poc)
test "(cmds[-1])" = "$n"
end
set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global
set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't install devDependencies" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependenices" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder"
set -l bun_builtin_cmds dev create help bun upgrade discord run install remove add init link unlink pm x
set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x
set -l bun_builtin_cmds_without_bun dev create help upgrade run discord install remove add init pm x
set -l bun_builtin_cmds_without_create dev help bun upgrade discord run install remove add init pm x
set -l bun_builtin_cmds_without_install create dev help bun upgrade discord run remove add init pm x
set -l bun_builtin_cmds_without_remove create dev help bun upgrade discord run install add init pm x
set -l bun_builtin_cmds_without_add create dev help bun upgrade discord run remove install init pm x
set -l bun_builtin_cmds_without_pm create dev help bun upgrade discord run init pm x
# clear
complete -e -c bun
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '(__fish__get_bun_scripts)' -d 'script'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bins)' -d 'package bin'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_scripts)' -d 'script'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_run; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from run" -a '(__fish__get_bun_bun_js_files)' -d 'Bun.js'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'run' -f -d 'Run a script or bin'
complete -c bun \
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths'
complete -c bun \
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'p' -l 'port' -r -d 'Port number to start server from'
complete -c bun \
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"'
complete -c bun \
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react'
complete -c bun \
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'use' -r -d 'Use a framework (ex: next)'
complete -c bun \
-n "not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) install remove add;" --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __fish_use_subcommand" -a 'dev' -d 'Start dev server'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'next' -d 'new Next.js project'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create next react; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from create;" -a 'react' -d 'new React project'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a '--help' -d 'See all commands and flags' -x
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -l "version" -s "v" -a '--version' -d 'Bun\'s version' -x
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); __fish_use_subcommand" -a 'bun' -d 'Generate a new bundle'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_bun; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from bun" -F -d 'Bundle this'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_create; and not __fish_seen_subcommand_from (__fish__get_bun_bins); and not __fish_seen_subcommand_from (__fish__get_bun_scripts); and __fish_seen_subcommand_from react; or __fish_seen_subcommand_from next" -F -d "Create in directory"
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json'
complete -c bun \
-n "bun_fish_is_nth_token 1; and not __fish_seen_subcommand_from $bun_builtin_cmds; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) and __bun_command_count 1 and __fish_use_subcommand add remove" -F
for i in (seq (count $bun_install_boolean_flags))
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]"
end
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cwd' -d 'Change working directory'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from install add remove;" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'Popular' -a '(__fish__get_bun_packages)'
complete -c bun \
-n "not __fish_seen_subcommand_from $bun_builtin_cmds_without_pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts); and __fish_seen_subcommand_from add;" -d 'History' -a '(__history_completions)'
complete -c bun \
-n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f
complete -c bun \
-n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f
complete -c bun -n "not __fish_seen_subcommand_from $bun_builtin_cmds (__fish__get_bun_bins) (__fish__get_bun_scripts)" -a "$bun_builtin_cmds" -f

View file

@ -1,7 +0,0 @@
complete --command fisher --exclusive --long help --description "Print help"
complete --command fisher --exclusive --long version --description "Print version"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins"
complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex"
complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)"

View file

@ -1,8 +0,0 @@
complete fzf_configure_bindings --no-files
complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h"
complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory"
complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log"
complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status"
complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history"
complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes"
complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables"

View file

@ -0,0 +1,63 @@
# Credits to https://github.com/BrewingWeasel/fishbang
function last_history_item
echo $history[1]
end
function nth_history_item
# Times by negative one because in fish $history[1] is the last used command
# while running !1 in bash returns the first command in your history ($history[-1] in fish)
set index (math (echo $argv[1] | cut -c 2- ) x -1)
echo $history[$index]
end
function _nth_history_arg
echo $history[1] | read -t --list args
echo $args[(math $argv[1] + 1)]
end
function last_history_arg
echo $history[1] | read -t --list args
echo $args[-1]
end
function first_history_arg
echo $history[1] | read -t --list args
echo $args[2]
end
function history_args
echo (string split --max 1 " " $history[1])[2]
end
function nth_history_arg
_nth_history_arg (echo $argv[1] | cut -c 3-)
end
function history_prefix_search
set cmd (echo $argv[1] | cut -c 2- )
history -p $cmd | head -n 1
end
function history_search
set cmd (echo $argv[1] | cut -c 3- )
history $cmd | head -n 1
end
# Commmands
abbr -a bang_history_prefix_search --position anywhere --regex '!([a-zA-Z0-9_.-]*)' --function history_prefix_search # !dnf returns the last command that started with dnf
abbr -a bang_history_search --position anywhere --regex '!\?([a-zA-Z0-9_.-]*)' --function history_search # !?abc returns the last command that included abc
abbr -a bang_negative_nth_history_item --position anywhere --regex '!-?([0-9]*)' --function nth_history_item # !3 returns the 3rd command used. !-3 returns the 3rd most recent command used.
abbr -a !! --position anywhere --function last_history_item # !! returns the last command. Taken from the fish documentation
# Arguments
abbr -a !^ --position anywhere --function first_history_arg # !^ returns the first argument of the last command
abbr -a !\$ --position anywhere --function last_history_arg # !$ returns the last argument of the last command
abbr -a !\* --position anywhere --function history_args # !* returns all arguments of the last command
abbr -a bang_nth_arg --position anywhere --regex '!:([0-9]*)' --function nth_history_arg # !$ returns the last argument of the last command
bind -M insert enter expand-abbr execute
bind -M default enter expand-abbr execute
bind enter expand-abbr execute

View file

@ -1,28 +0,0 @@
# fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup
if not status is-interactive && test "$CI" != true
exit
end
# Because of scoping rules, to capture the shell variables exactly as they are, we must read
# them before even executing _fzf_search_variables. We use psub to store the
# variables' info in temporary files and pass in the filenames as arguments.
# This variable is global so that it can be referenced by fzf_configure_bindings and in tests
set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)'
# Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings
fzf_configure_bindings
# Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased
function _fzf_uninstall --on-event fzf_uninstall
_fzf_uninstall_bindings
set --erase _fzf_search_vars_command
functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings
complete --erase fzf_configure_bindings
set_color cyan
echo "fzf.fish uninstalled."
echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings."
set_color normal
end

View file

@ -0,0 +1,39 @@
function vim
if test -z "$argv"
if test -f "./.session.vim"
nvim -S .session.vim -c 'lua vim.g.savesession = true'
else
nvim -c 'lua vim.g.savesession = true'
end
else
nvim $argv
end
end
function routevpn
sudo route -n add $argv 10.8.0.1
end
# Aliases
alias ls="eza --icons -l --sort type"
alias lg="lazygit"
alias routes="netstat -rn -f inet"
alias lc="lazygit --work-tree=$HOME --git-dir=$HOME/dotfiles"
alias config="git --work-tree=$HOME --git-dir=$HOME/dotfiles"
alias nvim_update='nvim --headless "+Lazy! sync" +qa'
function qmk_flash_right
echo "Flashing right side, waiting 5 seconds"
sleep 5
qmk flash -kb lily58 -km afonso -bl avrdude-split-right
end
function qmk_flash_left
echo "Flashing left side, waiting 5 seconds"
sleep 5
qmk flash -kb lily58 -km afonso -bl avrdude-split-left
end
function cd
builtin cd $argv; and ls
end

View file

@ -1,20 +0,0 @@
function _plugin-bang-bang_key_bindings --on-variable fish_key_bindings
bind --erase --all !
bind --erase --all '$'
switch "$fish_key_bindings"
case 'fish_default_key_bindings'
bind --mode default ! __history_previous_command
bind --mode default '$' __history_previous_command_arguments
case 'fish_vi_key_bindings' 'fish_hybrid_key_bindings'
bind --mode insert ! __history_previous_command
bind --mode insert '$' __history_previous_command_arguments
end
end
function _plugin-bang-bang_uninstall --on-event plugin-bang-bang_uninstall
bind --erase --all !
bind --erase --all '$'
functions --erase _plugin-bang-bang_uninstall
end
_plugin-bang-bang_key_bindings

View file

@ -0,0 +1,33 @@
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
set -l normal (set_color $fish_color_normal)
set -l status_color (set_color brgreen)
set -l cwd_color (set_color $fish_color_cwd)
set -l vcs_color (set_color yellow)
set -l prompt_status ""
# Since we display the prompt on a new line allow the directory names to be longer.
set -q fish_prompt_pwd_dir_length
or set -lx fish_prompt_pwd_dir_length 0
# Color the prompt in red on error
if test $last_status -ne 0
set status_color (set_color $fish_color_error)
set prompt_status $status_color "[" $last_status "]" $normal
end
echo -s $cwd_color (prompt_pwd) $vcs_color (fish_vcs_prompt) $normal ' ' $prompt_status
echo -n -s $status_color '' ' ' $normal
end
function fish_mode_prompt
switch $fish_bind_mode
case default
set_color --bold red
echo '[N] '
case visual
set_color --bold brmagenta
echo '[V] '
end
set_color normal
end

View file

@ -1,37 +1,52 @@
if status is-interactive
# Commands to run in interactive sessions can go here
and not set -q TMUX
tmux new-session -A -s 0
end
fish_default_key_bindings
set -gx EDITOR nvim
set -gx READER mupdf
set -g fish_greeting
fish_vi_key_bindings
bind -M insert \t complete-and-search
bind -M insert --key btab complete
fish_add_path /opt/homebrew/bin
fish_add_path /opt/homebrew/opt/openjdk@17/bin
fish_add_path $HOME/.bun/bin
fish_add_path $HOME/go/bin
# XDG directories
set -x XDG_CONFIG_HOME "$HOME/.config"
set -x XDG_CACHE_HOME "$HOME/.cache"
set -x XDG_DATA_HOME "$HOME/.local/share"
set -x XDG_STATE_HOME "$HOME/.local/state"
set -x XDG_RUNTIME_DIR /tmp
set -x EDITOR nvim
set -x VISUAL nvim
set -x READER mupdf
set -x GOPATH "$HOME/go"
set -x GOBIN "$GOPATH/bin"
# OS-specific exports
if test (uname) = "Darwin"
set -x JAVA_HOME (eval /usr/libexec/java_home)
set -x GEM_HOME "$HOME/.gem"
fish_add_path /opt/homebrew/bin
fish_add_path /opt/homebrew/opt/texlive/bin
fish_add_path $GEM_HOME/bin
end
# Common paths
fish_add_path /usr/sbin
fish_add_path /sbin
fish_add_path $HOME/.local/share/nvim/mason/bin
fish_add_path /home/afonso/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin
fish_add_path $HOME/.local/bin
fish_add_path $HOME/go/bin
fish_add_path $HOME/.cargo/bin
fish_add_path $HOME/.ghcup/bin
fish_add_path /usr/bin/vendor_perl
fish_add_path $HOME/.cabal/bin
source ~/.config/fish/myfunctions/dotfiles.fish
source ~/.config/fish/myfunctions/pacman.fish
source ~/.config/fish/myfunctions/qol.fish
source ~/.config/fish/myfunctions/replacements.fish
# bun
set --export BUN_INSTALL "$HOME/.bun"
set --export PATH $BUN_INSTALL/bin $PATH
# opam configuration
source /home/afonso/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
tmux new-session -A -s main
starship init fish | source
if test (uname) = "Darwin"
eval (/opt/homebrew/bin/brew shellenv)
end
fzf --fish | source
# Added by LM Studio CLI (lms)
set -gx PATH $PATH /Users/afonso/.lmstudio/bin

View file

@ -1,3 +0,0 @@
jorgebucaran/fisher
patrickf1/fzf.fish
oh-my-fish/plugin-bang-bang

View file

@ -1,103 +1,34 @@
# This file contains fish universal variable definitions.
# VERSION: 3.0
SETUVAR FZF_DEFAULT_OPTS:\x2d\x2dheight\x2040\x25
SETUVAR FZF_DISABLE_KEYBINDINGS:0
SETUVAR FZF_LEGACY_KEYBINDINGS:1
SETUVAR FZF_PREVIEW_DIR_CMD:ls
SETUVAR FZF_PREVIEW_FILE_CMD:head\x20\x2dn\x2010
SETUVAR FZF_TMUX_HEIGHT:40\x25
SETUVAR --export GPG_TTY:not\x20a\x20tty
SETUVAR --export SSH_AUTH_SOCK:/home/afonso/\x2egnupg/S\x2egpg\x2dagent\x2essh
SETUVAR FZF_CTRL_R_OPTS:\x2d\x2dreverse
SETUVAR FZF_TMUX_OPTS:\x2dp
SETUVAR __fish_initialized:3400
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
SETUVAR _fisher_oh_2D_my_2D_fish_2F_plugin_2D_bang_2D_bang_files:\x7e/\x2econfig/fish/functions/__history_previous_command\x2efish\x1e\x7e/\x2econfig/fish/functions/__history_previous_command_arguments\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/plugin\x2dbang\x2dbang\x2efish
SETUVAR _fisher_patrickf1_2F_fzf_2E_fish_files:\x7e/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_changed_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_diff_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_processes\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e\x7e/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e\x7e/\x2econfig/fish/completions/fzf_configure_bindings\x2efish
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1epatrickf1/fzf\x2efish\x1eoh\x2dmy\x2dfish/plugin\x2dbang\x2dbang
SETUVAR _fisher_upgraded_to_4_4:\x1d
SETUVAR fish_color_autosuggestion:737994
SETUVAR fish_color_cancel:e78284
SETUVAR fish_color_command:8caaee
SETUVAR fish_color_comment:838ba7
SETUVAR fish_color_cwd:e5c890
SETUVAR fish_color_autosuggestion:brblack
SETUVAR fish_color_cancel:\x2dr
SETUVAR fish_color_command:blue
SETUVAR fish_color_comment:red
SETUVAR fish_color_cwd:green
SETUVAR fish_color_cwd_root:red
SETUVAR fish_color_end:ef9f76
SETUVAR fish_color_error:e78284
SETUVAR fish_color_escape:ea999c
SETUVAR fish_color_gray:737994
SETUVAR fish_color_end:green
SETUVAR fish_color_error:brred
SETUVAR fish_color_escape:brcyan
SETUVAR fish_color_history_current:\x2d\x2dbold
SETUVAR fish_color_host:8caaee
SETUVAR fish_color_host_remote:a6d189
SETUVAR fish_color_keyword:e78284
SETUVAR fish_color_normal:c6d0f5
SETUVAR fish_color_operator:f4b8e4
SETUVAR fish_color_option:\x1d
SETUVAR fish_color_param:eebebe
SETUVAR fish_color_quote:a6d189
SETUVAR fish_color_redirection:f4b8e4
SETUVAR fish_color_search_match:\x2d\x2dbackground\x3d414559
SETUVAR fish_color_selection:\x2d\x2dbackground\x3d414559
SETUVAR fish_color_status:e78284
SETUVAR fish_color_user:81c8be
SETUVAR fish_color_host:normal
SETUVAR fish_color_host_remote:yellow
SETUVAR fish_color_normal:normal
SETUVAR fish_color_operator:brcyan
SETUVAR fish_color_param:cyan
SETUVAR fish_color_quote:yellow
SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold
SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
SETUVAR fish_color_status:red
SETUVAR fish_color_user:brgreen
SETUVAR fish_color_valid_path:\x2d\x2dunderline
SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
SETUVAR fish_key_bindings:fish_default_key_bindings
SETUVAR fish_pager_color_background:\x1d
SETUVAR fish_pager_color_completion:c6d0f5
SETUVAR fish_pager_color_description:737994
SETUVAR fish_pager_color_prefix:f4b8e4
SETUVAR fish_pager_color_progress:737994
SETUVAR fish_pager_color_secondary_background:\x1d
SETUVAR fish_pager_color_secondary_completion:\x1d
SETUVAR fish_pager_color_secondary_description:\x1d
SETUVAR fish_pager_color_secondary_prefix:\x1d
SETUVAR fish_pager_color_selected_background:\x1d
SETUVAR fish_pager_color_selected_completion:\x1d
SETUVAR fish_pager_color_selected_description:\x1d
SETUVAR fish_pager_color_selected_prefix:\x1d
SETUVAR fish_user_paths:/opt/homebrew/opt/openjdk\x4017/bin\x1e/Users/afonso/\x2elocal/share/nvim/mason/bin\x1e/opt/homebrew/bin\x1e/Users/afonso/\x2elocal/bin\x1e/usr/bin/vendor_perl\x1e/home/afonso/go/bin\x1e/home/afonso/\x2ebun/bin\x1e/var/lib/flatpak/exports/bin\x1e/home/afonso/\x2eghcup/bin\x1e/home/afonso/\x2econfig/emacs/bin\x1e/home/afonso/\x2enix\x2dprofile/bin\x1e/var/lib/snapd/snap/bin\x1e/home/afonso/\x2elocal/share/nvim/mason/bin\x1e/home/afonso/\x2erustup/toolchains/nightly\x2dx86_64\x2dunknown\x2dlinux\x2dgnu/bin\x1e/home/afonso/\x2ecargo/bin\x1e/home/afonso/\x2elocal/bin
SETUVAR pure_begin_prompt_with_current_directory:true
SETUVAR pure_check_for_new_release:false
SETUVAR pure_color_at_sign:pure_color_mute
SETUVAR pure_color_command_duration:pure_color_warning
SETUVAR pure_color_current_directory:pure_color_primary
SETUVAR pure_color_danger:red
SETUVAR pure_color_dark:black
SETUVAR pure_color_git_branch:brgreen
SETUVAR pure_color_git_dirty:pure_color_mute
SETUVAR pure_color_git_stash:pure_color_info
SETUVAR pure_color_git_unpulled_commits:pure_color_info
SETUVAR pure_color_git_unpushed_commits:pure_color_info
SETUVAR pure_color_hostname:pure_color_mute
SETUVAR pure_color_info:cyan
SETUVAR pure_color_jobs:pure_color_normal
SETUVAR pure_color_light:white
SETUVAR pure_color_mute:brblack
SETUVAR pure_color_normal:normal
SETUVAR pure_color_prefix_root_prompt:pure_color_danger
SETUVAR pure_color_primary:blue
SETUVAR pure_color_prompt_on_error:pure_color_danger
SETUVAR pure_color_prompt_on_success:pure_color_success
SETUVAR pure_color_success:magenta
SETUVAR pure_color_system_time:pure_color_mute
SETUVAR pure_color_username_normal:pure_color_mute
SETUVAR pure_color_username_root:pure_color_light
SETUVAR pure_color_virtualenv:pure_color_mute
SETUVAR pure_color_warning:yellow
SETUVAR pure_enable_container_detection:true
SETUVAR pure_enable_git:true
SETUVAR pure_enable_single_line_prompt:false
SETUVAR pure_reverse_prompt_symbol_in_vimode:true
SETUVAR pure_separate_prompt_on_error:false
SETUVAR pure_show_jobs:true
SETUVAR pure_show_prefix_root_prompt:false
SETUVAR pure_show_subsecond_command_duration:false
SETUVAR pure_show_system_time:false
SETUVAR pure_symbol_git_dirty:\x2a
SETUVAR pure_symbol_git_stash:\u2261
SETUVAR pure_symbol_git_unpulled_commits:\u21e3
SETUVAR pure_symbol_git_unpushed_commits:\u21e1
SETUVAR pure_symbol_prefix_root_prompt:\x23
SETUVAR pure_symbol_prompt:\u276f
SETUVAR pure_symbol_reverse_prompt:\u276e
SETUVAR pure_symbol_title_bar_separator:\x2d
SETUVAR pure_threshold_command_duration:5
SETUVAR fish_key_bindings:fish_vi_key_bindings
SETUVAR fish_pager_color_completion:normal
SETUVAR fish_pager_color_description:yellow\x1e\x2di
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
SETUVAR fish_pager_color_selected_background:\x2dr
SETUVAR fish_user_paths:/Users/afonso/\x2eghcup/bin\x1e/Users/afonso/\x2ecargo/bin\x1e/Users/afonso/go/bin\x1e/Users/afonso/\x2elocal/bin\x1e/Users/afonso/\x2elocal/share/nvim/mason/bin\x1e/sbin\x1e/usr/sbin\x1e/Users/afonso/\x2egem/bin\x1e/opt/homebrew/opt/texlive/bin\x1e/opt/homebrew/bin

View file

@ -1,8 +0,0 @@
function __history_previous_command
switch (commandline -t)
case "!"
commandline -t $history[1]; commandline -f repaint
case "*"
commandline -i !
end
end

View file

@ -1,9 +0,0 @@
function __history_previous_command_arguments
switch (commandline -t)
case "!"
commandline -t ""
commandline -f history-token-search-backward
case "*"
commandline -i '$'
end
end

View file

@ -1,43 +0,0 @@
function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings."
echo "\
USAGE:
fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...]
DESCRIPTION
fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it
previously installed. It installs bindings for both default and insert modes. fzf.fish executes
it without options on fish startup to install the out-of-the-box key bindings.
By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding
can be configured using a namesake corresponding option:
COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION
Search Directory | Ctrl+Alt+F (F for file) | --directory
Search Git Log | Ctrl+Alt+L (L for log) | --git_log
Search Git Status | Ctrl+Alt+S (S for status) | --git_status
Search History | Ctrl+R (R for reverse) | --history
Search Processes | Ctrl+Alt+P (P for process) | --processes
Search Variables | Ctrl+V (V for variable) | --variables
Override a command's binding by specifying its corresponding option with the desired key
sequence. Disable a command's binding by specifying its corresponding option with no value.
Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly
executed multiple times. Once the desired fzf_configure_bindings command has been found, add it
to your config.fish in order to persist the customized bindings.
In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an
equals sign between an option's name and value. However, it does not validate key sequences.
Pass -h or --help to print this help message and exit.
EXAMPLES
Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V
\$ fzf_configure_bindings --directory=\cf --variables=\e\cv
Default bindings but disable Search History
\$ fzf_configure_bindings --history=
An agglomeration of different options
\$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes=
SEE Also
To learn more about fish key bindings, see bind(1) and fish_key_reader(1).
"
end

View file

@ -1,15 +0,0 @@
# helper function for _fzf_search_variables
function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output."
# Extract only the lines about the variable, all of which begin with either
# $variable_name: ...or... $variable_name[
string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output |
# Strip the variable name prefix, including ": " for scope info lines
string replace --regex "^\\\$$variable_name(?:: )?" '' |
# Distill the lines of values, replacing...
# [1]: |value|
# ...with...
# [1] value
string replace --regex ": \|(.*)\|" ' $1'
end

View file

@ -1,49 +0,0 @@
# helper for _fzf_search_git_status
# arg should be a line from git status --short, e.g.
# MM functions/_fzf_preview_changed_file.fish
# D README.md
# R LICENSE -> "New License"
function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file."
# remove quotes because they'll be interpreted literally by git diff
# no need to requote when referencing $path because fish does not perform word splitting
# https://fishshell.com/docs/current/fish_for_bash_users.html
set -f path (string unescape (string sub --start 4 $path_status))
# first letter of short format shows index, second letter shows working tree
# https://git-scm.com/docs/git-status/2.35.0#_short_format
set -f index_status (string sub --length 1 $path_status)
set -f working_tree_status (string sub --start 2 --length 1 $path_status)
set -f diff_opts --color=always
if test $index_status = '?'
_fzf_report_diff_type Untracked
_fzf_preview_file $path
else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU
# Unmerged statuses taken directly from git status help's short format table
# Unmerged statuses are mutually exclusive with other statuses, so if we see
# these, then safe to assume the path is unmerged
_fzf_report_diff_type Unmerged
git diff $diff_opts -- $path
else
if test $index_status != ' '
_fzf_report_diff_type Staged
# renames are only detected in the index, never working tree, so only need to test for it here
# https://stackoverflow.com/questions/73954214
if test $index_status = R
# diff the post-rename path with the original path, otherwise the diff will show the entire file as being added
set -f orig_and_new_path (string split --max 1 -- ' -> ' $path)
git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2]
# path currently has the form of "original -> current", so we need to correct it before it's used below
set path $orig_and_new_path[2]
else
git diff --staged $diff_opts -- $path
end
end
if test $working_tree_status != ' '
_fzf_report_diff_type Unstaged
git diff $diff_opts -- $path
end
end
end

View file

@ -1,43 +0,0 @@
# helper function for _fzf_search_directory and _fzf_search_git_status
function _fzf_preview_file --description "Print a preview for the given file based on its file type."
# because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file
# as one argument, we collect all the arguments into one single variable and treat that as the path
set -f file_path $argv
if test -L "$file_path" # symlink
# notify user and recurse on the target of the symlink, which can be any of these file types
set -l target_path (realpath "$file_path")
set_color yellow
echo "'$file_path' is a symlink to '$target_path'."
set_color normal
_fzf_preview_file "$target_path"
else if test -f "$file_path" # regular file
if set --query fzf_preview_file_cmd
# need to escape quotes to make sure eval receives file_path as a single arg
eval "$fzf_preview_file_cmd '$file_path'"
else
bat --style=numbers --color=always "$file_path"
end
else if test -d "$file_path" # directory
if set --query fzf_preview_dir_cmd
# see above
eval "$fzf_preview_dir_cmd '$file_path'"
else
# -A list hidden files as well, except for . and ..
# -F helps classify files by appending symbols after the file name
command ls -A -F "$file_path"
end
else if test -c "$file_path"
_fzf_report_file_type "$file_path" "character device file"
else if test -b "$file_path"
_fzf_report_file_type "$file_path" "block device file"
else if test -S "$file_path"
_fzf_report_file_type "$file_path" socket
else if test -p "$file_path"
_fzf_report_file_type "$file_path" "named pipe"
else
echo "$file_path doesn't exist." >&2
end
end

View file

@ -1,18 +0,0 @@
# helper for _fzf_preview_changed_file
# prints out something like
# ╭────────╮
# │ Staged │
# ╰────────╯
function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch."
# number of "-" to draw is the length of the string to box + 2 for padding
set -f repeat_count (math 2 + (string length $diff_type))
set -f line (string repeat --count $repeat_count)
set -f top_border$line
set -f btm_border$line
set_color yellow
echo $top_border
echo "$diff_type"
echo $btm_border
set_color normal
end

View file

@ -1,6 +0,0 @@
# helper function for _fzf_preview_file
function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file."
set_color red
echo "Cannot preview '$file_path': it is a $file_type."
set_color normal
end

View file

@ -1,34 +0,0 @@
function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths."
# Directly use fd binary to avoid output buffering delay caused by a fd alias, if any.
# Debian-based distros install fd as fdfind and the fd package is something else, so
# check for fdfind first. Fall back to "fd" for a clear error message.
set -f fd_cmd (command -v fdfind || command -v fd || echo "fd")
set -f --append fd_cmd --color=always $fzf_fd_opts
# $fzf_dir_opts is the deprecated version of $fzf_directory_opts
set -f fzf_arguments --multi --ansi $fzf_dir_opts $fzf_directory_opts
set -f token (commandline --current-token)
# expand any variables or leading tilde (~) in the token
set -f expanded_token (eval echo -- $token)
# unescape token because it's already quoted so backslashes will mess up the path
set -f unescaped_exp_token (string unescape -- $expanded_token)
# If the current token is a directory and has a trailing slash,
# then use it as fd's base directory.
if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token"
set --append fd_cmd --base-directory=$unescaped_exp_token
# use the directory name as fzf's prompt to indicate the search is limited to that directory
set --prepend fzf_arguments --prompt="Search Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}"
set -f file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
else
set --prepend fzf_arguments --prompt="Search Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}'
set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments)
end
if test $status -eq 0
commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ')
end
commandline --function repaint
end

View file

@ -1,36 +0,0 @@
function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash."
if not git rev-parse --git-dir >/dev/null 2>&1
echo '_fzf_search_git_log: Not in a git repository.' >&2
else
if not set --query fzf_git_log_format
# %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below
set -f fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)'
end
set -f preview_cmd 'git show --color=always --stat --patch {1}'
if set --query fzf_diff_highlighter
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
end
set -f selected_log_lines (
git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \
_fzf_wrapper --ansi \
--multi \
--scheme=history \
--prompt="Search Git Log> " \
--preview=$preview_cmd \
--query=(commandline --current-token) \
$fzf_git_log_opts
)
if test $status -eq 0
for line in $selected_log_lines
set -f abbreviated_commit_hash (string split --field 1 " " $line)
set -f full_commit_hash (git rev-parse $abbreviated_commit_hash)
set -f --append commit_hashes $full_commit_hash
end
commandline --current-token --replace (string join ' ' $commit_hashes)
end
end
commandline --function repaint
end

View file

@ -1,41 +0,0 @@
function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths."
if not git rev-parse --git-dir >/dev/null 2>&1
echo '_fzf_search_git_status: Not in a git repository.' >&2
else
set -f preview_cmd '_fzf_preview_changed_file {}'
if set --query fzf_diff_highlighter
set preview_cmd "$preview_cmd | $fzf_diff_highlighter"
end
set -f selected_paths (
# Pass configuration color.status=always to force status to use colors even though output is sent to a pipe
git -c color.status=always status --short |
_fzf_wrapper --ansi \
--multi \
--prompt="Search Git Status> " \
--query=(commandline --current-token) \
--preview=$preview_cmd \
--nth="2.." \
$fzf_git_status_opts
)
if test $status -eq 0
# git status --short automatically escapes the paths of most files for us so not going to bother trying to handle
# the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping")
set -f cleaned_paths
for path in $selected_paths
if test (string sub --length 1 $path) = R
# path has been renamed and looks like "R LICENSE -> LICENSE.md"
# extract the path to use from after the arrow
set --append cleaned_paths (string split -- "-> " $path)[-1]
else
set --append cleaned_paths (string sub --start=4 $path)
end
end
commandline --current-token --replace -- (string join ' ' $cleaned_paths)
end
end
commandline --function repaint
end

View file

@ -1,35 +0,0 @@
function _fzf_search_history --description "Search command history. Replace the command line with the selected command."
# history merge incorporates history changes from other fish sessions
# it errors out if called in private mode
if test -z "$fish_private_mode"
builtin history merge
end
if not set --query fzf_history_time_format
# Reference https://devhints.io/strftime to understand strftime format symbols
set -f fzf_history_time_format "%m-%d %H:%M:%S"
end
# Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line
set -f commands_selected (
builtin history --null --show-time="$fzf_history_time_format" |
_fzf_wrapper --read0 \
--print0 \
--multi \
--scheme=history \
--prompt="Search History> " \
--query=(commandline) \
--preview="echo -- {} | string replace --regex '^.*? │ ' '' | fish_indent --ansi" \
--preview-window="bottom:3:wrap" \
$fzf_history_opts |
string split0 |
# remove timestamps from commands selected
string replace --regex '^.*? │ ' ''
)
if test $status -eq 0
commandline --replace -- $commands_selected
end
commandline --function repaint
end

View file

@ -1,32 +0,0 @@
function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process."
# Directly use ps command because it is often aliased to a different command entirely
# or with options that dirty the search results and preview output
set -f ps_cmd (command -v ps || echo "ps")
# use all caps to be consistent with ps default format
# snake_case because ps doesn't seem to allow spaces in the field names
set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command')
set -f processes_selected (
$ps_cmd -A -opid,command | \
_fzf_wrapper --multi \
--prompt="Search Processes> " \
--query (commandline --current-token) \
--ansi \
# first line outputted by ps is a header, so we need to mark it as so
--header-lines=1 \
# ps uses exit code 1 if the process was not found, in which case show an message explaining so
--preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \
--preview-window="bottom:4:wrap" \
$fzf_processes_opts
)
if test $status -eq 0
for process in $processes_selected
set -f --append pids_selected (string split --no-empty --field=1 -- " " $process)
end
# string join to replace the newlines outputted by string split with spaces
commandline --current-token --replace -- (string join ' ' $pids_selected)
end
commandline --function repaint
end

View file

@ -1,48 +0,0 @@
# This function expects the following two arguments:
# argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables
# argument 2 = output of (set --names | psub), i.e. a file with all variable names
function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable."
if test -z "$set_names_output"
printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2
commandline --function repaint
return 22 # 22 means invalid argument in POSIX
end
# Exclude the history variable from being piped into fzf because
# 1. it's not included in $set_names_output
# 2. it tends to be a very large value => increases computation time
# 3._fzf_search_history is a much better way to examine history anyway
set -f all_variable_names (string match --invert history <$set_names_output)
set -f current_token (commandline --current-token)
# Use the current token to pre-populate fzf's query. If the current token begins
# with a $, remove it from the query so that it will better match the variable names
set -f cleaned_curr_token (string replace -- '$' '' $current_token)
set -f variable_names_selected (
printf '%s\n' $all_variable_names |
_fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \
--prompt="Search Variables> " \
--preview-window="wrap" \
--multi \
--query=$cleaned_curr_token \
# $fzf_shell_vars_opts is the deprecated version of $fzf_variables_opts
$fzf_shell_vars_opts $fzf_variables_opts
)
if test $status -eq 0
# If the current token begins with a $, do not overwrite the $ when
# replacing the current token with the selected variable.
# Uses brace expansion to prepend $ to each variable name.
commandline --current-token --replace (
if string match --quiet -- '$*' $current_token
string join " " \${$variable_names_selected}
else
string join " " $variable_names_selected
end
)
end
commandline --function repaint
end

View file

@ -1,20 +0,0 @@
function _fzf_wrapper --description "Prepares some environment variables before executing fzf."
# Make sure fzf uses fish to execute preview commands, some of which
# are autoloaded fish functions so don't exist in other shells.
# Use --function so that it doesn't clobber SHELL outside this function.
set -f --export SHELL (command --search fish)
# If FZF_DEFAULT_OPTS is not set, then set some sane defaults.
# See https://github.com/junegunn/fzf#environment-variables
if not set --query FZF_DEFAULT_OPTS
# cycle allows jumping between the first and last results, making scrolling faster
# layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env
# border shows where the fzf window begins and ends
# height=90% leaves space to see the current command and some scrollback, maintaining context of work
# preview-window=wrap wraps long lines in the preview window, making reading easier
# marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >)
set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"'
end
fzf $argv
end

View file

@ -1,240 +0,0 @@
function fisher --argument-names cmd --description "A plugin manager for Fish"
set --query fisher_path || set --local fisher_path $__fish_config_dir
set --local fisher_version 4.4.3
set --local fish_plugins $__fish_config_dir/fish_plugins
switch "$cmd"
case -v --version
echo "fisher, version $fisher_version"
case "" -h --help
echo "Usage: fisher install <plugins...> Install plugins"
echo " fisher remove <plugins...> Remove installed plugins"
echo " fisher update <plugins...> Update installed plugins"
echo " fisher update Update all installed plugins"
echo " fisher list [<regex>] List installed plugins matching regex"
echo "Options:"
echo " -v, --version Print version"
echo " -h, --help Print this help message"
echo "Variables:"
echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~
case ls list
string match --entire --regex -- "$argv[2]" $_fisher_plugins
case install update remove
isatty || read --local --null --array stdin && set --append argv $stdin
set --local install_plugins
set --local update_plugins
set --local remove_plugins
set --local arg_plugins $argv[2..-1]
set --local old_plugins $_fisher_plugins
set --local new_plugins
test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins)
if ! set --query argv[2]
if test "$cmd" != update
echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1
else if ! set --query file_plugins
echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1
end
set arg_plugins $file_plugins
end
for plugin in $arg_plugins
set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin)
contains -- "$plugin" $new_plugins || set --append new_plugins $plugin
end
if set --query argv[2]
for plugin in $new_plugins
if contains -- "$plugin" $old_plugins
test "$cmd" = remove &&
set --append remove_plugins $plugin ||
set --append update_plugins $plugin
else if test "$cmd" = install
set --append install_plugins $plugin
else
echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1
end
end
else
for plugin in $new_plugins
contains -- "$plugin" $old_plugins &&
set --append update_plugins $plugin ||
set --append install_plugins $plugin
end
for plugin in $old_plugins
contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin
end
end
set --local pid_list
set --local source_plugins
set --local fetch_plugins $update_plugins $install_plugins
set --local fish_path (status fish-path)
echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal)
for plugin in $fetch_plugins
set --local source (command mktemp -d)
set --append source_plugins $source
command mkdir -p $source/{completions,conf.d,themes,functions}
$fish_path --command "
if test -e $plugin
command cp -Rf $plugin/* $source
else
set temp (command mktemp -d)
set repo (string split -- \@ $plugin) || set repo[2] HEAD
if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1])
set name (string split -- / \$path)[-1]
set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz
else
set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2]
end
echo Fetching (set_color --underline)\$url(set_color normal)
if command curl --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null
command cp -Rf \$temp/*/* $source
else
echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2
command rm -rf $source
end
command rm -rf \$temp
end
set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files
" &
set --append pid_list (jobs --last --pid)
end
wait $pid_list 2>/dev/null
for plugin in $fetch_plugins
if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
if set --local index (contains --index -- "$plugin" $install_plugins)
set --erase install_plugins[$index]
else
set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)]
end
end
end
for plugin in $update_plugins $remove_plugins
if set --local index (contains --index -- "$plugin" $_fisher_plugins)
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
if contains -- "$plugin" $remove_plugins
for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var)
emit {$name}_uninstall
end
printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
set --erase _fisher_plugins[$index]
end
command rm -rf (string replace -- \~ ~ $$plugin_files_var)
functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var)
for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var)
complete --erase --command $name
end
set --erase $plugin_files_var
end
end
if set --query update_plugins[1] || set --query install_plugins[1]
command mkdir -p $fisher_path/{functions,themes,conf.d,completions}
end
for plugin in $update_plugins $install_plugins
set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)]
set --local files $source/{functions,themes,conf.d,completions}/*
if set --local index (contains --index -- $plugin $install_plugins)
set --local user_files $fisher_path/{functions,themes,conf.d,completions}/*
set --local conflict_files
for file in (string replace -- $source/ $fisher_path/ $files)
contains -- $file $user_files && set --append conflict_files $file
end
if set --query conflict_files[1] && set --erase install_plugins[$index]
echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2
continue
end
end
for file in (string replace -- $source/ "" $files)
command cp -RLf $source/$file $fisher_path/$file
end
set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files
set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~)
contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin
contains -- $plugin $install_plugins && set --local event install || set --local event update
printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~
for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~)
source $file
if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file)
emit {$name}_$event
end
end
end
command rm -rf $source_plugins
if set --query _fisher_plugins[1]
set --local commit_plugins
for plugin in $file_plugins
contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin
end
for plugin in $_fisher_plugins
contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin
end
printf "%s\n" $commit_plugins >$fish_plugins
else
set --erase _fisher_plugins
command rm -f $fish_plugins
end
set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins)
test "$total" != "0 0 0" && echo (string join ", " (
test $total[1] = 0 || echo "Installed $total[1]") (
test $total[2] = 0 || echo "Updated $total[2]") (
test $total[3] = 0 || echo "Removed $total[3]")
) plugin/s
case \*
echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1
end
end
if ! set --query _fisher_upgraded_to_4_4
set --universal _fisher_upgraded_to_4_4
if functions --query _fisher_list
set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share
command rm -rf $XDG_DATA_HOME/fisher
functions --erase _fisher_{list,plugin_parse}
fisher update >/dev/null 2>/dev/null
else
for var in (set --names | string match --entire --regex '^_fisher_.+_files$')
set $var (string replace -- ~ \~ $$var)
end
functions --erase _fisher_fish_postexec
end
end

View file

@ -1,46 +0,0 @@
# Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect
# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1
function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options."
# no need to install bindings if not in interactive mode or running tests
status is-interactive || test "$CI" = true; or return
set -f options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'processes=?' 'variables=?'
argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null
if test $status -ne 0
echo "Invalid option or a positional argument was provided." >&2
_fzf_configure_bindings_help
return 22
else if set --query _flag_help
_fzf_configure_bindings_help
return
else
# Initialize with default key sequences and then override or disable them based on flags
# index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = processes, 6 = variables
set -f key_sequences \e\cf \e\cl \e\cs \cr \e\cp \cv # \c = control, \e = escape
set --query _flag_directory && set key_sequences[1] "$_flag_directory"
set --query _flag_git_log && set key_sequences[2] "$_flag_git_log"
set --query _flag_git_status && set key_sequences[3] "$_flag_git_status"
set --query _flag_history && set key_sequences[4] "$_flag_history"
set --query _flag_processes && set key_sequences[5] "$_flag_processes"
set --query _flag_variables && set key_sequences[6] "$_flag_variables"
# If fzf bindings already exists, uninstall it first for a clean slate
if functions --query _fzf_uninstall_bindings
_fzf_uninstall_bindings
end
for mode in default insert
test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory
test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log
test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status
test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history
test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] _fzf_search_processes
test -n $key_sequences[6] && bind --mode $mode $key_sequences[6] "$_fzf_search_vars_command"
end
function _fzf_uninstall_bindings --inherit-variable key_sequences
bind --erase -- $key_sequences
bind --erase --mode insert -- $key_sequences
end
end
end

View file

@ -1,7 +0,0 @@
function config
/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME $argv
end
abbr -a lc "lazygit --git-dir=$HOME/dotfiles/ --work-tree=$HOME/"

View file

@ -1,5 +0,0 @@
abbr -a i sudo pacman -S
abbr -a s sudo pacman -Ss
abbr -a u yay -Syu
abbr -a r sudo pacman -Rns

View file

@ -1,24 +0,0 @@
bind \cH backward-kill-path-component
bind "[3;5~" kill-word
function backup --argument filename
cp $filename $filename.bak
end
function restore --argument file
mv $file (echo $file | sed s/.bak//)
end
function core
xhost +local:root
sudo docker exec -it core core-gui
end
function core-bash
sudo docker exec -it core /bin/bash
end
function launch-term --argument nodename
sudo docker exec -it core xterm -bg black -fg white -fa 'DejaVu Sans Mono' -fs 16 -e vcmd -c /tmp/pycore.1/$nodename -- /bin/bash
end

View file

@ -1,15 +0,0 @@
function ls
eza --icons -l --sort type $argv
end
function nvim
/opt/homebrew/bin/nvim --listen /tmp/nvim.pipe $argv
end
function vim
/opt/homebrew/bin/nvim --listen /tmp/nvim.pipe $argv
end
abbr -a find fd
abbr -a df duf
abbr -a lg lazygit
function rm
echo "rm is disabled, use trash instead"
end

View file

@ -1,30 +0,0 @@
# name: 'Catppuccin frappe'
# url: 'https://github.com/catppuccin/fish'
# preferred_background: 303446
fish_color_normal c6d0f5
fish_color_command 8caaee
fish_color_param eebebe
fish_color_keyword e78284
fish_color_quote a6d189
fish_color_redirection f4b8e4
fish_color_end ef9f76
fish_color_comment 838ba7
fish_color_error e78284
fish_color_gray 737994
fish_color_selection --background=414559
fish_color_search_match --background=414559
fish_color_operator f4b8e4
fish_color_escape ea999c
fish_color_autosuggestion 737994
fish_color_cancel e78284
fish_color_cwd e5c890
fish_color_user 81c8be
fish_color_host 8caaee
fish_color_host_remote a6d189
fish_color_status e78284
fish_pager_color_progress 737994
fish_pager_color_prefix f4b8e4
fish_pager_color_completion c6d0f5
fish_pager_color_description 737994

View file

@ -1,30 +0,0 @@
# name: 'Catppuccin latte'
# url: 'https://github.com/catppuccin/fish'
# preferred_background: eff1f5
fish_color_normal 4c4f69
fish_color_command 1e66f5
fish_color_param dd7878
fish_color_keyword d20f39
fish_color_quote 40a02b
fish_color_redirection ea76cb
fish_color_end fe640b
fish_color_comment 8c8fa1
fish_color_error d20f39
fish_color_gray 9ca0b0
fish_color_selection --background=ccd0da
fish_color_search_match --background=ccd0da
fish_color_option 40a02b
fish_color_operator ea76cb
fish_color_escape e64553
fish_color_autosuggestion 9ca0b0
fish_color_cancel d20f39
fish_color_cwd df8e1d
fish_color_user 179299
fish_color_host_remote 40a02b
fish_color_host 1e66f5
fish_color_status d20f39
fish_pager_color_progress 9ca0b0
fish_pager_color_prefix ea76cb
fish_pager_color_completion 4c4f69
fish_pager_color_description 9ca0b0

View file

@ -4,5 +4,8 @@
"diagnostics.globals": [
"vim",
"numbers"
],
"diagnostics.disable": [
"missing-fields"
]
}

View file

@ -4,11 +4,17 @@ return {
lazy = false,
dependencies = {
'rafamadriz/friendly-snippets',
{ 'echasnovski/mini.icons', version = '*' },
},
version = "*",
version = '*',
opts = {
enabled = function()
return not (string.find(vim.bo.filetype, "himalaya") or string.find(vim.bo.filetype, "mail"))
end,
keymap = {
preset = 'default',
['<Up>'] = {},
['<Down>'] = {},
['<C-u>'] = { 'scroll_documentation_up', 'fallback' },
['<C-d>'] = { 'scroll_documentation_down', 'fallback' },
},
@ -44,6 +50,19 @@ return {
draw = {
treesitter = { 'lsp' },
columns = { { 'kind_icon' }, { 'label' } },
components = {
kind_icon = {
ellipsis = false,
text = function(ctx)
local kind_icon, _, _ = require('mini.icons').get('lsp', ctx.kind)
return kind_icon
end,
highlight = function(ctx)
local _, hl, _ = require('mini.icons').get('lsp', ctx.kind)
return hl
end,
}
}
}
},
documentation = {

View file

@ -1,54 +1,37 @@
return {
{
"tpope/vim-surround",
event = "VeryLazy",
},
{
"mbbill/undotree",
event = "VeryLazy",
},
{
"windwp/nvim-autopairs",
event = "VeryLazy",
config = function()
local npairs = require('nvim-autopairs')
npairs.setup({
map_cr = true,
map_bs = true,
check_ts = true,
enable_check_bracket_line = true,
ignored_next_char = "[%w]"
})
end,
'echasnovski/mini.surround',
version = '*',
opts = {}
},
{
"epwalsh/obsidian.nvim",
version = "v3.9.0",
lazy = true,
ft = "markdown",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
workspaces = {
{
name = "tese",
path = "~/vaults/uni/tese/",
'echasnovski/mini.pairs',
version = '*',
config = function()
vim.api.nvim_set_keymap('n', 'S', 'saiw', { silent = true })
require("mini.pairs").setup({
mappings = {
-- Prevents the action if the cursor is just before any character or next to a "\".
["("] = { action = "open", pair = "()", neigh_pattern = "[^\\][%s%)%]%}]" },
["["] = { action = "open", pair = "[]", neigh_pattern = "[^\\][%s%)%]%}]" },
["{"] = { action = "open", pair = "{}", neigh_pattern = "[^\\][%s%)%]%}]" },
-- This is default (prevents the action if the cursor is just next to a "\").
[")"] = { action = "close", pair = "()", neigh_pattern = "[^\\]." },
["]"] = { action = "close", pair = "[]", neigh_pattern = "[^\\]." },
["}"] = { action = "close", pair = "{}", neigh_pattern = "[^\\]." },
-- Prevents the action if the cursor is just before or next to any character.
['"'] = { action = "closeopen", pair = '""', neigh_pattern = "[^%w][^%w]", register = { cr = false } },
["'"] = { action = "closeopen", pair = "''", neigh_pattern = "[^%w][^%w]", register = { cr = false } },
["`"] = { action = "closeopen", pair = "``", neigh_pattern = "[^%w][^%w]", register = { cr = false } },
},
{
name = "chronolens",
path = "~/vaults/uni/chronolens/",
},
},
completion = {
nvim_cmp = false,
min_chars = 2,
},
picker = {
name = "fzf-lua",
},
},
})
end
},
-- Adds S in regex replace and change camelCase to snake_case, etc
"tpope/vim-abolish"
}

View file

@ -46,9 +46,6 @@ return {
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
callback = function(ev)
-- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
local fzflua = require("fzf-lua")
local conform = require("conform")
@ -109,9 +106,10 @@ return {
settings = {
ltex = {
language = "en-GB",
},
additionalRules = {
enablePickyRules = true,
additionalRules = {
enablePickyRules = true,
languageModel = '~/Downloads/ngrams/',
},
},
},
})
@ -122,6 +120,9 @@ return {
lspconfig["clangd"].setup({
capabilities = capabilities,
})
lspconfig["texlab"].setup({
capabilities = capabilities,
})
end,
},
{
@ -175,14 +176,22 @@ return {
filetypes = { "tex" },
config = function()
if vim.loop.os_uname().sysname == "Darwin" then
vim.g.vimtex_view_method = 'skim'
vim.g.vimtex_view_skim_sync = 1
vim.g.vimtex_view_skim_activate = 1
vim.g.vimtex_view_method = 'sioyek'
else
vim.g.vimtex_view_method = 'zathura'
end
vim.g.vimtex_compiler_method = 'latexmk'
vim.g.vimtex_view_automatic = 0
vim.g.vimtex_compiler_latexmk = {
out_dir = 'build',
options = {
"-verbose",
"-shell-escape",
"-file-line-error",
"-synctex=1",
"-interaction=nonstopmode",
}
}
vim.g.vimtex_view_automatic = 1
end,
},
{

View file

@ -46,4 +46,5 @@ return {
end
},
"tpope/vim-fugitive",
"pimalaya/himalaya-vim"
}

View file

@ -1,6 +1,8 @@
# tmux_general.conf
set -g default-terminal "tmux-256color"
set -gq allow-passthrough on
set -g visual-activity off
set -sa terminal-features ",*:RGB"
set -sg escape-time 0
set -g mouse on
@ -15,5 +17,3 @@ setw -g mode-keys vi
set -g status-style 'bg=#181926 fg=#cad3f5'
set -g status-right ""
set -g status-left-length 20
set-option -g default-command /bin/zsh
set-option -g default-shell /bin/zsh

@ -1 +1 @@
Subproject commit 4e8ec5a4c86873018f3ba33669fb9affff280d6e
Subproject commit 7390d759240785f660cbdb0ca55898732aa12c98

@ -1 +1 @@
Subproject commit 2c161ff670593d147823a08d73730080ef952753
Subproject commit 4fc3642fa28e1cb405afdf12f922576a7e0705a9

@ -1 +1 @@
Subproject commit aadb8df59bca896b198420757aff570e53bd9c9c
Subproject commit 39ae48970cac7cc75431ad39b003636541a1fae4

View file

@ -1,11 +1,6 @@
#This is used to reload the instance
if [[ ! $(tty) =~ ^/dev/tty[0-9]*$ ]]; then
TRAPUSR1() {
if [[ -o INTERACTIVE ]]; then
exec "${SHELL}"
fi
}
fi
export EDITOR=nvim
export VISUAL=nvim
export READER=mupdf
export XDG_CONFIG_HOME="${HOME}/.config"
export XDG_CACHE_HOME="${HOME}/.cache"
@ -13,17 +8,16 @@ export XDG_DATA_HOME="${HOME}/.local/share"
export XDG_STATE_HOME="${HOME}/.local/state"
export XDG_RUNTIME_DIR=/tmp
# Add exports
export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"
# OS-specific exports
if [[ $(uname) == "Darwin" ]]; then
#ONLY MACOS
export JAVA_HOME=$(/usr/libexec/java_home)
export GEM_HOME=$HOME/.gem
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/opt/texlive/bin:$PATH"
export GEM_HOME=$HOME/.gem
export PATH=$PATH:$GEM_HOME/bin
else
#ONLY LINUX
export LIBVA_DRIVER_NAME=nvidia
fi
@ -34,12 +28,6 @@ export PATH="$HOME/.local/bin:$PATH"
export PATH="$HOME/go/bin:$PATH"
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.ghcup/bin:$PATH"
export PATH="$HOME/.miniforge3/bin:$PATH"
export PATH="$HOME/.cabal/bin:$PATH"
export PATH="$XDG_CONFIG_HOME/emacs/bin:$PATH"
export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"
. "$HOME/.cargo/env"

View file

@ -1,26 +1,9 @@
# Setup History
HISTFILE=${ZDOTDIR:-$HOME}/.zsh_history
HISTSIZE=100000000
SAVEHIST=100000000
setopt BANG_HIST # Treat the '!' character specially during expansion.
setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
setopt HIST_SAVE_NO_DUPS
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_VERIFY
if [[ -z "$TMUX" ]]; then
tmux new-session -A -s 0
fi
#Set EDITOR AND READER
export EDITOR=nvim
export VISUAL=nvim
export READER=mupdf
#Prompt
source $ZDOTDIR/setup-history.zsh
source $ZDOTDIR/prompts/simple-two-line.zsh
source $ZDOTDIR/functions.zsh
source $ZDOTDIR/plugins.zsh

View file

@ -16,9 +16,7 @@ function routevpn {
alias ls="eza --icons -l --sort type"
alias lg="lazygit"
alias calcurse-caldav='CALCURSE_CALDAV_PASSWORD=$(keyring get caldav afonso) calcurse-caldav'
alias routes="netstat -rn -f inet"
alias lc='lazygit --work-tree="$HOME" --git-dir="$HOME/dotfiles"'
alias config='git --work-tree="$HOME" --git-dir="$HOME/dotfiles"'

View file

@ -1,23 +1,21 @@
#Completions
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion)
# Completions
zstyle ':completion:*' rehash true
fpath+=$ZDOTDIR/plugins/zsh-completions/src
autoload -U compinit && compinit
# Autosuggestions
ZSH_AUTOSUGGEST_STRATEGY=(match_prev_cmd history completion)
source $ZDOTDIR/plugins/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
# Syntax Highlighting
source $ZDOTDIR/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.plugin.zsh
source $ZDOTDIR/plugins/zsh-history-substring-search/zsh-history-substring-search.plugin.zsh
# Fzf-Tab
zvm_after_init_commands+=('source <(fzf --zsh) && enable-fzf-tab')
source $ZDOTDIR/plugins/fzf-tab/fzf-tab.plugin.zsh
# Vi mode
source $ZDOTDIR/plugins/zsh-vi-mode/zsh-vi-mode.plugin.zsh
# MacOS
source $ZDOTDIR/plugins/zsh-macos.plugin.zsh
source $ZDOTDIR/plugins/zsh-git.plugin.zsh
source $ZDOTDIR/plugins/zsh-sudo.plugin.zsh
source $ZDOTDIR/plugins/zsh-tmux/zsh-tmux.plugin.zsh

@ -1 +1 @@
Subproject commit cf57116eb2410139b8bd78fcb793dd84db79e28f
Subproject commit 6aced3f35def61c5edf9d790e945e8bb4fe7b305

@ -1 +1 @@
Subproject commit c160d09fddd28ceb3af5cf80e9253af80e450d96
Subproject commit 85e041be36a33d8f6ca71746654406425d3a910f

View file

@ -14,6 +14,7 @@
[core]
autocrlf = input
pager = delta
excludesFile = ~/.gitignore
[interactive]
diffFilter = delta --color-only
[delta]

View file

@ -1,17 +0,0 @@
# Use subroutine to do preprocessing and running pdflatex
$pdflatex = 'internal mylatex %B %O';
sub mylatex {
my $base = shift @_;
my $tex = "$base.tex";
# Run the preprocessor
if (-e "$base.lhs" && `which lhs2TeX` ne "") {
# Run the preprocessor
system('lhs2TeX', '--poly', '-o', $tex, "$base.lhs") == 0 or return $?;
}
# Run pdflatex
my $return = system('pdflatex', @_, $tex);
system "echo INPUT $base.lhs >> $aux_dir1$base.fls";
return $return;
}

View file

@ -1,3 +1,3 @@
export XDG_CONFIG_HOME="$HOME"/.config
export XDG_CONFIG_HOME=~/.config
export ZDOTDIR="$XDG_CONFIG_HOME"/zsh
source "$ZDOTDIR"/.zshenv