Several problems of Macvim

  question, vim

1. How to set the default vertical split screen when opening multiple files?
It can only be realized now, with the default horizontal split screen.
2. How to set syntax highlighting to be supported when Macvim is turned on?
Now open a blank, save it as XXX.cpp, and then reopen it to support highlighting.

This is vim’s problem and has nothing to do with Mac

  1. vim -o file1 file2Andvim -O file1 file2When vim is opened, it is directly divided horizontally and vertically, or -o and -O are followed by digital parameters to indicate the number of desired divided screens. Of course, gvim or mvim parameters are the same. If vim is already turned on, use:splitAnd:vsplitSeparately divide the screen horizontally and vertically.

  2. If you are an unsaved file and want to force highlighting with the syntax of a language, use the command:set syntax=XXX, for example:set syntax=cpp,:set syntax=offCan be closed