Tuesday, January 31, 2017

Re: How to set a local syntax file?

On 2017-01-31 14:44, Charles E Campbell wrote:

Fabio D'Alfonso wrote:
Hi,
I am using nasm, and made the change in syntax to nasm in the global
config, both to highlight and snippets.
Could you tell me where I could make a local setting?
Also I am using ti amix/vimrc .
IF: you've taken nasm.vim and modified it, but its a complete syntax
file...  put it in $HOME/.vim/syntax
IF: you've just modified a rule or two, added something,  and have a
small changes file: put it in $HOME/.vim/after/syntax

I'm not sure what you mean by using it amix/vimrc . If you have a
specific filetype that you want it used on (abc.amix?): in a file called
$HOME/.vim/filetype.vim:

 au BufNewFile,BufReadPost *.amix                                      
                            setf amix

assuming that you've called the syntax file amix.vim .

Regards,
Chip Campbell

-- 

I did this in the global  filetype.vim, I would know where I could put this in a local setting.

Thanks

Fabio

Changing the default syntax to nasm

sudo vi /usr/share/vim/vim74/filetype.vim

” if b:asmsyntax still isn’t set, default to asmsyntax or NASM (was GNU)
if b:asmsyntax == “”
if exists(“g:asmsyntax”)
let b:asmsyntax = g:asmsyntax
else
let b:asmsyntax = “nasm”  (was “asm”)
endif
endif

Look for “asm” and change to “nasm”

 

--

Fabio D'Alfonso

Network Analysis And VMware Enterprise Solutions

cell. +39.348.059.40.22

web: http://www​.​fabiodalfonso​.​com    email: fabio.dalfonso@fabiodalfonso.com    Linkedin:   https://it.linkedin.com/in/fabiodalfonso    Twitter:    https://twitter.com/fabio_dalfonso  
FB Page: https://www.facebook.com/dalfonsoco/
fax: +39.06.874.599.581

No comments: