File tree Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Expand file tree Collapse file tree 3 files changed +24
-6
lines changed Original file line number Diff line number Diff line change 11# 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
33# line to abbr with --add or --erase depending on if it's during an install
44# 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
59
610# Quick edit access for Zephish plugin
711EZ 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 33 set -lx action $argv [1]
44 set -lx context (tint: 778899 [zephish/(status --current-filename )])
55
6- if not test $action = " install"
7- and not test $action = " uninstall"
6+ if not test $action = install
7+ and not test $action = uninstall
88 echo $context Invalid argument (bold: (tint: red $action )) passed to abbrs. Expects either (bold: (tint: cyan install)) or (bold: (tint: cyan uninstall))
99 exit 1
1010 end
1111
12+ echo " # Source from zephish/abbreviations" > ~/.config/fish/conf.d/abbreviations.fish
1213 while read -la line
1314 if test " $line [1]" = " #"
1415 or test -z " $line "
1516 continue
1617 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
1920 else
2021 abbr -e $line [1]
2122 end
2223 end < abbreviations
2324
24- end
25+ end
You can’t perform that action at this time.
0 commit comments