Skip to content

Commit

Permalink
Update: completely replace old config file with neo config file
Browse files Browse the repository at this point in the history
  • Loading branch information
relastle authored and Hiroki-Konishi committed Jun 13, 2019
1 parent 83988ab commit f7dd645
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 118 deletions.
85 changes: 72 additions & 13 deletions resources/pmy_rules.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,102 @@
[
{
"regexpLeft": "^(vi||vim|nvim) ",
"command": "command find . -maxdepth 4",
"regexpLeft": "git (co|checkout) *$",
"cmdGroups": [
{
"tag": "🌱:branch",
"stmt": "git branch --format=\"%(refname:short)\"",
"after": "awk '{print $0}'"
},
{
"tag": "🍺:commit",
"stmt": "git log --oneline -10",
"after": "awk '{print $1}'"
}
],
"bufferLeft": "[]",
"bufferRight": "[]"
},
{
"regexpLeft": "git merge *$",
"cmdGroups": [
{
"tag": "🌱:branch",
"stmt": "git branch --format=\"%(refname:short)\"",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "[]",
"bufferRight": "[]"
},
{
"regexpLeft": "^(vi|vim|nvim) ",
"cmdGroups": [
{
"tag": "",
"stmt": "command find . -maxdepth 4",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "[]",
"bufferRight": "[]"
},
{
"regexpLeft": "^(python|python|python3|pypy|pypy3) ",
"command": "command find . -mindepth 1 | egrep '.py$'",
"cmdGroups": [
{
"tag": "",
"stmt": "command find . -mindepth 1 | egrep '.py$'",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "[]",
"bufferRight": "[]"
},
{
"regexpLeft": "^cd +(?P<path>.*)$",
"command": "command ls ${PMY_LS_OPTION} -1 <path> | egrep '/$'",
"cmdGroups": [
{
"tag": "",
"stmt": "command ls ${PMY_LS_OPTION} -1 <path> | egrep '/$'",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "[]",
"bufferRight": "[]"
},
{
"regexpLeft": "(?P<num>[1-9][0-9]+).for$",
"command": "echo ''",
"cmdGroups": [
{
"tag": "",
"stmt": "echo ''",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "for x in $(seq 1 <num>); do ",
"bufferRight": "; done"
},
{
"regexpLeft": "(?P<cmd>.+)\\.for$",
"command": "echo ''",
"cmdGroups": [
{
"tag": "",
"stmt": "echo ''",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "for x in $(<cmd>); do ",
"bufferRight": "; done"
},
{
"regexpLeft": "git (co|checkout) *$",
"command": "git branch --format=\"%(refname:short)\"",
"bufferLeft": "[]",
"bufferRight": "[]"
},
{
"regexpLeft": " +(?P<path>.*)/$",
"command": "command ls -a ${PMY_LS_OPTION} -1 <path>",
"cmdGroups": [
{
"tag": "",
"stmt": "command ls -a ${PMY_LS_OPTION} -1 <path>",
"after": "awk '{print $0}'"
}
],
"bufferLeft": "[]",
"bufferRight": "[]"
}
Expand Down
103 changes: 0 additions & 103 deletions resources/pmy_rules_neo.json

This file was deleted.

3 changes: 1 addition & 2 deletions shell/pmy.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env zsh
# test environment path variable
export PATH="${GOPATH}/src/github.com/relastle/pmy:${PATH}"
export PMY_CONFIG_PATH="${GOPATH}/src/github.com/relastle/pmy/resources/pmy_rules_neo.json"
export PMY_DELIMITER=':::'
export PMY_CONFIG_PATH="${GOPATH}/src/github.com/relastle/pmy/resources/pmy_rules.json"

pmy-widget() {
# get current buffer information
Expand Down

0 comments on commit f7dd645

Please sign in to comment.