在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):julienr/vim-cellmode开源软件地址(OpenSource Url):https://github.com/julienr/vim-cellmode开源编程语言(OpenSource Language):Vim Script 100.0%开源软件介绍(OpenSource Introduction):Vim-cellmodeThis a vim plugin that enables MATLAB-style cell mode execution for python scripts in vim, assuming an ipython interpreter running in screen (or tmux). DemoUsageBlocks are delimited by
If you put your cursor on the line marked with (1) and hit Ctrl-G, the 3 lines in the first cell will be sent to tmux. If you hit Ctrl-B, the same will happen but the cursor will move to the line after the ## (so you can chain Ctrl-B). You can also select line(s) and hit Ctrl-C to send them to tmux. The plugin automatically deindent selected lines so that the first line has no indentation. So for example if you select the line marked (2) and (3), the print statements will be de-indented and sent to tmux and ipython will correctly run them. RequirementsOn Linux, you need xclip if you want to use screen. Keys mappingBy default, the following mappings are enabled :
You can disable default mappings :
In addition, there is a function to execute all cells above the current line which isn't bound by default, but you can easily bind it with :
OptionsYou have to configure the target tmux/screen session/window/pane. By default, the following is used :
This scripts relies on temporary files to send text from vim to tmux. To
allow cell execution queuing, we use a rolling buffer of temporary files.
You can control the size of the buffer by defining To choose between tmux and screen, set You can also configure the cell delimiter. This is done through the
will match Difference with vim-ipythonNote that if you want more advanced integration with IPython (using the new multi-client architecture), there is the vim-ipython project : https://github.com/ivanov/vim-ipython/ The main difference with vim-ipython is that this plugin simply emulate a paste as you would do it manually from vim to ipython. This allow to see the result of the execution directly in the ipython split whereas vim-ipython uses a separate vim buffer to show the results. LicenseMIT (see LICENSE) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论