223 points · by wsdjeg · 9y ago · 176 comments
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".
> 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.
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.
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.
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.
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.
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.