onhernandes / vim-js-snippets

My favorite JS snippets for (neo)vim!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vim-js-snippets

My favorite JS snippets for (neo)vim!

Database snippets

[Op] Sequelize.Op

const Op = require('sequelize').Op

[Op.eq] Sequelize.eq

$1: {
  [Op.eq]: $2
}

[Op.in] Sequelize.in

$1: {
  [Op.in]: $2
}

[oid] ObjectId

ObjectId($1)

[roid] mongoose require ObjectId

const ObjectId = require('mongoose').Types.ObjectId

Javascript

[js] JSON.stringify

JSON.stringify($1, null, 2)

[jp] JSON.parse

JSON.parse($1)

[hop] hasOwnProperty

hasOwnProperty($1)

[me] module.exports

module.exports = $0

[ex] exports

exports $0

[cr] const x = require(y)

const $1 = require('$1')

[im] import x from y

import $1 from $2

[imo] import { x } from y

import { $1 } from $2

[cl] console.log

console.log($1)

[ce] console.error

console.error($1)

[cw] console.warn

console.warn($1)

[c] const x = y

const $1 = $0

[l] let x = y

let $1 = $0

[if] if

if ($1) {
	${0:${VISUAL}}
}

[fun] function

function $1 ($2) {
	${0:${VISUAL}}
}

[af] arrow function

($1) => {
	${0:${VISUAL}}
}

[mf] prototype method function

$1.prototype.$2 = function $2 ($4) {
${0:${VISUAL}}
}

Test snippets

[des] describe()

describe('$1', () => {
	${0:${VISUAL}}
})

[it] it()

it('$1', () => {
	${0:${VISUAL}}
})

[test] test()

test('$1', () => {
	${0:${VISUAL}}
})

About

My favorite JS snippets for (neo)vim!

License:MIT License


Languages

Language:Vim Snippet 100.0%