4 ms·
Is there a gentle way of picking up Emacs? I've been trying Spacemacs with Evil mode on (I'm a regular Vim user), and I can kind of manage to use it for day-to
by cryptarch 9y ago
Is there a gentle way of picking up Emacs?
I've been trying Spacemacs with Evil mode on (I'm a regular Vim user), and I can kind of manage to use it for day-to-day editing and running Make, but it feels like I'm about to be eaten by snakes because I now have to deal with three additional meta key-combos (alt-x, C-c and space-m) in addition to the one I had for i3 (now banished from alt to Win) and I also have to learn escape codes to use my terminal and use them a lot to Vim on remote hosts over SSH.
- notalaser 9y agoFirst, at the risk of pissing off fellow emacs-ers -- if you're already a regular Vim user, why not stick to it? It's a great editor, and I know a lot of people who use it and are just as productive as I am with emacs. Plus, if anyone ever needs to use their computer, you won't get weird looks when you tell them Caps Lock is Control on your keyboard... Anyway, if you absolutely want to learn something else, I'd suggest going the other way 'round, really: start with something minimal and work your way up from there. For the first 1-2 years, I think, I've used Emacs as little more than a glorified Notepad clone (in fact, I even used it with cua-mode). I think my .emacs file was barely ten lines long. I was transitioning to Emacs from nedit, an old-ish Unix editor with a Motif UI that was getting increasingly difficult to digest and kept crashing and had trouble with Unicode and man I'm old... anyway, all I really needed it to do was let me write text and paint it in pretty colors sometimes. I then sort of picked up its features one by one, as I needed them. The keybindings came first, because it was weird the arrow keys for motion and the other keys for everything else. Then I got a larger monitor and I could fit more than two windows on it and I installed window-mode so that I could switch between windows with M-1, M-2 and so on. (Please remember this was 2005 or 2006 or something, a 21" CRT was a big deal for me...) That's pretty much how I picked up everything else: first big C project was how I picked up xrefactory, then xcscope. First time I had to do big merges was how I picked up ediff, and so on. The best thing about having something as scriptable and customizable as emacs is being able to make it work exactly the way you want it. Making it work exactly the way someone else wants it sort of defeats the purpose, I mean, any editor already works the way someone else wants it. Edit: ah, yes, to address some of your pain points: - Remote editing: look into something called tramp-mode. It's not perfect, and I, for one, use it sparingly, but it may fit your use case. - Weird key combinations: I'm not sure what to say other than "you get used to them". It may be worth looking into how i3 deals with this stuff, too. I no longer use a tiling WM, but when I used ratpoison, it fit near Emacs pretty well -- I bound C-t to Ratpoison's prefix key, and just didn't use C-t for anything in Emacs. But then again, Ratpoison (and its successort, scrotwm) were both written by Emacs enthusiasts, and used similar key sequences. If you're curious about anything else, ask away :-)
- leef 9y agoI finally got into emacs using the prelude distribution - https://github.com/bbatsov/prelude https://github.com/bbatsov/prelude It has sane defaults and contextual tips that help when you're getting started (and can turn off later).
- kqr 9y agoI found starting from a vanilla Emacs and installing evil mode myself was much more gentle than jumping straight into spaceman.
- grandalf 9y agoI used this: https://github.com/technomancy/emacs-starter-kit https://github.com/technomancy/emacs-starter-kit Some of it has been subsumed into newer emacs releases. In general, find out which modes are considered best for whatever you are doing, install them, and then learn how to modify the configuration file to customize how the rest of the UI works.
- stinkytaco 9y agoI tried prelude and a few other starter kits, but still had trouble because the starter kits change the default behaviors, which can be confusing when trying to troubleshoot or find answers. I personally feel its better to start "vanilla" and understand the various Emacs concepts. The built-in tutorial is good. It gets you through the basics of navigating. Even after having used it for a few years, I enjoyed Mastering Emacs [1]. There are several "getting started" articles on the website and if you find them helpful, the book is also good, in my opinion. Print out one of the many reference cards available (the official one is available on the Gnu website [2]). Try org-mode [3], which is built in. It's extremely useful and a gateway to emacs. [1]:https://www.masteringemacs.org/ https://www.masteringemacs.org/ [2]:https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf https://www.gnu.org/software/emacs/refcards/pdf/refcard.pdf [3]:http://orgmode.org/ http://orgmode.org/ EDIT: Oh, and for remote hosts, I find it easiest to connect with Emacs, rather than connect and try to run Emacs from the remote host.
- cryptarch 9y agoOn remote hosts, is there a trick like having an Emacs-slave on the remote hosts? Something like SSH for Emacs, that makes use on remote systems seamless?
- stinkytaco 9y agoI guess it depends on what you're trying to accomplish. If you are trying to edit on the remote machine, just open the files directly in emacs is the best bet: http://stackoverflow.com/a/20624538 http://stackoverflow.com/a/20624538 (side note, this is one of the best parts of org-mode, it supports remote links to files. When you open the link, it will open it in a buffer and depending on your config, even switch to the correct mode). On the same page there's a tip to set up dired (an emacs file browser) to browse the remote machine and open files within emacs. You can also run eshell or ansi-term from within emacs, if that's what you need to do. So I guess I don't find much need to run a client system, but I'm not 100% sure what your needs are.
- film42 9y agoI'm running i3 with alt as my modifier key on one laptop and win key on the other and run emacs just fine. I run a pretty basic setup and I really need to go pull out a few things I never use anymore. I set caps lock as control, now, though. What really helped me get started was using a specific tool/ language. After playing around in Clojure for a while, I learned how to use emacs for a better REPL experience, but I did everything else in Sublime. Most of my school work at the time was in python so I worked on switching that workflow over to emacs. Eventually got pretty comfortable with python too. A few years later and it's now my main editor. It took a few days to figure things out, and a few months to get really comfortable, but I'm now really happy. I run emacs in window mode and rarely use emacs in the terminal for the same reasons you mentioned. At some point I started using projectile for project management and now I can fuzzy fine files and fuzzy find projects on my system without needing to switch to the terminal. And now if I'm in a terminal, it's probably because I'm using vim on some remote host.
- cryptarch 9y agoHow is it better than e.g. enabling Vi-mode in your inputrc and just using a "vanilla" commandline REPL? shell and multi-term have been very uncomfortabe to me, while I really liked Evil mode, the Rust linter + formatter + Cargo integration and Projectile, and Helm was pretty nice as well.
- carapat_virulat 9y agoI don't think there is. I've been trying to move from vim to Emacs for a few weeks unsuccessfully, mostly for org-mode and all the agenda stuff. I still use emacs for org-mode but I don't feel comfortable using it for normal code editing. I am using evil mode, Helm, Projectile and Jedi for completion, and even though everything is more or less configured and took me around 300 lines of elisp I still find all the time defaults that are completely different to vim and I'll have to fix at some point and I am not sure how much time and code it will take to make it feel comfortable. Just a few problems from the top of my head: - evil-mode "u" to undo changes sometimes works and sometimes does crazy stuff. I think it has something to do with incompatible modes, specially org-mode. - Tab doesn't work, I'll have to investigate how to make it work properly. - The defaults for Projectile for opening files inside a project look and feel horrible, it's configurable but I'll have to investigate and probably spend a few hours writing elisp until I have it working to my taste. - Things like ":set nowrap" don't seem to work in evil-mode, I'll have to investigate how to do the same in emacs. - The completion is kind of weird and it appears automatically instead of using a key to activate it. Again it's configurable, but I'll have to spend a bunch of time getting it to work as I want. - If you do ":e path/to/file" and then you try to open another file from inside emacs using ":e [TAB]" it will work as if you changed to "path/to" instead of the original directory. And this is just from the top of my head without having used it for a few weeks now as I don't have the time to configure all that stuff. I'd say that evil-mode is not transparent enough to make the change simple.
- cryptarch 9y agoYou're touching on some of the same painpoints I encountered, though I don't know what Jedi is. My impression is, we might both benefit from starting from a bare-bones Emacs setup and expanding that by hand. I guess vanilla Emacs would be the most bare-bones experience, or at least the most bare-bones experience you can find help for on Google (which kinda hurts me to say, but DDG has worthless search results and only sticks in my browsers because of the !bang functionality).
- canadian_voter 9y agoOff the top of my head: Tab doesn't work, I'll have to investigate how to make it work properly. You mean for auto-complete? I think I had to do this under dotspacemacs/user-config: (define-key evil-insert-state-map (kbd "<C-tab>") 'hippie-expand) Things like ":set nowrap" don't seem to work in evil-mode, I'll have to investigate how to do the same in emacs. This worked for me, also under dotspacemacs/user-config: (spacemacs/toggle-truncate-lines-on) (add-hook 'text-mode-hook 'spacemacs/toggle-visual-line-navigation-on) Edit: Wow, sorry, answered the wrong question. The above will enable wrapping. I'll leave it up for anyone who wants it. For me, nowrap seemed to be on by default and it drove me crazy. After 15 years of vim, it took me a few weeks before I was using Spacemacs more often, but now I only use vim for quick changes when I'm sshed into a server. Took a lot of googling and yak shaving, but so far I'm happy and getting more productive with time. Good luck with the other issues.
- bitexploder 9y agoYou learn emacs on 3 tracks: The text editor, the extensions, and elisp. Pick a use case you really want to get into (Editing code in language X) and dig into that one use case first. Or taking notes (Learn Org mode). But pick just /one/ use case to start your practice. Learn the editor: https://www.gnu.org/software/emacs/manual/pdf/emacs.pdf https://www.gnu.org/software/emacs/manual/pdf/emacs.pdf Work through it up to chapter 9. Practice each command. There is (mostly) a rhythm. Memorize and emblazon the "describe key" shortcut into thy mind. Clear your mental desk and just do it for 30 minutes. It really isn't that bad, you just have to give it a little time and practice. Packages / Modes: There are a few packages in Emacs that are life savers. Get melpa working. Install and learn helm. Helm provides a completion buffer system for things like file selection and and commands. Helm is that /one/ thing I can't live without for extended Emacs usage. Learn Lisp: If this is going to be more than just a toe in endeavor, you need to learn lisp. When you learn the rudiments of elisp and build a couple of small modes or extensions for yourself or customize existing modes a little so many things about emacs just "click". Want to bang out some quick math or do a quick base 64 decode? An example document: ''' This is a document where I am thinking. Oh, I needed to do some quick math: (- 2017 1980)[C-x e] -- result appears in Message area. ''' Things and concepts not to miss: CUA mode / block selection, macros (very easy and nice), regions, buffers, point, mark, registers. Things you might not think much about: The kill ring. Learn and read about the kill ring. Final thought: M-x = never remember all the shortcuts again. With helm doing fuzzy matching you only have to remember much easier to remember english names for things. Naming is consistent for modes too, so to start searching for "what was that Org mode shortcut?" Start typing 'org pro' oh yeah, org promote! [Whack enter] indents a sub tree in my notes. Then I usually remember the shortcut from there out because it is shown on the commands. M-x along with describe key are life savers as you can go from shortcut to function name and function name to shortcut and you can lazily search through commands and buffers. Helm makes buffers easy. To summarize: 1.) Learn the editor Emacs and focus on editing on specific type of document (Markdown, Org, programming language). Follow whatever popular setup guide you find for document type X. 2.) Learn the extensions Emacs. Helm is a must-try. 3.) Learn elisp and get used to the idea you are in a giant lisp machine. Running lisp code /anywhere, anytime/ in your documents is awesome. 4.) Learn the little tips and tricks. 5.) Use evil mode if you must, but I have found being fluent in Emacs is great (iPython, for example, is very Emacs biased in its readline / shortcuts). Tons of other tools (mutt) will go with vim like bindings, so taking the time to be fluent in both means you are almost guaranteed to have the right shortcuts in your brain. 6.) I feel your pain about the shortcuts. I have it mostly down to 3: Emacs, Tmux, i3. I try to ram everything through that set of shortcuts, and then a small set of my tools I use a lot use vim bindings, and I am ok with that (mutt, mitmproxy).
- AlexCoventry 9y agoI suggest working with just evil mode for a bit, or going all the way with vanilla emacs. Spacemacs is great, but overwhelming. Also, spacemacs should not be used in sensitive contexts, because it is a massive security hole: it brings in a vast number of melpa packages, the git repositories for any one of which could be compromised. And whenever spacemacs updates, it updates all those packages for you, and melpa updates a package on any new commit to the source git repository.
- cryptarch 9y agoThank you for reminding me of the security implications! I tend to forget there's a more reasons I develop on Debian Stable than "it's convenient to standardize on something you can run on prod".
- alphapapa 9y agoYep, that's true. They're planning to essentially fork MELPA and have their own "stable" repo of packages Spacemacs uses. I wish them luck on that, because the security issue is a concern.
- AlexCoventry 9y agoThat's interesting. Can you point me to where that's discussed?
- alphapapa 9y agoIIRC I saw it in the Spacemacs release notes.
- kromem 9y agoI recently tried switching to spacemacs from my custom init.el, and after a half hour switched back. It did inspire me to spend some time improving my setup, but elisp is so simple to work with once you learn it a bit, that there's really no reason not to just roll your own config. I don't need 200+ key combinations off my leader. I have about 10 for the things I use often, and if I find myself pulling up commands from Alt+X (mapped to space x) regularly, I add that to a new leader mapping. Use-package is really convenient to learn for setting up your config. Other than that, the things I find I can't live without: * Ivy/Counsul * Company * Flyckeck * Flyspell * Evil If you take a look at spacemacs's GitHub, dive into their "layers" and pop open the packages file for any given layer for inspiration of other things to add for your desired languages/features. But integrate then yourself given the packages' instructions. You'll be far better off knowing your setup intimately than learning to skim the very large surface area of spacemacs.
- weaksauce 9y ago> You'll be far better off knowing your setup intimately than learning to skim the very large surface area of spacemacs. I disagree. spacemacs is not all that scary or hard. it's a thin configuration over emacs packages that all work well together. Take for instance the java layer: it has some configs to make completion work well, syntax highlighting, add things to the "mode leader menu that changes per file type" and a few other things. ootb spacemacs works very well and is a pretty good experience.
- cryptarch 9y agoMight I ask how you've picked up Emacs? Did you start with Spacemacs or did you have prior experience and understanding of Emacs?
- weaksauce 9y agoNever used emacs before and I was a power vim user that was sick of all the vim extensions feeling hacky and not integrated together nicely(the vim scripting language, viml, is awful and it's no wonder that these extensions are hacky) and liked the idea of spacemacs because I used a basic version of it on vim with space as my leader. no which key popup on vim so the bindings were very simple and you had to remember them by heart (I think I used `spc e v` for "edit vimrc" and `spc e z` for edit the zsh dotfile. spc-= to format the entire file etc.) I jumped into spacemacs and figured out how to do the vimrc bindings that I had in emacs lisp. I watched a few videos[1] from the creator of spacemacs to see how he configured his and to see what was the way to navigate files in spacemacs correctly. watch a magit video[2][3] too... that program(I say program because it's basically full git well done) is phenomenal. hit me up on the gitter.im channel for spacemacs if you have questions on it or emacs. 1. https://www.youtube.com/watch?v=HKF41ivkBb0 https://www.youtube.com/watch?v=HKF41ivkBb0 (basics of spacemacs... also check out his channel for a complete dive into each of the prefixes and how to use them) 2. https://www.youtube.com/watch?v=vQO7F2Q9DwA https://www.youtube.com/watch?v=vQO7F2Q9DwA (basics of magit) 3. https://www.youtube.com/watch?v=mtliRYQd0j4 https://www.youtube.com/watch?v=mtliRYQd0j4 (more advanced features of magit like rebasing interactively and easily.)
- deleted 9y ago[deleted]
- auganov 9y agoLearn to use the help commands (press "C-h ?" for a list). Apropos especially ("C-h a"). Personally, that's what got me hooked. The self-documenting was so mind-blowing to me at the time; I would spend hours just looking commands up.