Now that you know how to get out of VIM, maybe it's time to learn how to get into VIM.
We typically start VIM from the command line, though you may have menues or other ways.
There are a few ways you can start VIM.
vim | start with an empty window |
vim file.txt | start with an file.txt loaded and ready to edit |
vim +23 file.txt | start with an file.txt loaded and ready to edit at line 23. |
vimtutor | Start in tutorial mode. This is a good idea. |
vimdiff oldfile.txt newfile.txt | Start VIM as a really fancy code merge tool. |
vimdiff . | Start VIM as a file explorer. |
There is more, not shown.
For now, knowing these will help you to get started.
DO try out the vimtutor and the vimdiff.
Some of these won't work until you set up a .vimrc, but that is explained later.
If you type
gvim
instead of vim
then you will get the gee-whiz, cool, gui version of VIM (if it's installed). It has some extra powers. You'll typically like it better than the plain VIM. It is like VIM with chocolate icing. Everything we say about VIM here is also true of GVIM, so you can use the same tutorial with either.You don't have to edit one file at a time.
You can start (g)vim with multiple filename arguments, or even with wildcards!
When you do, there are a few options you can pass to get some fun additional effects.
Of course, these are more fun after you learn how to work with split windows, so you can refer back to it later.
Options
-o | Open multiple files in horizontally tiled windows . |
-O | Open multiple files in vertically tiled windows . |
-p | Open multiple files in separate tabs (I hate this). |
No comments:
Post a Comment