Is it possible to yank an entire block of Python code in Vim?
Be it a def, for, if, etc. block...
Is it possible to yank an entire block of Python code in Vim?
Be it a def, for, if, etc. block...
If you want to yank everything except the { use yi{ (or yi}). If you to include the curly braces use ya{ (or ya}).
The i and a modifiers mean in and all.
To yank a word no matter where in the word you are: yiw
To yank the contents of parentheses: yi); if you want to include them, use ya(
You can do the same for " or ' with yi", ya" or yi' and ya'.
Of course, you're not limited to yanking. You can delete a word with diw or change it with ciw, etc... etc...
Just fold the class using za and then use visual mode ( V ) to select the collapsed class. This way you don't have to scroll too much. Then just yank with y. When you are done yanking unfold the class with za again.
Escshift V to enter visual line moded to delete the selected rowsp to paste lines after a row or press shift P to paste before a rowHope that helps.