Video 1 - Setting up the package manager
Video 2 - Intro to Org Mode
Spacemacs is different, but for a new emacs user it's hard to argue with such a batteries-included approach.
For me, using Spacemacs would be limiting because not every mode has bindings and none of the official Emacs documents and most of the unofficial blogs and SO questions etc. don't describe keystrokes in terms of Spacemacs. In the end, using Spacemacs is using Emacs and will sooner or later require I know Emacs. Other people may have a different experience. Personally, I don't want to spend time cross-referencing the official documentation with this: https://github.com/Somelauw/evil-org-mode/blob/master/doc/ke... in the middle of trying to understand an org-mode feature.
I apologize for misinterpreting your comment, though.
As for notepad, I will give up org mode when you pry it from my cold dead hands. Can't imagine not using structured text and navigation for notes, outlines and task management.
At least that was my experience... twice..
The only way to stick with emacs is to see how extensible and useful it is - which is really all about learning org and how to add packages.
Org is really the gateway drug b/c of how useful it is for everyone - even non developers. For developers the other "killer-app" is magit. For a long time I used emacs just for magit. Only a couple of windows git GUI editors come close in usefulness
If you get used to smacking tab a zillion times while opening files to autocomplete, upgrading to helm find files after the tab habit is deeply ingrained will be painful (tab in helm find files is the help key, not the autocomplete key, helm is conceptually like "always on autocomplete" times a million sorta)
Also with the ecosystem of modes, meta-e usually does the right thing in all the modes unless you're editing something that doesn't have the right mode installed by default, then you get used to not using the keystroke M-e, possibly all the time in all files, which is really bad because M-e will work if you simply install that file's mode package. Obviously this extends way beyond one keystroke which multiplies the impact.
Its possible to use emacs at least two levels. Theres low level where the editor helps you navigate and format, if you permit it by adding file type packages. Then there's the high level where magit or org mode are nice CLI applications almost stand alone. So if you start out at a high level emacs with "my vim-alike can also run magit, so to me emacs is just a vi that can run magit" you're going to miss out on the substantial performance gains of low level emacs like navigation keystrokes.
Maybe a good programming analogy is its much simpler to start noob programming students on msbasic.exe, but everyone seems to think almost anything else as a first language is better in the long run, even if almost everything else is harder to use for the first fifteen minutes.
That's an exaggeration, it's definitely a lot less than twice the work. I'd say 1.2 times at most.
Currently I only use it to edit org files, but it feels like there is a whole ecosystem waiting to be explored.
There are some fundamentals that make it relatively easy to pick up anything:
* Help system (nearly everything is self-documenting)
* ELisp basics (write some helper functions in your .emacs)
* Debugging (Edebug, just do C-u C-M-x to instrument a fn and step through it next time it's called)
Personally I find that a better starting point.
I agree. There is a lot of "magic" going on, and it doesn't help that Spacemacs is a lot slower and less stable than my less-intensive personal customization.
Of course, that's the problem with any significant starter kit. As a new user, now you don't just have to learn emacs, you have to learn emacs + whatever heavy modifications they've done to emacs.
In principle, I liked Spacemacs, but stability is a big problem. Often certain org functionality stops working, etc. I now have a reasonably stable snapshot and I just don't update ELPA/MELPA packages anymore, because the risk is simply too big that things break (yes, I know that you can rollback).
Another problem that I have been running into is that Mitsuharu Yamamoto's emacs-mac, which is IMO by far the nicest Mac version regularly seems to trigger a bug where WindowServer starts using 100% CPU. I haven't really nailed it down (I only notice it later when the fans start getting loud), except that it only occurs sometimes when I run emacs-mac.
I use it, though I'm not a heavy emacs user.
- if you're on a mac set the command modifier to meta
- ido mode
- transform yes or no into y or n
- Disable the bell and the visual bell
- cua mode (this begins to be personal so I'll stop there)
(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(setq ido-create-new-buffer 'always)
Maybe enable flycheck globally if you're used to syntax checking.
Also worth learning TRAMP if you're used to sshing into boxes and running vim. M-x info, C-s tramp.
Get rid of the waste of space toolbar:
(setq custom-theme-directory "~/.emacs.d/theme")
(setq custom-safe-themes t)
Make CTRL L clear eshell
(defun eshell/clear ()
"Clear the eshell buffer"
(let ((inhibit-read-only t))
(defun my-eshell-mode-hook ()
(local-set-key (kbd "C-c e") 'end-of-buffer)
(local-set-key (kbd "C-l") 'eshell/clear)
(add-hook 'eshell-mode-hook 'my-eshell-mode-hook)
(when (not (display-graphic-p))
(setq linum-format "%4d | "))
(defcustom linum-disabled-modes-list '(eshell-mode wl-summary-mode compilation-mode org-mode text-mode dired-mode doc-view-mode image-mode rcirc-mode)
"* List of modes disabled when global linum mode is on"
:type '(repeat (sexp :tag "Major mode"))
:tag " Major modes where linum is disabled: "
;; override linum-on because there is no good way to disable global-linum-mode
;; on a per-mode basis
(defun linum-on ()
(unless (or (minibufferp)
(member major-mode linum-disabled-modes-list)
(string-match "*" (buffer-name))
(> (buffer-size) 3000000))
I originally wasn't sure if I was going to do the mini org-mode stuff early on but thought that it would be better for organizational reasons rather than pedagogical.
That kind of introduction is already in the Emacs tutorial.
And it's the type that drives newcomers away.
I first used Emacs in the late 90's. Even then, the regular cursor keys worked. Now I do understand that some prefer the original keybindings, but the tutorial is likely not targeting that minority.
You mean c-x c-[fs], right? I'm by no mean an emacs expert although I've been using it for 6 years now, and when I read your comment I thought "Wow, c-x c-a is a functionality? How comes I have never used that?", so I tried that in emacs but it's not mapped to anything.
Apart from that, I fully agree with your comment.
(defun align-all-matches (start end regexp)
"Align all matches of the given regular expression."
(interactive "r\nsAlign regexp: ")
(align-regexp start end (concat "\\(\\s-*\\)" regexp) 1 1 t))
(If you call align-regexp interactively without a prefix argument it does something much like this function but only aligning the first ocurrence on each line, and if you call it with the prefix argument it prompts for all parameters of align-regexp.)
Like forgetting the original keybindings and switching to evil.
What Emacs calls "modes" have indeed been around for a long time; I started using Emacs in 1978 as it happens and did use it to read my mail. However ITS didn't have the concept of "shell" (the command entry system was also the debugger!) nor of "inferior" processes so you would exit EMACS to compile or run other programs.
And sorry for getting the history wrong. I think I mixed the ITS and Multics versions up. Maybe the email reader was only in the ITS version and the Multics version had the ability to call the PL/I or Fortran compiler within Emacs and get a buffer with an error list. Does that sound right? And I'm not sure about command shells, that's probably just wrong and they came later.
Also, C-h v user-emacs-directory RET says programs in Emacs store information in this directory.
P.S. I've recently tried to move from Spacemacs to Emacs and by no means a pro, so the process I've described may not be optimal.
- .emacs - which defines my config dir and loads everything in there
- my own config dir (called .emacs.conf), in which I have lots of .el files with specific configurations
Emacs packages still write by default to .emacs.d, and this way I don't have to care about any of that when moving between machines, because my configuration and Emacs's ongoing state are separate.
To be honest, though, I'll probably be migrating into a single-file literate solution soon, which will render my own config directory unnecessary.
There is also GNU Stow  that does something similar, and probably better.
2: brew and brew cask, dotfiles ofc, and a _lot_ of system settings on mac os can be changed via the CLI, see
2. A similar scheme would be to maintain a directory called ~/elisp in git and make ~/.emacs a symlink to ~/elisp/emacs. And pretend that ~/.emacs.d/ does not exist.
2. You could!
user-emacs-directory is a variable defined in ‘subr.el’.
Its value is "~/.emacs.d/"
This variable may be risky if used as a file-local variable.
Directory beneath which additional per-user Emacs-specific files are placed.
Various programs in Emacs store information in this directory.
Note that this should end with a directory separator.
See also ‘locate-user-emacs-file’.
Author: Richard M. Stallman <email@example.com>
Date: Sat Oct 26 22:41:33 2002 +0000
(command-line): Look for .emacs under ~/.emacs.d after looking in ~.
See also chapter 51.4 of the Emacs manual (which is often preferred over the documentation of variables simply because it can be more explanatory):
51.4 The Emacs Initialization File
When Emacs is started, it normally tries to load a Lisp program from an
“initialization file”, or “init file” for short. This file, if it
exists, specifies how to initialize Emacs for you. Emacs looks for your
init file using the filenames ‘~/.emacs’, ‘~/.emacs.el’, or
‘~/.emacs.d/init.el’; you can choose to use any one of these three names
(*note Find Init::). Here, ‘~/’ stands for your home directory.
The best setup I've found is to use js2-mode for .js and rjsx-mode for .jsx, which parse the buffer for syntax highlighting, local refactoring (with js2r) and basic linting. For typescript, use typescript-mode. Flow support is quite bad ATM
nvm.el replaces the shell scripts from nvm.
Add a jsconfig.json to your project root and enable tide-mode for completion. This has worked far better than tern-mode, which some people recommend.
For fuller linting than what js2/rjsx offer, use flycheck. Eslint support is built-in, so it should just work, I think.
Finally, for build management, I use prodigy to run webpack, babel, ts, etc. Feel free to ping me if you need more help
What in particular would you be looking for in terms of front-end development?
One issue I run into is problems with poor (auto)indentation when I am editing a file which contains html formatted as a string. For example an html template in an angular module. Anybody have/fix this issue?
If you're looking for 'intelligent' auto-completion like IntelliJ Emacs is probably not for you, but I think most people choose Emacs for its keybindings and workflow anyway. The shortcomings are definitely worth it imo.
I also use web-mode a lot for source files that are a mix of CSS, Js and HTML.
I find this pretty funny since MPJ is editor-agnostic and thinks it's a huge waste of time to learn command shortcuts, config files, etc. He promotes using a clean Atom install with no plugins to his viewers.
It's got a ton of great defaults and I'm considering changing over full-time. I've been using it quite a bit lately and love it so far.
On my desktop, I have a Microsoft Natural Ergonomic 4000, which is an awesome keyboard and cheap and robust. The major compromise is that it is corded to USB, but for me it is worth it.
That said, it takes practice to develop muscle memory to use both ctl keys and both alts and key bindings that require switching ctl keys to touch type feel strange.
One day, my pinky genuinely hurt from stabbing the control key of my work-issued keyboard. I remapped the control key to caps and never looked back.
Unfortunately it only works with physical keyboards. Still use caps lock on my laptop.
Then I read somewhere that the Ctrl key used to be at the location now occupied by Caps Lock on PC keyboards. So now, on every computer I use regularly, I remap Caps Lock to be an additional Ctrl key. My pinky has thanked me for it ever since. ;-)
Also, I cannot remember having used Caps Lock ever, except by accident.
Sun put control where caps lock goes; i don't know if they originated that or if it copied someone else's existing practice.
I don't like to remap control, alt, escape, or caps-lock because I don't want to be hobbled when I use another computer that I don't control to type on. This method has worked well for me for decades.
As for Right Control - I don't think I ever pressed that key in my life...
However, even though I long ago stopped using Emacs, to this day I still swap Caps Lock with Ctrl because it's a much more natural position for the control key once you get used to it.