Yves Dorfsman writes: > For people spending a lot of time in a terminal/shell (bash, csh etc...) do > you work from the shell or from an editor? > > The joke goes that people using emacs live inside emacs, and I have indeed > seen developers working from a simple window and sending chunk of code to a > compiler/repl right from emacs, now what about the shell? > > I'm a vi/vim person, and when working from the shell I tend to use one of > these two patterns:
> [ . . . ] > This morning it occurred to me (after 25 years of using UNIXes, I'm not > really > fast I guess) that if I know that the output is going to be very long and it > is likely that I will want to do searches on the output, I can open a blank > file, then do something like (in vi/vim): > > esc-: r ! whois google.com > > Bingo! Then really, I can continue my day by doing "Shift-g" and re-using the > above trick. It has the huge advantage to log everything I do, I guess I > could > clean up anything I don't really care for (or not and assume that anything > could be important, I just don't know yet), and save the file after the date > and have a log of my work for the rest of my life. Now, I could see the added > gymnastic of "esc-: r !" becoming a pain very quickly. > > Hence my question, anybody already doing something similar (Even with emacs, > I > guess that'd be the straw to get me to start using evil mode!)? Can you > describe? The basic equivalent of that vim command in Emacs is M-! (M-x shell-command), which will run a shell command and display its output in a buffer. You can also do M-| (M-x shell-command-on-region) to have a region supplied as input to the shell command. However, you can also use M-x shell or any of several newer variants such as M-x eshell or M-x term to get an interactive shell in an Emacs buffer, but with command history and command-line editing managed by Emacs instead of your shell, and output logged in the buffer. M-x term emulates a full-screen terminal within a buffer. There are also a number of other modes to run programming language interpreters (Python, Lisp/Scheme, etc.) interactively in an Emacs buffer, so you can do things like send code you are editing to the interpreter for execution and testing. _______________________________________________ Tech mailing list [email protected] https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech This list provided by the League of Professional System Administrators http://lopsa.org/
