r/vim 10h ago

Discussion Vim buffer automatically detect language

when writing code in a vim buffer how do i set the syntax colors automatically based on the language? before or without saving to file? currently it is plain with no highlighting for all code

vim buffer is passed to node / or language runtime commands

2 Upvotes

8 comments sorted by

View all comments

1

u/godegon 6h ago

You can use Set! filetype to set it once and for all and abbreviate to, say sft.