Skip to content

Instantly share code, notes, and snippets.

@griffinqiu
Last active March 30, 2018 10:18
Show Gist options
  • Save griffinqiu/f21c0b42c55528f7e405dcc0c10ab457 to your computer and use it in GitHub Desktop.
Save griffinqiu/f21c0b42c55528f7e405dcc0c10ab457 to your computer and use it in GitHub Desktop.

Revisions

  1. griffinqiu revised this gist Mar 30, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions vim
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    /\v^(\s+)(get|post|put|patch|destroy) :(index|show|edit|update|new|create|destroy), ([^params].+[^,])$
    /\v^(\s+)(get|post|put|patch|destroy) :(\w+), ([^params].+[^,])$
    :%s//\1\2 :\3, params: { \4 }/g

    :%s/\v^(\s+)(get|post|put|patch|destroy) :(index|show|edit|update|new|create|destroy), ([^params].+[^,])$/\1\2 :\3, params: { \4 }/g
    :%s/\v^(\s+)(get|post|put|patch|destroy) :(\w+), ([^params].+[^,])$/\1\2 :\3, params: { \4 }/g
  2. griffinqiu revised this gist Mar 30, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion vim
    Original file line number Diff line number Diff line change
    @@ -1,2 +1,4 @@
    /\v^(\s+)(get|post|put|patch|destroy) :(index|show|edit|update|new|create|destroy), ([^params].+[^,])$
    :%s//\1\2 :\3, params: { \4 }/g
    :%s//\1\2 :\3, params: { \4 }/g

    :%s/\v^(\s+)(get|post|put|patch|destroy) :(index|show|edit|update|new|create|destroy), ([^params].+[^,])$/\1\2 :\3, params: { \4 }/g
  3. griffinqiu created this gist Mar 30, 2018.
    2 changes: 2 additions & 0 deletions vim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    /\v^(\s+)(get|post|put|patch|destroy) :(index|show|edit|update|new|create|destroy), ([^params].+[^,])$
    :%s//\1\2 :\3, params: { \4 }/g