Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VimuxPromptCommand should support completion #169

Open
hupfdule opened this issue Feb 18, 2019 · 4 comments
Open

VimuxPromptCommand should support completion #169

hupfdule opened this issue Feb 18, 2019 · 4 comments

Comments

@hupfdule
Copy link

It would be the best if Vimux would utilize the completion features of the users shell.
I expect that this is not easy / impossible inside vim, but since Vimux integrates with tmux it could be done by actually using a tmux pane for entering the command (which then supports the completion features of the users shell) and remember that command to be used for VimuxRunLastCommand.

@shushcat
Copy link

As you can see at #142---and in case anyone else comes across this issue while waiting for repository ownership to settle, as I did---all you need to do is add an argument to the input function, so that its invocation reads let l:command = input(_VimuxOption("g:VimuxPromptString", "Command? "), command, 'shellcmd'). Notwithstanding @madchap's comment on that issue, this fix does not seem to interfere with calls to VimuxRunLastCommand.

@alerque
Copy link
Member

alerque commented Feb 13, 2021

Fixed in #142, thanks to @thalesmello for the contribution.

@hupfdule
Copy link
Author

I leave this issue closed, as it seems that other people are fine with the current solution.

But in fact this is not fully what I meant when writing this issue. I was a bit unclear in the description of my expectations. In fact I do not only want the actual command to be autocompleted, but (and that is way more important to me) the arguments to the command. Most of the time I have to add some file path to a command. That one is hard to remember and easy to mistype. Every shell has the functionality to expand file paths. Or a command has a lot of different options I can't easily remember. Most shells have a feature for autocompleting options to specific commands (bashcompl for example). That is also very handy. In fact that is way more important than the command which is most of the time an easy to remember and easy to type short string.

@alerque
Copy link
Member

alerque commented Feb 15, 2021

@hupfdule I see what you are saying now, but I think it is out of scope for this plugin to try to invent an entire completion system, even if it is some kind of pass through to a shell.

On the other hand we could easily change the completion mechanism to any provider. The shellcmd provide is a VIM builtin, but it is possible to write your own completion provider function and have it do anything you want. See :help command-completion for some info including how to write custom functions.

I'd be happy to adapt the input field to use a configuration preference instead of hard coding shellcmd so that you can use any completion provider you wish. There are lots of them out there and presumably one is out there somewhere that mimics shell completions.

@alerque alerque reopened this Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants