When writing vimscript, is there any difference between things like <foo>, <Foo>, and <FOO>? I see certain words always written in lower case, e.g. <silent>, certain words always in upper case, e.g. <CR>, certain words with leading uppercase, e.g. <Leader>, and and others written in multiple ways, e.g. <TAB> and <Tab>. Are these completely case-insensitive? Is there a convention to follow?
1 Answer
Yes, case sensitivity matters in Vim. For example p will paste something you yanked where the cursor is whereas P will paste it before the cursor. N will go to the previous occurrence of a search and n will go to the next occurrence.
However for keywords such as <Tab>, <cr>, and such, no case sensitivity does not matter. These usually refer to a key, such as the tab key, or a concert like a carriage return. The case should be consistent within a document for clarity.
<and>in vim are case-insensitive. Just try:help <Tab>,:help <TAB>,:help <taB>,:help <tAB>you will realize that they will yield all to the same position of the manual (i.e refering to the same thing) but it would be better to follow vim notation when writing script.