
'Using Emacs' Series - rafiei
https://cestlaz.github.io/stories/emacs/
======
gumby
I am a little concerned you start with package repository and then org mode.
Emacs is at heart a simple, modeless editor. With c-[fbpns] and c-x c-[fa] you
can immediately, if laboriously, do anything. Every new thing you learn
incrementally speeds you up.

~~~
lottin
Agreed, although it's also true that vanilla Emacs is quite spartan and has
many questionable defaults. In my opinion it would be much better if plain
Emacs provided a nicer user experience out of the box, thus reducing the need
for customisation and external packages which is a big barrier to entry for
new users.

~~~
Numberwang
Do you have a good set of basic customisations that anyone using Emacs should
do?

~~~
CBatts
I'm not sure how you are with vim bindings but in my opinion evil mode helps a
lot with productivity.

~~~
moomin
And spacemacs is a great starting point.

------
sigjuice
I have never understood the rampant practice of using ~/.emacs.d/ for one's
personal Elisp files. Most of what is in this directory appears to be machine
generated files from various packages. To me, it seems much cleaner to have a
separate directory for my own files, instead of maintaining ~/.emacs.d in Git
and having to constantly update my .gitignore as I install and use new
packages.

EDIT: Also, C-h v user-emacs-directory RET says _programs in Emacs store
information in this directory._

~~~
rafiei
1\. You shouldn't be updating your `.gitignore` continuously. You need to
ignore everything and explicitly define exceptions e.g.

    
    
      *
      !.gitignore
      !init.el
    

2\. The reason I prefer ~/.emacs.d/ is that I have it in a git repo and on
every system, I'll just clone the repo and soft link it in the home directory.
This way, I have only one directory inside home about emacs within which my
files are explicitly separated and tracked.

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.

~~~
TeMPOraL
I solve this issue by using my own config directory; this way I soft-link
_two_ things from my dotfiles repo:

\- .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.

~~~
geokon
So each time you launch emacs you have to point it to your init file?

~~~
TeMPOraL
No. My .emacs has a code snippet that points Emacs to another directory for my
own configs. I softlink both .emacs and the config directory.

------
azangru
Hey, has any of you guys been using emacs for modern front-end development?
I’ve been looking for video tutorials (or at least for demos) on this subject,
but could not find anything useful and practical. How is emacs’ support of
JSX? Of typescript and TSX? Of flow? Of CSS in JS? Of eslint? Does it keep up
with the crazy speed frontend development is changing, or has it remained far
behind (being used mostly for the basic tasks that are shown in the video on
web-mode in the 'Using Emacs' series)? What's your experience?

~~~
fovc
(Disclosure: I'm the author of rjsx-mode)

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

~~~
azangru
Thank you! That was really helpful.

------
everybodyknows
Multi-occur has kept me with emacs. Exactly what's wanted when making
coordinated edits to multiple file formats, e.g. a project that involves JS,
Go, Markdown. After some setup hassle, 'M-x mo <regexp>' or similar searches
all open buffers, and presents matches in a new temporary buffer. Typing 'e'
in that buffer makes it writable. The usual editing commands then
simultaneously modify both the temporary multi-occur buffer, and the
originals.

------
free_everybody
>Inspired by Mattias Petter Johansson, or MPJ who make a weekly video, I
decided to try to create a series of YouTube videos and matching blog posts.

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.

------
Accacin
I'm a Vim user that did try to get into Emacs with evil-mode. However, I got
annoyed when dired wouldn't let me user the Vim movement keys and went back to
Vim.

~~~
brandoncordell
You need to check out Spacemacs[1]. It's set up so that as soon as it's
installed you can use it efficiently using your vim keys.

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.

[1][https://spacemacs.org](https://spacemacs.org)

------
mycat
What is the best way to reduce pain from using ctrl with pinky finger? (emacs
pinky?)

~~~
brudgers
For me, it's been keyboards with ctl and alt on both sides. Thanks to Xah Lee
[1]. This rules out Macbooks (and most laptops) and favors Thinkpads, though
currently I have a Dell Precision laptop and it has ctl and alt on both sides
but the ctl's are not symmetrically placed and it is a bit annoying and not as
good as the Thinkpad it replaced but it is workable.

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.

[1]:
[http://ergoemacs.org/emacs/emacs_pinky.html](http://ergoemacs.org/emacs/emacs_pinky.html)

~~~
willtim
Good points. I also swap Ctrl and Alt on both sides, using my thumbs for Ctrl.
Using the opposite hand to press the modifier is analogous to how a touch
typist uses the shift keys. For desktop use, I now use a Kinesis keyboard,
again with symmetrical modifiers but all as thumb keys.

