News for hackers. Stuff that matters.
Re:Emacs Is My New Window Manager by a3n on Wednesday January 21, 2015 @06:48AM (#8922617)
I'm always a little jealous when I see what people do with emacs. But I've never liked using emacs, so I've resigned myself to a permanent, mild case of emacs envy.

I think you could get approximately his same functionality with a terminal (e.g urxvt) and tmux for the splitting. In fact I do essentially that at work on Windows, from a cygwin terminal and tmux. When it fits whatever workflow I'm doing from within cygwin, I'll launch the occasional Windows program from there; the rest of the corporate Outlook, IE etc is done normally from Windows.

At home on Linux I get my basic window splitting from my window manager, i3wm. If I need more terminal-ish splitting I'll run tmux in a urxvt.

... still jealous of emacs though.

Re:Emacs Is My New Window Manager by chriswarbo on Wednesday January 21, 2015 @08:02AM (#8922861)
The nice thing about Emacs is how much it's open to modification. There are compatibility modes to make it work like other editors (eg. "evil mode" to make it work more like Vi, "cua mode" to use "normal" key combos instead of having to learn Emacs's, etc.). There are often a bunch of alternative ways to do things, which have their own pros and cons, so if something seems frustrating, it pays to Google around a little to see if there's another way.

For example, running a terminal can be done with `term` (b/w) or `ansi-term` (colour), which provide a pretty standard xterm-like terminal emulator, completely under the control of whatever shell you use (eg. bash). This is useful for screen-manipulating programs like ncurses-based UIs, but is awkward to manipulate as text (a bit like the awkward copy/paste functionality in screen and tmux).

There's also `shell`, which runs a regular shell (like bash), but Emacs keeps control of the screen. This makes it useless for curses-based UIs, but great for text manipulation. For example, rather than running a pipeline over and over, tweaking the output options, we can often just dump everything to stdout then play around with it using the full power of Emacs (search/replace, regexes, keyboard macros, lisp functions, etc.).

There's also `eshell`, which is like shell mode but instead of a regular shell like bash, it uses a custom shell written in Emacs Lisp. Eshell's strength is its integration with Emacs; for example, Emacs Lisp functions can be run just like commands and Emacs buffers (including shells!) can be treated as files, etc. Eshell's weakness compared to shell is that it can't do pipes.

Personally, I use mixture of shell and eshell, plus some handy Lisp functions eg. for spawning new shells instead of always switching back to the same one. I avoid term and ansi-term in favour of a separate st terminal though, since they're pretty slow to update and their lack of decent text manipulation makes them feel uncomfortably "un-Emacsish".

Re:Emacs Is My New Window Manager by acomjean on Wednesday January 21, 2015 @09:23AM (#8923170)
M-x shell

is so useful for searching for text strings in outputs. (when grep alone will not do) like all things emacs/ terminal its a little awkward when trying to use the control keys (up arrow, ^r) and they get captured by emacs and not the shell.

Re:Emacs Is My New Window Manager by wainstead on Wednesday January 21, 2015 @09:35AM (#8923225)
Amen, and throw in hi-lock and you can create arbitrary keyword highlighting (like any time the word "error" appears it's colored red). Great for tailing log files.
Re:Emacs Is My New Window Manager by MarcScott on Wednesday January 21, 2015 @12:22PM (#8924130)
M-p is the replacement for up arrow
Re:Emacs Is My New Window Manager by wglb on Wednesday January 21, 2015 @07:57PM (#8926848)
Which I bind to f6 for convenience.
Re:Emacs Is My New Window Manager by codygman on Thursday January 22, 2015 @09:47AM (#8929362)
I've never understood claims that function keys are convenient, but I guess it's because I don't use them that much.
Re:Emacs Is My New Window Manager by wglb on Thursday January 22, 2015 @10:57AM (#8929800)
I agree that they are less convenient than the control key sequence, but better than the up arrow trick.

And it is a little worse on the kinesis, as the function keys are not the same quality as the rest of the keys.

Re:Emacs Is My New Window Manager by signa11 on Wednesday January 21, 2015 @06:45PM (#8926576)
have you tried multi-term (http://www.emacswiki.org/emacs/MultiTerm) it is much nicer than the canonical shell that is available...
Re:Emacs Is My New Window Manager by jfoutz on Wednesday January 21, 2015 @10:30AM (#8923474)
I've only used eshell casually, but /dev/clip for redirecting output to the clipboard was really handy. It turns out there's a bunch of ways to do this, but eshell was my first exposure to clipboard as file.

It's also kinda nice setting up emacs in a cygwin that winds up being relatively consistent with mac.

Re:Emacs Is My New Window Manager by agumonkey on Wednesday January 21, 2015 @12:22PM (#8924136)
Also redirect to buffer : ls >> #<buffer scratch>

(warning stars are turned into formatting in HN)

with C-c M-b to pick a buffer name easily

Re:Emacs Is My New Window Manager by wainstead on Wednesday January 21, 2015 @09:38AM (#8923239)
Another shortcoming of eshell is the still-incomplete manual.

https://www.gnu.org/software/emacs/manual/html_mono/eshell.h...

Re:Emacs Is My New Window Manager by omaranto on Wednesday January 21, 2015 @09:08AM (#8923098)
> Eshell's weakness compared to shell is that it can't do pipes.

I thought eshell had both pipes and output redirection but lacked input redirection.

Re:Emacs Is My New Window Manager by martanne on Wednesday January 21, 2015 @11:48AM (#8923874)
For some reason I share the feeling about emacs. However I personally prefer dwm in X11 environments and have thus written a "clone" for terminal/ssh sessions called dvtm.

http://www.brain-dump.org/projects/dvtm/

Re:Emacs Is My New Window Manager by rian on Wednesday January 21, 2015 @04:14PM (#8925820)
Digging the abduco/dvtm split.
Re:Emacs Is My New Window Manager by buro9 on Wednesday January 21, 2015 @08:02AM (#8922862)
What do you use i3wm with?

I like Debian and wonder if there's a best practise setup for desktop environment plus i3wm. Everyone seems to do something different and the setups I've seen have all had minor quirks (wifi tray icon, sound control, locking, etc).

Currently my main machine is Ubuntu 14.04 with Xcfe and i3wm and I have a few quirks (something about the keyboard charset picker never aligning with the Xcfe tray).

Re:Emacs Is My New Window Manager by TheCraiggers on Wednesday January 21, 2015 @10:00AM (#8923321)
For what it's worth, I also use i3 under Arch. I don't think there is a canonical right distro or anything, but then again I've only ever used it under Arch so what do I know? Also like the sister comment, I also use dmenu & i3bar to handle the rest of my needs. I generally stay away from things like conky.

Good luck, although I generally found i3 a breeze to set up. Part of that is due to the fact it was already 95% of what I wanted in a WM. I didn't have to spend hours and hours customizing it like dwm or Awesome. Your mileage will, of course, vary.

I will say that the Arch wiki page on i3 is a treasure trove of info, most of which is distro-agnostic or at least easily translated into debian flavors.

https://wiki.archlinux.org/index.php/i3

Re:Emacs Is My New Window Manager by a3n on Wednesday January 21, 2015 @12:14PM (#8924064)
> I will say that the Arch wiki page on i3 is a treasure trove of info

I think Arch docs are the best Linux docs I've seen. The FreeBSD manual is the only thing I've seen that's comparable. I've only ever ran Arch for a day or two a few times (no complaints), but Arch docs always deliver for me.

Re:Emacs Is My New Window Manager by rakoo on Wednesday January 21, 2015 @08:41AM (#8922991)
I use i3 on Arch with a custom dmenu (https://wiki.archlinux.org/index.php/dmenu) for opening GUI applications, along with tmux for terminal applications like OP. I also use the included i3bar (http://i3wm.org/i3bar/). i3 documentation is so good it's a joy to configure. I only have few tools, but it gets me wherever I need to go.
Re:Emacs Is My New Window Manager by a3n on Wednesday January 21, 2015 @12:08PM (#8924011)
Mint. Works fine, lasts a long time.