7 ms·
I'd recommend https://github.com/tpope/vim-commentary https://github.com/tpope/vim-commentary for commenting out code. Anyway, it's not a good practice.
by rakhimov 10y ago
I'd recommend https://github.com/tpope/vim-commentary https://github.com/tpope/vim-commentary for commenting out code. Anyway, it's not a good practice.
- hackmiester 10y agoWhat would you recommend for turning off a section of code temporarily?
- jaymon 10y agoYou could try a plugin I wrote to quickly comment/uncomment blocks of code: https://github.com/Jaymon/vim-commentify https://github.com/Jaymon/vim-commentify It's a no frills plugin that only does one thing, but it does it pretty well.
- RBerenguel 10y agoKill region, save, run/compile/read, undo if needed. With undo tree (or if you add commit to the process above) there is no need to comment just one region to turn off something. Optionally, convert the region into a separate function/method and just don't call it while checking.
- pablasso 10y agoYou still didn't explained why it wasn't a good practice. This just sounds impractical.
- ssalazar 10y agoYeah, "not a good practice" (i.e. "the user is wrong" or "why would you want to do that?") is the lazy way of justifying software deficiencies.
- RBerenguel 10y agoI use emacs, so deficiencies on how vim handles anything do not mean much to me, actually.
- RBerenguel 10y agoCommented code (as in, working code commented out, not comments in code) eventually rots/becomes cruft that at some point in time is going to bite you (or someone else in your team, or some maintainer in the future)
- OMGWTF 10y agoFor C: #if 0 ...code... #endif