Add .config/fish/config.fish
Add .config/fish/functions/cd.fish Add .config/fish/functions/compress.fish Add .config/fish/functions/dcim.fish Add .config/fish/functions/decompress.fish Add .config/fish/functions/ff.fish Add .config/fish/functions/fish_greeting.fish Add .config/fish/functions/ls.fish Add .config/fish/functions/lsa.fish Add .config/fish/functions/lt.fish Add .config/fish/functions/lta.fish Add .config/fish/functions/open.fish Add .config/fish/functions/repo.fish Add .config/fish/user-dirs.fish
This commit is contained in:
parent
f80c45dc3e
commit
5b3b5d0730
14 changed files with 114 additions and 0 deletions
12
private_dot_config/fish/functions/cd.fish
Normal file
12
private_dot_config/fish/functions/cd.fish
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
function cd
|
||||
if test (count $argv) -eq 0
|
||||
builtin cd ~
|
||||
else if test -d $argv[1]
|
||||
builtin cd $argv[1]
|
||||
else
|
||||
z $argv
|
||||
and printf "\U000F17A9 "
|
||||
pwd
|
||||
or echo "Error: Directory not found"
|
||||
end
|
||||
end
|
||||
3
private_dot_config/fish/functions/compress.fish
Normal file
3
private_dot_config/fish/functions/compress.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function compress
|
||||
tar -cfz "$argv[1].tar.gz" "$argv[1]";
|
||||
end
|
||||
9
private_dot_config/fish/functions/dcim.fish
Normal file
9
private_dot_config/fish/functions/dcim.fish
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
function dcim
|
||||
if test -d $XDG_DCIM_DIR
|
||||
cd $XDG_DCIM_DIR
|
||||
else if test -d ~/dcim
|
||||
cd ~/dcim
|
||||
else
|
||||
echo "no dcim dir found"
|
||||
end
|
||||
end
|
||||
3
private_dot_config/fish/functions/decompress.fish
Normal file
3
private_dot_config/fish/functions/decompress.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function decompress --wraps='tar -xzf' --description 'alias decompress=tar -xzf'
|
||||
tar -xzf $argv
|
||||
end
|
||||
3
private_dot_config/fish/functions/ff.fish
Normal file
3
private_dot_config/fish/functions/ff.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function ff --wraps="fzf --preview 'bat --style=numbers --color=always {}'" --wraps="fzf --preview 'bat --style=numbers --color=always{}'" --description "alias ff=fzf --preview 'bat --style=numbers --color=always {}'"
|
||||
fzf --preview 'bat --style=numbers --color=always {}' $argv
|
||||
end
|
||||
3
private_dot_config/fish/functions/fish_greeting.fish
Normal file
3
private_dot_config/fish/functions/fish_greeting.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function fish_greeting
|
||||
echo "fsh🐟";
|
||||
end
|
||||
3
private_dot_config/fish/functions/ls.fish
Normal file
3
private_dot_config/fish/functions/ls.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function ls --wraps='eza -lh --group-directories-first --icons=auto --git' --description 'alias ls=eza -lh --group-directories-first --icons=auto --git'
|
||||
eza -lh --group-directories-first --icons=auto --git $argv
|
||||
end
|
||||
3
private_dot_config/fish/functions/lsa.fish
Normal file
3
private_dot_config/fish/functions/lsa.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function lsa --wraps='ls -a' --description 'alias lsa=ls -a'
|
||||
ls -a $argv
|
||||
end
|
||||
3
private_dot_config/fish/functions/lt.fish
Normal file
3
private_dot_config/fish/functions/lt.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function lt --wraps='eza --tree --level=2 --long --icons --git' --description 'alias lt=eza --tree --level=2 --long --icons --git'
|
||||
eza --tree --level=2 --long --icons --git $argv
|
||||
end
|
||||
3
private_dot_config/fish/functions/lta.fish
Normal file
3
private_dot_config/fish/functions/lta.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function lta --wraps='lt -a' --description 'alias lta=lt -a'
|
||||
lt -a $argv
|
||||
end
|
||||
3
private_dot_config/fish/functions/open.fish
Normal file
3
private_dot_config/fish/functions/open.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function open
|
||||
xdg-open $argv >/dev/null 2>&1 &;
|
||||
end
|
||||
11
private_dot_config/fish/functions/repo.fish
Normal file
11
private_dot_config/fish/functions/repo.fish
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
function repo
|
||||
if test (count $argv) -ge 1
|
||||
set SRC_DIRECTORY $argv[1]
|
||||
else
|
||||
set SRC_DIRECTORY $HOME/src
|
||||
end
|
||||
set repo (find $SRC_DIRECTORY -mindepth 1 -maxdepth 3 -type d -exec test -d "{}/.git" \; -print \
|
||||
| fzf --preview "bash -c '[ -f {}/README.md ] && bat --style=plain --color=always {}/README.md || echo \"No README\"; echo; git -C {} status --short --branch'" --preview-window=up:60%)
|
||||
or return
|
||||
cd $repo
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue