Call bash function using vim external command

后端 未结 4 1966
既然无缘
既然无缘 2021-01-13 22:00

I use vim\'s :! external command function all the time, usually providing % as an argument to the shell command. For example :

:!psql -f %

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-13 22:27

    The accepted answer didn't work for me. I'm going to go with setting shcf, as suggested elsewhere:

    :set shcf=-ic
    

    but another solutions is

    !source ~/.bashrc && psql ...
    

    Unfortunately, no solution allows the auto-completion for the command I'm creating to work properly. (The auto_completions suggested are for names of files in my current directory, rather than the ones I specified as follows in .bashrc

    complete -F _generate_foo_completions foo
    

提交回复
热议问题