Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


Extending Vim with Scripting

Nov 16, 2011, 14:01 (0 Talkback[s])

[ Thanks to Lee Schlesinger for this link. ]

"Vim is a great text editor – but Vimscript makes it even better. Vimscript, Vim's built-in scripting language, allows you to extend Vim however you want. You can write your own commands and functions to fit what you most often want to do, so that over time, you can make Vim exactly the editor that you want it to be. The DIY syntax highlighting I wrote about recently is a form of Vimscript, but in this piece I'm going to look at scripting more generally.

"Before you get started, there are a few basic rules to bear in mind when writing Vim scripts. First, a function name must start with an uppercase letter, and you should declare it with function! to make sure it's unique. The ! will redefine it if it's already defined (e.g. if you reload the script file). Secondly, there are a bunch of different ways of scoping variables."

Complete Story

Related Stories: