Skip to content

Commit

Permalink
rename install to configure
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickF1 committed Jun 3, 2021
1 parent 68c7f29 commit 2a5ad20
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion conf.d/fzf.fish
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function _fzf_uninstall --on-event fzf_uninstall

set --erase _fzf_search_vars_command
functions --erase _fzf_uninstall _fzf_migration_message
functions --erase _fzf_uninstall_keymap fzf_install_keymap fzf_conflictless_mnemonic_keymap fzf_simple_mnemonic_keymap
functions --erase _fzf_uninstall_keymap fzf_configure_keymap fzf_conflictless_mnemonic_keymap fzf_simple_mnemonic_keymap

set_color --italics cyan
echo "fzf.fish uninstalled"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function _fzf_install_keymap_help
echo 'fzf_install_keymap - installs a set of key bindings for fzf.fish.'
function _fzf_configure_keymap_help
echo 'fzf_configure_keymap - change the key bindings for fzf.fish.'
echo 'Usage:'
echo ' fzf_install_keymap --searchable_entity=key_sequence...'
echo ' fzf_configure_keymap --searchable_entity=key_sequence...'
echo 'Description:'
echo ' Key bindings must be specified as long options where the option name is an entity searchable by fzf.fish and the option value is a key sequence. Try fish_key_reader to generate key sequences.'
echo ' You do not have to specify key bindings for all entities. However, you must specify at least one.'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Supports overriding bindings set by pre-configured keymaps with appended user-specified bindings
# Supports overriding keymaps with appended user-specified bindings
# Always installs bindings for insert mode since for simplicity and b/c it has almost no side-effect
# https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1
function fzf_install_keymap --description "Install a set of key bindings for fzf.fish's functions using the specified key sequences."
function fzf_configure_keymap keymap --description "Change the key bindings for fzf.fish's functions to the specified key sequences."
if test (count $argv) -eq 0
_fzf_install_keymap_help
_fzf_configure_keymap_help
return
end

set options_spec h/help directory= git_log= git_status= history= variables=
argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null
if test $status -ne 0
_fzf_install_keymap_help
_fzf_configure_keymap_help
return 22
else if set --query _flag_h
_fzf_install_keymap_help
_fzf_configure_keymap_help
return
end

Expand Down
2 changes: 1 addition & 1 deletion functions/fzf_conflictless_mnemonic_keymap.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function fzf_conflictless_mnemonic_keymap --description "Install key bindings that are mnemonic and unlikely to override existing key bindings."
# \e = alt, \c = control
fzf_install_keymap \
fzf_configure_keymap \
--directory=\e\cf \
--git_log=\e\cl \
--git_status=\cs \
Expand Down
2 changes: 1 addition & 1 deletion functions/fzf_simple_mnemonic_keymap.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function fzf_simple_mnemonic_keymap --description "Install key bindings that are simple and mnemonic but may override existing key bindings."
# \c = control
fzf_install_keymap \
fzf_configure_keymap \
--directory=\cf \
--git_log=\cl \
--git_status=\cs \
Expand Down
2 changes: 2 additions & 0 deletions tests/configure_keymap/fails_if_pos_args.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fzf_configure_keymap --directory=\co positional_argument 2>/dev/null
@test "fails if provided positional argument" $status -ne 0
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
fzf_install_keymap --unknown=\cq 2>/dev/null
fzf_configure_keymap --unknown=\cq 2>/dev/null
@test "fails if passed unknown option" $status -ne 0
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function binding_contains_func --argument-names sequence function_name
string match --entire $function_name (bind $sequence) >/dev/null
end

fzf_install_keymap --directory=\ca --git_log=\cb --git_status=\cc --history=\cd --variables=\ce
fzf_configure_keymap --directory=\ca --git_log=\cb --git_status=\cc --history=\cd --variables=\ce

@test "installs the specified binding for directory" (binding_contains_func \ca __fzf_search_current_dir) $status -eq 0
@test "installs the specified binding for git log" (binding_contains_func \cb __fzf_search_git_log) $status -eq 0
Expand Down
2 changes: 2 additions & 0 deletions tests/configure_keymap/supports_partial_keymap.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fzf_configure_keymap --directory=\co && test -z (bind | string match --entire __fzf_search_history)
@test "allows not installing key bindings for all entities" $status -eq 0
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fzf_install_keymap --directory=\e\cp
fzf_configure_keymap --directory=\e\cp
fzf_simple_mnemonic_keymap
@test "new keymap should completely overwrite previous keymap" (bind \e\cp 2>/dev/null) $status -ne 0
2 changes: 0 additions & 2 deletions tests/install_keymap/fails_if_pos_args.fish

This file was deleted.

2 changes: 0 additions & 2 deletions tests/install_keymap/supports_partial_keymap.fish

This file was deleted.

0 comments on commit 2a5ad20

Please sign in to comment.