Extending Vim with Scripting | Linux Today

Extending Vim with Scripting

Written By
Web Webster
Web Webster
Nov 16, 2011

[ 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

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.