11 ms·
It's definitely a problem All Vi/Vim users know well; and, it's precisely why I don't install these "vim mode" plugins / extensions / whatever for other softwar
by bcrescimanno 14y ago
It's definitely a problem All Vi/Vim users know well; and, it's precisely why I don't install these "vim mode" plugins / extensions / whatever for other software. Simply put: no matter what they do, it's still not actually Vim. And honestly, I'd rather be forced to do a complete mental shift into a "plain editor" mode rather than have to wrestle with "will this particular combination of Vim commands work in this pseudo-Vim world?"
I've found that if I completely break the expectation that I'll get anything even remotely "Vim-like" outside of Vim, I'm better able to deal.
...though I still wish I could make every editor I have to interact with a Vim window. :)
- dllthomas 14y ago* 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
- patrickod 14y ago8 steps is hardly efficient. That's not a nice flow to edit every text field where you want a more powerful editor.
- dllthomas 14y agoEh, 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.
- patrickod 14y agoThe 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.
- eieio 14y agoI 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.
- q_revert 14y agof 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
- darklajid 14y agopentadactyl user here. I'd replace your second step with 'gi'. Saves a char, and avoids scanning for numbers..
- slurgfest 14y agoThere 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.
- dllthomas 14y ago> 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).
- eieio 14y agoI 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.
- slurgfest 14y agoYou are right, piping with xsel is very cool.
- ibotty 14y agoyou will need a vim with xclipboard though. (not on every server)
- eieio 14y agoThe 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).
- dlikhten 14y agoI started using VIM 3 months ago. And now I can't fucking use anything else. The ergo gains of vim are so rediculously awesome, and NOBODY else does VI right, other than VI. Even Sublime 2, it has vintage mode but its not VI, it's missing most of the magic. This is why we need a new VI. One that has better syntax highlighting, one that can use something other than VIMScript AND STILL support all of vimscript. Something with better graphics like what Sublime 2 has, but still lose nothing of VIM's power. Tough project, but needs to be done.
- bcrescimanno 14y agoBetter syntax highlighting? For what language? In all honesty, it's not super-tough to write your own syntax for any language. If you do it, release it on github and others will probably be willing to contribute. Vim has support for scripting against Python and Ruby in addition to VimScript. Better graphics? For what purpose? For displaying text?
- Ralith 14y ago> it's not super-tough to write your own syntax for any language Spoken like somebody who's never tried to parse C++.
- slurgfest 14y agoParsing C++ isn't required if all you are doing is syntax coloring. vim has a fully configurable syntax highlighting system; its behavior is not hard-coded. So if you have a problem with how C++ is highlighted then you don't need to petition for the developers to patch or rewrite vim for you. You can tweak the related configuration. And it's true that it's really not that hard to make your own new configuration to do this. Because you aren't compiling the code, you are only highlighting it according to your own tastes.
- Ralith 14y agoAny syntax highlighting scheme which does not leverage a language parser is woefully limited. If you're satisfied with a scattering of heuristics, great; you'll find satisfaction in a much wider set of tools. Myself, I want syntax highlighting that doesn't break as soon as I do something unusual, and which is capable of more than identifying keywords. Given that vim is open source, I'm not sure why you think hard-coded syntax highlighting would be impossible for me to modify.