9

So, I'm addicted to vim and often add lots of garbage to regular text fields when I try to use vim commands and am not in vim. I thought to myself, why can't vim be EVERYWHERE?!

Then it struck me. Why not? Has anyone written a program that could redirect input/current text fields into a vim buffer so that one could use vim-style editing in things other than terminals and gVim? Redirect keyboard input? Alter a key-logger?

Any thougts as to how it could be done?$wdw thoughtsA I did it again. I need serious help. Ideas, anyone?

UPDATE: More in need. I just got an email with this as the tail end of it:

Campus librarians will be happy to work with faculty and students to identify alternative high-quality sources of scientific news reporting and analysis.

--Karen
:r signature

Its nice to know there are others.

3
  • You need a :s/\$wdw /^wce/.^[:wq
    – intuited
    Apr 17, 2010 at 22:45
  • @intuited english? Aug 3, 2016 at 19:13
  • Hmm looks like I was correcting @physicsmichael 's strikeout-ed text that was meant to fix the typo in the word "thoughts [sic]". For more explanation, fire up vim and do :help :s.
    – intuited
    Aug 11, 2016 at 18:48

4 Answers 4

2

I use vi-style editing in bash and vimperator for web browsing with firefox (sadly doesn't have :vsplit). In firefox the fantastic It's All Text! plugin configured to use gvim makes input boxes (likes this one) less crappy. mutt picks up my $EDITOR without problems (tell Karen to set that variable, too).

I guess that's all I ever do outside of vim.

3
  • I'll be checking vimperator for possible chrome extensions regularly. If I used Firefox, this would be awesome. It's a great start; thanks a lot! Apr 15, 2010 at 23:49
  • I followed some vimperator forums to vrome for chrome. I haven't gotten it to work, but for the sake of others there is an option. Apr 15, 2010 at 23:55
  • You can also try uzbl for a similar feel, but it needs a lot of work to get the features one is used to from "normal" browsers. Apr 16, 2010 at 0:24
1

I've not seen anything to allow this, but it sounds like it could be handled by writing a module to plug into an IM such as SCIM or IBus.

0
1

This isn't exactly what you are looking for, but I also have experienced the desire for vim keybindings everywhere. One solution I've used is Touch Cursor, which I mapped so that my home row keys would allow me to navigated my cursor. The default arrangement is not vim-like, but you can easily change that. It may take some getting used to holding the space bar to achieve chords, but I found it pretty natural.

These are some other programs that offer application-specific solutions: I use Viemu, which provides a vim emulation layer in Visual Studio 2005/2008, Outlook and Word.

There is also a new chrome extension that adds vim-like keybindings for browsing as well called Vimium.

1

I haven't found a way yet, but using an xclip script you can at least make the copy-paste-edit-paste cycle speedy. It pastes into a temporary file and edits it with Vim:

#!/bin/bash

# Dependencies: xclip, gvim

# Create an "ephemeral" file, that disappears with this process
tmpfile=$(mktemp /tmp/vim-edit-clipboard.XXXXXX)
exec 3>"$tmpfile"
rm $tmpfile

# It's unlinked, but can be referred to by other processes using /proc
ephemeral_path=/proc/$$/fd/3

# Paste to the file
xclip -selection clipboard -o > $ephemeral_path
# Edit it. Make Vim respect the presence or lack of EOL at EOF
gvim --nofork -c 'set nofixeol' $ephemeral_path
# Then copy it to the clipboard, removing the newline at the end
xclip -selection clipboard < $ephemeral_path

You'll probably want to assign a keyboard shortcut to this script, so you can do something like CtrlA, CtrlC, SuperC

1
  • 1
    if you want to get rid of the extra <kbd>Ctrl</kbd><kbd>a</kbd> <kbd>Ctrl</kbd><kbd>c</kbd> before each time you can simulate the inputs at the start of your script with something like xdotool: xdotool key --clearmodifiers ctrl+a key --clearmodifiers ctrl+c
    – guest4308
    Jan 10 at 20:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .