1. How to set the default vertical split screen when opening multiple files?
It can only be implemented now, and the default is horizontal split screen
2. How to set up to support syntax highlighting when opening Macvim?
Now open a blank space, save it as XXX.cpp and then reopen it to support highlighting
仅有的幸福2017-05-16 16:40:39
This is a problem with vim and has nothing to do with Mac
vim -o file1 file2
和vim -O file1 file2
分别是打开vim时直接水平分屏和垂直分屏,或者-o和-O后面跟数字参数表示希望分屏的数量,当然gvim或者mvim的参数也一样。如果已经打开vim,使用:split
和:vsplit
Horizontal split screen and vertical split screen respectively
If you have an unsaved file and want to force syntax highlighting in a certain language, use the command :set syntax=XXX
,例如:set syntax=cpp
,:set syntax=off
to close it
漂亮男人2017-05-16 16:40:39
1、split
是水平分屏的意思,vsplit
是垂直分屏
2、没有文件名文件又是空的情况下,vim 是无从判断使用的是什么语言的,可以执行一句set ft=cpp
,如果你想直接打开就是 cpp
不用执行这一句,那么就可以把这一句写到配置文件里,但是这样打开其他无论什么文件都会被设置为cpp