Prevent vim from opening binary files accidentally?

后端 未结 3 1661
一个人的身影
一个人的身影 2021-02-02 15:31

I frequently accidentally open a binary executable, i.e. \"foo\", when I mean to open the associated source code \"foo.cpp\". The root of the problem is that tab completion, i.

3条回答
  •  灰色年华
    2021-02-02 16:33

    Not exactly what you need, but I have something like this in my .vimrc

    " ignore these files when completing names and in Ex
    set wildignore=.svn,CVS,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pdf,*.bak,*.beam
    " set of file name suffixes that will be given a lower priority when it comes to matching wildcards
    set suffixes+=.old
    

提交回复
热议问题