|
| 1 | +*Gist.vim* Vimscript for creating gists (http://gist.github.com) |
| 2 | + |
| 3 | +Usage |gist-vim-usage| |
| 4 | +Tips |gist-vim-tips| |
| 5 | +Requirements |gist-vim-requirements| |
| 6 | +License |gist-vim-license| |
| 7 | +Install |gist-vim-install| |
| 8 | + |
| 9 | +This is vimscript for creating gists (http://gist.github.com) |
| 10 | + |
| 11 | +For the latest version please see https://github.com/mattn/gist-vim |
| 12 | + |
| 13 | +============================================================================== |
| 14 | +USAGE *gist-vim-usage* |
| 15 | + |
| 16 | +:Gist~ |
| 17 | + Post current buffer to gist, using default privacy option. |
| 18 | + |
| 19 | +:'<,'>Gist~ |
| 20 | + Post selected text to gist, using defualt privacy option. |
| 21 | + This applies to all permutations listed below (except multi). |
| 22 | + |
| 23 | +:Gist -p~ |
| 24 | + Create a private gist. |
| 25 | + |
| 26 | +:Gist -P~ |
| 27 | + Create a public gist. |
| 28 | + (Only relevant if you've set gists to be private by default.) |
| 29 | + |
| 30 | +:Gist -P~ |
| 31 | + Post whole text to gist as public. |
| 32 | + This is only relevant if you've set gists to be private by default; |
| 33 | + if you get an empty gist list, try ":Gist --abandon". |
| 34 | + |
| 35 | +:Gist -P~ |
| 36 | + Post whole text to gist as public. |
| 37 | + This is only relevant if you've set gists to be private by default. |
| 38 | + If you get an empty gist list, try ":Gist --abandon". |
| 39 | + |
| 40 | +:Gist -a~ |
| 41 | + Create a gist anonymously. |
| 42 | + |
| 43 | +:Gist -m~ |
| 44 | + Create a gist with all open buffers. |
| 45 | + |
| 46 | +:Gist -e~ |
| 47 | + Edit the gist (you need to have opened the gist buffer first). |
| 48 | + You can update the gist with the {:w} command within the gist buffer. |
| 49 | + |
| 50 | +:Gist -e foo.js~ |
| 51 | + Edit the gist with name "foo.js" (you need to have opened the gist buffer |
| 52 | + first). |
| 53 | + |
| 54 | +:Gist -d~ |
| 55 | + Delete the gist (you need to have opened the gist buffer first). |
| 56 | + Password authentication is needed. |
| 57 | + |
| 58 | +:Gist -f~ |
| 59 | + Fork the gist (you need to have opened the gist buffer first). |
| 60 | + Password authentication is needed. |
| 61 | + |
| 62 | +:Gist XXXXX~ |
| 63 | + Get gist XXXXX. |
| 64 | + |
| 65 | +:Gist -c XXXXX~ |
| 66 | + Get gist XXXXX and add to clipboard. |
| 67 | + |
| 68 | +:Gist -l~ |
| 69 | + List your public gists. |
| 70 | + |
| 71 | +:Gist -l mattn~ |
| 72 | + List gists from user "mattn". |
| 73 | + |
| 74 | +:Gist -la~ |
| 75 | + List all (public and private) of your gists. |
| 76 | + |
| 77 | +============================================================================== |
| 78 | +TIPS |gist-vim-tips| |
| 79 | + |
| 80 | +If you set {g:gist_clip_command}, gist.vim will copy the gist code with option |
| 81 | +"-c". |
| 82 | + |
| 83 | + - Mac: > |
| 84 | + let g:gist_clip_command = 'pbcopy' |
| 85 | +< |
| 86 | + - Linux: > |
| 87 | + let g:gist_clip_command = 'xclip -selection clipboard' |
| 88 | +< |
| 89 | + - Others (cygwin?): > |
| 90 | + let g:gist_clip_command = 'putclip' |
| 91 | +< |
| 92 | + |
| 93 | +If you want to detect filetype from the filename: > |
| 94 | + |
| 95 | + let g:gist_detect_filetype = 1 |
| 96 | +< |
| 97 | +If you want to open the browser after the post: > |
| 98 | + |
| 99 | + let g:gist_open_browser_after_post = 1 |
| 100 | +< |
| 101 | +If you want to change the browser: > |
| 102 | + |
| 103 | + let g:gist_browser_command = 'w3m %URL%' |
| 104 | +< |
| 105 | +or: > |
| 106 | + |
| 107 | + let g:gist_browser_command = 'opera %URL% &' |
| 108 | +< |
| 109 | +On windows, this should work with your user settings. |
| 110 | + |
| 111 | +If you want to show your private gists with ":Gist -l": > |
| 112 | + |
| 113 | + let g:gist_show_privates = 1 |
| 114 | +< |
| 115 | +If you get problems when creating gists try: > |
| 116 | + |
| 117 | + :Gist --abandon |
| 118 | +< |
| 119 | + |
| 120 | +============================================================================== |
| 121 | +REQUIREMENTS |gist-vim-requirements| |
| 122 | + |
| 123 | + - Curl command (http://curl.haxx.se/) |
| 124 | + - and, if you want to use your git profile, the git command-line client. |
| 125 | + |
| 126 | +============================================================================== |
| 127 | +License |gist-vim-license| |
| 128 | + |
| 129 | + |
| 130 | +Copyright 2010 by Yasuhiro Matsumoto |
| 131 | +modification, are permitted provided that the following conditions are met: |
| 132 | + |
| 133 | +1. Redistributions of source code must retain the above copyright notice, |
| 134 | + this list of conditions and the following disclaimer. |
| 135 | +2. Redistributions in binary form must reproduce the above copyright notice, |
| 136 | + this list of conditions and the following disclaimer in the documentation |
| 137 | + and/or other materials provided with the distribution. |
| 138 | + |
| 139 | +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 140 | +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 141 | +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 142 | +FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 143 | +REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 144 | +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 145 | +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 146 | +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 147 | +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 148 | +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 149 | +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 150 | +OF THE POSSIBILITY OF SUCH DAMAGE. |
| 151 | + |
| 152 | +============================================================================== |
| 153 | +INSTALL |gist-vim-install| |
| 154 | + |
| 155 | +Copy gist.vim to your plugin directory. |
| 156 | + |
| 157 | +gist.vim will create a curl cookie-jar file in your runtimepath. |
| 158 | + |
| 159 | +rtp: |
| 160 | + - plugin/gist.vim |
| 161 | + - cookies/github |
| 162 | + |
| 163 | +If you want to uninstall gist.vim, remember to also remove "cookies/github". |
0 commit comments