diff --git a/.config/fish/functions/cw.fish b/.config/fish/functions/cw.fish new file mode 100644 index 0000000..61d4dfc --- /dev/null +++ b/.config/fish/functions/cw.fish @@ -0,0 +1,5 @@ +function cw + set -l wpath (wslpath -a -w (readlink -f "$argv[1]")) + echo Copied \"$wpath\" to clipboard + echo -n $wpath | clip.exe +end diff --git a/.config/fish/functions/w2u.fish b/.config/fish/functions/w2u.fish new file mode 100644 index 0000000..42a2c69 --- /dev/null +++ b/.config/fish/functions/w2u.fish @@ -0,0 +1,5 @@ +function w2u + set -l wpath (wslpath "$argv[1]") + echo Copied \"$wpath\" to clipboard + echo -n "$wpath" | clip.exe +end diff --git a/.config/fish/marks.fish b/.config/fish/marks.fish index 1317105..ff83a7a 100644 --- a/.config/fish/marks.fish +++ b/.config/fish/marks.fish @@ -73,7 +73,7 @@ function bookmark --description "Bookmark files and directories in fish" echo "$bname $bpath" >> $BMS_FILE set -l ftype ([ -d $bname ] && echo "file" || echo "directory") echo "Bookmark '$bname' added for $ftype $bpath" - __bookmarks_update_completions + # __bookmarks_update_completions case "remove" if [ (count $argv) -lt 2 ] @@ -99,20 +99,6 @@ function bookmark --description "Bookmark files and directories in fish" end -function _valid_bookmark - if begin; [ (count $argv) -lt 1 ]; or not [ -n $argv[1] ]; end - return 1 - else - cat $BMS_FILE | grep "^export DIR_" | sed "s/^export /set -x /" | sed "s/=/ /" | . - set -l bookmark (env | grep "^DIR_$argv[1]=" | cut -f1 -d "=" | cut -f2 -d "_" ) - if begin; not [ -n "$bookmark" ]; or not [ $bookmark=$argv[1] ]; end - return 1 - else - return 0 - end - end -end - function __bookmarks_opener --description "Default opener" set -l f "$argv[1]" switch (file --mime-type -b "$f")