AutoYADM commit: 2025-07-01 18:01:06
This commit is contained in:
parent
0b5efac511
commit
4164b067b4
1 changed files with 47 additions and 2 deletions
|
@ -1,5 +1,50 @@
|
||||||
map global insert <down> <c-n>
|
# arrow keys for completions
|
||||||
map global insert <up> <c-p>
|
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
|
||||||
|
hook global InsertCompletionHide .* %{
|
||||||
|
set-option window completions_status 'completions-off'
|
||||||
|
}
|
||||||
|
|
||||||
|
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 <c-m> <home>
|
||||||
map global insert <a-m> <home>
|
map global insert <a-m> <home>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue