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

Truly cross platform : Nov 1st deadline #12

Merged
merged 5 commits into from Nov 25, 2018

Conversation

Projects
None yet
2 participants
@gagbo
Copy link
Contributor

gagbo commented Oct 31, 2018

Trying to follow the calendar here. Here's a more fleshed out version for the article.

All quotes are actually comments. @romainl I've put a small question for you in the middle : why still using the call to uname in setEnv() while vim has osx and osx_darwin features ? Are there cases where uname returns darwin but both has(osx) and has(osx_darwin) are false ?

gagbo added some commits Oct 31, 2018

truly-cross-platform : first serious draft
I tried to add all the things that I want to talk about in a mode
fleshed out way. Also added the "sources" in an additional folder for
archiving purpose, and for people who may be interested.
@romainl

This comment has been minimized.

Copy link
Contributor

romainl commented Nov 1, 2018

That snippet has been in my config in one form or another for a long time and, well… I actually didn't even know about osx.

Anyway, MacVim does honor both macunix and osx but /usr/bin/vim doesn't, so uname is basically the only safe way to determine that you are on a Mac. I don't have Mojave so this may have changed in the mean time.

@romainl

This comment has been minimized.

Copy link
Contributor

romainl commented Nov 1, 2018

About autoloading: since it doesn't change anything to the example at hand, mentioning it at that point would add unneeded complexity. FWIW, if that function is in a larger file with many functions, Vim will source the whole file, potentially slowing startup.

@romainl

This comment has been minimized.

Copy link
Contributor

romainl commented Nov 1, 2018

About host-specific stuff: it's pretty spot-on IMO but it would be better with a working example. Windows has a hostnamecommand, too, so this shouldn't be too difficult.

Also, you are mentioning "cluster", which is not exactly a common thing. Could you give your reader a bit of background? "I use Windows at work and Linux at home" is common but "I work on clusters" is fancy and sounds exciting.

truly-cross-platform : first corrections post 11/1
Question answered for has('osx') and has('osx_darwin')

Host specific settings fleshed out :
- What is a cluster ?
- What is my use case ?
- Snippets with security-aware alternatives
@gagbo

This comment has been minimized.

Copy link
Contributor Author

gagbo commented Nov 4, 2018

I agree on most of this stuff, so I made a few corrections :

  • I basically linked the comment on macunix and osx here, stating that it may not work as you'd want it to.
  • Removed autoloading in functions
  • Explained what I do, and how the need for 'Host specific settings' arised in my work. I used the occasion to present one way to hide hostnames (or possibly other information) from your version controlled files if they happen to be public.

@romainl romainl merged commit 2e1a177 into vim-advent-calendar:master Nov 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment