- Fisher blogja
- A hozzászóláshoz be kell jelentkezni
- 248 megtekintés
Hozzászólások
6.5.6.1 Copying Lines
To copy a line requires two commands: yy or Y ("yank") and either p ("put below") or P ("put above"). Note that Y does the same thing as yy.
To yank one line, position the cursor anywhere on the line and type yy. Now move the cursor to the line above where you want the yanked line to be put (copied), and type p. A copy of the yanked line will appear in a new line below the cursor.
To place the yanked line in a new line above the cursor, type P.
The yy command works well with a count: to yank 11 lines, for example, just type 11yy. Eleven lines, counting down from the cursor, will be yanked, and vi indicates this with a message at the bottom of the screen: 11 lines yanked.
You can also use the P or p commands immediately after any of the deletion commands discussed earlier. This puts the text you deleted above or below the cursor, respectively.
- A hozzászóláshoz be kell jelentkezni
Aha... na, egy kicsit jobban érzem magam.
- A hozzászóláshoz be kell jelentkezni
Eredeti vi doksiból vágtam ki.
Viszont nézzük a vim oktatóanyagát:
$ sudo apt install vim # ha netán nem lenne fent a teljes
$ LANG=en_US vimtutor
Lesson 6.4: COPY AND PASTE TEXT
** Use the y operator to copy text and p to paste it **
1. Move to the line below marked ---> and place the cursor after "a)".
2. Start Visual mode with v and move the cursor to just before "first".
3. Type y to yank (copy) the highlighted text.
4. Move the cursor to the end of the next line: j$
5. Type p to put (paste) the text. Then type: a second <ESC> .
6. Use Visual mode to select " item.", yank it with y , move to the end of
the next line with j$ and put the text there with p .
---> a) this is the first item.
b)
NOTE: You can also use y as an operator: yw yanks one word,
yy yanks the whole line, then p puts that line.
- A hozzászóláshoz be kell jelentkezni
Aha. Alakul ez.
Szóval ez úgy volt, hogy a ~20 gépből kettőn nem ment. Az a kettő pont Ubuntu, frissebb csomaggal. Oké, néztem én hogy milyen cséncsek vannak amik eltörnet ezt-azt, de túl hosszú volt a lista, illetve biztos voltam benne, hogy az általam frissen összeügyeskedett konfiggal van a baj.
Persze miután már teljesen mindenféle plugin, konfig, minden nélkül indítva se volt jó, kezdett gyanús lenni. Aztán kiderült, hogy már eleve a regiszterbe "rosszul" yankol, és akkor már "könnyű" volt, hogy tudtam, pontosan mire is is keressek.
Aztán ja, hát ilyen, az egyik vi* ilyen, a másik vi* olyan.
- A hozzászóláshoz be kell jelentkezni
Próbálj meg ,,nvi''-t telepíteni és használni. Ez ,,bug-to-bug'' kompatibilis az eredeti Bill Joy-féle vi-vel.
"Share what you know. Learn what you don't."
- A hozzászóláshoz be kell jelentkezni
Nem az a cél :)
A neovim most ki van cicomázva, elégedett vagyok vele, és a következő húsz évre ellát tanulnivalóval. Szóval teljesen jó így.
- A hozzászóláshoz be kell jelentkezni
20+ éve használok vi(m)-(e)t, alap szinten. Én mindig is "yy"-jal copy-ztam 1 sort, 4yy paranccsal 4 sort, stb.
Az aktuális sortól a fájl végéig yank-et meg mindig y+Shift+G-vel csinálom.
A gyors gondolat többet ér, mint a gyors mozdulat.
- A hozzászóláshoz be kell jelentkezni
Én mindig az yy formát használom. Az is igaz, hogy amikor láttam a címet, helyből az ugrott be, hogy "nem, mert a yy a teljes sort teszi a pufferbe, míg a Y az y$ -t jelenti". És ehhez képest meglepetéssel láttam hogy az Y az a yy -t és nem az y$ -t jelenti.
- A hozzászóláshoz be kell jelentkezni