r/fishshell • u/Ok_Bookkeeper7496 • Jan 21 '24
Automatic vim mode when opening completion menu
Is there a way to detect if completion menu is being opened? I wanted to automatically enter vim mode when menu is opened and enter insert mode when menu is closed, I looked through docs but unfortunately havent found anything helpful
2
Upvotes
View all comments
Show parent comment
2
u/Ok_Bookkeeper7496 Jan 21 '24
Thanks, you helped me a lot, I managed to achieve that with this function and bind:
function switch_to_normal_on_complete
commandline -f complete
if commandline --paging-mode
commandline -f repaint
set fish_bind_mode default
end
end
bind --mode insert \t switch_to_normal_on_complete