← Back to Upcase

Intro to Vimscript

(Upcase ) #1

This is a companion discussion topic for the original entry at https://thoughtbot.com/upcase/videos/intro-to-vimscript-with-ben-orenstein

(Ben) #2

For intro to vimscript, it might be helpful to mention sourcing the file first. I had to give it a quick google. but I needed to source the file before my scripts would work. I think this isn’t needed if it’s in the vimrc, but I don’t think these are needed for that.

(thedanotto) #3

source the current file with :so %

(Alex Shelmire) #4

You incorrectly asserted that strings evaluate to false in Ruby in this video. Only nil and false are falsey in Ruby. Everything else is truthy (including 0, empty strings, etc).

(Lidiane Taquehara) #5

@shelmire guess he was talking about how ruby coerces a string into an integer.

> "hey".to_i
=> 0 
> "8 days a week".to_i
=> 8 

pretty similar to vimscript! :slight_smile: