开发者

Custom autocompletion for zsh

开发者 https://www.devze.com 2023-03-30 16:14 出处:网络
ZSH has builtin autocompletion for scp, so a command like scp 开发者_如何学Cuser@host/path/ would show directory listings on the remote server.

ZSH has builtin autocompletion for scp, so a command like

scp 开发者_如何学Cuser@host/path/

would show directory listings on the remote server.

However, this does not work when opening a remote file in vim

vim scp://user@host/path/

I have googled around for documentation on the zsh autocomplete functions but it seems very complicated. How can I enable autocomplete for vim scp?


Complete autocompletion documentation is located in man zshall (if you don't want to view all sections in one man, see index in man zsh). Completion for vim is located in /usr/share/zsh/$ZSH_VERSION/functions/Completion/Unix/_vim, I guess you need to modify _vim_files function located at the top of the file and somehow export function _remote_files located in the /usr/share/zsh/$ZSH_VERSION/functions/Completion/Unix/_ssh.

0

精彩评论

暂无评论...
验证码 换一张
取 消