5 ms·
I've been waiting for this release before finally trying to switch from Vim (MacVim) to Spacemacs. Anybody have any tips for somebody who's never really used Em
by pash 10y ago
I've been waiting for this release before finally trying to switch from Vim (MacVim) to Spacemacs. Anybody have any tips for somebody who's never really used Emacs?
- optimali 10y agoMap command key to caps lock. Setting (global-set-key (kbd "M-P") 'scroll-down-line) (global-set-key (kbd "M-N") 'scroll-up-line) Has also been indispensable for scrolling (though you may choose to do so differently, coming from vim).
- Steeeve 10y agoI forgot about that. Caps lock is useless 99% of the time and having that control available easily with your left pinky makes emacs (and everything else) work. I'm so confused when I get on other people's computers and caps lock is actually caps lock.
- mijoharas 10y agoSince he is looking at spacemacs, I'd recommend mapping caps lock to escape when it's tapped, but ctrl when it's pressed in conjunction with other keys. Very useful, (though I suffer from the same problem when on other peoples computers)
- Asooka 10y agoHear hear. Ctrl on caps lock changed my life. Then I bought a TECK^, which comes with a split spacebar and put left alt on caps (or where caps is usually, teck has control there) and right control on the right spacebar. This is honestly the best setup ever and I don't even use Emacs, I use Vim. ^ truly ergonomic computer keyboard. It's nice, but the hardware can be a bit wonky.
- kiliancs 10y agoMy experience was very straightforward. It's easy to configure for most scenarios if you follow the documentation and use any of its layers (see https://github.com/syl20bnr/spacemacs/tree/master/layers https://github.com/syl20bnr/spacemacs/tree/master/layers). Most Vim key bindings work beautifully. For be its best feature is how discoverable it is.
- mikekchar 10y agoI'm not using Spacemacs, but rather Evil mode in Emacs. I think the biggest thing I would caution is to expect small things to be different. For example underscores are word boundaries in Emacs. File selection is different. Some modes do not have vi key bindings set up by default. Escape doesn't always work to abort (you need to get used to pressing ctl-g). Omni complete is absent and completion in Emacs works quite differently. Searching through files and sorting through compilation errors works quite differently. I think that's most of the issues I've run into. It took me about a month to get everything set up the way I wanted it and to get used to it. With Spacemacs, I imagine that things will generally be set up, but that it will take longer to get used to because it is pretty opinionated about things like leader keys. Right now my set up is good enough that if I accidentally run vim instead of emacs, it takes me about 15-20 minutes before I realise it (normally when I try to update an org mode file ;-) ). My biggest advice is to take the transition slowly. Use Emacs/Spacemacs until you get annoyed with it and then put it away for a while. Eventually you will start to get used to Emacs-isms (like ctl-g) and Vim will start to annoy you. At that point cut over entirely. One thing that's really annoying is that when you are modifying your .emacs/init.d file, it's easy to get it into a bad state. At that point Evil and also probably your theme won't be set up properly. So you have to fix everything using emacs keystrokes. I used emacs for 20 years before I switched to vim and even still it seems I am no longer able to use vanilla emacs ;-) One you get it set up and are used to it, though, it works surprisingly well. For me the absolute biggest advantage to emacs is Org mode and I basically can't give it up now. Good luck on your switch!
- wcummings 10y ago> For example underscores are word boundaries in Emacs This is configurable [1] >The word commands’ understanding of word boundaries is controlled by the syntax table. Any character can, for example, be declared to be a word delimiter. [1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Words.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Wo...
- mikekchar 10y agoThanks for that. My understanding of the documentation leads me to believe that I will have to change it for every single major mode, which is a bit of a pain. But at least it is mostly possible.
- _asummers 10y agoFollow the tutorial! It's really really good. Turn on god-mode. It turns off e.g. the arrow keys and the delete key, forcing you to use the movement keys and keybindings for deleting word, character, etc. It'll yell at you in the minibuffer with the command you SHOULD have hit, so you'll know. It builds the muscle memory super quickly. Keyboard macros are dope. My keys are bound to f3 and f4 but I don't remember if that's standard. Basically you hit f3 to open a macro, do some stuff, and then hit f4 to close it. Then you hit C-x e to execute it from the point, and hit e repeatedly to keep executing it. Super convenient. As an example, you might make a macro where you move the point to the beginning of the line, deletes 2 characters of whitespace, then moves to the next line. But you gotta be careful it's actually gonna do what you want; you'll get better at this over time. You generally have to imagine the point exists at a random point in a line, and find how to get it to where it needs to go, before you're able to do the real work of the macro. Get Projectile. It's fantastic for navigating projects. It binds its key prefix to C-c p, and binding ANYTHING to C-c whatever is frowned upon heavily, so be aware of that. Doing things like project wide searches (C-c p s s) is super fast, and makes navigating codebases manageable. I LOVE Helm. It's a huge departure from vanilla emacs, so know that going into it. That said, I love what it does. Basically you have a minibuffer chilling at the bottom of the screen above the normal minibuffer, and it is usually hidden until activated. Then when you activate it (e.g. in the projectile search) it shows the results of the operation in the helm minibuffer. http://tuhdo.github.io/helm-intro.html http://tuhdo.github.io/helm-intro.html is a good intro to it. But really, pay attention to what you like and don't like about everything. Then find things that scratch your itches. I really encourage you to start from vanilla emacs, bringing in packages as you find you need them, so you fall onto your own unique, special editor, built just for you. That said, I sort of understand the appeal of starting with a config that's curated for you already. Though if you decide to make your own configs, use-package is fantastic for managing the complexity of it all. Emacs is a wonderful editor, and you're in for a wonderful experience. You just have to be willing to put up with some annoyance before you make it your own. As a datapoint, it took about a month and a half when I started using it to get it behaving the way I wanted. It's still a thing I tinker with occasionally, especially when I venture into a new language, but I leave it alone most of the time.
- OvidNaso 10y ago
- twblalock 10y agoEvery command has a name, and you can do M-x and type in that name, with tab completion, if you forget the keyboard shortcut. Even better, you can enable ido-mode and install ido-vertical-mode, and see a list of possible command completions without pressing tab. I also highly recommend remapping your caps lock key to control.
- Steeeve 10y agoI had used IDE's, windows based text editors like UltraEdit, and vi/vim for the longest time before I decided it was time to go back to Emacs. I dedicated two weeks to using it almost exclusively to pick up the muscle memory of major keybindings. I haven't looked back since. The keys I really needed out of the gate: * F3/F4 - building macros, then C-x e to execute (after that, just plain e) * C-s - search * M-s o - occur (you define a regular expression, it lists all the lines that match it, so something like `def (` for python functions C-v/M-v - page up/page down * C-f/C-b - forward and back character * M-f/M-b - forward and back word * C-/ - undo * M-w - copy * C-y - paste * C-o - open new line * M-z - zap-to-character (try it, it's awesome) * C-M-e / C-M-h - beginning/end of function * C-a / C-e - beginning/end of line * C-l - center window on cursor * C-[space] - mark cursor / unmark cursor * C-d/M-D - delete char/word * C-k - kill line * M-/ - autocomplete word (works in any file, any language, and cycles through suggestions on repeated calls) ... Those and then getting yasnippet installed and working was probably the most important plugin. It's real simple templates for any language and there are a lot of decent default ones. (so for instance, you type html, then tab and it'll build a basic html file for you and put your cursor in the <head> tag, or def, then tab and you have a structured function definition and your cursor stops where the name goes, tab again it puts it in the parameters, tab again, docstring, tab again, coding area). If you dedicate two weeks to it, you'll begin to see the power that everyone talks about. The first day or two will be frustrating because even the basics I just listed are a pain to remember out of the gate, let alone have the muscle memory to do without thinking.
- tangue 10y agoC-s works for text ahead if you want to search backwards it's C-r . This confuses a lot of people so I guess it's worth mentioning.
- mijoharas 10y agoThis list seems really useful for general emacs, but does not help for spacemacs which has it's own equivalents (with vim-ey keybindings). I've been using spacemacs for a few years as my editor every day, and have not needed any of these.