dotfiles/.config/fish/config.fish

92 lines
1.8 KiB
Fish
Raw Normal View History

2021-03-14 18:12:50 +01:00
# activate usable-mode
fish_vi_key_bindings
# ALIASES
alias ls="lsd"
alias ll="ls -l"
alias la="ll -a"
2021-04-13 01:06:56 +02:00
alias lt="ll --tree"
2021-09-12 17:24:03 +02:00
alias jo="TERM=xterm-256color joshuto"
2021-03-14 18:12:50 +01:00
alias clip="xclip -sel clip"
2021-04-13 01:06:56 +02:00
alias nv="nvim"
2021-09-02 11:00:47 +02:00
alias nvide="rbg neovide --multigrid --"
2021-08-20 19:10:23 +02:00
# colored man pages
set -gx LESS_TERMCAP_mb \e'[1;32m'
set -gx LESS_TERMCAP_md \e'[1;32m'
set -gx LESS_TERMCAP_me \e'[0m'
set -gx LESS_TERMCAP_se \e'[0m'
set -gx LESS_TERMCAP_so \e'[01;33m'
set -gx LESS_TERMCAP_ue \e'[0m'
set -gx LESS_TERMCAP_us \e'[1;4;31m'
2021-04-13 01:06:56 +02:00
2021-03-14 18:12:50 +01:00
function rbg
2022-05-08 21:19:06 +02:00
$argv &>/dev/null &
2021-03-14 18:12:50 +01:00
end
2021-03-27 18:56:46 +01:00
function rbgd
rbg $argv
disown
end
2021-04-13 01:06:56 +02:00
function foreachdir
for file in (find $argv[1] -type f -print)
f=$file eval $argv[2..-1]
end
end
2022-05-08 21:19:06 +02:00
function !!
2021-03-14 18:12:50 +01:00
eval $history[1]
end
function mkdircd
mkdir $argv[1]
cd $argv[1]
end
2021-04-13 01:06:56 +02:00
function ifpresent
2022-05-08 21:19:06 +02:00
if which $argv[1] &>/dev/null
2021-04-13 01:06:56 +02:00
eval $argv[2..-1]
end
end
function todos
rg -i -H todo
end
# install custom prompt to ~/.local/bin/prompt (or somewhere else in $PATH)
2021-10-31 23:39:39 +01:00
functions -e fish_mode_prompt
function fish_prompt
2021-11-01 12:18:31 +01:00
prompt $status $fish_bind_mode
end
2021-12-27 17:15:42 +01:00
# custom title
functions -e fish_title
function fish_title
echo (prompt_pwd) '|' (set -q argv[1] && echo $argv[1] || status current-command)
end
2021-03-14 18:12:50 +01:00
# ENV
export CXX=clang++
export EDITOR=nvim
2021-04-13 01:06:56 +02:00
export PATH="$PATH:$HOME/.cargo/bin:$HOME/.local/bin:/var/lib/snapd/snap/bin:$HOME/go/bin"
2022-01-29 00:23:06 +01:00
export LUA_CPATH="$HOME/.local/lib/lua/?.so;$HOME/.local/lib/lua/?.lua;;"
2021-04-13 01:06:56 +02:00
# initialization stuff
ifpresent zoxide 'zoxide init fish | source'
ifpresent cod 'cod init %self fish | source'
ifpresent opam 'eval (opam env)'
2021-04-16 01:44:39 +02:00
ifpresent navi 'navi widget fish | source'
2021-03-14 18:12:50 +01:00
2021-06-22 21:04:42 +02:00
# fw init
2022-05-08 21:19:06 +02:00
if which fw &>/dev/null
if test -x (command -v fw)
if test -x (command -v fzf)
fw print-fish-setup -f | source
else
fw print-fish-setup | source
end
end
2021-06-22 21:04:42 +02:00
end