Vim with Python support?
I wanted to be able to do quick pasties from vim so I installed codepad.vim to ~/.vim/plugin/
The docs at http://www.vim.org/scripts/script.php?script_id=2298 said, "This requires +python support in vim." When I'm editing a file and I do a :CPP I get the following: Code:
~ If not, what are some of the preferred ways to add python support to vim? There's a tool called AAp on the vim.org website, there's downloading and compiling from source, like the website recommends as the best method, and then there's the Slackware logical extension of that, getting the sources for the package from the Slackware repo and running the SlackBuild. The vim.SlackBuild Here shows the following: Code:
config_vim() { So what might I look at next? Basically, I'm just wanting to paste directly to a pastebin quickly from within vim. Thanks. |
You can check vim's compile-options with
Code:
vim --version Code:
vim --version | grep pyt Markus |
Yes it seems Python support is compiled in. I went ahead and re-compiled enabling Ruby, which is something I figured I would like to have, but I'm still wondering how to handle the error below:
Quote:
|
I checked the source of this plugin and the error is happening in line 67:
Code:
vim.command("call setreg('+', '%s')" % url) This works for me in GVim, but doesn't work in console Vim. According to Vim help, "for Unix systems the clipboard is only available when the +xterm_clipboard feature is present", which isn't in my case (:echo has('xterm_clipboard') returns 0). I build Vim myself, but my guess is that the same applies to Slackware's Vim as well. |
Quote:
on my system :echo has('xterm_clipboard') returns a 0 in vim and a 1 in gvim. This really doesn't do all that much from me though. I tested pasting via :CPP with the plugin and it worked fine in gvim - but that's not an app I actually use. Typically, I'll use geany or bluefish or kate when I want a gui, and yet I know that I can just launch gvim, I tend to always have a terminal open and invoke the regular console vim there and use it almost exclusively for most things. Well I'll look around to see if there's any pastie plugins that will work w/regular vim, and thanks so much for your help in determining what the problem was :) I'll mark this solved now but if anyone has any suggestions for something that works for a pastebin from console vim I'd appreciate hearing about it. |
I haven't tested it, but couldn't you just get rid of the two instances of
Code:
vim.command("call setreg('+', '%s')" % url) Code:
config_vim --without-x --disable-gui |
Yes!
Here's mention of that in the Vim wiki: http://vim.wikia.com/wiki/Script:2298 Essentially, There's three lines in each function to be commented out and then it works in both vim and gvim :) I commented out those three lines and the only gripe I have now is that there's no syntax highlighting for shell scripts, but that's a minor issue. I'm able to quickly post text to a pastebin and like you suggested I can just copy the URL from the browser to paste in an IRC channel or share it some other way. I haven't tried with commenting just the two lines you suggest and don't know what more that would get me. It works now and I'm pretty happy. |
Quote:
|
All times are GMT -5. The time now is 03:02 PM. |