GithubHelp home page GithubHelp logo

rliang / nvim-pygtk3 Goto Github PK

View Code? Open in Web Editor NEW
54.0 3.0 4.0 332 KB

PyGTK3 frontend to Neovim with some visual GUI elements.

License: MIT License

Python 87.87% Vim Script 12.13%
neovim pygtk3 gtk gtk3

nvim-pygtk3's Introduction

nvim-pygtk3

PyGTK3 frontend to Neovim with some visual GUI elements.

  • Provides GTK's clipboard (no need for xclip/xsel)
  • Buffers on header bar
  • GUI Tabs
  • Overlay scrollbars
  • Applies GTK's light/dark themes according to &bg
  • Applies font from :GuiFont, or from GSettings' org.gnome.desktop.interface:monospace-font-name
  • Customizable with Python scripts

Preview

Installation

Requirements:

  • python 3.6+
  • python-setuptools (make)
  • python-neovim
  • python-gobject
  • vte3

Per-user:

$ python setup.py install --user --root=/

System-wide:

$ sudo python setup.py install --root=/

Python scripts

Scripts in $XDG_CONFIG_HOME/nvim_pygtk3/*.py are exec'd at startup, exposing the following globals:

  • connect: Utility wrapper to connect GObject signals.
  • window: The GTK top-level window. Docs
    • window.terminal: The VTE terminal that hosts neovim. Docs
    • window.switcher: The GtkStackSwitcher that displays buffers. Docs
    • window.notebook: The GtkNotebook that displays tabs. Docs
    • window.viewport: The GtkViewport that holds the terminal. Docs

The window object has the following additional signals:

  • nvim-setup: Emitted when neovim has started.
  • nvim-notify: Emitted when neovim has notified the GUI.
  • nvim-request: Emitted when neovim has requested the GUI.

Example script ~/.config/nvim_pygtk3/a.py:

@connect(window, 'nvim-setup')
def a(nvim):
    nvim.command(f'call rpcnotify({nvim.channel_id}, "hello", "world")')

@connect(window, 'nvim-notify')
def b(nvim, event, args):
    if event == 'hello':
        print('hello', args)

@connect(window.terminal, 'cursor-moved')
def c():
    print('cursor moved!')

nvim-pygtk3's People

Contributors

oliveiraev avatar rliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nvim-pygtk3's Issues

Installation errors: 'invalid syntax'

Hi!
I just found your project and tried installing nvim-gtk3. However I'm getting the following errors when I try to do the installation method provided in the Readme.md:

running install
running build
running build_py
running install_lib
byte-compiling /home/tuxflo/.local/lib/python3.5/site-packages/nvim_pygtk3/application.py to application.cpython-35.pyc
  File "home/tuxflo/.local/lib/python3.5/site-packages/nvim_pygtk3/application.py", line 12
    application_id=f'org.{name}',
                               ^
SyntaxError: invalid syntax

byte-compiling /home/tuxflo/.local/lib/python3.5/site-packages/nvim_pygtk3/window.py to window.cpython-35.pyc
  File "home/tuxflo/.local/lib/python3.5/site-packages/nvim_pygtk3/window.py", line 237
    ['nvim', f'+set rtp^={rtp}', *argv],
                              ^
SyntaxError: invalid syntax

running install_data
running install_egg_info
running egg_info
writing nvim_pygtk3.egg-info/PKG-INFO
writing dependency_links to nvim_pygtk3.egg-info/dependency_links.txt
writing top-level names to nvim_pygtk3.egg-info/top_level.txt
writing requirements to nvim_pygtk3.egg-info/requires.txt
writing entry points to nvim_pygtk3.egg-info/entry_points.txt
reading manifest file 'nvim_pygtk3.egg-info/SOURCES.txt'
writing manifest file 'nvim_pygtk3.egg-info/SOURCES.txt'
removing '/home/tuxflo/.local/lib/python3.5/site-packages/nvim_pygtk3-0.3.4.egg-info' (and everything under it)
Copying nvim_pygtk3.egg-info to /home/tuxflo/.local/lib/python3.5/site-packages/nvim_pygtk3-0.3.4.egg-info
running install_scripts
Installing nvim-pygtk3 script to /home/tuxflo/.local/bin

Any ideas what to do about that?

Thanks for helping,
Flo

doesn't respect background from config file

Great project,

while using it I discovered that the gui doesn't respect the background I set in the config files.
In both ginit.vim and init.vim I set:

set background=dark
set bg=dark

but the gui starts always with light bg! (anyway I think it should be enough to set it in ginit.vim)

If once started I set it manually :set bg=dark it switches to dark bg as expected.

White frame around terminal

There is a white frame around the Vte widget, which seems made of two part:

  1. A white 1px frame border that is always there
  2. A variable right and bottom border that grows/shrinks as the window is resized (the bottom border also happens with Gvim), the border becoming 0px when the width/height is a multiple of a character width/height.
    screenshot from 2017-06-16 08-40-27

nvim-pygtk3: neovim outdated

I have installed nvim-pygtk3 on user mode and i tried to launch it, but there is the output:

./nvim-pygtk3  
Traceback (most recent call last):
  File "./nvim-pygtk3", line 6, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3254, in <module>
    def _initialize_master_working_set():
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3237, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 901, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 787, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'neovim>=0.1.10' distribution was not found and is required by nvim-pygtk3

but my nvim version is

nvim --version
NVIM v0.4.3
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-gOb7vg/neovim-0.4.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-gOb7vg/neovim-0.4.3/build/config -I/build/neovim-gOb7vg/neovim-0.4.3/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-gOb7vg/neovim-0.4.3/build/src/nvim/auto -I/build/neovim-gOb7vg/neovim-0.4.3/build/include
Compilado por [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

i have installed nvim from ubuntu's repo

Changing the font in nvim-pygtk3

Hi!

First, congratulations! Very nice app ๐Ÿ‘

I'm wondering if it is possible to change the default font of this app.

Thanks,
Ronan

Set window default size (or save last size before closing)

Hi!

Very nice GUI.

But I can't set the default size of the window... It's very little after startup.
I'm using xfce, and I've searched an option in dconf to globally set windows defaults size, but did not find one.

Thanks in advance!

send commands to nvim

Hi,

Is there a way to send command line arguments to nvim (I'd like to send commands such as -c <command>)?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.