Armand Halbert
Customer Success Engineer
DataKitchen


Contact:
armand.halbert@gmail.com
ajhalber@us.ibm.com
Resume - pdf
Resume - text

   
Published on:
Saturday, August 29, 2015



Introducing Vimjects


I wrote my first amateur vim plugin, vimjects. It’s designed to source project-specific vim configurations, so that you can set options specific to your project.

  • Recursively searches the filesystem for .vimjectrc and .vimjectrcbuf files and sources them
  • Rudimentary security features
  • Completely customizable to your needs

I also looked into alternatives to writing my own plugin.

###Modeline

Modeline is a great idea but is completely incompatible with teams, or anything that needs to be published. Either the entire team keeps the same settings. or each push converts the files to a canonical form. Doing is just asking for issues with merges and weird comments.

I don’t think the security issue is a huge problem, as there are much easier ways to target vim users.

###Alternative Plugins

MarcWeber’s local-addon is pretty much what I wanted, recursively searching for a config file and sourcing it, and includes a security check.

Mine has similar features. However, I also allow users to customize the loading function, and disable security. By doing so, I hope to make a true “hacker’s” local configuration manager, rather than a simple recursive sourcer.

###Emacs

Just Kidding!

###What I Learned

Vimscript is a weird language. It’s got some mixture of python and ruby syntax, but just different enough to make learning the language difficult and the basic language. It is also very procedural - you are given a set of types, and manipulate them via C-style functions.

This plugin is simple enough to write in vimscript. It is easier to write more complex plugins in other languages, but have the disadvantage of not being guaranteed to run on all vim configurations(python support is managed at compile time, for instance)

I look forward to NeoVim’s use of lua as a native language that is guaranteed to run on any neovim system. However, as a system for running vim commands autonomously, vimscript it does everything you expect it to do, . Once you understand vimscript, it is not terrible as long as you stay within the parameters of what vim is meant to be.

Anyways, enjoy the plugin, and feedback is welcome.


<< Previous Next >>