I’m currently trying to use more of snippets in vim and this is a group of commands that I think would help me out. These snippets are provided by two different repositories and I installed vim-pathogern to add more of my own in the future.
honza vim-snippets
Rails
snippet resources
- Create resources controller classsnippet befc
- before createsnippet befd
- before destroysnippet befu
- before updatesnippet befv
- before validationsnippet defcreate
- def create - resourcesnippet fina
- find(:all)snippet defi
- def initializesnippet class
- classdef initialize … end end
Markdown
snippet link
- Link to somethingsnippet img
- Imagesnippet ilc
- Inline Codesnippet cbl
- Codeblock
Html
snippet body
- body tagssnippet div
- div tagssnippet div.
- div tags with classsnippet div#
- div tags with class and idsnippet p
- paragraph tagssnippet ul
- unordered list tagssnippet li
- list item tags
r00k dotfiles
Ruby
snippet =b
- comment code blocksnippet req
- reuire statementsnippet case
- case when statementssnippet def
- def method with endsnippet if
- if statementsnippet ife
- if else statementsnippet elsif
- elsif statementsnippet Enum
- include Enumerable and create each methodsnippet Comp
- include Comparable and create spaceship methodsnippet defs
- def self. statementsnippet ea
- each methodsnippet eai
- each with index methodsnippet inj
- inject methodsnippet map
- map method
ERB
snippet p
snippet pe
snippet end
Rspec
snippet new
- test double with allowsnippet desc
- describe blocksnippet it
- it blocksnippet con
- context blocksnippet bed
- before blocksnippet hc
- expect page have contentsnippet let
- let blocksnippet ex
- expect tosnippet scen
- scenario blocksnippet rrh
- require rails helper
Commands I’ve learned
rails new api -T -d postgresql
- The -T is the same as –skip-test-unitrails new bostonember -B -S
- Skips bundle install and sprocketsFactoryGirl.create_list(:contact, 10)
rails g model Account name:string subdomain:string --skip