aboutsummaryrefslogtreecommitdiffhomepage
path: root/README.md
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-12 23:56:30 +0800
committertypebrook <typebrook@gmail.com>2020-03-12 23:56:30 +0800
commit449b345293cb76c4272904e2667c1e046d4dbb3e (patch)
treec2da425c20822b4c300ab8029cf45e310942acfd /README.md
parent76e6d01dded802876e77faf80ec335f203be14bb (diff)
Update README
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 15 insertions, 9 deletions
diff --git a/README.md b/README.md
index a86217d..7c2c868 100644
--- a/README.md
+++ b/README.md
@@ -7,8 +7,12 @@ gist fetch
7gist 7gist
8# create a new gist 8# create a new gist
9gist new 9gist new
10# edit files in your third gist(default action), and get the path 10# create private gist with files 'foo' and 'bar'
11gist new -p foo bar
12# get the path of cloned repo of your third gist
11gist 3 13gist 3
14# cd to the cloned repo
15cd `gist 3`
12# push changes in your third gist to the remote repo 16# push changes in your third gist to the remote repo
13gist push 3 17gist push 3
14# update the description of your third gist 18# update the description of your third gist
@@ -101,18 +105,20 @@ Use `gist config folder <prefered-directory>` to set the value if needed.
101Use `gist config auto_sync false` to disable this feature. 105Use `gist config auto_sync false` to disable this feature.
102 106
103### action 107### action
104**[Optional]** A custom action is performed when you do `gist <index-of-gist>` (like `gist 3` for your third gist). If is being set, `gist` will automatically cd to the folder of gist repo, and just simply use `eval` to perform action. Default to be 108**[Optional]** A custom action is performed when you do `gist <index-of-gist>` (like `gist 3` for your third gist). If is being set, `gist` will `cd` to the cloned repo, and just simply use `eval` to perform action.
109
110For example, you can use the following command to set the action for:
111**print the filename and its content of all files inside the given gist**
105``` 112```
106${EDITOR:-vi} . 113gist config action 'tail -n +1 *'
107``` 114```
108That is, use default editor or vi (if not set) to open the folder where the git repo of this gist is stored. 115or do
109
110For example, you can use the following command to change the action into "print the content of files and list filenames".
111``` 116```
112gist config action 'cat *; ls' 117gist config action '${EDITOR:-vi} .'
113``` 118```
119That is, use default editor or vi (if not being set) to open the cloned repo.
114 120
115Also, if you run `gist <index-of-gist>` with `--no-action`, then action would not performs. 121Also, if you run `gist <index-of-gist>` with `--no-action`, then action would be ignored.
116 122
117### EDITOR 123### EDITOR
118**[Optional]** Editor to open `~/.config/gist.conf`. Default to be `vi` . 124**[Optional]** Editor to open `~/.config/gist.conf`. Default to be `vi` .
@@ -142,7 +148,7 @@ But since `gist` is a bash script which goes in subshell, if you want to achieve
142 And run `cdgist 3` to jump to the repo of your third gist. 148 And run `cdgist 3` to jump to the repo of your third gist.
143 149
144### Useful action for gist repo 150### Useful action for gist repo
145Though default [`action`](#action) is to open gist repo in vi, I strongly recommend use [`tig`](https://github.com/jonas/tig) instead. It is the most powerful git CLI tool as far as I know, and also easy to get in most of the Linux distros and Homebrew for mac. Give it a try! 151I strongly recommend using [`tig`](https://github.com/jonas/tig) as [action](#action). It is the most powerful git CLI tool as far as I know, and also easy to get in most of the Linux distros or Homebrew for mac. Give it a try!
146 152
147If [`tig`](https://github.com/jonas/tig) is installed, run the following command to configure it as custom action: 153If [`tig`](https://github.com/jonas/tig) is installed, run the following command to configure it as custom action:
148 154