vim: would like it to turn settings on only for certain file types

后端 未结 3 1359
既然无缘
既然无缘 2021-02-18 15:52

I\'ve looked at this but it wasn\'t too much help. Maybe I didn\'t read it too well.

Basically what I want is when I open a .txt file the settings:

set          


        
3条回答
  •  一整个雨季
    2021-02-18 16:29

    My answer to that question still applies:

    Put autocmd commands based on the file suffix in your ~/.vimrc

    autocmd BufRead,BufNewFile   *.txt set wrap linebreak
    

    As Luc says, you might prefer to

    autocmd BufRead,BufNewFile   *.txt setlocal wrap linebreak
    

    if you're likely to open txt and non-txt files at the same time.

提交回复
热议问题