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

ggvG$"zy can be replaced with ggVG"zy

Visual line mode is often very convenient.

Also, kana's text-object-entire plugin may come in handy here (many of her text-object plugins are very useful).



Better still, I'll recommend @kana's vim-textobj-entire[1]. This adds 'e' as an 'everything' text object, with 'ae' (around everything) and 'ie' (inside everything) bindings by default. Thus 'vie' would select everything in the buffer in visual mode. Likewise for 'Vie' (Visual line select) or 'cie' (change everything).

[1] https://github.com/kana/vim-textobj-entire


Also you don't need any visual mode if you don't need visual feedback. Yanking everything:

    gg"zyG


Or

    :%yz


Good call! But you'll need a space:

    :%y z


If I can recall the file name, :r <file name> might be a better choice than gg...y




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

Search: