Hacker News new | comments | show | ask | jobs | submit login

This is what the scratch (EDIT: read scratch as * scratch * without the spaces--is there any way to escape that properly on HN?) buffer is for in Emacs, and I find it extremely useful. Also, unlike using a different tool, it allows me to use all the Emacs-specific features I usually rely on. (For example, I can easily type special characters like r₁ × r₂ ≈ r₃ using the TeX mode.)

If you want more than one scratch buffer--which happens to me once in a while--you can just create a new buffer with any name, and it will also do. New buffers are in a different mode by default, but you can set it up to work exactly the same way as scratch if you want.

As another commenter pointed out, you can use the browser to evaluate JavaScript. Emacs lets you do the same thing with elisp in the scratch buffer by default: try entering in an elisp expression and pressing C-j.

Just a fun alternative to this trick for the Emacs users around here :).

I have a scratch.txt file that I've had around for years. Just shy of 10,000 lines now - it's full of workings and things to remember.

I keep it in textmate, been thinking about moving it to vim but I quite like having it in its own space.

I just work in a call center right now, but live in my scratch buffer all day long. Being able to go from note taking to evaluating elisp for quick calculations and never having to switch tools is great. Plus the main piece of software for taking orders is a horrendous java application, with all kinds of weird buggy behavior, so the more I can do with firefox + emacs the better.

There's also a "scratch" plugin for vim that offers similar functionality: http://www.vim.org/scripts/script.php?script_id=664

Geany has a built-in scratch pane, as well (along with a Terminal and some other handy panes that come included).

For vim, I just open an unnamed buffer (:new). I think this is exactly the same as the scratch buffer in emacs.

The only differences being, when you close vim, the scratch buffer does not yield a save prompt, and also, if you open a scratch buffer, then close it, and then reopen it again with :Scratch during the same vim session, any leftover contents from before (but during that same vim session, of course) will be restored, which is neat/convenient. :)

edit: misread your comment, thought you were comparing :new and :Scratch (linked above), not emacs' scratch. Not sure about that one, but again, the 'reopen scratch -> find leftover contents' functionality is a neat thing.

:new | set buftype=nofile

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact