Live data from Hacker News

Mastering Emacs

masteringemacs.org

71–80 of 102 posts

Re: Mastering Emacs

#71
post #67
post #66

Is it weird that I wish somebody would make a terminal-ized version of newer editors like Atom/ST/Brackets?

How else can you screen/tmux your work? Terminals ftw.

If you're using emacs you can use M-x eshell to open a shell. Combined with tramp (which lets you open remote files via ssh: C-x C-f /ssh:you@otherhost:path/to/file) you can actually avoid using tmux/screen at all. Instead of managing screens in tmux and simultaneously buffers in emacs, you just need the emacs buffers.

Re: Mastering Emacs

#72
post #40
post #31

I hadn't tried Magit before now, but on the suggestion of this blog I'm giving it a look through. Looks good so far. I also enjoy the style the blog is using: anyone know what backend the author is using?

One thing I hated about magit was that I couldn't stage multiple files with a region or similar. I'm currently on my phone for the rest of the evening so I won't have chance to check - if you notice this has arrived in your testing, do let me know! I usually use shell emulator + company for dir/file autocomplete. This is the fastest I've got to staging individuals files or dirs, especially with projects that have a d…

> stage multiple files with a region or similar

This feature has been available for some time, I believe. In magit-status, just select with region the files and then `s` to stage the highlighted files.

Re: Mastering Emacs

#73

Earlier quoted context omitted.

Swap your CTRL and caps lock keys. It will make it a lot easier to use.

If emacs expects 3 modifier keys, and emacs is wildly popular with programmers, then why hasn't someone made a keyboard with the windows key renamed and remapped to the missing meta key?

Look up HHKB, that is what the best emacs users I know prefer to use.

Re: Mastering Emacs

#74

If you're on OSX and want a good Emacs, go to https://github.com/railwaycat/emacs-mac-port and read the installation instructions under the Homebrew section. It follows the official Emacs repo pretty closely, but has useful OSX additions (smooth scrolling, gesture support [font size e.g] and more).

That git repo claims to be retired. I get my emacs from here http://emacsformacosx.com

You misunderstand.

The repo you're referring to is Railwaycat's mirror of Yamamoto Mitsuharu's codebase. (which previously was only available via ftp and tarballs.)

Yamamoto has recently migrated to git and hosts a repo at Chiba U, the address is: http://www.math.s.chiba-u.ac.jp/~mituharu/emacs-mac.git

HOWEVER. Railwaycat does still maintain the Homebrew tap and formula for installing Emacs Mac Port

Here: https://github.com/railwaycat/homebrew-emacsmacport

A simple install via:

   brew tap railwaycat/emacsmacport
   brew update
   brew install emacs-mac
And you have a far superior Emacs for OSX than that built by emacsformacosx.com.

Once built, you can (without any problems) move the Emacs.app into your /Applications/ folder.

Don't do yourself a disservice, install Emacs Mac Port now.

Re: Mastering Emacs

#75

Earlier quoted context omitted.

Swap your CTRL and caps lock keys. It will make it a lot easier to use.

If emacs expects 3 modifier keys, and emacs is wildly popular with programmers, then why hasn't someone made a keyboard with the windows key renamed and remapped to the missing meta key?

you mean like this?

http://i.imgur.com/evUJkAv.jpg

Re: Mastering Emacs

#76
post #33

Earlier quoted context omitted.

hjkl is QWERTY-centric, and would be totally nonsensical to a user of a different keyboard layout, like Dvorak. C-f, C-b are English-centric, and would be totally nonsensical to a user of a different language. Intuitive is hard.

Hmm, maybe someone should invent keys with arrows on them! :P

That just sounds silly.

Re: Mastering Emacs

#77
post #72
post #40

Earlier quoted context omitted.

One thing I hated about magit was that I couldn't stage multiple files with a region or similar. I'm currently on my phone for the rest of the evening so I won't have chance to check - if you notice this has arrived in your testing, do let me know! I usually use shell emulator + company for dir/file autocomplete. This is the fastest I've got to staging individuals files or dirs, especially with projects that have a d…

> stage multiple files with a region or similar This feature has been available for some time, I believe. In magit-status, just select with region the files and then `s` to stage the highlighted files.

It's a little un-intuitive.

Adding git-gutter to the mix will allow staging / reverting at the hunk level.

I should probably note also that in Magit status, the user has to TAB the unstaged file to be able to do region or hunk level staging.

Ideally it would be possible to do it in the buffer in question as well.

Not even git-gutter has region style staging. Hopefully it will be implemented soon. I had a crack at it but time got away from me.

Re: Mastering Emacs

#78
post #31

I hadn't tried Magit before now, but on the suggestion of this blog I'm giving it a look through. Looks good so far. I also enjoy the style the blog is using: anyone know what backend the author is using?

There's a lot of power hidden away.

Interactive rebase/squash is tough to find... so here it is.

in Magit status, do l l (log, short-log)

Select the sha1/commit you want to begin squash/pick rebasing...

press E

off you go.

Re: Mastering Emacs

#79
I'm really enjoying using Cask to manage my Emacs packages:

https://cask.readthedocs.org/

You maintain a list of packages in a Cask file and run "cask" to automatically download and install them from a repository like MELPA. Like Gemfile or requirements.txt, but for Emacs.

I found this really reduced the number of elisp snippets I've had to write or grab from around the web. Most popular packages are on MELPA, and there's usually a more polished way to accomplish things I was hacking together myself.

Re: Mastering Emacs

#80
post #60
post #54

Earlier quoted context omitted.

ctrl-k ctrl-y ?

Not quite the same. For instance, to duplicate a line in Emacs you have to go to the beginning of the line, kill it and then yank twice, and it doesn't even work always, particularly at the end of a buffer. In vi, it's just yyp. No corner cases.

Just to share experience, i've recorded Macro named dup-line and bind to `C-M-y`. And find it very handy :)
Post reply on HN