GitXplorerGitXplorer
n

pynvim-hello-world

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Verified
453adbd28873af8d50063386e2ab9d7dda801dd7

Update README.md

nnoelevans committed 6 years ago
Verified
c8c3cf70aa4d9aa31b4df17c699267c057a2ac69

Update README.md

nnoelevans committed 6 years ago
Verified
38b1c57536521dfc8649bd23579c1091edad232f

Update README.md

nnoelevans committed 6 years ago
Verified
2f4fdf926d0ce61209262324fe2bc9b5f1d79692

Update README.md

nnoelevans committed 6 years ago
Verified
2ee66130e91ed504eb8baf55742558f76e3f0199

Create README.md

nnoelevans committed 6 years ago
Verified
f5353a3f40a858566644162859765d9efb213be1

Initial commit

nnoelevans committed 6 years ago

README

The README file for this repository.

pynvim-hello-world

A simple set of instructions to write a greeting with the Python Neovim API.

This is a quick guide to writing a simple Python Plugin for Neovim. You will first need Neovim installed. I then installed pynvim from source following their instructions.

Write the following code to

  • /home/yourname/.config/nvim/rplugin/python3/greet.py
  • or another directory that ends .../nvim/rplugin/python3/some_filename.py where ... is a folder on your runtime path. Use set runtimepath? to see that.

.

import pynvim

@pynvim.plugin
class Greeting(object):

    def __init__(self, vim):
        self.vim = vim

    @pynvim.command('Greet', range='', nargs='*', sync=True)
    def command_handler(self, args, range):
        self.vim.command('echo "Hello, World!"')

After writing this file, run :UpdateRemotePlugins to tell Neovim to load the new file. You can then see "Hello, World!" echoed with the command :Greet