Skip to content

Conversation

@bronzehedwick
Copy link
Contributor

A simple change to support neovim. Fixes #774.

@ghost
Copy link

ghost commented May 11, 2015

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.

@ghost ghost mentioned this pull request May 11, 2015
@bronzehedwick
Copy link
Contributor Author

I'm a little confused; is there a way to have all the functionality inside .nvimrc with only the .nvim directory?

@ghost
Copy link

ghost commented May 13, 2015

It is possible in vim (with just a .vim dir) , before the neovim fork happened. So it is very likely possible in neovim also.

@bronzehedwick
Copy link
Contributor Author

Oh cool, I'll look into that and check back with another PR.

@ghost
Copy link

ghost commented May 13, 2015

@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.

@bronzehedwick
Copy link
Contributor Author

@jrobeson ok, gotcha. I still want to investigate it, and see how it works.

@bronzehedwick bronzehedwick reopened this May 20, 2015
@bronzehedwick
Copy link
Contributor Author

Re-opening to make changes.

@bronzehedwick
Copy link
Contributor Author

@jrobeson Finally got around to investing, and after a little trial and error I got the nvimrc file to work inside the .nvim directory. I like the cleanliness of this approach. Thanks for the suggestion!

@spf13
Copy link
Owner

spf13 commented May 21, 2015

@jrobeson I'll let you review and merge this one. It looks good to me.

@bronzehedwick
Copy link
Contributor Author

@jrobeson any word on merging this?

@ghost
Copy link

ghost commented May 31, 2015

shouldn't we check if nvim exists before creating potentially unnecessary files? We should probably do the same for vim too.

@ghost
Copy link

ghost commented Jun 1, 2015

btw: neovim is going to support xdg at some point soon, so we'll have to adjust for that later: neovim/neovim#78

@bronzehedwick
Copy link
Contributor Author

Good point; I wrapped the linking in a check for neovim

bootstrap.sh Outdated
Copy link

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neovim implements it.

Copy link

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

endif

Copy link

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().

Copy link

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.sh

Copy link
Contributor Author

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.

@bronzehedwick
Copy link
Contributor Author

I updated the code to fix the issue of using has('nvim').

@bronzehedwick
Copy link
Contributor Author

@jrobeson any chance of getting this merged? Does the PR still need work?

@ghost
Copy link

ghost commented Jul 27, 2015

thanks @mkwmms ! I wouldn't have noticed that line 39 issue!

@mwilliammyers
Copy link

@jrobeson no problem!

@bronzehedwick
Copy link
Contributor Author

Ack, what was I thinking! Thanks for the catch @mkwmms. The code should be corrected now.

@spf13
Copy link
Owner

spf13 commented Aug 3, 2015

@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?

Copy link

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?

Copy link
Contributor Author

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.

Copy link

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

Copy link
Contributor Author

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.

@mwilliammyers
Copy link

Should I go ahead and wait for these changes and then incorporate them into #814 ?

@ghost
Copy link

ghost commented Aug 11, 2015

I don't see a reason to wait.

@bronzehedwick
Copy link
Contributor Author

@jrobeson I refactored the naming of the functions and generalized the functionality of what was nvim_exists.

@bronzehedwick
Copy link
Contributor Author

@jrobeson have you by chance had a moment to review this?

@ghost
Copy link

ghost commented Aug 27, 2015

@mkwmms : what do you think? I'm questioning my own decisions after missing that exit :(

bootstrap.sh Outdated

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, makes sense!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

@mwilliammyers
Copy link

@jrobeson haha it's all good, happens to all of us. For the most part 👍, just some minor things...

@mwilliammyers
Copy link

@bronzehedwick nice work, this will be very handy for all of us who like a more modern vim 😄

@bronzehedwick
Copy link
Contributor Author

😆
On Sun, Aug 30, 2015 at 7:46 PM william notifications@github.com wrote:

@bronzehedwick https://github.com/bronzehedwick nice work, this will be
very handy for all of us who like a more modern vim [image: 😄]


Reply to this email directly or view it on GitHub
#777 (comment).

@ghost
Copy link

ghost commented Aug 31, 2015

now it just needs squash/rebase and it will be good to go.

@bronzehedwick
Copy link
Contributor Author

Done and done.

@ghost
Copy link

ghost commented Aug 31, 2015

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.
@bronzehedwick
Copy link
Contributor Author

@jrobeson Oops, didn't force push. Should be fixed now :)

ghost pushed a commit that referenced this pull request Sep 2, 2015
Preliminary support for neovim
@ghost ghost merged commit 748e494 into spf13:3.0 Sep 2, 2015
@ghost
Copy link

ghost commented Oct 26, 2015

@bronzehedwick : this needs to be redone now. XDG support has been merged into neovim

@ghost
Copy link

ghost commented Oct 26, 2015

neovim/neovim@1ca5646

@ghost ghost mentioned this pull request Oct 26, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Neovim support

3 participants