Hacker News new | ask | show | jobs
by pdelgallego 5672 days ago
That is easy, I always include this lines in the .emacs f new users

---

  (defun  disabled-key ()
    "Assign this to disable a key"
    (interactive)
    (print "All your arrow keys are belong to me. Have a nice day!"))

  ;; All your arrow keys are disabled Hahahah
  (global-set-key (kbd "<up>")      'disabled-key)
  (global-set-key (kbd "<down>")    'disabled-key)
  (global-set-key (kbd "<left>")    'disabled-key)
  (global-set-key (kbd "<right>")   'disabled-key)
  (global-set-key (kbd "<C-up>")      'disabled-key)
  (global-set-key (kbd "<C-down>")    'disabled-key)
  (global-set-key (kbd "<C-left>")    'disabled-key)
  (global-set-key (kbd "<C-right>")   'disabled-key)
Learning emacs can means many different things.

The first thing you will need to learn is, indeedn to use it as a text editor. But you should also learn many other things, like learning eshell, learn and use elisp to adapt emacs to your work flow, use org emacs, rectangular editing, ...

Yesterday I send this "Mastering EShell" link [1] that didn't make the front page.

[1] http://news.ycombinator.com/item?id=2002037

2 comments

Is using the arrow keys really that bad? I understand that it moves you off the home row, but is _that_ really so bad? Should I be doing this?

If you're being serious, it kinda seems like just punishing new users for no good reason. If you want that kind of self-flagellation, use vim (kidding! kidding!!)

(FWIW I use arrow keys, but also other smart navigation combinations, a lot. I consider myself a reasonable user of emacs but no pro - I have bells and whistles turned off, fairly hefty .emacs/.emacs.d file, much of which I wrote (or tweaked, to be honest) myself for specific cases, etc. but I know I only use <1% of what is out there. I try and make myself learn a new feature reasonably regularly, though.)

Dont understand me wrong, I use Arrow Keys, plus S-j S-k S-l S-i as custom "smart navigation".

I think the extra pain, that you cause when you remove the arrow keys is worth because force a new user to be conscious all the time that he is not anymore in his old editor.

E.g For me the arrow keys were a good enough option to align things by hand, but after removing the them, I learned to use align-regex and rectangular editing.

Thanks. I've never used either align-regex or rectangular editing, so you've inspired me to give them a go!
Fantastic - not sure why you were downvoted, this is definitely my favorite solution! Thank you