AutoYADM commit: 2025-07-01 18:16:22
This commit is contained in:
parent
4164b067b4
commit
b292153f3e
1 changed files with 4 additions and 40 deletions
|
@ -1,51 +1,15 @@
|
|||
# arrow keys for completions
|
||||
|
||||
declare-option -hidden str completions_status 'completions-off'
|
||||
define-command -hidden completions-off fail
|
||||
define-command -hidden completions-on nop
|
||||
define-command -hidden completions-up nop
|
||||
define-command -hidden completions-down fail
|
||||
|
||||
hook global InsertCompletionShow .* %{
|
||||
set-option window completions_status 'completions-on'
|
||||
map window insert <down> <c-n>
|
||||
map window insert <up> <c-p>
|
||||
}
|
||||
|
||||
hook global InsertCompletionHide .* %{
|
||||
set-option window completions_status 'completions-off'
|
||||
unmap window insert <up>
|
||||
unmap window insert <down>
|
||||
}
|
||||
|
||||
define-command -hidden assert-completions %{
|
||||
%opt{completions_status}
|
||||
}
|
||||
|
||||
# arg: "completions-up" or "completions-down"
|
||||
define-command -hidden -params 1 move-or-complete %{
|
||||
try %{
|
||||
# completions are visible
|
||||
%opt{completions_status}
|
||||
try %{
|
||||
# up
|
||||
%arg{1}
|
||||
execute-keys <c-p>
|
||||
} catch %{
|
||||
# down
|
||||
execute-keys <c-n>
|
||||
}
|
||||
} catch %{
|
||||
# completions are not visible
|
||||
try %{
|
||||
# up
|
||||
%arg{1}
|
||||
execute-keys <up>
|
||||
} catch %{
|
||||
execute-keys <down>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
map global insert <down> '<a-;>: move-or-complete completions-down<ret>'
|
||||
map global insert <up> '<a-;>: move-or-complete completions-up<ret>'
|
||||
|
||||
map global insert <c-m> <home>
|
||||
map global insert <a-m> <home>
|
||||
map global insert <c-i> <end>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue