Movint to Fish + Tide

This commit is contained in:
Rodolphe Bréard 2025-03-02 14:26:08 +01:00
parent 4b08537918
commit ae7e402728
Signed by: rodolphe
SSH key fingerprint: SHA256:3rodCKnk1MUOfSlIKY0nHbBtvFyQx4EqjS+JIy69lN0
28 changed files with 167 additions and 326 deletions

52
.config/fish/config.fish Normal file
View file

@ -0,0 +1,52 @@
if status is-login
# Utilities
if type -q nvim
set --global --export EDITOR "nvim"
else if type -q vim
set --global --export EDITOR "vim"
end
set --global --export PAGER "less"
type -q kitty && set --global --export TERMINAL "kitty"
# Path
function add_path
set --function bin_path "$argv[1]"
if test -d "$bin_path"
if not contains "$bin_path" $PATH
set --global --export PATH "$bin_path" $PATH
end
end
end
add_path "$HOME/.local/bin"
add_path "$HOME/.cargo/bin"
# SSH agent
# Enable it using `systemctl enable --user ssh-agent.service`
begin
set --local ssh_agent_socket "$XDG_RUNTIME_DIR/ssh-agent.socket"
test -S "$ssh_agent_socket" && set --global --export SSH_AUTH_SOCK "$ssh_agent_socket"
end
# XDG
set --global --export XDG_USER_DIR_FILE "$HOME/.config/user-dirs.dirs"
set --global --export XDG_DESKTOP_DIR "$HOME/desktop"
set --global --export XDG_DOWNLOAD_DIR "$HOME/downloads"
set --global --export XDG_TEMPLATES_DIR "$HOME/templates"
set --global --export XDG_PUBLICSHARE_DIR "$HOME/public_share"
set --global --export XDG_DOCUMENTS_DIR "$HOME/documents"
set --global --export XDG_MUSIC_DIR "$HOME/music"
set --global --export XDG_PICTURES_DIR "$HOME/pictures"
set --global --export XDG_VIDEOS_DIR "$HOME/videos"
# Java
# https://wiki.archlinux.org/title/Java#Switching_between_JVM
set --global --export JAVA_HOME "/usr/lib/jvm/default"
end
if status is-interactive
# Disable the Fish greeting message
set --global fish_greeting
# zoxide
zoxide init fish | source
end

View file

@ -0,0 +1,3 @@
function audio-dl
command yt-dlp --extract-audio --audio-quality 0 --audio-format "vorbis" $argv
end

View file

@ -0,0 +1,4 @@
function clang-format
set --local style "{BasedOnStyle: llvm, IndentWidth: 4, AllowShortFunctionsOnASingleLine: None, KeepEmptyLinesAtTheStartOfBlocks: false}"
command clang-format -style="$style" $argv
end

View file

@ -0,0 +1,3 @@
function df
command df -h $argv
end

View file

@ -0,0 +1,7 @@
function du
if type -q duf
command duf $argv
else
command du $argv
end
end

View file

@ -0,0 +1,9 @@
function grep
if test "$pipestatus" = "0"
# No pipe before the grep
command grep -n --color=auto $argv
else
# There is a pipe before the grep
command grep --color=auto $argv
end
end

View file

@ -0,0 +1,3 @@
function hx
command helix $argv
end

View file

@ -0,0 +1,3 @@
function ip
command ip --color $argv
end

View file

@ -0,0 +1,3 @@
function j
command jobs $argv
end

View file

@ -0,0 +1,3 @@
function kitty_ssh
command kitty +kitten ssh $argv
end

View file

@ -0,0 +1,3 @@
function l
ls -AlihF $argv
end

View file

@ -0,0 +1,11 @@
function ls
if type -q eza
command eza $argv
else
if test "$(uname -s | tr '[:upper:]' '[:lower:]')" = 'linux'
command ls --color=auto $argv
else
command ls $argv
end
end
end

View file

@ -0,0 +1,3 @@
function mount_ro
command mount -o ro,noexec,noatime,nodev,nosuid,noiversion $argv
end

View file

@ -0,0 +1,3 @@
function sqlmap-tor
sqlmap --tor --tor-type=SOCKS5 $argv
end

View file

@ -0,0 +1,3 @@
function sqlmap
command sqlmap --user-agent="Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" $argv
end

View file

@ -0,0 +1,3 @@
function t
command tree $argv
end

View file

@ -0,0 +1,9 @@
function top
if type -q btop
command btop $argv
else if type -q htop
command htop $argv
else
command top $argv
end
end

View file

@ -0,0 +1,7 @@
function vim
if type -q nvim
command nvim $argv
else
command vim $argv
end
end