21

I come from the Mac world, where I use http://www.hogbaysoftware.com/products/quickcursor to edit text from anywhere in Vim.

Is there anything like that on Linux ? I'm already using "It's All Text" in Firefox, but I'm looking for something broader.

Also, I've looked at this thread, but it's only solutions for software X, and software Y. Any idea ?

3
  • @Evan: I'm a Linux user and I'm not interested in Macs. You don't have to pay; he offers the source on Github.. and its not as simple as opening a file from your file browser. Have you seen the video on the app's homepage?. Personally I can't see the point of it, but I'm not Julien, and maybe I like calico :) .. @Julien: I like the " one-editor " idea, and I often copy text to my favourite editor and then paste it back. That can be done in about 4 keyboard actions, using a very short script. But I'm not sure of the details of what quickcursor does. Does it always paste the entire vim document?
    – Peter.O
    Feb 16, 2011 at 12:40
  • I'm becoming more interested in it! I tried the FF addon, and it's quite good (using it now :), so +1 for even that reference. I read QuickCursor's pdf github.com/jessegrosjean/quickcursor/blob/master/…. It uses simple copy and paste, but he monitors the source TEXTAREA in a manner which is beyond simple scripting. I think the FF plugin gets it easier, as it only has to deal with text in it own environment (which it has full access to). QuickCursor looks good, but until a Linux equivalent surfaces, its back to Alt+Tab and It's All Text :)
    – Peter.O
    Feb 17, 2011 at 2:34
  • I don't know of any tool like that in Linux. I would email the guys from quickcursor and ask them to port it. I expect that it will be a mission to make it a universal Linux tool as it seam like it is working with the Mac windows manager and Linux has so many. I would be specific in your request ask for them to port it to gnome or kde which ever you use. I might also try posting on the gnome and kde projects wish lists for a feature like that.
    – nelaaro
    Feb 17, 2011 at 8:56

2 Answers 2

2

It would depend on what file manager you are using, but most of them you can usually add some sort of right-click menu item to "Open in Vim".

I use Dolphin for KDE4. To add menu items (called service menus) you create a .desktop file in your service menus folder. In my system this resides in /usr/share/kde4/services/ServiceMenus but it may vary for your system.

Create the file open_in_vim.desktop with the following contents:

[Desktop Entry]
X-SuSE-translate=true
Type=Service
MimeType=all/allfiles
ServiceTypes=KonqPopupMenu/Plugin
Actions=openInVim
X-KDE-Priority=TopLevel

[Desktop Action openInVim]
Name=Open in Vim
Icon=gvim
Exec=gvim %u

Restart Dolphin (or Konqueror) and you should see this option when you right-click on a file.

If you would also like to be able to open folders in vim, then change the mime type to all/all.

If you would prefer to have "Open in Vim" appear under the Actions menu then remove the line, X-KDE-Priority=TopLevel

Granted, it's not intuitive, but you don't have to pay money in order to do it!

1
  • For KDE5, use ~/.local/share/kservices5/ServiceMenus/. Sep 3, 2016 at 11:35
1

Try this script: quicked. I was inspired to have a bash at it, after having tried It's all Text!.. (Hey, I'm Australian; the "bash" pun was unavoidable :)

It isn't as slick as It's all Text! which is limited to use within Firefox, but it works for (almost) ALL text in (almost) ALL windows ...I'm using Ubuntu 10.04

It should(?) work in other X11 / Gnome environments, but it may not(?).

By default it is set to use gedit, and you can choose gvim if you prefer...
...just change the value of EDITOR=

Be sure to read all the comments..

It should do the trick until something better comes along...

PS: You must pre-select some text, but there is no need to copy it to the Clipboard.
Just select the text and then press whatever shortcut key you've chosen for quicked

PPS:
In the script's comments I forgot to mention: xwininfo is in the x11-utils suite.
...so, to install all the dependencies on Ubuntu/Debianm use the following command

  • sudo apt-get install wmctrl xclip xdotool x11-utils zenity
1
  • The linked 'paste' is no longer available.
    – dotancohen
    Dec 26, 2013 at 7:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.