Last active
November 11, 2019 12:59
-
-
Save ttscoff/139255fcdd31e88123385ef75e27cfea to your computer and use it in GitHub Desktop.
Fish functions with commandline tricks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Defined in /Users/ttscoff/.config/fish/functions/__prev_token.fish @ line 1 | |
function __prev_token -d "repeats last token on the command line" | |
set -l buffer (commandline -bo) | |
commandline -a " "$buffer[-1] | |
commandline -f end-of-line | |
end | |
# Defined in /Users/ttscoff/.config/fish/functions/__re_extension.fish @ line 1 | |
function __re_extension --description 'remove extension from word under/before cursor' | |
commandline -f forward-word | |
commandline -f backward-word | |
set -l token (commandline -t) | |
set token (echo "$token" | sed -E 's/\.[^.]*\.?$/./') | |
commandline -t "" | |
commandline -i $token | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment