Live data from Hacker News

'Using Emacs' Series

cestlaz.github.io

71–80 of 106 posts

Re: 'Using Emacs' Series

#72
post #7

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.

> Every new thing you learn incrementally speeds you up. Like forgetting the original keybindings and switching to evil.

Or God mode.

Re: 'Using Emacs' Series

#73
post #22
post #7

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.

Well there is the built in tutorial for that. And it'll leave you at a point where you can frustratingly do text editing and feel a bit confused about what all the hype is and then after a few weeks/months you'll drift back to a more traditional/"modern" text editor. 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 learni…

Another way to look at it is saving time and effort to do it right at the start. Learning how to use emacs without paredit and then learning again with paredit is twice the work of just learning once with paredit. Ditto projectile (with projectile-helm)

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.

Re: 'Using Emacs' Series

#76
post #42

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…

On this discussion. I was trying to work better with React code. I found out about global + gtags + pygments. I'll soon be able to jump to reference if I set things up properly. I'll probably post something about that soon. Anyone got jump to definition and jump to references set up with javascript (or JSX) code properly? In terms of autocompletion, I don't what would be the best way to go about it yet.

Re: 'Using Emacs' Series

#77
post #15

Earlier quoted context omitted.

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.

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

Install ido-mode and projectile as a bare minimum. All these can be installed with M-x package-install, or you can do something like this https://github.com/wcummings/dotemacs/blob/master/modes/my-p... to automagically install your packages.

(setq ido-enable-flex-matching t) (setq ido-everywhere t) (setq ido-create-new-buffer 'always) (ido-mode 1)

(projectile-global-mode)

Maybe enable flycheck globally if you're used to syntax checking.

(global-flycheck-mode)

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:

  (tool-bar-mode -1)
And install a nice theme, whatever floats your boat, I use a solarized theme [1]. The default theme is gross.

  (setq custom-theme-directory "~/.emacs.d/theme")
  (setq custom-safe-themes t)
  (when (display-graphic-p)
    (load-theme 'my-solarized))
I use eshell, I think the plan9 smart shell features are nice:

  (require 'em-smart)
Basically includes additional editing features in eshell. It creates keybindings to edit previous commands and page through the output of commands.

Make CTRL L clear eshell

  (defun eshell/clear ()
    "Clear the eshell buffer"
    (interactive)
    (let ((inhibit-read-only t))
      (erase-buffer)
      (eshell-send-input)))

  (defun my-eshell-mode-hook ()
    (local-set-key (kbd "C-c e") 'end-of-buffer)
    (local-set-key (kbd "C-l") 'eshell/clear)
    (eshell-smart-initialize))

  (add-hook 'eshell-mode-hook 'my-eshell-mode-hook)
Line numbers, but only when you're editing code (GUI and text):

  (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: "
    :group 'linum)

  ;; 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))
 (linum-mode 1)))
"Smooth scrolling"

https://www.emacswiki.org/emacs/SmoothScrolling

[1] https://raw.githubusercontent.com/wcummings/dotemacs/master/...

Re: 'Using Emacs' Series

#78
post #44

Earlier quoted context omitted.

I don't think Emacs has been modeless in many, many years. I read that already in 1978 Emacs buffers could be used to edit files, of course, but also read email, run a shell, show a list of compilation errors linked to source locations, etc. Each of those is a completely different mode of operation with different keybindings (and different meaning for keybindings that happened to be shared).

"Modeless" is used as a term of art here: when entering text there is no difference between entering and editing (as opposed to, say, vi which separates editing and navigation from entry). Word and TextEdit are modeless editors. 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" (t…

Are you saying the term modeless only applies to text editing? I thought it was a general UI term that can be applied to any program and means that keystrokes always mean the same thing independent of context. In that case, Emacs as a whole is not modeless, but usually each individual buffer is.

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.

Re: 'Using Emacs' Series

#79
post #73
post #22

Earlier quoted context omitted.

Well there is the built in tutorial for that. And it'll leave you at a point where you can frustratingly do text editing and feel a bit confused about what all the hype is and then after a few weeks/months you'll drift back to a more traditional/"modern" text editor. 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 learni…

Another way to look at it is saving time and effort to do it right at the start. Learning how to use emacs without paredit and then learning again with paredit is twice the work of just learning once with paredit. Ditto projectile (with projectile-helm) 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 pain…

Another way to look at it is saving time and effort to do it right at the start. Learning how to use emacs without paredit and then learning again with paredit is twice the work of just learning once with paredit.

That's an exaggeration, it's definitely a lot less than twice the work. I'd say 1.2 times at most.

Re: 'Using Emacs' Series

#80
post #7

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.

I saw the headline and my first thought was "Emacs tutorials, cool! What's not to like?" and then I clicked the link and saw Video 1 - Setting up the package manager Video 2 - Intro to Org Mode ... and thought "Why there are two things" and then came back to the comments and this thread was at the top and it sort of put the decision by the videos' authors in perspective. At it's heart, Emacs is "The Extensible, Custo…

If you want to avoid all that, just use spacemacs. Don't like VI keys? No problem, it asks you if you want them when you first start it up.

Spacemacs is different, but for a new emacs user it's hard to argue with such a batteries-included approach.

Post reply on HN