Giter VIP home page Giter VIP logo

vim-gist's Issues

cannot delete gist

I pulled the latest commits, now I cannot delete gists anymore. It's really strange:

Some file will display this error

Deleting to gist...
Delete failed: Not Found

But for the ones that have GistID: XXXX, it just goes ahead and post.

Error when posting

Error detected while processing function Gist..86_GistPost:
Line 69:
Post failed

crashing in MacVim 7.3 (53)

When I do :Gist everything in that window freezes and I can't do anything, waiting results in nothing. It just keeps saying :Gist below, it doesn't even say Pasting... or anything like that, like it does in the terminal vim. It works perfectly fine in the terminal vim. I know this is a very broad report, but I have no idea where the fault may lie. I tried disabling all plugins (moving them all out) except for this one, and still. The only thing I noticed is that when I switch my shell back to bash, it works, but if I switch it to zsh, it doesn't. I do have the github global configs for my username and token. If I explicitly write them in the .vimrc, MacVim does work, but I don't want to put them there.

Again, it works perfectly fine in the terminal vim (when using the github config variables), but for some reason it locks up MacVim.

I'm just putting this here in case someone has any ideas as to how I can go about debugging this.

fork interface

:Gist -f XXXXX

XXXX mean gist-id
or
XXXX mean user for latest gist.

Error when posting (installation issue?)

Hi, I am getting the following when I create a new file then try to use :Gist.

I may have installed it wrong, I have gist.vim and gist.vim.vimup both in my ~/vim/plugins directory.

Error Detected while processing function Gist..14_GistPost:
line 42:
Post failed.

The : in the gist buffer name creates empty file on Windows (with NTFS file system).

I started using gist.vim today, and I'm really impressed by its functionality. Great, thanks a lot!

I'm using the plugin on Windows Vista/x86 with Vim 7.3. I noticed that when I open an existing Gist via :Gist 123456, an empty file named 'gist' is created in the current working directory, and it sticks around even after exiting Vim. I suspect this is due to the fact that NTFS alternate data streams are accessed in exactly this way (filename:streamname), and that Vim creates such a file as a side effect of the gist buffer creation.

I would therefore suggest to change the Gist buffer name to gist_* for Windows. The following patch against gist.vim version 4.7 factors out the buffer prefix and changes it for non-Unix systems (Cygwin seems to translate the ':' internally and doesn't suffer from this problem.)

-- regards, ingo

--- gist.vim.orig   2011-01-21 11:32:10.720000000 +0100
+++ gist.vim    2011-01-21 21:46:44.397302000 +0100
@@ -173,6 +173,8 @@ function! s:encodeURIComponent(instr)
return outstr
endfunction

+" Note: A colon in the file name has side effects on Windows due to NTFS Alternate Data Streams; avoid it. 
+let s:bufprefix = 'gist' . (has('unix') ? ':' : '_')
function! s:GistList(user, token, gistls, page)
if a:gistls == '-all'
    let url = 'https://gist.github.com/gists'
@@ -181,14 +183,14 @@ function! s:GistList(user, token, gistls
else
    let url = 'https://gist.github.com/'.a:gistls
endif
-  let winnum = bufwinnr(bufnr('gist:'.a:gistls))
+  let winnum = bufwinnr(bufnr(s:bufprefix.a:gistls))
if winnum != -1
    if winnum != bufwinnr('%')
    exe "normal \<c-w>".winnum."w"
    endif
    setlocal modifiable
else
-    exec 'silent split gist:'.a:gistls
+    exec 'silent split' s:bufprefix.a:gistls
endif
if a:page > 1
    let oldlines = getline(0, line('$'))
@@ -289,14 +291,14 @@ function! s:GistWrite(fname)

function! s:GistGet(user, token, gistid, clipboard)
let url = 'https://gist.github.com/'.a:gistid.'.txt'
-  let winnum = bufwinnr(bufnr('gist:'.a:gistid))
+  let winnum = bufwinnr(bufnr(s:bufprefix.a:gistid))
if winnum != -1
    if winnum != bufwinnr('%')
    exe "normal \<c-w>".winnum."w"
    endif
    setlocal modifiable
else
-    exec 'silent split gist:'.a:gistid
+    exec 'silent split' s:bufprefix.a:gistid
endif
filetype detect
silent %d _
@@ -654,7 +656,7 @@ function! Gist(line1, line2, ...)
let deletepost = 0
let editpost = 0
let listmx = '^\(-l\|--list\)\s*\([^\s]\+\)\?$'
-  let bufnamemx = '^gist:\([0-9a-f]\+\)$'
+  let bufnamemx = '^' . s:bufprefix .'\([0-9a-f]\+\)$'

let args = (a:0 > 0) ? split(a:1, ' ') : []
for arg in args

Filetype not properly detected

Line 261 contains

let mx = '^.<div class="data syntax type-([^"]+)">.$'

But the type-* div on the gist page doesn't have the class syntax (maybe it changed or I'm just not getting it). I reduced it to the following, this might help future proof it a bit if this change or there are variations between setups.

let mx = '^._<div class="._type-([^"]+)".*$'

Saving local file to existing gist

I have some file on my disk and I created a gist from it. Some time later I changed something in it and wanted to update the gist.
Is it a way to update gist with given ID from the local, non-gist buffer? I don't want to do :Gist XXXX and copy/paste changes from local buffer to gist buffer and saving (it's too manual for me).

Great plugin, thx!

`Gist -l` buffer is collapsed

When I execute Gist -l for the first time,
[gist:tyru] buffer is not collapsed:

But I execute Gist -l again,
[gist:tyru] buffer is collapsed like this:

Improved help text.

I had trouble understanding the use of gist.vim through the rudimentary help text contained in the script's header. I was missing a structure (posting vs. editing vs. listing. vs. context-sensitive commands in the buffer itself). The long arguments aren't listed at all.

Below is my stab at an improved help text. Beware, I've been using gist.vim only for a couple of hours, so my interpretation may be off! I would also recommend to split off the help text into a separate doc/gist.txt file (and then packaging the script either as Vimball or TAR/ZIP archive). This would allow translation of the help into other languages and integration with the :help command.

-- regards, ingo

POSTING                                                                      *
:[range]Gist            Post selected text / entire buffer to gist.
:Gist -p|--private      Post a private gist. If you get an empty gist list,
                        try :Gist --abandon
:Gist -a|--anonymous    Post anonymously, without using your configured login.
:Gist -m|--multibuffer  Multi buffer: Post all visible buffers concatenated. 

EDITING                                                                      *
:Gist XXXXX             Download and edit existing gist XXXXX.
:Gist -c|--clipboard XXXXX
                        Get gist XXXXX and copy the contents to the clipboard,
                        too.

LISTING                                                                      *
:Gist -l|--list [{username}]
                        List gists from {username} / my own gists. 
:Gist -la|--listall     List all gists. 

IN GIST BUFFERS                                                              *
:w                      You can update the gist with :w command in the gist
                        buffer.
:Gist -e|--edit [{name}]
                        Edit the gist, optionally passing the gist file name
                        {name}. 
:Gist -d|--delete       Delete the gist. (password authentication is needed)
:Gist -f|--fork         Fork the gist. (password authentication is needed)

 vim:tw=78:ts=8:ft=help:norl:

Parsing HTML doesn't work correctly on Gist -l

When set gdefault is on .vimrc then parsing HTML on :Gist -l command may not work correctly and raw HTML is displaied. So I recommend you to store the status of its and restore after everything has complete or whatever. Sorry that If I could write VIM-Script, I would fix and send you pull request.

And it is not related to this issue but if description is displaied on :Gist -l command, that would be nice because the Gist ID is not useful for finding.

P.S.
Just in case I rewrote this issue in English.

Automatically adding filename to gist?

Is there a reason why you don't automatically add the filename field of the list, for example set it to the filename of the "gisted" file if there is any? I have to manually add a name with "Gist -e filename".

Post failed: Unauthorized

I get this message every time I attempt a gist which requires authentication (ie everything but -a).

Here's the full output:

Posting it to gist...
Error detected while processing function Gist..13_GistPost:
line   73:
Post failed: Unauthorized   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current^@
                              Dload  Upload   Total   Spent    Left  Speed^@^M  0     0    0     0    0     0
     0      0 --:--:-- --:--:-- --:--:--     0^M100   315  100     1  100   314      1    396  0:00:01 --:--:-
-  0:00:01   554^M100   315  100     1  100   314      1    395  0:00:01 --:--:--  0:00:01   553^@HTTP/1.1 401
 Unauthorized^M^@Server: nginx/0.7.67^M^@Date: Sat, 16 Apr 2011 20:41:55 GMT^M^@Content-Type: text/html; chars
et=utf-8^M^@Connection: keep-alive^M^@Status: 401 Unauthorized^M^@X-Runtime: 3ms^M^@Content-Length: 1^M^@Set-C
ookie: _gh_sess=BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D--ed7e
add474fd37850b68bd3c08a5c55ad0c3c833; path=/; expires=Fri, 01 Jan 2021 00:00:00 GMT; secure; HttpOnly^M^@Cache
-Control: no-cache^M^@Strict-Transport-Security: max-age=2592000^M^@^M^@

I've tried setting g:github_user and g:github_token explicitly but this makes no different, and it appears the GistPost function has the correct credentials. Am I missing something?

After PIN, get lots of errors

After I enter the PIN, I get a lot of errors, which disappear shortly after so I cannot copy and paste it here. The same thing happens if I do the number 1 option (basic auth).

Please add more meaningful error messages

I tried using gist.vim with a wrong github token and it never told me what was wrong with it :-(. Can you please add some more meaningful error messages. Like for example "Your Github Token is wrong". Would be very nice.

Updating gist erases description

Steps to reproduce:

  1. :Gist -l
  2. <CR> on a gist that has a description
  3. Modify the gist
  4. :w -> Updating gist

Now the updated gist doesn't have the description anymore =\

.gist-vim doesn't save ClienID/Secret Information

Although doing Gist -l works and it creates a .gist-vim file it doesn't save the information inputed in the dialog nor is there in the documentation the format in which to put it.

Btw, thank you for fixing the api_change issue promptly.

@ in github_user causes an error

The basic :Gist command to post the buffer fails when github_user contains a character @.

echo g:github_user # => <my_email>@gmail.com

When I changed github_user to my username shuuesugi instead of my email, it was fixed.

Typo in README

The bottom of the Tips section would be the following.


or in your .vimrc

let g:github_token = 'XXXXX'

or by using an environment variable on *nix systems

let g:github_token = '$GITHUB_TOKEN'

Error writing buffer under gvim

Running the latest gist.vim from github and gvim on Windows 7. Git/Curl are installed and working. I can list gist, post new gists, and start to edit them without any errors. When issuing :w in a gist buffer after editing however, I get the following error and nothing is posted to github:

Error detected while processing function 31_GistWrite:
line 4:
E676: No matching autocommands for acwrite buffer

Gist.vim works just fine on OSX mvim using the same .vimrc and .vim files.

when doing visual select, I cannot see resulting gist URL

open up a buffer, select using visual select multiple line with shift-v
I run :Gist -a -p to paste. The resulting gist url doesn't show on my prompt.

This is with the latest git repo code: 2012-02-24

with Version: 4.4 from 04-Nov-2010 it worked fine.

current repo behavior:
current repo behavior

Note that I'm just kicked back to the --VISUAL-- prompt with no URL to grab

How do I get the URL with the current repo behavior?

This is how I used to see it

old expected behavior:
old expected behavior

Can't open file (win gvim)

win vim, it worked fine.
but in gvim, when I tried to Gist
it said:

Posting it to gist...
Error detected while processing function gist#Gist..44_GistPost:
line 63:
E484: Can't open file C:\Users\Ash\AppData\Local\Temp\VIo24B.tmp

And I looked this file, it didn't exist.

I tried with existing file, unsaved new file, results are the same.

Gist -ls isn't working

Hi,

Gist -ls appears not to be working, it only returns more.... Gist -l works fine on the other hand.

Error when saving gist

When I try to save a gist I get a gethub 404 page.

I also can't list any of my gists. All of them are private. Works fine if using id.

Make cookie directory configurable.

  1. I'm sharing my ~/.vim directory across multiple systems, but I don't necessarily want to synchronize my Gist cookie(s) across all systems.
  2. On some test systems, my .vimrc directory is mounted read-only and cannot be written to.

Therefore, I would appreciate a simple g:gist_cookie_dir configuration variable that allows to put the cookie directory outside the Vim runtime path, e.g. to ~/.gist_cookie_dir/.

-- regards, ingo

Support copying Gist URL in MacVim 7.3

Latest MacVim 7.3 (and its bundled vim), comes compiled with -xterm_clipboard. This might be because support to OS X clipboard was finally added in this version (see under :help added-7.3).

As I result, the check the script does if has('unix') && !has('xterm_clipboard') passes and thus stores the url in the "" register and not to the "+ (which is an alias for the clipboard register for OS X, "*).

Not sure how can this be fixed (I'm virtually vim-illeterate, otherwise you'd be getting a pull request instead :-) ), and I might as well be missing something...

I obviously have g:gist_put_url_to_clipboard_after_post set to 1.

Thanks!

feature request: default filename/extension

バッファにファイル名前がないときに、指定した名前と拡張子をつけれるようにしてほしいです…

g:gist_default_filename = 'foo.md'
g:gist_default_extension = 'md'

Multi-word Description

It seems that right now you can only do one-word descriptions when using :Gist -s.

It would be nice to be able to do: :Gist -s this is my description or :Gist -s "this is my description"
to delineate the description by surrounding it with quotes. This way you could have multi-word descriptions.

Newline on the end when copying to clipboard?

Hi,

I often use :Gist when I want to show someone my code on IRC. The problem I'm having is that if I just create the gist with :Gist and then go to the irc client and paste it it is written instantly without me needing to hit ENTER. I don't want this to happend since I may be in the middle of a sentence. I'm not sure why this is happening but I thought maybe it's because there is a newline character at the end or something like that?

Option to Fail Silently if git is not Available

When I open vim with gist-vim in Windows (or presumably other environments where executable("git") fails), I get an annoying popup.

Would it be possible to have it so no warning is presented when this happens?

Gist filename must be fnameescape()'d.

:Gist 789447

This Gist is named todo.txt%20final%20filter. When opening via Gist.vim, the Gist is opened in a buffer named gist_789447/todo.txtXXX20finalXXX20filter, where XXX stands for the current buffer name.

The problem is that the "%" inside filename must be escaped:

exec 'silent noautocmd split' s:bufprefix.a:gistid."/".filename

You can use the fnameescape() function for that; unfortunately, this was only introduced in Vim 7.1.299, so you have to either bump the minimum supported version to 7.2 or add a if exists('*fnameescape') check.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.