5 ms·
Emacs, Google this
- ktamura 11y agoNeat idea. I've been using something like this with Acme from plan9port. Acme's plumber lets the user customize behavior on a piece of text based on its context or a program that takes it as an argument. A previous discussion about Acme on HN: https://news.ycombinator.com/item?id=4533156 https://news.ycombinator.com/item?id=4533156
- RBerenguel 11y agoSeems ages ago, but I wrote a post about its extensibility here: http://www.mostlymaths.net/2013/03/extensibility-programming-acme-text-editor.html http://www.mostlymaths.net/2013/03/extensibility-programming... I explained more or less how to use the plumber and endpoints, and gave a sample shell script and a reddit browser written in python you could plug into acme
- ktamura 11y agooh yea, I remember your blog. As a matter of fact, it was one of few variable resources to learn about Acme's "API". Thanks for your work =)
- RBerenguel 11y agoYes, there are very few resources about the "API", at least the original Acme/plumber papers are easy to read... And specially, the code is very straightforward in acme, the plumber or most of Plan9
- vcdimension 11y agoEmacs already has webjump which does pretty much the same thing but with arbitrary webpages.
- _ph_ 11y agoGreat! Thanks for this. I had considered writing something like that for ages. Sometimes error messages seem to be created only as a key for a search on Stackoverflow.
- agumonkey 11y agoFunny, just installed it two days ago after reading http://melpa.org/#/selected http://melpa.org/#/selected page which hints at it.
- toothbrush 11y agoHaha, interesting -- i've had a similar functionality that i hacked into my window manager (XMonad) forever ago. I have an arbitrary keystroke that grabs the highlighted (x clipboard) text, raises a running firefox instance, and plugs it into a StartPage search :). Especially useful when a terminal command barfs an error.
- psibi 11y agoThis functionality is sort of now available in the package xmonad-contrib[0]. [0] http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-Search.html http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-...
- deleted 11y ago[deleted]
- sjm 11y agoSimilarly, I use engine-mode (https://github.com/hrs/engine-mode https://github.com/hrs/engine-mode) with Emacs, which allows you to set up basically any search engine. I use Google (on C-c / g) and Github (on C-c / h), but the engine-mode readme explains how to set it up with DuckDuckGo, stack overflow, etc. It's configurable, but results can be displayed in eww, Emacs' built-in text-based web browser.
- ams6110 11y agoEmacs' built-in text-based web browser Is it time to update Zawinski's Law to "Every program attempts to expand until it can browse the web." Not that Emacs isn't already one of the best (if not the number one) examples of "kitchen sink" programs...
- sjolsen 11y agoEmacs gets a bad rap as a "kitchen sink" program, but it isn't really, any more than something like the Bourne shell or Python. The majority of Emacs' built-ins are things like an elisp interpreter, some text processing stuff, and system libraries. Conversely, most of the really interesting things you can do with Emacs, like web browsing (eww), git repo management (magit), terminal emulation (ansi-term), etc. are really just programs written in elisp. Some of them also happen to be distributed with Emacs.
- sooheon 11y agoI use Launchbar (https://www.obdev.at/products/launchbar/index.html https://www.obdev.at/products/launchbar/index.html) for this. It works system wide, I just select the word or phrase and tap the Option key once. This brings up Launchbar with that text inputted, and then I can send that off to Google, Wikipedia, the system dictionary, YouTube, or anything else. I love it because instead of having different convoluted keybindings for every different type of search (C-c / g, C-c / h, etc.) I only have one, and then dispatch off a fuzzy frecency search that takes <2 letters for the result I want. So tap Alt, Tab, g, Enter searches Google, while Alt, Tab, w, Enter searches Wikipedia, etc. It does tons more with this same paradigm, I use it more than the command line, and can't recommend it enough to people who like to optimize their computer use.
- alxprc 11y agoI use LaunchBar and didn't know about this; cool! For those who also didn't know about it: it's the 'Instant Send' feature under 'Shortcuts' in the preferences. It doesn't seem to work for words selected in the terminal, though, like in vim, or a scrollback buffer in tmux or less (you can click-and-drag to highlight things, but I mean highlighting in the apps themselves, like `viw` in vim to select the word under the cursor). That would be very nice.
- ams6110 11y agoWait -- you need an app for this now? Ever since NEXTStep, Mac OS X has had the "Services" entry on the menu which can do things like this. Is that gone now?
- dubya 11y agoServices are still there. Command-shift-L Googles the selection, though I don't know how standard this is.
- raverbashing 11y agoDoes Google's terms of use allow this?
- Styx- 11y agoTwo questions. Why wouldn't they, and how could they tell?
- raverbashing 11y agoI might have gotten this wrong, but it seems emacs open a browser window with the given query, then it's ok I was thinking it would do a curl/wget on the url then show the results on emacs
- ams6110 11y agoI don't understand the practical difference between your two examlpes. What does a browser do, other than essentially "run curl on the URL and then show the results"
- raverbashing 11y agoTechnically of course, there's no difference, however: https://support.google.com/webmasters/answer/66357?hl=en https://support.google.com/webmasters/answer/66357?hl=en
- gaius 11y agoWhy not? It's just another browser.
- cLeEOGPw 11y agoWhy would I care? Honest question.
- _asummers 11y agoIn a similar type of helpfulness (though the Google one could replace this in certain cases) helm-dash is an excellent plugin. You can bring up the helm-dash menu and search your Dash docs for functions by name, or search for the symbol at point. I have mine configured to open the docs in my browser, pointing to the local docs. If you use OS X, something is broken in browse-url (I think) which causes anchors to not get opened correctly (annoying), so I added this[0] snippet to allow it. Not robust at all, but you get the idea. The "open -a" gives window focus to Chrome, mimicking the built in behavior. [0] https://gist.github.com/asummers/8b8dfabf0e25a86ce0c320b39ba5aa29 https://gist.github.com/asummers/8b8dfabf0e25a86ce0c320b39ba...
- merb 11y agoEmacs is a great operating system – it lacks a good editor, though.
- supernintendo 11y agoI love Emacs as an editor but there's also Evil mode [1] (and I'd disagree if you told me Vim isn't a good editor). [1] https://www.emacswiki.org/emacs/Evil https://www.emacswiki.org/emacs/Evil