Movint to Fish + Tide
This commit is contained in:
parent
4b08537918
commit
ae7e402728
28 changed files with 167 additions and 326 deletions
52
.config/fish/config.fish
Normal file
52
.config/fish/config.fish
Normal 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
|
3
.config/fish/functions/audio-dl.fish
Normal file
3
.config/fish/functions/audio-dl.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function audio-dl
|
||||
command yt-dlp --extract-audio --audio-quality 0 --audio-format "vorbis" $argv
|
||||
end
|
4
.config/fish/functions/clang-format.fish
Normal file
4
.config/fish/functions/clang-format.fish
Normal 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
|
3
.config/fish/functions/df.fish
Normal file
3
.config/fish/functions/df.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function df
|
||||
command df -h $argv
|
||||
end
|
7
.config/fish/functions/du.fish
Normal file
7
.config/fish/functions/du.fish
Normal file
|
@ -0,0 +1,7 @@
|
|||
function du
|
||||
if type -q duf
|
||||
command duf $argv
|
||||
else
|
||||
command du $argv
|
||||
end
|
||||
end
|
9
.config/fish/functions/grep.fish
Normal file
9
.config/fish/functions/grep.fish
Normal 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
|
3
.config/fish/functions/hx.fish
Normal file
3
.config/fish/functions/hx.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function hx
|
||||
command helix $argv
|
||||
end
|
3
.config/fish/functions/ip.fish
Normal file
3
.config/fish/functions/ip.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function ip
|
||||
command ip --color $argv
|
||||
end
|
3
.config/fish/functions/j.fish
Normal file
3
.config/fish/functions/j.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function j
|
||||
command jobs $argv
|
||||
end
|
3
.config/fish/functions/kitty_ssh.fish
Normal file
3
.config/fish/functions/kitty_ssh.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function kitty_ssh
|
||||
command kitty +kitten ssh $argv
|
||||
end
|
3
.config/fish/functions/l.fish
Normal file
3
.config/fish/functions/l.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function l
|
||||
ls -AlihF $argv
|
||||
end
|
11
.config/fish/functions/ls.fish
Normal file
11
.config/fish/functions/ls.fish
Normal 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
|
3
.config/fish/functions/mount_ro.fish
Normal file
3
.config/fish/functions/mount_ro.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function mount_ro
|
||||
command mount -o ro,noexec,noatime,nodev,nosuid,noiversion $argv
|
||||
end
|
3
.config/fish/functions/sqlmap-tor.fish
Normal file
3
.config/fish/functions/sqlmap-tor.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function sqlmap-tor
|
||||
sqlmap --tor --tor-type=SOCKS5 $argv
|
||||
end
|
3
.config/fish/functions/sqlmap.fish
Normal file
3
.config/fish/functions/sqlmap.fish
Normal 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
|
3
.config/fish/functions/t.fish
Normal file
3
.config/fish/functions/t.fish
Normal file
|
@ -0,0 +1,3 @@
|
|||
function t
|
||||
command tree $argv
|
||||
end
|
9
.config/fish/functions/top.fish
Normal file
9
.config/fish/functions/top.fish
Normal 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
|
7
.config/fish/functions/vim.fish
Normal file
7
.config/fish/functions/vim.fish
Normal file
|
@ -0,0 +1,7 @@
|
|||
function vim
|
||||
if type -q nvim
|
||||
command nvim $argv
|
||||
else
|
||||
command vim $argv
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue