5 ms·
Vim & Python: Making yourself at home
- Pewpewarrows 15y agoPlease, save yourself the hassel and use Pathogen for all your vim plugin needs. Otherwise there's some nice tips in this article.
- St-Clock 15y agoActually, I found vundle (https://github.com/gmarik/vundle https://github.com/gmarik/vundle) to be slightly easier to use.
- benatkin 15y agoThat's interesting, but it's a very different approach to Pathogen, and it's very much a matter of taste IMHO. I prefer to use git submodules directly or through a general-purpose scripting language and just have the vim component load my plugins.
- Pewpewarrows 15y agoExactly. I use homesick to version and sync all the config files in my home directory across machines (linux and OSX alike), and git submodules already solve the problem for me.
- Dejital 15y agoMy .vim folder would be a gigantic mess without Pathogen. I recommend using Tammer Saleh's update_bundles script ( http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen http://tammersaleh.com/posts/the-modern-vim-config-with-path... ) to keep your vim plugins up to date.
- tednaleid 15y agoI hadn't seen that one before so I came up with a similar script that updates both git and mercurial repositories: https://bitbucket.org/tednaleid/vimrc/src/tip/install.sh https://bitbucket.org/tednaleid/vimrc/src/tip/install.sh Tammer's has some nice things in it that I might crib, thanks for the link
- benatkin 15y agoThe author switched to Emacs. https://twitter.com/#!/justinlilly/status/96630245226061824 https://twitter.com/#!/justinlilly/status/96630245226061824 But yeah, as a vim user I agree. Pathogen helps a lot.
- IgorPartola 15y agoDoes anyone else use code folding plugins for vim? If you have something good for this, please share, since all the popular plugins are pretty buggy (they fold functions withing functions, and sometimes just white space).
- patrickod 15y agoI've just been using vim's built in folding with indentation as the fold method. Thus far I have complaints; it seems to work as I want it.
- igorgue 15y agoJust fold by indent or syntax, if your code isn't already indented right, you're doing it wrong :-)
- pyre 15y agoSome people don't want if-else, while or for blocks folded, which will happen if you just fold on indent with considering syntax.
- nakkiel 15y agohttp://paste.pocoo.org/show/449029/ http://paste.pocoo.org/show/449029/ As mentioned in the paste: Please note that this is hacked Python SimpleFold. I don't know how much of the original plugin the code share (as I hacked it loooong ago). Do remember that it doesn't always work (but always do with my company's coding conventiens; hear I have no intent to make it work for others). Also, there is probably some useless crap laying around. Edit: Judging by my English, I'm really tired. I leave it as-is for posterity and because it's the way it is in the paste.
- ristretto 15y agoOne thing i miss in languages like python that don't enclose blocks in {} is the convenience of using % to find the matching beginning/end of the block.
- sixtofour 15y agoThat, and the lack of constant constants (class workarounds don't do it for me) are the only two "complaints" for me. On the whole I really like significant white space (despite my suspicions before taking up the language). With a brace-blocked language like C, indentation can fool you into thinking there's a block when there really isn't. This is very unlikely to happen in Python. A section of code that looks like a block due to indentation is virtually certain to be a single coherent block. I love that.
- igorgue 15y agoI use "vii" in normal mode to do that. It basically selects the block. http://vim.wikia.com/wiki/Indent_text_object http://vim.wikia.com/wiki/Indent_text_object
- iloveyouocean 15y agoI haven't tried it in Python, but it's worth checking out matchit. http://www.vim.org/scripts/script.php?script_id=39 http://www.vim.org/scripts/script.php?script_id=39 matchit generally seems to do a good job at identifying beginning/end pairs in a variety of languages.
- razzmataz 15y agoIn my years of experience, I've found that huge ass blocks of code where % is useful in finding the beginning/end of a block are usually in need of massive amounts of refactoring.
- jholman 15y agoI wish HN had a Save button, so I could remember to come back to this later, and experiment with the parts I didn't already know.
- bretthoerner 15y agohttp://readitlaterlist.com/add http://readitlaterlist.com/add
- rsuttongee 15y agoIt's a little weird (to me at least), but upvoting stories in HN is considered 'saving' them. You can view all your saved stories from your profile page under the link 'saved stories'. You can also just go to: http://news.ycombinator.com/saved?id=jholman http://news.ycombinator.com/saved?id=jholman
- pyre 15y agoThere is also this to download those 'saved' links: https://github.com/bsandrow/hn-profile https://github.com/bsandrow/hn-profile
- AlecSchueler 15y agoReminder Bear, created by a fellow HNer, works pretty well for this - http://app.reminderbear.com/ http://app.reminderbear.com/
- a3_nm 15y agoBookmark the page in your browser?
- yuvadam 15y agoI use instapaper for stuff like that.
- joshu 15y agoif only there were a way to save and share urls using some sort of online service.
- streptomycin 15y agoI've been using this: http://sontek.net/turning-vim-into-a-modern-python-ide http://sontek.net/turning-vim-into-a-modern-python-ide
- fs111 15y agono love for my pydoc.vim? https://github.com/fs111/pydoc.vim https://github.com/fs111/pydoc.vim
- palish 15y agoNope, no love =(
- mrkva 15y agoI am experiencing weird glitch at your site: http://cl.ly/8v2D http://cl.ly/8v2D Using Chrome 14.0.835.8 dev, Mac OS X 10.7