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

Basic Zsh auto-completion for --options #440

Merged
merged 1 commit into from
Jan 19, 2016
Merged

Basic Zsh auto-completion for --options #440

merged 1 commit into from
Jan 19, 2016

Conversation

SethBarberee
Copy link
Contributor

Hi, I've created at least a skeleton of zsh completion files for the sway, swaymsg, and swaygrab. Currently, it is only for --options but I will work on the other commands unless you say otherwise.
I'm sorry if it is a mess because it is my first time submitting a pull request to anything.

@mikkeloscar
Copy link
Collaborator

I think this is good, but maybe rename the files to something like completion.zsh or swaymsg-completion.zsh etc.

Also please use tabs for indentation, right now you use a mix of tabs and spaces :)

@SethBarberee
Copy link
Contributor Author

I'll make sure to do that. The only thing that isn't in my request but should be is an update to cmake to install those files to the appropriate directory for zsh completions. I didn't do that because I did not how to code cmake.

On Jan 8, 2016, at 4:38 PM, Mikkel Oscar Lyderik notifications@github.com wrote:

I think this is good, but maybe rename the files to something like completion.zsh or swaymsg-completion.zsh etc.

Also please use tabs for indentation, right now you use a mix of tabs and spaces :)


Reply to this email directly or view it on GitHub.

@mikkeloscar
Copy link
Collaborator

It's pretty much done like this: https://github.com/SirCmpwn/sway/blob/master/CMakeLists.txt#L121

@SethBarberee
Copy link
Contributor Author

Could this work for the cmake file? They will be placed with this cmake file in a directory called completions. However, the problem with suffixing them with .zsh screws up the autoloading feature because it has to be prefixed with an underscore such as _(command) for each completion file. If I am wrong, then please tell me!
https://gist.github.com/SethBarberee/7c833c963d06d1f4c778

@ddevault
Copy link
Contributor

That should work. Make it optional, though.

@crondog
Copy link
Contributor

crondog commented Jan 11, 2016

Shouldn't the directory be share/zsh/site-functions as that is where third party completions go

@SethBarberee
Copy link
Contributor Author

I debated this on the sway IRC was told that it was share/zsh/Completions/ but I do agree with you, crondog. I too think it should be share/zsh/site-functions.

Sent from my iPhone

On Jan 11, 2016, at 5:11 PM, crondog notifications@github.com wrote:

Shouldn't the directory be share/zsh/site-functions as that is where third party completions go


Reply to this email directly or view it on GitHub.

@mikkeloscar
Copy link
Collaborator

@SethBarberee share/zsh/site-functions is the correct path as mentioned by @crondog.

Could you also move the files to completions/zsh then it will be possible to add bash completions if anyone want that at some point.

Other than that it looks good.

@SethBarberee
Copy link
Contributor Author

Will do :)

Sent from my iPhone

On Jan 11, 2016, at 5:19 PM, Mikkel Oscar Lyderik notifications@github.com wrote:

@SethBarberee share/zsh/site-functions is the correct path as mentioned by @crondog.

Could you also move the files to completions/zsh then it will be possible to add bash completions if anyone want that at some point.

Other than that it looks good.


Reply to this email directly or view it on GitHub.

@ddevault
Copy link
Contributor

Can you squash all of this when you're done?

@SethBarberee
Copy link
Contributor Author

I tried to squash them but to no avail... I'm sorry if i'm causing a lot of trouble. I'm still new to Git and I will try to fix the problems before I try to actually make the pull request. If I did somehow fix it then maybe there is hope..

@SethBarberee
Copy link
Contributor Author

It says 9 days ago so I guess I squashed it? Idk

@SethBarberee SethBarberee reopened this Jan 12, 2016
@ddevault
Copy link
Contributor

Do this:

git rebase -i HEAD~18

Double check that you have all the right commits here, then replace "pick" with "squash" for all but the first commit, then save and close the file and enter a single commit message for this whole change. Then:

git push -f

@ddevault
Copy link
Contributor

Whoops, you got one commit too many in the squash. This can't be merged like that. Can you just grab the relevant files and make a new commit on a new branch and open a new pull request?

@SethBarberee
Copy link
Contributor Author

Yeah, I've been busy all week and forgot to do that. Thx!

Sent from my iPhone

On Jan 17, 2016, at 11:39 AM, Drew DeVault notifications@github.com wrote:

Whoops, you got one commit too many in the squash. This can't be merged like that. Can you just grab the relevant files and make a new commit on a new branch and open a new pull request?


Reply to this email directly or view it on GitHub.

@SethBarberee
Copy link
Contributor Author

So I force-pushed this so now it's one commit. This should work now, I hope.

@ddevault
Copy link
Contributor

Looks great. Nice work!

ddevault added a commit that referenced this pull request Jan 19, 2016
Basic Zsh auto-completion for --options
@ddevault ddevault merged commit a6b1998 into swaywm:master Jan 19, 2016
@SethBarberee SethBarberee deleted the zsh-completions branch January 20, 2016 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants