News for hackers. Stuff that matters.
Re:My biggest problem with Vim by dllthomas on Friday August 10, 2012 @11:41AM (#4366605)

  * select all: ctrl-a
  * copy: ctrl-c
  * spawn vim: ctrl-f ! vim enter (varies by desktop environment)
  * paste contents into vim: :.!xsel -o
  * edit text in vim
  * copy contents from vim: :%!xsel -ib
  * close vim: :q!
  * paste contents into original window: ctrl-a ctrl-v
Re:My biggest problem with Vim by slurgfest on Friday August 10, 2012 @01:13PM (#4367128)
There is no reason to use xsel. try "+p or "* p to pull into the clipboard, try "+y or "* y (edit: the spaces are just me trying to escape the asterisks for HN)

You can also easily configure vim so that simple 'y' and 'p' will operate using the system clipboard, which I do.

You don't have to spawn and close vim around each task either.

Of course vim has no way at all to reduce the amount of ctrl-a, ctrl-c, ctrl-f, ctrl-a, ctrl-v boilerplate you are doing in this example because that all occurs in some other program.

Re:My biggest problem with Vim by eieio on Friday August 10, 2012 @02:14PM (#4367415)
The easiest thing to do here would likely be to make an alias that runs vim -c s/^/\\=@\* which opens vim with the text from "* on the first line. You could even add a mapping like gg"* yG:qa!<Cr> to yank the new text and close vim(the space after the asterisk is to escape it, of course).

I definitely agree that having a faster way to use the system clipboard is great, but I don't like cloberring the clipboard when I do deletions and whatnot in vim, so I have <Leader><Leader> (I use ; for leader, seems like most people use ,) mapped to "* which I find much easier(;;y is so much faster than "+y for me).

Re:My biggest problem with Vim by dllthomas on Friday August 10, 2012 @03:14PM (#4367730)
This is a great idea, for optimizing this pathway. With a sufficiently programmable desktop environment, you can probably wrap it all up into one hotkey (including the select-all, cut, and paste in the original window). I'm not sure if it's quite worth doing, on first principles, but I may take a swing at it for the practice in customizing my setup.
Re:My biggest problem with Vim by slurgfest on Friday August 10, 2012 @02:48PM (#4367597)
although I've used vim for a while now, I still feel like chuckling when I see something like 'gg"* yG:qa!<Cr>' written out, because of how ridiculous it looks to anyone who doesn't use vim.
Re:My biggest problem with Vim by eieio on Friday August 10, 2012 @03:01PM (#4367652)
I know just what you mean, it looks absolutely ridiculous. I occasionally send coworkers very long vim macros just for the enjoyment of explaining how useful some 100-character line of gibberish is.
Re:My biggest problem with Vim by dllthomas on Friday August 10, 2012 @02:05PM (#4367382)
> try "+p or "* p to pull into the clipboard, try "+y or "* y

Very nice. I like xsel because it gives me more flexibility and uniformity (I can pipe it to/from whatever, and use it the same in the shell as in vim), but I'll probably wind up using the above for simple cases (especially if the xsel command I want isn't in my history for some reason).

Re:My biggest problem with Vim by eieio on Friday August 10, 2012 @02:25PM (#4367471)
I made a more detailed post below, but I would think an alias to something like vim -c s/^/\\=@\* (or @\+ I'm not sure which register you'd need to use) would be your best bet for fast editing: it should let you open vim with text from your clipboard already inserted on the first line.
Re:My biggest problem with Vim by slurgfest on Friday August 10, 2012 @02:47PM (#4367593)
You are right, piping with xsel is very cool.
Re:My biggest problem with Vim by ibotty on Friday August 10, 2012 @04:02PM (#4367959)
you will need a vim with xclipboard though. (not on every server)
Re:My biggest problem with Vim by patrickod on Friday August 10, 2012 @11:50AM (#4366668)
8 steps is hardly efficient. That's not a nice flow to edit every text field where you want a more powerful editor.
Re:My biggest problem with Vim by dllthomas on Friday August 10, 2012 @11:55AM (#4366701)
Eh, most of the time what I write in a text field is short enough I'm not really going to be editing it. When I find myself writing paragraphs, I do something like the above. I agree that it's not ideal, but it suffices.
Re:My biggest problem with Vim by patrickod on Friday August 10, 2012 @12:25PM (#4366859)
The biggest pain point I have with the constant copying back and forth is when I'm editing something that live previews in the text field or that needs to be executed. There are times when I just want to embed vim when editing code in a browser.
Re:My biggest problem with Vim by eieio on Friday August 10, 2012 @02:20PM (#4367448)
I use the pentadactyl extension for firefox, and I've added the emacs hotkeys <C-a>, <C-e>, <C-n>, <C-p>, <C-f>, <C-b>, <M-f>, and <M-b> to insert mode so that I can at least move between lines and words without much problem. It's not vim, but it makes things like writing this comment a lot easier for me.

Also having <C-p> and <C-n> as up and down means that moving between search suggestions on sites is really easy, which is nice.

Re:My biggest problem with Vim by q_revert on Friday August 10, 2012 @11:52AM (#4366679)

   f 24 ^M      - choose reply
   f 6  ^M      - enter text buffer
   ^i           - open vim
   *** write this message ***
   :wq          - message gets transplanted into text buffer
   esc, esc     - exit text buffer, exit insert mode
   f 7 ^M       - choose reply again

   ??? 

   profit       - vimperator
Re:My biggest problem with Vim by darklajid on Friday August 10, 2012 @06:15PM (#4368569)
pentadactyl user here.

I'd replace your second step with 'gi'. Saves a char, and avoids scanning for numbers..