Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Pisces Compatible with Fisher 4 #26

Merged
merged 7 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ set -U pisces_only_insert_at_eol 1

* Using [Fisher](https://github.com/jorgebucaran/fisher):
```fish
fisher add laughedelic/pisces
fisher install laughedelic/pisces
```

* Using [oh-my-fish](https://github.com/oh-my-fish/oh-my-fish):
Expand Down
43 changes: 43 additions & 0 deletions conf.d/pisces_key_bindings.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
set -l _pisces_bind_mode default
switch $fish_key_bindings
case 'fish_vi_key_bindings' 'fish_hybrid_key_bindings'
set _pisces_bind_mode insert
end

set -q pisces_pairs
or set -U pisces_pairs '(,)' '[,]' '{,}' '","' "','"

for pair in $pisces_pairs
_pisces_bind_pair $_pisces_bind_mode (string split -- ',' $pair)
end

# normal backspace, also known as \010 or ^H:
bind -M $_pisces_bind_mode \b _pisces_backspace
# Terminal.app sends DEL code on ⌫:
bind -M $_pisces_bind_mode \177 _pisces_backspace

# overrides TAB to provide completion of vars before a closing '"'
bind -M $_pisces_bind_mode \t _pisces_complete


set -l uninstall_event (basename (status -f) .fish)_uninstall
nickeb96 marked this conversation as resolved.
Show resolved Hide resolved
function $uninstall_event --on-event $uninstall_event
# NOTE: won't work as expected if user has changed the mode after installation
set -l _pisces_bind_mode default
switch $fish_key_bindings
case 'fish_vi_key_bindings' 'fish_hybrid_key_bindings'
set _pisces_bind_mode insert
end

for pair in $pisces_pairs
for c in (string split -- ',' $pair)
bind -e -M $_pisces_bind_mode $c
end
end

bind -M $_pisces_bind_mode \b backward-delete-char
bind -M $_pisces_bind_mode \177 backward-delete-char
bind -M $_pisces_bind_mode \t complete

set -e pisces_pairs
end
20 changes: 0 additions & 20 deletions key_bindings.fish

This file was deleted.

18 changes: 0 additions & 18 deletions uninstall.fish

This file was deleted.