Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this feeling that if I knew the correct terminology here, I wouldn't need to ask this question and Google would suffice. Alas.

Using http://www.vim.org/scripts/script.php?script_id=2423, when I run the ':Gist' command, the plugin prints the link to the gist at the bottom of the terminal window, where one would normally enter commands. I'm not sure what this is called. I can't select the text there and thus can't copy it, and the moment I do something else, the text disappears and gets replaced with the normal mode text.

I know there is q: for viewing old commands, but is there some way that I can view old messages like the one that gist.vim spits out? Or is there at least some magical way that I can copy that beautiful text before I do something else and it disappears?

If it is relevant, I'm on OS X Lion and running Vim in iTerm. Nothing special.

share|improve this question
    
I don't know about iTerm, but in Linux xterm you can shift-click-drag to select text, without sending any mouse message to Vim. –  joeytwiddle Jan 13 at 18:22

3 Answers 3

up vote 4 down vote accepted

In :help Gist, there is a setting that automatically copies the gist link to your clipboard with :Gist -c

If you set g:gist_clip_command, gist.vim will copy the gist code with option '-c'.

Mac:

let g:gist_clip_command = 'pbcopy'

Linux:

let g:gist_clip_command = 'xclip -selection clipboard'

Others (cygwin?):

let g:gist_clip_command = 'putclip'

Add this to your ~/.vimrc and you're good to go.

Edit:

Found a hackish solution.

Go to gist.vim and find this function.

function! s:GistPost(user, token, content, private)

  " find GistID: in content, then we should just update

  ...  

  let location = substitute(location, '^[^:]\+: ', '', '')
  if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
    redraw
    echo 'Done: '.location
  else

  ...

  return location
endfunction

Change echo to echomsg.

  if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
    redraw
    echomsg 'Done: '.location

Now restart vim, and after entering :Gist, type :message to get the link from the message-history. The message-history logs everything from echomsg and echoerr for that session.

share|improve this answer
    
Right, I did that. The question is still relevant though. –  Rayne Sep 28 '11 at 17:29
    
@Rayne See edit :) –  Jin Sep 28 '11 at 17:55

I was looking for any answer for your question due to a different plugin. I stumbled upon the name of the message output in :h message.

If your vim window is still open, it looks like you can hit g< to see the last message.

I think :messages works too.

share|improve this answer

Sent a fix to the plugin author about this. https://github.com/mattn/gist-vim/pull/49

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.