8051 Programming using vi editor and ctags

8051Here are some tips to work on 8051 assembly language files (A51 assembler) using vi editor and ctags code navigation tool:

1. Syntax highlighting:

By default file type extensions .A51 and .I51 are not recognized as assembly language files by vi editor (atleast for my gvim version of vi). To instruct vi to recognize them as assembly file just add extension “.A51,.I51” in the filetype.vim file available in the installation directory of vi. It would be some thing like this.

au BufNewFile,BufRead *.asm,*.[sS],*.[aA],*.mac,*.lst,*.A51,*.I51 call s:FTasm()

2. Code navigation using ctags:

It is assumed that you have installed ctags in your system. To force ctags to recognize .A51 and .I51 files as assembly file, issue the following command in your source directory.

ctags -R –language-force=asm *

Reload your source files with new vi session, you can enjoy highlighted syntax and code navigation. Enjoy!

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *