File tree 3 files changed +24
-6
lines changed
3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 1
1
# This file contains all the custom fish abbreviations that I enable.
2
- # The helpers/abbbrs .fish script reads it in and passes each non-comment
2
+ # The helpers/abbrs .fish script reads it in and passes each non-comment
3
3
# line to abbr with --add or --erase depending on if it's during an install
4
4
# or uninstall
5
+ #
6
+ # Due to a change in 3.6.0 I can't used run abbr --add directly, instead the
7
+ # abbreviations are written to ~/.config/fish/conf.d/abbreviations.fish which will
8
+ # be loaded on shell start
5
9
6
10
# Quick edit access for Zephish plugin
7
11
EZ code ~/.local/share/omf/pkg/zephish
Original file line number Diff line number Diff line change
1
+ # See https://unix.stackexchange.com/questions/631733/how-to-write-a-command-to-history-in-fish-shell
2
+ function add_history_entry --description " Adds a command to the shell history"
3
+ begin
4
+ # brew install flock
5
+ flock 1
6
+ and echo -- ' - cmd:' (
7
+ string replace -- \n \\ n (string join ' ' $argv ) | string replace \\ \\\\
8
+ )
9
+ and date +' when: %s'
10
+ end >> $_ _fish_user_data_dir/fish_history
11
+ and history merge
12
+ atuin history start $argv > /dev/null
13
+ end
Original file line number Diff line number Diff line change 3
3
set -lx action $argv [1]
4
4
set -lx context (tint: 778899 [zephish/(status --current-filename )])
5
5
6
- if not test $action = " install"
7
- and not test $action = " uninstall"
6
+ if not test $action = install
7
+ and not test $action = uninstall
8
8
echo $context Invalid argument (bold: (tint: red $action )) passed to abbrs. Expects either (bold: (tint: cyan install)) or (bold: (tint: cyan uninstall))
9
9
exit 1
10
10
end
11
11
12
+ echo " # Source from zephish/abbreviations" > ~/.config/fish/conf.d/abbreviations.fish
12
13
while read -la line
13
14
if test " $line [1]" = " #"
14
15
or test -z " $line "
15
16
continue
16
17
end
17
- if test $action = " install"
18
- abbr -a $line
18
+ if test $action = install
19
+ echo " abbr -a $line " >> ~/.config/fish/conf.d/abbreviations.fish
19
20
else
20
21
abbr -e $line [1]
21
22
end
22
23
end < abbreviations
23
24
24
- end
25
+ end
You can’t perform that action at this time.
0 commit comments