Is there a way I can select a portion of multiple lines in vim and then paste them at the end of another block of lines. For instance if I want everything after the equal sign from:
qw=12345
er=23435
and pasted into:
ty=
ui=
What would I have to do?
This seems real simple, but for some reason, I am completely stuck.
You are looking for block selection mode.
Please note the different keybinding for Windows platforms.
Related
My vim seems to be acting weird today.When I try to copy paste it is carrying out the vim keyboard shortcuts related to the characters I have copied and pasted. e.g. If i copy and paste two letter ks they will not paste but the cursor will jump up two lines. I think it has something to do with SHIFT+CTRL+V taking me out of insert mode and into normal mode. Then paste is putting the kk as input into normal mode.
How do I get back to the correct copy paste functionality/ stop making shift+ctrl+v exit insert mode? Thanks!
My cluster terminal went into bracketed paste mode while in vim somehow.
Typing reset into the terminal outside of vim fixed it.
What i am looking to achieve is simple, but i am a noob in this and i have tried to get that done.
I am used to copy in excel but in Emeditor i feel there is a better way of doing that, afterall it opens more file.
I do not want to be copying-down specific line range like i do in excel.
For instance, if i have a file that is 20million lines, and i need to copy only specific range, maybe between 1-2M or from 2M to 5M, without having to highlight and copydown, how do i go about it?
I will appreciate your responses.
Press F8 (or Ctrl+F8 to select whole lines) to mark the
beginning point of a selection.
Press Ctrl+G and specify the destination line number/column to jump to the ending point.
Press Ctrl+C to copy the selection.
Line number 7 shows the paste of a macro I recorded. When I copy/paste it, the following 4 lines is what I get. I know we can replace ^[ character using <ESC>, but thats not just one, there is ^M & that too in many places. It doesn't seem to be a scalable way to get things done. I feel there is a better way to deal with this than by manually replacing the special characters. If anyone is aware of a better solution, please suggest?
Normally, I am using <shift-v> and <up(or)down> to select some lines of code in vim. Then I use <y-y> to yank the lines. Then, I do <p> for pasting the code at the desired location.
I used this step for a long time and had no issues. Recently, I started noticing that when I yank more than 10 lines and paste them, only 2 of the lines are pasted.
What could be the reason for this? If anybody knows alternate ways of selecting multiple lines, yanking and pasting it, please let me know.
I have never seen where lines get lost when I paste them. However, when you use visual mode (shift-v), usually you only need the first "y" to yank lines. It's likely that when you press the second "y" and move down, you are actually yanking the top two lines (which is what is supposed to happen). You probably just need to stop pressing "y" twice. (Hint: press "y" once in visual mode, or twice when you want to yank the current line in normal mode).
You can yank multiple lines in a variety of other ways. For example, 14yy will yank 14 lines. If you use gvim, you can use the mouse cursor to select text. You can also do y14j to yank the next fourteen lines, since y, followed by a movement command, copies everything in that movement command.
Probably this question is absurd for you and i don't know if there is solution.
What i would like to do is increment the number that i have copied with control-c after each control-v that i do..
For example if i copy with control-c the number 10 from a site, then when i paste with control-v in another program the number pasted should be 11 etc..
Is there a way to do this???
Because i have to insert about 2000 number in a program and in this specific case is not possible to do script in order to automate the work..
I hope in some answer
Thanks
I can't think of a great way to do it.
What comes immediate to mind is you can open Excel and have two cells, let's call them incoming and outgoing. You paste into incoming, and outgoing is setup to be incoming + 1, which you can copy and paste into your program. So you double the number of copies and pastes you have to make but it won't be the end of the world. It sure beats manually typing.
It's possible, using a small (custom written) program that would run in the background. It would have to look at the contents of the clipboard, test if it's numeric, and if so, increment the value, if it's not already been incremented. Shouldn't be all that hard for a windows programmer worth their salt to cook up.
I did this in excel when i needed it multiple views. row() function enters current row number. Copy this cell for as many times as you want one below other and then copy paste in android studio.
=CONCATENATE("dateBoxView"|ROW()|" = fragmentView.findViewById(R.id.dateBox"|ROW()|");")
You can do this using something like Pulover's Macro Creator. You press a hotkey to copy a number. Everytime you press ctrl-v a the copied number gets +1 and that new number copied to clipboard for the next paste. When you want to stop doing this just stop the macro.