search

Home  >  Q&A  >  body text

gvim - Several problems with Macvim

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

给我你的怀抱给我你的怀抱2774 days ago630

reply all(2)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-16 16:40:39

    This is a problem with vim and has nothing to do with Mac

    1. vim -o file1 file2vim -O file1 file2分别是打开vim时直接水平分屏和垂直分屏,或者-o和-O后面跟数字参数表示希望分屏的数量,当然gvim或者mvim的参数也一样。如果已经打开vim,使用:split:vsplitHorizontal split screen and vertical split screen respectively

    2. 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

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 16:40:39

    1、split 是水平分屏的意思,vsplit 是垂直分屏
    2、没有文件名文件又是空的情况下,vim 是无从判断使用的是什么语言的,可以执行一句set ft=cpp,如果你想直接打开就是 cpp不用执行这一句,那么就可以把这一句写到配置文件里,但是这样打开其他无论什么文件都会被设置为cpp

    reply
    0
  • Cancelreply