Home » Questions » Computers [ Ask a new question ]

In Firefox, is there a shortcut to paste the content of the X buffer directly into the search box?

In Firefox, is there a shortcut to paste the content of the X buffer directly into the search box?

In particular when programming, it's handy to post error messages in Firefox' search box, to see what Google has to say on the matter :) On linux and particularly X11, it's even more handy since you only have to select some text to put in the X buffer, to later paste it with the middle button.

Asked by: Guest | Views: 370
Total answers/comments: 3
Guest [Entry]

"The problem is subtle. You want a way to clear the contents of a text field without selecting the contents first, because selecting them will clobber your selection buffer's contents. In my opinion, this is a design flaw in whatever UI toolkits are used on Linux. Only manually selected text should be copied to the X primary selection, not text that is selected incidentally as a result of a non-text-selecting operation (e.g. clicking in a text field). But anyway, how about a couple of workarounds?

If you don't mind adding extra toolbar buttons, you can try the pastego extension: But I'm not sure it works with the X selection.

Another option is to install one of the many extensions that add clear buttons to the location/search bars, such as Clear Fields, DiggiDig, ClearURLButton, or xclear. Then, you just hit the clear button, and the text field is empty, ready for you to middle-click your own text into it.

Lastly, you can try clickngo, which does more or less exactly what you want, and seems to work in FF 3.5, despite the lack of a recent version bump.

Edit: I just remembered a command-line solution to this problem: surfraw. Here's the beginning of the package description:

Surfraw provides a fast unix command line interface to a variety of
popular WWW search engines and other artifacts of power. It reclaims
google, altavista, dejanews, freshmeat, research index, slashdot
and many others from the false-prophet, pox-infested heathen lands of
html-forms, placing these wonders where they belong, deep in unix
heartland, as god loving extensions to the shell.

Basically, it lets to do google (and other) searches from the command line."
Guest [Entry]

"I'm not entirely sure I understand the question, but here's a favorite set-up of mine:

Give all the items in the search bar keywords (Google is 'g', CPAN is 'cpan', Wikipedia is 'wiki', Weather.com is 'w', and so on)
Remove the search bar from the GUI (it just wastes space and after 1 you no longer need it). You can do this via View -> Toolbars -> Customize. Drag the search bar off the browser onto the customizer to remove it.
When you want to search, CTRL + L selects the whole address bar. Type 'g' and then insert the text you've copied. Hit enter and you just started a Google search. (If it's an error message, you probably want to try the search wrapped in quotes first, now that I think of it.)"
Guest [Entry]

"While this isn't a single key combination, using SHIFT+INS to paste, you can do several in quick succession. So your key combos would be

Highlight or cut something in your IDE or Terminal
ALT+TAB to Firefox
CTRL+K in firefox (will auto select everything, no need to delete)
SHIFT+INSERT to paste (w/o using mouse)
ENTER

also, I would recommend setting up Firefox to open a new tab on every search, so you don't lose everything you were referencing on in your browser:

go to about:config
search for 'openintab'
set browser.search.openintab to true"