How can I stop vim from loading syntax file automatically for certain file types?

I am working on a project that creates a shader for a GLSL fragment, and so it is, it has a file extension .fs, so vim automatically loads the following syntax when opening a file.

This is usually not a problem, I could just change the syntax with au BufRead, but for some reason, the fourth syntax is loaded first, which completely confused the situation. It adds more characters to the word, which makes syntax and motion highlighting not work as expected.

Is there a way to stop the fourth syntax from loading and load only the specified syntax?

+3
source share
2

.vim ( vimfiles Windows) filetype.vim :

if exists("did_load_filetypes")
    finish
endif

augroup filetypedetect

    " Ignore filetypes for *.fs files
    autocmd! BufNewFile,BufRead *.fs  setfiletype ignored

augroup END

script Vim , Vim.

Vim .fs, Forth, iskeyword . ( GLSL, ignored .)

:

:help remove-filetype
:help new-filetype
:help :setfiletype
+6

:

let b:current_syntax = "<filetype>"
0

Source: https://habr.com/ru/post/1755436/


All Articles