mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
runtime: Document python interface, clipboard and add intro doc
This commit is contained in:
parent
40a8193c6a
commit
84aff1da6a
47
runtime/doc/nvim_clipboard.txt
Normal file
47
runtime/doc/nvim_clipboard.txt
Normal file
@ -0,0 +1,47 @@
|
||||
*nvim_clipboard.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Clipboard integration for Nvim *nvim-clipboard*
|
||||
|
||||
By default, Nvim has no connection to the system clipboard. Eventually that
|
||||
will be implemented by UI programs, which connect to Nvim via |msgpack-rpc|.
|
||||
|
||||
Even though externalized UIs are not available yet, there's a workaround that
|
||||
enables clipboard usage through the python interface(which also uses
|
||||
|msgpack-rpc| and consequently can implement the clipboard methods required
|
||||
by Nvim):
|
||||
|
||||
- Make sure you follow the setup instructions in |nvim-python-quickstart|.
|
||||
- Install the `xerox` python module:
|
||||
>
|
||||
$ pip install xerox
|
||||
<
|
||||
- Create a ~/.vim/pythonx/nvim_clipboard.py file with the following contents:
|
||||
>
|
||||
import xerox
|
||||
|
||||
class NvimClipboard(object):
|
||||
def __init__(self, vim):
|
||||
self.provides = ['clipboard']
|
||||
|
||||
def clipboard_get(self):
|
||||
return xerox.paste().split('\n')
|
||||
|
||||
def clipboard_set(self, lines):
|
||||
xerox.copy(u'\n'.join([line.decode('utf-8') for line in lines]))
|
||||
<
|
||||
This should enable the '+' and '*' registers. As an optional step, set the
|
||||
'unnamedclip' option to transparently access clipboard using the unnamed
|
||||
register. If you use the same |vimrc| for both Vim and Nvim, make sure you
|
||||
only set the option when `has('neovim')` is true:
|
||||
>
|
||||
if has('neovim')
|
||||
set unnamedclip
|
||||
endif
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
22
runtime/doc/nvim_intro.txt
Normal file
22
runtime/doc/nvim_intro.txt
Normal file
@ -0,0 +1,22 @@
|
||||
*nvim_intro.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Introduction to Nvim *nvim-intro*
|
||||
|
||||
This is an introduction new Nvim users. It is meant for experienced Vim users
|
||||
that want to get started with Nvim. For a basic introduction to Vim, see
|
||||
|help.txt|.
|
||||
|
||||
For now, it is just an index with the most relevant topics/features that
|
||||
differentiate Nvim from Vim:
|
||||
|
||||
1. Msgpack-RPC |msgpack-rpc|
|
||||
2. Job control |job-control|
|
||||
3. Python plugins |nvim-python|
|
||||
4. Clipboard integration |nvim-clipboard|
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
40
runtime/doc/nvim_python.txt
Normal file
40
runtime/doc/nvim_python.txt
Normal file
@ -0,0 +1,40 @@
|
||||
*nvim_python.txt* For Nvim. {Nvim}
|
||||
|
||||
|
||||
NVIM REFERENCE MANUAL by Thiago de Arruda
|
||||
|
||||
|
||||
Python plugins and scripting in Nvim *nvim-python*
|
||||
|
||||
1. Introduction |nvim-python-intro|
|
||||
2. Quickstart |nvim-python-quickstart|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *nvim-python-intro*
|
||||
|
||||
Through an external python interpreter connected via |msgpack-rpc|, Nvim
|
||||
offers some support for the classic |python-vim| interface. For now only the
|
||||
old Vim 7.3 API is supported.
|
||||
|
||||
==============================================================================
|
||||
2. Quickstart *nvim-python-quickstart*
|
||||
|
||||
If you just want to start using python plugins with Nvim quickly, here's a
|
||||
simple step-by-step:
|
||||
|
||||
- Make sure python 2.6 or 2.7 is available on your `$PATH`
|
||||
- Install the `neovim` python package:
|
||||
>
|
||||
$ pip install neovim
|
||||
<
|
||||
- Add the following snippet to your `vimrc`, before any python plugins are
|
||||
loaded:
|
||||
>
|
||||
if has('neovim')
|
||||
runtime! plugin/python_setup.vim
|
||||
endif
|
||||
<
|
||||
Most python plugins created for Vim 7.3 should work after these steps.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
Loading…
Reference in New Issue
Block a user