SpaceVim – Like Spacemacs, but for Vim
spacevim.org
spacevim.org
Is it a vim plus a bundle of plugins?
EDIT: Cleaned up the spacemacs sentence.
Spacemacs is the same for Emacs.
In both Spacemacs and Spacevim, all that's being provided is a config. No runtime, no package manager, no changes to the actual binaries of either app.
It's hyperbole.
Using and customizing SpaceMacs is considerably different from using plain emacs.
They use their own config system, their own plugin system (aka layers), and the user experience is very different, right from the start.
Of course it's emacs underneath, and you can still do much as with plain emacs, but it's different enough for it to be more than "just a config for emacs".
In emacs, thanks to Elisp, you can't really distinguish between a config and a plugin, because most 'configs' use actual code to (often extensively) alter the editors behaviour.
You can still install Melpa packages quite easily and you can still bind keys however you want. It's still Emacs.
I can only guess at the reason why Spacemacs team chooses this term, but there is one simple problem with it.
Users of Spacemacs are encouraged (by this naming quirk) to treat it as somehow essentially different to Emacs. That's wrong.
It would be of benefit to all for the code that comprises Spacemacs (layers mainly) to be released as packages. It would place greater emphasis on Emacs as the actual core product, and allow people to use and collaborate on smaller chunks of Spacemacs, without the monolith problem.
Can found more explanations on reddit for the bravest :-)
> No runtime,
Spacemacs loads your config (very fast I might add), adds a nice startup screen, gathers statistics about your config etc.
> no package manager
It also bundles use-package - which is a package manager. And makes bootstrapping emacs on a new machine trivial.
> no changes to the actual binaries of either app
Remember this is emacs. You don't need to rewrite any part of it, you can change anything with advices/hooks, and it is actually easier to do than patching some random packages.
They explain it plainly.
> SpaceVim is a distribution, a bundle of custom settings and plugins, for Vim. It got inspired by spacemacs.
It's hyperbolic to suggest there's a real issue here
Emacs is a living, self-documenting environment and Spacemacs extends it quite a lot. This Lisp environment is very different from a set of plugins developed offline or mere configurations.
Calling Spacemacs a bunch of plugins and configuration is like calling any conventional program a plugin of its language and runtime. Plugins attach to an environment with a specific runtime API, instead of extending said API, blurring the line between runtime and extension in the process.
This page is not emacs. This page is just a bunch of neovim plugins, as OP surmised.
If it was simple, there'd be an answer to this question: how do I setup Vim/Emacs as a fully feature complete IDE for C, C++, Rust, Go, Java, JavaScript (Node or Web), C#?
By feature complete I mean autocomplete, error detection, built in one-button-runs, automatic config/sane defaults.
Keep in mind this is a dream list. It's perfectly fine if the list only includes 2-4 of these languages but it needs to have all of these features.
Looking at this from the outside (people who use IDEs) in (onto the people who use Vim/Emacs) we have maybe 1 IDE/Language and that's confusing for us. I can't imaginge having 3 text editors all of which have different common dotfiles.
That's the promise of Spacemacs:
- clone their git repository into your .emacs.d directory
- run emacs once, answer three basic questions about your preferences
- add your list of languages to the "dotspacemacs-configuration-layers" list in your .spacemacs
- I even looked up the syntax for you: "c-c++ rust go java javascript csharp"
- make it reload the configYou're done. All this should take less time than it took me to look up those "layer" names in the docs.
> By feature complete I mean autocomplete, error detection, built in one-button-runs, automatic config/sane defaults.
Yes, all that is the promise of Spacemacs.
If anything, I found it to be too much of a kitchen sink (it tries too hard to be "smart" about balancing parentheses for me etc.). Still, you might want to give it a whirl if you have 15 minutes. I ended up going back to vim for almost everything, and I'm on the line on whether to use Proof General from plain Emacs or from Spacemacs. But the time to check it out is not wasted.
How do you create a project in spacemacs? Is there a simple text-based UI for it?
if you're talking "project" in the Atom / Sublime / Eclipse sense of the word then a "project" is just a folder. If that's what you mean by "project" then yes, you can create folders in a text-based ui, and you've been able to do so since the dawn of unix, and basically every editor out there has an easy way to either create a folder with some clicks or enable direct access to the underlying shell to create one.
> By feature complete I mean autocomplete, error detection, built in one-button-runs, automatic config/sane defaults.
By and large, I find features like these distracting to the point of unusability, which is why I like living in stripped-down editor land. Different strokes for different folks.
That said, I think many would agree that for C/C++ YouCompleteMe is a must-have. It has ctags functionality (but without false positives), error detection, autocomplete... And probably lots of other features I'm ignorant of.
There is a semi-official vim plugin for go. I used to use it when I was playing with this language. Same for Rust. I don't know about other languages you've mentioned.
As for the "distributions". I prefer to configure everything myself, but I get it that others might want everything preconfigured for them.
PS. Yes, I'd agree that vim has insane defaults. All vim config files I saw have a common part, I think.
I think if one really want's to pick up vim (or emacs) you have to set aside the IDE part of your brain. For example, I still use an ide for java, but I use vanilla vim with no plugins for frontend (html, css, javascript, ember cli). There it's a text editor and that's all I need. Plain vim actually has A LOT of functionality. If one learns the vim way, they might find they don't need nearly as many plugins.
But I admit it would be nice if the vim project shipped a sane default setup that was aimed at the average programmer.
IntellJ becomes a hob-cobbled mess of half complete plugins if you attempt to push everything into that single beast of an IDE.
I currently use CLion, PyCharm, PHPStorm, Project Rider and a few other JetBrains IDEs but sadly their autocompletion and features aren't on-par with Eclipse's autocomletion and integration into Java. Nothing really comes close to that in my opinion.
When it does work, it's great. But the inconsistency is probably going to drive me away, back to Vim. I think that if anyone can build a similar thing for Vim that actually works, I'll use it in a heartbeat.
Regarding plugins you can use melpa and track the latest release of everything at all times.
You can use melpa and update most stuff infrequently save for the ones that are most important to you.
You can use melpa stable and run only stable versions of everything.
You can use melpa stable and run newer versions of a minority of plugins that are important to you.
What plugins you choose to use and and whether you choose stable or unstable could very well lead to vastly different experiences.
The best strategy is to carefully select plugins which are useful to you and high quality, and run the stable versions of most things updating your tools infrequently when a new major release adds something that looks useful to you.
The only other thing that can break you other than updating spacemacs is updating packages, but that's a factor with vanilla emacs and with vim. This happens occasionally but not too often.
Also keep in mind: spacemacs is not all or nothing. There are many, many layers that are higher in the dependency tree, that both get less attention and are easier to swap. For instance, even though I mostly develop in C++, I don't use the C/C++ layer from spacemacs. There were things I wanted that were missing (like rtags), and things that I didn't want that were there (like older tags solutions).
I started out by just configuring rtags inside a single simple file, the same way a vanilla emacs user would, and I dropped the C++ layer. I eventually added more stuff and wrote my own C++ layer. I'm quite happy with the result. I still got a ton of useful layers/packages from spacemacs that were easily setup and configured, like evil, magit, helm, company, flycheck, etc. And the whole layer system itself made even the parts that I customized myself more modular.
I don't think it's really possible to build something like Spacemacs for Vim because of the different underlying architectural decisions. Vim is a one-thing-only-and-do-it-well tool. Emacs is 'an operating system missing a decent text edtior'.
Especially since I use quite a few different languages.
Ain't nobody got time for that...
Some love bringing their emacs/vim setup to their own perfection and spend a lot of time on it. Other are too lazy for that and are fine with a preconfigured setup like SpaceMacs. Whatever you prefer.
My point just was, for someone like me, SpaceMacs is a truly awesome project.
Spacemacs is so customized that it is like learning new editor from ground up, at least for me. Last year I spent solely using and learning Emacs, to the point where every command and keybinds made sense, before that I used Vim for years. After one year of training I decided to install EVIL, and now I am enjoying Emacs and Vim a lot. Yesterday I downloaded spacemacs, opened it and I was like, ugh, wtf now?! I just go overwhelmed by the amount of preexisting code which I did not understand, and needed to crash a lot of hours to get everything from ground zero.
After a week or two with SpaceMacs I tried to start from a plain emacs and build up my own config, but I gave up. Just too much hassle for me.
I probably would not have enjoyed SpaceMacs if I had used emacs at all before. But I switched directly from Vim with no prior emacs experience, so for me it's a perfect fit.
I'd have to write my own editor for that. ;)
For example, this site listed some useful plugins that I didn't know about, such as https://github.com/bogado/file-line
This is one of the most obtuse project descriptions I've seen. If you're making a...whatever this is...aimed at Vim users, why would you expect them to be familiar with a something-or-other for Emacs?
Taking that into account, this can be interpreted as "It makes Vim work more like Vim."
After a while it becomes sort of second nature:
SPC f s - file save
SPC m t f - mode test file (e.g. if you're in a go file it'd know how to run tests for go files).
Another nice thing is that `SPC ?` brings up a prompt that lets you search for commands: you type a keyword for example and you get all the editor commands that match your keyword, so it's easy to navigate your editor shortcuts. That was useful for me, since every result came with the "spacemacs" shortcut, and the Emacs shortcut, so I ended up learning Emacs for free (I was coming from Vim).
Note: I've also tried Spacevim and the only thing it has in common with Spacemacs is the mnemonic key bindings. It doesn't seem to be discoverable (at least not with SPC ?) and it also doesn't seem to be consistent (I couldn't "guess" what certain things were, in spacemacs it's consistent enough that you can guess). Those are the main core pillars imho: http://spacemacs.org/doc/DOCUMENTATION.html#core-pillars
If you want an extensible editor, use emacs. If you want a vi-like extensible editor, use spacemacs (or just evil-mode on its own). If you want a lean editor, use vim. Torturing vim (and writing tortured code to torture vim) into a simulacrum of emacs just doesn't make sense to me.
The table rendering issues I suspect are from the lack of a newline after the headers. I don't know whether it's correct or not because, yknow, markdown.
Still better than rst. :)
I like reStructuredText and work in it regularly. I’m sad that Markdown with all its terrible inconsistency, lack of extensibility, insecurity, &c. has prevailed.
When this actually became a real problem, HTML5 came out to spec it much more rigorously.
RST in that picture is XHTML. Rigorous spec, but very picky with the input. Typo? Your whole document won't render.
I've been bitten by XHTML and I've been bitten by RST. The experiences are very similar. I agree with the need for a more rigorous spec but like with HTML it still needs to be liberal with its input.
So that's what we need, and I just hope it doesn't take years to come into existence. An HTML5 for markdown. And we shall call it MD5!
What I haven't done is check neovim. Any comments regarding the potential for inline code execution?
In my experience, you really can't beat Org-mode when it comes to inline code execution. You can preview LaTex and plotting inline as well. Plus, you can of course export the document into a variety of formats (HTML, PDF, etc.), which are quite customizable thereafter. Here is a document I put together with Org-mode for a short C++ seminar [1]. All the code is executable while editing the document in Org, which is nice for a number of reasons. I also added some custom CSS/JS for the HTML export.
[1]: https://htmlpreview.github.io/?https://github.com/notmatthan...
Try codi.vim for REPL-like eval:
vim sh mv ~/.vimrc ~/.vimrc_bak mv ~/.vim ~/.vim_bak git clone https://github.com/SpaceVim/SpaceVim.git ~/.vim
nvim sh git clone https://github.com/SpaceVim/SpaceVim.git ~/.config/nvim
Why do people always expect the average joe user to understand this? What do I do with this? Do I run this in the terminal? Then what? First line opens Vim and it opens 11 files. Now what? This seems like the average explanation that works for the person who writes it, but is useless unless you know this already. for vim do: sh mv ~/.vimrc ~/.vimrc_bak mv ~/.vim ~/.vim_bak git clone https://github.com/SpaceVim/SpaceVim.git ~/.vim
for nvim do: sh git clone https://github.com/SpaceVim/SpaceVim.git ~/.config/nvim
I'm guessing markdown fail.Disclaimer: I haven't tried this package but it does seem to have a lot of promise.
For those who don't know what it is, it is showing possible keystrokes you can hit, which is super helpful when I was using new plugins and such.
I wonder why?
Trust me. "truncate -s 0 ~/.vimrc" and take the time to learn. You won't regret it in the long run.
This sort of 'configure your own' extremist software purity movement is great for some people, but if you want a setup that meets your needs 95% of the time, and works well, Spacemacs is great. I'm sure learning to configure your own vimrc has been a rewarding experience, but I don't think you can really argue it's a time saving measure.
I think there's value in learning what prepackaged configs provide and tailoring them. I don't necessarily agree that starting from scratch is optimum for most though.
Like, there could be a bunch of features that are barely used and not discovered, but seems like the easiest way to discover new features is to scan through a good .vimrc, rather than sleuthing through online resources.
Using a configuration bundle makes the learning curve less steep but more tall, essentially.
Beautiful quote which I'll definitely use more often :)
truncate -s 0 ~/.vimrc
Shorter way: > ~/.vimrc $ mv ~/.vimrc ~/vimrc-referenceAnyways my zsh has noclobber set so your command fails with error: zsh: file exists: ~/.vimrc
:> ~/.vimrc
:> ~/.vimrc
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
See ':help defaults' for more info.I like package managers, and I tolerate tarballs, because I know what they do and how to reverse it. I care about the organisation of my filesystem and suspect that the people who suggest I pipe their script into my shell do not care at all.
For parent: check out http://github.com/awalGarg/curl-tap-sh (disclaimer: I am the author, and it was on HN's frontpage already a while ago)
And yes, I am aware of the irony of this being completely off topic. ;)
When I update my Debian distro, I get binaries via HTTP, that's true. But I also have the public keys of my distro's maintainers whom I trust. The authenticity of every binary I download is automatically checked using those public keys. It's an example of "any script you haven't read, or binary you haven't decompiled" type 1.
curl | sh via HTTP is an example of "any script you haven't read, or binary you haven't decompiled" type 2.
curl | sh via HTTPS is an example of something that is very-very close to "any script you haven't read, or binary you haven't decompiled" type 1.
Point is, don't run binaries you don't have some way of vetting. curl sh is no worse offender than "download link here".
Ok, let's say you don't do any of that. The Debian developers are still fallible, and they certainly don't audit the source code of everything they package. Sure, you have to trust something, and I'll certainly agree that it's more reasonable to trust the Debian packagers (and their distribution infrastructure) than a lot of other things, but saying "curl | sh" (when you're curl'ing over https at least, from a website you can reasonably expect not to be compromised) is always bad is a bit extremist. At any rate, the shell script you download is there for you to inspect before running, and if you're not happy with it, you don't have to run it.
Personally, my main beef with that sort of thing is that I want to know if the script is going to accidentally clobber any existing files, or install things to a location where I might not prefer them to be installed.
Edit: I'm only now realizing that the OP has you curl from a non-TLS webserver, which I imagine is the first thing that got you upset. Ugh. Asking people to install something that way is just irresponsible.
Strawman. If an amount of critical code is audited (and it is) it's still much better than nothing.
> I want to know if the script is going to accidentally clobber any existing files
Packages are tested on various hosts and architectures. The packaging system check for files being overwritten and that the package can be removed cleanly Also suspicious things (e.g. unsecure file permissions) are checked. Sandboxing tools are often used to contain daemons.
Furthermore the package content is tracked, while "curl | sh" cannot guarantee that the same script will be received every time or by every user.
Is it, though? I'm specifically thinking about the Debian fiasco a few years ago when a packager broke OpenSSL's key generation. Clearly less scrutiny is paid than one might think. I'm unable to find any evidence/documentation/anything that suggests that code audits by Debian packagers of critical packages are done regularly (or ever).
I did find a few links to some Debian-specific tools to aid code auditing, but nothing to suggest where they're used, how often, and on what packages. Regardless, they look more like linters and static analyzers -- nothing that would help you discover backdoors or just flat-out malicious behavior.
> The packaging system check for files being overwritten...
Yes, I'm well aware, not sure why you're bringing this up. I was merely pointing out (regardless of any other argument being made) that file-clobbering is a reason why "curl | sh"-style installation bothers me, personally, much more than possible security considerations, which I consider to be overblown.
Only the official repos, yes, because anything else would be insecure.
> Never add a 3rd-party apt repo for anything that maybe you didn't trust as much?
Heck no, never, ever. Not even once. That's insanely foolish. Frankly, I view, 'please add my PPA/repo to install' as a different way of saying, 'I don't know enough about security for the software I write to be installed on your computer.'
> Never clone a git/hg/svn/etc. repo from somewhere and build & install the software yourself?
I view that as somewhat different, given that the source is there and has a weakly-cryptographically-secure history (weak because it's SHA1), so that if someone ever did something bad then it'd be easy to prove it.
How do you end up dealing with things that aren't packaged for your distro? Do you end up downloading source, doing some checks to whatever level makes you comfortable, and package yourself? Or do you mostly either not find yourself in that situation, or just take an "oh well, I'll deal without it" attitude.
I use a few 3rd-party repos, though ones that I would consider more trustworthy than a random PPA (for example, Google's Chrome apt repo). I certainly don't trust them as much as Debian's official repos (but, again, I'm not sure how much that trust is actually rational!), but I'd consider it unlikely that Google would get compromised or slip something nasty in (and even if they did, it's not like the Chromium source in the Debian repo has been audited).
> I view that as somewhat different, given that the source is there and has a weakly-cryptographically-secure history (weak because it's SHA1), so that if someone ever did something bad then it'd be easy to prove it.
That's all well and good, but that sounds like an after-the-fact reactionary thing. It's little comfort to be able to prove something bad happened after you've been owned.
I just feel like most of desktop security, even on Linux is on pretty shaky ground, and we greatly overestimate the care we take when installing software. I think you're probably ahead of most people by using only official repos, but it's like the classic analogy of a chain with a single weak link: all it takes is one "git clone" of something that does something malicious, and that's it. Sure, the probability of a successful attack is reduced by avoiding 3rd-party repos, etc., but attack possibilities are still very much there, and it feels like people don't seem to see that.
But, overall, yeah, the state of desktop security wrt software installations is so much better on nearly any Linux distro than common practice on Windows or macOS, it's crazy.
a) ensure this exact binary/script is GPG signed by someone I ostensibly trust
b) ensure it's not been tampered with by a MitM between the hosting server and my computer
This reduces my risk exposure to "creator of software X (or distro packager Y) has turned rogue", which is many orders of magnitude less likely than "website of software X got pwned, or someone is MitM-ing me".
Unlike a distro package you can also just -not- pipe it to the shell immediately and actually read it.
Even if you did unpack every distro package source before you installed it with the amount of crap and boiler plate you would almost never be able to work out -exactly- what it will do.
The way I see it the "curl | sh" people have found somewhat of a middle ground. It achieves similar convenience to "apt-get blah" but with simplicity level closer to binary tarball. It's almost as easy to work out what it's going to do as the tarball but it will also do it for you automatically.
IDK about other distros, but for the one I use (ArchLinux) it's trivial to inspect the install script, and they (PKGBUILDs) are usually well structured and easy to read.
But all of that is irrelevant when 99% of the Linux world is running RPM/APT.
You trust the distro maintainer and have a security mechanism to ensure the scripts and binaries have not been tampered with.
So virtually no risk of MitM and very little risk of malicious scripts and binaries.
Reading script and decompiling binaries does not imply you understand every thing they do, but it does imply that you have an unlimited amount of time which is impractical at best.
https://www.djm.org.uk/posts/protect-yourself-from-non-obvio...
There's a ton of potential issues when you're curl-piping; all those issues are present in some form when you're simply doing curl first then sh.
It's far more egregious to download a hard-to-inspect binary then run it, than it is to download a shell script then run it. Although it's harder to inject code on the fly, if you're at the stage where you're worried about these kinds of attacks it makes very little difference.
I don't see people bitching about https://www.terraform.io/ offering download links for example. So yeah, it gets tiresome to always see "oh! curl|sh! boo! bad!" - there's actually no better way of sharing such scripts short of making and vetting a package with a high-entry-bar distribution. And a two-step curl + sh instead of a pipe is security theater.
https would certainly be appreciated on that site but that's a general issue, regardless of the download script.
RPM's are inspectable, signed by default and integrate better with your system. (the same is true of apt). And if they're in the package repository then there is a maintainer who is ultimately responsible for ensuring the quality of the code.
But the whole point of high-entry-bar distros is that it's highly curated. Some random script from the web will not be in there. How do you serve those that need to casually distribute trivial software?
There's some answers to that question - they're not widespread at all. It's one of the major failures of package management on Linux. macOS gets it mostly right.
Because there is no standard packaging format between distributions, the best people can do is release a deb that may or may not work on either debian or ubuntu. Or an RPM that may or may not work on RH/Fedora. Or a tar.gz that will contain sometimes source code, sometimes a binary, and if it has source code there's no clear way to compile it, if it has a binary there's no clear way to install it.
So instead, curl sh.
It's pretty ridiculous that it's still a problem, tbh. What we need is somebody with the right political clout at either RH or Debian to sit down with devs of the other, come up with a decently generic solution that fits both systems and a backwards compatibility policy. It doesn't have to be perfect nor the best, it just has to be good enough to support the use cases of most Linux distros.
Once both Debian and Fedora support it, Ubuntu (and its many flavors) and Red Hat will follow. And if it's a generic enough system, with a pluggable-enough backwards compatibility policy, it's not unlikely for it to be adopted in more minor distros. If it's sold correctly, distros will gladly adopt it - we've all been waiting for this a long time.
It seems as though you are now talking about cross-distribution package management. It is further confusing that you are contrasting all "Linux" to the single distribution macOS.
To me the term is "ad hoc" current w.r.t. NixOS , GNU Guix and other purely functional systems, and there the distinction is made between:
1) declarative -- in which a rebuild of the system will ensure the package is present and configured as expected; and
2) ad-hoc -- in which the user can affect all of the system with side effects and rebuilds will not result in the same state.
Why would you want to allow users to randomly and aribitrarily affect all of the system and end up in an unknown state? Isn't that exactly what curling shell scripts achieves? And what method does macOS implement in order to avoid this?
If all you're talking about is cross-distro package management then you and your users can either give up on this and standardize on one OS and just pony up the cash for RedHat (same as you do for macOS) or else start writing Flatpaks.
What you have is an acute case of righteous rage against a flaming straw-man. The only medicine against this affliction is girding your loins and guarding your mind against those seemingly plausible but ultimately horseshit security theater tropes, so popular among the impressionable today.
Attacking curl yielding nerds is not going to get you a botnet.
https://news.ycombinator.com/item?id=5508225
http://www.ush.it/team/ascii/hack-tricks_253C_CCC2008/wysinw...
Is there any evidence of this ever happening, anywhere?
> -f, --fail > (HTTP) Fail silently (no output at all) on server errors.
You don't even need that. You could spoof a wifi network with a PineAP or similar and MitM at that level.
https://news.ycombinator.com/newsguidelines.html
https://news.ycombinator.com/newswelcome.html
We detached this comment from https://news.ycombinator.com/item?id=13316485 and marked it off-topic.