Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I force keywords to automatically capitalize in the VIM editor?

Tags:

syntax

vim

editor

Does anybody know how to edit a syntax file for VIM so that keywords are capitalized automatically? I need to do this to keep my coding style consistent with the rest of the developers in my team.

I'm using VIm version 7.2 (actually gVIM) and the syntax file I'm using is the Progress.vim file (installed automatically with VIM under the Syntax directory). I have made a couple tweaks to the file as I didn't like how some things were done, but it is mostly the same.

TIA

like image 849
Jason Down Avatar asked Nov 06 '08 20:11

Jason Down


People also ask

How does VIM do syntax highlighting?

Syntax highlighting is on for vim editor by default. The content of login.sh will be displayed with the following format when the syntax highlighting is on. After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting.

What does G mean in VIM?

In some cases g is the short way of "global" (for range command for example), for line moving the g stands for goto. In VIM commands are often shortened for quick of use.

Where does VIM put syntax files?

If you use Vim for programming, you find that by default based on the type of the file, Vim enables syntax highlighting. That is if your file name is myfile. c or myfile.


1 Answers

Try:

:help abbreviations

For example:

:iab begin BEGIN

Now whenever you type "begin", it will be replaced by "BEGIN".

like image 115
Greg Hewgill Avatar answered Oct 03 '22 05:10

Greg Hewgill