home-environments: radio: Make @git-root fish-abbreviation more general
parent
fdfdd898ae
commit
e62b83b75c
|
@ -2,6 +2,11 @@ function code-projects
|
||||||
string replace '@' '~/projects/code/' $argv[1]
|
string replace '@' '~/projects/code/' $argv[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function git-root
|
||||||
|
set -l result (git root 2>/dev/null) && \
|
||||||
|
echo $result || echo ""
|
||||||
|
end
|
||||||
|
|
||||||
function bookmarks
|
function bookmarks
|
||||||
$EDITOR (string replace ':' '~/resources/bookmarks/' $argv[1])
|
$EDITOR (string replace ':' '~/resources/bookmarks/' $argv[1])
|
||||||
end
|
end
|
||||||
|
@ -36,7 +41,7 @@ end
|
||||||
|
|
||||||
function bang-bang-k
|
function bang-bang-k
|
||||||
set -l k (string replace '!!:' '' $argv[1])
|
set -l k (string replace '!!:' '' $argv[1])
|
||||||
set -l arr $history[1]
|
set -l arr (string replace -ra ' ' '\n' $history[1])
|
||||||
echo $arr[$k]
|
echo $arr[$k]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,10 @@
|
||||||
(expansion "~/resources/bookmarks"))
|
(expansion "~/resources/bookmarks"))
|
||||||
(abbreviation
|
(abbreviation
|
||||||
(name "@git-root")
|
(name "@git-root")
|
||||||
(expansion "cd (git root)"))
|
(pattern "@git-root")
|
||||||
|
(position 'anywhere)
|
||||||
|
(expansion
|
||||||
|
(fish-function "git-root")))
|
||||||
|
|
||||||
#|Quick edit|#
|
#|Quick edit|#
|
||||||
(abbreviation
|
(abbreviation
|
||||||
|
|
Loading…
Reference in New Issue