Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make vim open certain file types with specific syntax highlighting?

Tags:

vim

nasm

I want to make vim open all files of type *.asm with the syntax set to nasm so I don't have to type :set syntax=nasm every time I fire up vim.

I'm sure there's something I can put in my .vimrc file?

like image 257
imnotfred Avatar asked Sep 27 '12 02:09

imnotfred


1 Answers

Add this to your vimrc file

au BufRead,BufNewFile *.asm set filetype=nasm

Anytime a buffer read or creates a new file with the extension .asm it will format it with the nasm file syntax

au is short for autocmd you can find out more by using :h au

like image 59
Brombomb Avatar answered Sep 19 '22 22:09

Brombomb