Use sd and ripgrep for some fish functions. Changed fish functions to repaint the command line as well
This commit is contained in:
parent
65c7efee0f
commit
24fb458ba8
3 changed files with 6 additions and 11 deletions
|
@ -3,5 +3,7 @@ function cdzi --description 'Open directories from zoxide in a new Kitty tab'
|
||||||
|
|
||||||
if test -n "$selected_dir"
|
if test -n "$selected_dir"
|
||||||
cd $selected_dir
|
cd $selected_dir
|
||||||
|
else
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
function fgit --description 'List forgit options with fzf'
|
function fgit --description 'List forgit options with fzf'
|
||||||
set selected_command (functions | grep -o 'forgit::[^ ]*' | cut -d ':' -f 2- | sed 's/^://' | fzf)
|
set selected_command (functions | rg -o 'forgit::[^ ]*' | cut -d ':' -f 2- | sd '^:' '' | fzf)
|
||||||
if [ -n "$selected_command" ]
|
if [ -n "$selected_command" ]
|
||||||
eval "forgit::$selected_command"
|
eval "forgit::$selected_command"
|
||||||
else
|
|
||||||
echo "Command selection canceled"
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
|
commandline -f repaint
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,18 +2,13 @@ function repos --description 'Open Git directories in ~/Repos with fzf in a new
|
||||||
set selected_category (echo -e "Personal\nClass\nWork\nCommunity" | fzf --prompt "Select category: ")
|
set selected_category (echo -e "Personal\nClass\nWork\nCommunity" | fzf --prompt "Select category: ")
|
||||||
|
|
||||||
if test -n "$selected_category"
|
if test -n "$selected_category"
|
||||||
set selected_dir (fd --type d --base-directory ~/Repos/"$selected_category"/ -H '^\.git$' | sed 's/\/\.git\/$//' | fzf)
|
set selected_dir (fd --type d --base-directory ~/Repos/"$selected_category"/ -H '^\.git$' -d 3 | sd '\.git/' '' | fzf)
|
||||||
|
|
||||||
if test -n "$selected_dir"
|
if test -n "$selected_dir"
|
||||||
set tab_title (basename "$selected_dir")
|
set tab_title (basename "$selected_dir")
|
||||||
set new_tab_cmd "kitty @ launch --type=tab --tab-title \"$tab_title\" ~/Repos/$selected_category/$selected_dir"
|
set new_tab_cmd "kitty @ launch --type=tab --tab-title \"$tab_title\" ~/Repos/$selected_category/$selected_dir"
|
||||||
eval $new_tab_cmd
|
eval $new_tab_cmd
|
||||||
else
|
|
||||||
echo "No directory selected"
|
|
||||||
return
|
|
||||||
end
|
|
||||||
else
|
|
||||||
echo "No category selected"
|
|
||||||
return
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
commandline -f repaint
|
||||||
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue