Vim capable IDE?

Ron Adam rrr at ronadam.com
Tue Oct 18 13:12:30 EDT 2005


Chris Lasher wrote:
> Thanks for your responses, guys. I can't get the PIDA page to come up
> for me; server timeout error. I'll have to look into Eclipse more, but
> I've been warned that it's resource greedy and that the VI plugin
> doesn't provide very much functionality. Still, that's hearsay, so I'll
> have to find out for myself.
> 
> I would have figured Vim or VI editing behavior would be a lot more
> prevalent in IDEs but it seems to be quite rare. I don't understand
> that, because a lot of people seem to use IDEs, and a lot of people
> seem to use VI/Vim or Emacs. Is it the young guns that are tied to the
> IDEs, never knowing powerful text-editors exist, and old dogs sticking
> to their favorite editors, not giving in to all those "distracting"
> bells and whistles of IDEs? What's the deal? A marriage of the two
> would seem like the best of both worlds.
> 
> Chris

What features are you looking for.  I think most Vim users just add what 
they want to Vim.

Here's what I use to launch a script and capture the output into a read 
only panel.  I think it may still needs a little fine tuning.  This is 
on windows, but it should work on linux with some minor changes.

Cheers,
    Ron


Add this to your python.vim file in your ftplugin directory.

" Run a python script and get the output into a window.
set switchbuf=useopen
function! RunPython(rmode)
     if a:rmode=='wnd'
         " Run in python shell and capture the
         "   output to a vim buffer window.
         execute "w!"
         if bufnr("python_stdout") >0
             exe "sb python_stdout"
         else
             exe 'split python_stdout'
         endif
         setlocal noswapfile
         set buftype=nofile
         setlocal modifiable
         normal ggdG
         silent! exe 'r!python #'
         setlocal nomodified
         set filetype=txt
         normal 1G
     elseif a:rmode=='ext'
         " Execute script in python shell
         execute "w!"
         !start python -i %
     else
         " Open an interactive shell
         !start python
     endif
endfunction

" Add keymap to run and open console
map <F12> :call RunPython("wnd")<cr>
map <S-F12> :call RunPython("ext")<cr><cr>
map <c-F12> :call RunPython("psh")<cr><cr>
imap <F12> <C-\><C-N>:call RunPython("wnd")<cr>:star<cr>
imap <S-F12> <C-\><C-N>:call RunPython("ext")<cr><cr>:star<cr>
imap <c-F12> <C-\><C-N>:call RunPython("psh")<cr><cr>:star<cr>



More information about the Python-list mailing list