Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).



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.


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: