An Example of Vim With Coding
Top Comments
All Comments (8)
-
There are faster ways of doing some of this stuff in VIM. For instance instead of using search and replace to remove comments on a group of lines, use block selection (ctrl + v) to select the slashes and then d or x to delete them. You can also use block selection to comment out whole blocks, select the first character in each line and then shift + i to insert in front of the first selected line. When you exit insert mode what you typed will be inserted in front of the other selected lines.
-
Wow, you searched for a string and replaced it !! Wohooo !
-
Folks must understand though, that this is ONLY an editor, not a full dev. environment. Yes, there are some attempts at a VIM debugger out there, but go look at how many real-world software people rely on it, and you'll have your answer as to its viability. Minus a few exceptional specialists, those that think they can sit down and write even 5,000 lines of real code logic without bugs/errors live in a dream land. Debugging and testing is a discipline and a reality.
-
@alexbeynenson You got it. Folks have to watch for these programming "editors" that boast about being the greatest programming tool to come about. I'm convinced, anyone who says they use Notepad++ or similar editor for most of their programming, has NOT embarked on a very serious software effort, containg 20,000+ LOC, having to debug it and maintain it, often not all in one language. The closest I've come to that is 35,000 lines of T-SQL stored proc code, and it's never fun.
-
@9b8 Thank you for saying that. I just can't fathom doing serious programming in vim. You have to practice like a madman just to be half decent. Then you have to maintain that practice lest you forget everything. Might as well type one-handed. No thanks.
-
posted a video response here: watch?v=G5TdtB03V40
In short: Vim is an editor, not a programming language.
Using :substitute all the time is degrading vim into a 'sed'-clone.
In my response I do the same actions (only in roughly the time taken by this video, I also managed type up the existing sample)
-
Ok, now multiple that number of lines of code by at least 1000, and then try to debug it.
You could use gv to reselect the previous selection. You dont have to move too much although vim makes you move less you can squeeze more of it ;)
uslack 7 months ago 3