-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Preliminary support for neovim #777
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
Conversation
|
for neovim can be break with tradition and rely on the presence of the .nvim directory only? and not create a .nvimrc ? I wanted to do that for regular vim, but @spf13 wanted to keep up with what is expected of vim, even though vim works fine with only a .vim directory. |
|
I'm a little confused; is there a way to have all the functionality inside |
|
It is possible in vim (with just a .vim dir) , before the neovim fork happened. So it is very likely possible in neovim also. |
|
Oh cool, I'll look into that and check back with another PR. |
|
@bronzehedwick : i did ask spf13 about relying on that for vim itself, but he thought that too many people were used to having a .vimrc and wouldn't complain if it didn't exist. It's up to you if you think we should be concerned about that for neovim. |
|
@jrobeson ok, gotcha. I still want to investigate it, and see how it works. |
|
Re-opening to make changes. |
|
@jrobeson Finally got around to investing, and after a little trial and error I got the |
|
@jrobeson I'll let you review and merge this one. It looks good to me. |
|
@jrobeson any word on merging this? |
|
shouldn't we check if nvim exists before creating potentially unnecessary files? We should probably do the same for vim too. |
|
btw: neovim is going to support xdg at some point soon, so we'll have to adjust for that later: neovim/neovim#78 |
|
Good point; I wrapped the linking in a check for neovim |
bootstrap.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does has() come from? This doesn't look valid in a shell script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neovim implements it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neovim might implement it, but vimscript doesn't work inside bootstrap.sh
a shell script if looks more like
if [ "$1" -eq '1' ]; then
endifThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like your approach (with has('nvim') would only install the nvim symlinks if we were running nvim, but not if we had nvim installed, but were executing it with vim.
It should check for nvim in the $PATH via type or which. We currently use type in program_exists().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still like to use has('nvim') in combination with an environment variable to specify that nvim is your only vim, but not as the default.
Something like
ONLY_NVIM=1 bootstrap.shThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, of course. I'll refactor this into an actual shell script if.
|
I updated the code to fix the issue of using |
|
@jrobeson any chance of getting this merged? Does the PR still need work? |
|
thanks @mkwmms ! I wouldn't have noticed that line 39 issue! |
|
@jrobeson no problem! |
|
Ack, what was I thinking! Thanks for the catch @mkwmms. The code should be corrected now. |
|
@jrobeson You're much more familiar with this than I am. It all LGTM. Can you merge when you feel it's in a good place? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't we using program_exists here? is that not good enough somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @mkwmms mentioned, program_exists will exit the script if neovim is not found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, yeah that was it. I must have been barely awake when I made that comment. I think I'd like to see program_exists renamed to something that indicates it's a fatal error, and then use program_exists for what you're doing with nvim_exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, sounds good. I'll refactor to that.
|
Should I go ahead and wait for these changes and then incorporate them into #814 ? |
|
I don't see a reason to wait. |
|
@jrobeson I refactored the naming of the functions and generalized the functionality of what was |
|
@jrobeson have you by chance had a moment to review this? |
|
@mkwmms : what do you think? I'm questioning my own decisions after missing that exit :( |
bootstrap.sh
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would make this: if [ "$ret" -ne 0 ]; then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
|
@jrobeson haha it's all good, happens to all of us. For the most part 👍, just some minor things... |
|
@bronzehedwick nice work, this will be very handy for all of us who like a more modern vim 😄 |
|
😆
|
|
now it just needs squash/rebase and it will be good to go. |
|
Done and done. |
|
i still see 9 commits ? |
A simple change to support neovim. Fixes spf13#774. Move nvimrc file inside .nvim directory Only install neovim support if neovim is being used Use program_exists function instead of vimscript Made a hasty mistake and added vimscript to a bash script :X Neovim not existing no longer stops script Also correct `endif` to `fi`. Refactor program_exists naming Changed `program_exists` to `program_must_exist`, which throws an error which halts the script if the program is not found, and refactored `nvim_exists` to be the more general `program_exists`, which does not throw an error if the program is not found. Refactor program_exists and program_must_exist `program_must_exist` uses `program_exists` now, instead of repeating code. Changed `type` to `command -v` in `program_exists` to be more POSIX compliant. Refactored status code conditional in `program_exists` to remove double negatives. Thanks to @mkwmms for the suggestions. Preliminary support for neovim A simple change to support neovim. Fixes spf13#774. Move nvimrc file inside .nvim directory Refactor program_exists naming Changed `program_exists` to `program_must_exist`, which throws an error which halts the script if the program is not found, and refactored `nvim_exists` to be the more general `program_exists`, which does not throw an error if the program is not found. Refactor program_exists and program_must_exist `program_must_exist` uses `program_exists` now, instead of repeating code. Changed `type` to `command -v` in `program_exists` to be more POSIX compliant. Refactored status code conditional in `program_exists` to remove double negatives. Thanks to @mkwmms for the suggestions.
6d80007 to
9f78da8
Compare
|
@jrobeson Oops, didn't force push. Should be fixed now :) |
|
@bronzehedwick : this needs to be redone now. XDG support has been merged into neovim |
A simple change to support neovim. Fixes #774.