All of the questions lumped together expose a point of view issue. From the point of view of the folks (starting with Bill Joy, the original author of vi
) who created Unix and vi
, the the shell prompt is the whole development environment. vi
is just the editor part. make
is the project builder. The file system along with ls
, find
, grep
and a myriad other tools provides the file grouping and organizational tools.
This is why vi
has a rich set of command line options that allow you to name multiple files to open, and where in each file to position the cursor. Along with the ctags
tool, you can even ask vi
to open the file holding a named function without typing the name of the file.
From within vi
, you can always use the !
command to operate on text using an arbitrary program. !fmt
is a quick and dirty way to do wrapped text, for instance. And, of course, the :
command is your gateway into the wonderfully dangerous power of CLI based editing.
Underlying it all is a requirement that you really understand the commands that move the cursor and describe a span of text. The first step is to notice every time you find yourself repeating a command (like a simple movement command 'h', 'j', 'k' or 'l') until you reach the right spot and ask your self how you could have achieved that effect with less typing. Instead of 'lllll', say '5l' or perhaps 'w' or better 'fa' if the target was the next letter 'a' that just happened to be five characters over.
With the right mindset, and a good grasp of the larger universe of text processing filters, most of your questions boil down to identifying the right span of text and passing it to an external utility, in the context of a project already sensibly organized in folders and with ctags
run from make
to keep the tags database current.
There are lots of tutorials and quick references out there. This one seems to express the point of view I'm trying to convey here.