作为一个坚定的VIM拥护者和R用户,我已经真正地享受了vim在Vim-R-插件中的相互作用。我一直很难找到这个版本的python。不存在吗?
我注意到了一个类似的问题,它显示了Python的Rstudio等效项,但我正在寻找这样的东西,它生活在.
编辑:特别是,我要找的东西
下列情况下的奖金:
发布于 2016-01-25 06:47:06
另一种方法是使用screen
vim插件。我更喜欢这一点,因为它避免了配置步骤。所以你要做的是:
screen
vim插件.vimrc
中创建一些方便的命令(参见下面添加的内容).py
文件,点击<LocalLeader>p
就可以了。请注意,您不必在打开TMUX
文件之前打开.py
。这就是我添加的内容(基于https://github.com/akhilsbehl/configs/blob/master/vimrc):
" use tmux for splitting screen
let g:ScreenImpl = "Tmux"
" default width of tmux shell pane
let g:ScreenShellWidth = 82
" open an ipython shell (! for vertical split)
autocmd FileType python map <LocalLeader>p IPython!<CR>
" close whichever shell is running
autocmd FileType python map <LocalLeader>q :ScreenQuit<CR>
" send commands
" line
autocmd FileType python map <LocalLeader>r V:ScreenSend<CR>0j
" block
autocmd FileType python map <LocalLeader>b {jv}:ScreenSend<CR>}
" selection
autocmd FileType python map <LocalLeader>v :ScreenSend<CR>`>}0j
" convenience
autocmd FileType python map <LocalLeader>gw :call g:ScreenShellSend('!pwd')<CR>
autocmd FileType python map <LocalLeader>L :call g:ScreenShellSend('!clear')<CR>
autocmd FileType python map <LocalLeader>t :call g:ScreenShellSend('%%time')<CR>
autocmd FileType python map <LocalLeader>tt :call g:ScreenShellSend('%%timeit')<CR>
autocmd FileType python map <LocalLeader>db :call g:ScreenShellSend('%%debug')<CR>
autocmd FileType python map <LocalLeader>pr :call g:ScreenShellSend('%%prun')<CR>
" get ipython help for word under cursor
function GetHelp()
let w = expand("<cword>") . "??"
:call g:ScreenShellSend(w)
endfunction
autocmd FileType python map <LocalLeader>h :call GetHelp()<CR>
" get `dir` help for word under cursor
function GetDir()
let w = "dir(" . expand("<cword>") . ")"
:call g:ScreenShellSend(w)
endfunction
autocmd FileType python map <LocalLeader>d :call GetDir()<CR>
" get `len` for word under cursor
function GetLen()
let w = "len(" . expand("<cword>") . ")"
:call g:ScreenShellSend(w)
endfunction
autocmd FileType python map <LocalLeader>l :call GetLen()<CR>
发布于 2017-10-21 04:59:49
我相信它的功能并不像你所希望的那样全面,但是我刚刚发布了这个插件。
https://github.com/iago-lito/intim
尝试一下,并毫不犹豫地在repo上提交您的第一个bug报告/特性请求:)
发布于 2016-01-20 03:14:36
到目前为止我发现的最好的是https://github.com/jpalardy/vim-slime
如何使用vim-slime
tmux
vim
打开脚本echo $TMUX_PANE
获取tmux窗格的名称(需要7)ipython
:SlimeConfig
中运行vim
,保持套接字名称"default"
并输入目标窗格,例如%14
vim
发送到ipython
https://stackoverflow.com/questions/32156208
复制相似问题