I have so many println (") in my codes .. I know this is dirty ... I want to put a comment for each of println (" ");
how to do it in vim? I want to say that I want to do this on multiple files.
Also, if possible, can it determine if the lines have // ββalready or not ... if the lines have been commented out .. I don't want to add new //
To add //commentto all unauthorized calls println(...)in your lines:
//comment
println(...)
:%s/^\(\s*println(.*);\)\s*$/\1\/\/comment/gc
To comment on all undocumented calls println(...)in their own lines
:%s/^\(\s*println(.*);\)\s*$/\/\/\1/gc
:
:g|println|normal I//
: g (: normal I//) , ( println).
, , : bufdo:
:bufdo g|println|normal I//
Amarghosh :
:bufdo g|\s*println(.*);|normal I//
Source: https://habr.com/ru/post/1747810/More articles:How many Android apps are open source? - androidHow can I find the gitk tool for hg - mercurialCheck xml on xsd using C ++ - c ++CA Certificate Issue Certificate - certificateloading security issues in php - securityresponse.sendRedirect - check redirection up - javaRemoving a node from a skip list - c ++how to save java date type for mysql date type? - javapython dictionary with constant type value - pythonHow to change FPU context in a signal handler (C ++ / Linux) - linuxAll Articles