Joined April 2013
·

Kaleb Hornsby

Software Engineer at Intermedix
·
Augusta, GA
·
·
·

Posted to Using Vim with fish shell over 1 year ago

I should probably compile my own Vim. I was awaiting Ubuntu 14.10 to see if it would be in there, but this is what I see:

$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 20 2014 16:09:34)
Included patches: 1-273
Posted to Using Vim with fish shell over 1 year ago

@gpakosz Whaaaaat?!?! I have to remove that dreaded line from my vimrc and try that out!

Thanks for the tip! I have set this up for myself as well, but the set backupdir=~/.vim/.backup// is not working as expected for me. It is putting the backup files in the correct directory, but the backup filenames are not what I expected. If I were to edit ~/foo.txt, then the backup file in my new vim backupdir is ~/.vim/.backup/foo.txt~ and not ~/vim/.backup/home%user%foo.txt~. Do you have this same issue as well?

Here's my config file if you're interested: https://github.com/kaleb/vim-files/blob/master/xdg.vim#L10

@mike hedman - I usually will add a null so that all public properties are in one place. It aids in documentation.

/**
 * @constructor
 * @param {string} name - given name of this `Person`
 */
function Person(name) {

    // here we override a default value if an alternative value is provided
    if(name) {
        this.name = name;
    }

    // The array is created inside the constructor so as to not have every Person instance share the same array
    this.property = [];
}

Person.prototype = {
    constructor: Person,

    // All of my properties are now going to be documented in the same location

    /**
      * The given name of the `Person`
      * @type {string}
      */
    name: 'Anonymous',

    /**
      * List of all the objects owned by this `Person`
      * @type Array<*>
      */
    property: null
}

The thing that one has to remember is that one should not add any non-primitive properties directly to the prototype, in otherwords, if typeof object == 'object', add it as a member in the constructor. Functions are OK to add directly to the prototype as well, unless you are doing something crazy like using it has some sort of value store.

Here is a list of things that you can add directly to the prototype:

  • boolean
  • number
  • string
  • function
  • null
  • undefined

strings, numbers, and booleans are always coppied instead of being passed by reference (unless they are the non-primitive variants, i.e. created with new String, etc.). I will also add objects to the prototype if it is a sort of default value, but never anything that will be storing instance specific data, instead add that in the constructor.

// never
function Ctor() {}
Ctor.prototype.store = [];

// always
function Ctor() {
    this.store = [];
}
Posted to Stylus is better than LESS and SASS over 1 year ago

Some things that I like about Less: name-spacing, arbitrary selectors as mixins (great for re-usability), nested media-queries

Achievements
46 Karma
0 Total ProTip Views