Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

M-x shell is one of the first things I just show people when I introduce them to Emacs. I had a databases class a few years ago where the CLI program we used to interact with the database was a basically an input loop where you entered commands. It had absolutely no concept of history though so if you messed up a query you had to retype it or use the clunky copy and paste feature of whatever terminal emulator you were using. Emacs changed everything though be cause I could just kill my last command and paste it into the new prompt. I have since done this with many other commands and I love it.


sort by: page size:

Just use `M-x shell` in emacs.

My favorite thing I wish they'd told me about emacs:

M-x shell

Run a shell (or shells) inside emacs. Great for long running apps like servers. You can search back through the output using normal Emacs search commands. For me, one of the killer features of Emacs.

Rename the shell buffer to something else to start another shell.


M-x shell in Emacs lets you use your mouse.

The best feature of emacs is running shells in buffers. For interactive work, this is supremely useful because you can easily search your history, grab previous lines/chunks of code, and edit them into future commands. I do this all the time for data exploration with python.

I mostly use `M-x shell`. One of the best features (other than the standard features of Emacs buffers) is `C-c C-p` and `C-c C-n` to jump to the previous/next prompt.

Is anybody else addicted to shell mode within emacs?

I love having the shell as just another buffer right in the editor. Easy history searchability, copy and paste between code and various repls or SQL prompts, and all the other full editor features available at the prompt.


Of course you can do the same shell thing easily enough with emacs, too.

I've used Emacs off and on for years now. But I can never get to that place where I get totally emersed because of the clunky terminal/shell story. I've tried eshell but what always gets me is having to C-c while in the terminal or eshell to get back to a different buffer.

I prefer M-x and fuzzy function entry to key bindings and when I'm in a terminal buffer or eshell I always go for M-x which won't work.

Any tips would be appreciated as I really like everything else about Emacs.


Tangent: any tips on how to make the M-x line more usable, similar to a command palette?

I just got started with Emacs, and the archaic terminology and inconsistent naming is causing me to have to consult StackOverflow for basic things like “what are the copy and paste commands called?”. (Those were probably both in the tutorial, but I already forgot them a few times.)

I’m aware of “apropos”, but it also uses antiquated terminology, so it’s frequently not useful to me.

I’m sure this problem has been solved :)


Thanks for the info. It's been many years since I tried shell use under Emacs; I should have figured there'd be a better solution by now!

I've been messing with Emacs lately, tab completion in M-x is amazing. The editor is surprisingly discoverable because of its "minibuffer" command window.

I use Emacs shell-mode for most of my terminals, which allows navigating and editing the buffer just like any other file. I'll often make several copies of a command, then use a macro to alter each one; after checking that they look right, pressing Enter will send them all to the shell.

Emacs + Smex makes the M-x command discovery even more effective.

For me the killer feature of using emacs on a Mac is having a dedicated command c/v/x/z for copy/paste/cut/undo that's separate from ctrl c/v/x/z in emacs (and readline shell bindings in general).

I've been using those commands in Emacs since the late 70s

I agree. That’s why I mostly use Eshell in Emacs, but if for some reason I’m in a stand-alone terminal emulator and need some advanced editing capabilities ^X ^E saves the day by firing up Emacs on the current input.

Emacs has done this for years.

This is one of the things that makes Emacs one of the coolest pieces of software to me. 98% of the operations it can do, are defined in functions, which you can search for easily in the M-x pane with something like Helm, and boom. Even navigation. It's a near fully self-documenting editor that I rarely need to look up help on. Never forget how to activate an action again. Remember what the action is, type it, find the matching command that is aptly-named, push enter to run it. And, with Helm for example, it even shows the keybind next to it.

I might be misremembering, but I think there was a package for Emacs that would track the most frequently used M-x commands, so that you could later look at the list and see which ones are worth binding to a key. I can't for the love of me find it now.
next

Legal | privacy