Coder Social home page Coder Social logo

neovim-gtk's Introduction

neovim-gtk Build statusBuild status

GTK ui for neovim written in rust using gtk-rs bindings. With ligatures support.

Screenshot

Main Window

For more screenshots and description of basic usage see wiki

Configuration

To setup font add next line to ginit.vim

call rpcnotify(1, 'Gui', 'Font', 'DejaVu Sans Mono 12')

for more details see wiki

Install

From sources

First check build prerequisites

By default to /usr/local:

make install

Or to some custom path:

make PREFIX=/some/custom/path install

archlinux

AUR package for neovim-gtk https://aur.archlinux.org/packages/neovim-gtk-git

git clone https://aur.archlinux.org/neovim-gtk-git.git
cd neovim-gtk-git 
makepkg -si

openSUSE

https://build.opensuse.org/package/show/home:mcepl:neovim/neovim-gtk

windows

Windows binaries on appveyor latest build

Build prerequisites

Linux

First install the GTK development packages. On Debian/Ubuntu derivatives this can be done as follows:

apt install libgtk-3-dev

On Fedora:

dnf install atk-devel cairo-devel gdk-pixbuf2-devel glib2-devel gtk3-devel pango-devel  

Then install the latest rust compiler, best with the rustup tool. The build command:

cargo build --release

Windows

Neovim-gtk can be compiled using MSYS2 GTK packages. In this case use 'windows-gnu' rust toolchain.

SET PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig
cargo build --release

neovim-gtk's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neovim-gtk's Issues

Trouble with vim-devicons

Devicons are not rendered properly (see attached screenshots). I know these are double width characters not obvious to deal with, do you think this could be fixed?

nvim-gtk
nvim-gtk-2

Multiple instances share working directory

I am not really sure if this problem is in neovim-gtk or somewhere else (it does not happen in neovim alone)

if I launch neovim-gtk from two different folders (one after the other), the neovim-gtk launched last will have the working directory of the first instance, so things like Ctrl-P will lookup files from the wrong folder.

Steps to reproduce:

  1. launch neovim-gtk in ~/tmp/a
  2. launch neovim-gtk in ~/tmp/b
  3. launch CtrlP in second instance, and see the files from ~/tmp/a show up when you search

Fails after about hour of working

It freezes and after about 10-20 seconds it fails.

Here is the log:

$ nvim-gtk 
Unknown error type: Wait timeout
Unknown error type: Wait timeout
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /checkout/src/libcore/result.rs:906:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
thread '<unnamed>' panicked at 'Can't join dispatch thread: Any', /checkout/src/libcore/result.rs:906:4
Unknown error type: Wait timeout
Unknown error type: Wait timeout
nUnknown error type: Wait timeout
Unknown error type: Wait timeout
thread 'main' panicked at 'Error run input command to nvim: GenericError("Wait timeout")', /checkout/src/libcore/result.rs:906:4

Neovim :version:

NVIM v0.2.2
Build type: Debug
LuaJIT 2.0.5
Compilation: /usr/bin/cc -Wconversion -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/build/config -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/src -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/.deps/usr/include -I/usr/include -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/build/src/nvim/auto -I/home/unclechu/.compile_n_build/neovim/neovim-v0.2.2-from-git/build/include
Compiled by unclechu@fedorafarm25

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

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/home/unclechu/neovim-v0.2.2-from-git/share/nvim"

Run :checkhealth for more info

My neovim config: https://github.com/unclechu/neovimrc/

default instalation path

in the Makefile, the default installation path is /usr/local, this path need root permission, it will trigger error if not change to path with user permission because cargo can not run as root in default configuration. I believe ~/.local is better.

Cannot enter lesser then character

As per title, I am not able to enter the lesser then character ('<') when in insert mode, it simply does nothing. I can enter the greater then character ('>') though

Neovim-gtk flickers a lot

Hi,
I'm trying to run neovim-gtk on my computer (Linux 4.14, Debian, X11, integrated GPU) and it flickers a lot. I tried running neovim-gtk with an empty init.vim and also making the window smaller, nothing changed.
The only way to make the flickering stop on my computer is to focus another window.

I don't really know how to troubleshoot this issue, if you need more information, feel free to ask.

Pretty cool project by the way ! :)

AUR package

FYI I made a first pass at an AUR package for neovim-gtk: https://aur.archlinux.org/packages/neovim-gtk-git. This makes it easy to build and install on Arch Linux:

git clone https://aur.archlinux.org/neovim-gtk-git.git
cd neovim-gtk-git 
makepkg -si

PS This thing is brilliant. The ligature support is fantastic and some of the best I've seen in any editor.

Plugin Manager causes panic when opened from gnome application menu

  1. Start with or without having an init.vim file and existing plugins
  2. open neovim-gtk on Fedora 27 with Gnome 3.26.2 / Rust 1.23.0
  3. click the application menu
  4. click Plugins

RESULT
Plugins manager briefly appears then the both the plugin manager and the main window close.

EXPECTED
Plugins manager to open normally

thread 'main' panicked at 'already borrowed: BorrowMutError', src/libcore/result.rs:906:4
stack backtrace:
0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
1: std::sys_common::backtrace::_print
2: std::panicking::default_hook::{{closure}}
3: std::panicking::default_hook
4: std::panicking::rust_panic_with_hook
5: std::panicking::begin_panic
6: std::panicking::begin_panic_fmt
7: rust_begin_unwind
8: core::panicking::panic_fmt
9: core::result::unwrap_failed
10: <nvim_gtk::ui::UiMutex>::borrow_mut
11: nvim_gtk::ui::Ui::init::{{closure}}
12: gtk::auto::widget::window_state_event_trampoline
13:
14: g_closure_invoke
15:
16: g_signal_emit_valist
17: g_signal_emit
18:
19: gtk_main_do_event
20:
21:
22: g_main_context_dispatch
23:
24: g_main_loop_run
25: gtk_dialog_run
26: nvim_gtk::plug_manager::ui::Ui::show
27: nvim_gtk::ui::Ui::create_main_menu::{{closure}}
28: gio::auto::simple_action::activate_trampoline
29: g_closure_invoke
30:
31: g_signal_emit_valist
32: g_signal_emit
33:
34:
35:
36:
37:
38: g_main_context_dispatch
39:
40: g_main_context_iteration
41: g_application_run
42: nvim_gtk::main
43: __rust_maybe_catch_panic
44: std::rt::lang_start
45: __libc_start_main
46: _start
Uncaught panic, exiting
Aborted (core dumped)

Completion Popup Menu does not hilite current selection

In regular neovim, when the popup completion menu appears, the selected entry is hilited according to PmenuSel. I understand that this probably cannot be done with neovim-gtk, but currently there is no hilite or frame or whatsoever at all, which makes it impossible to navigate the completion list.

Turn off GUI tabline

I have customized tabline by extension, and would prefer use this features instead of standard tabline provided by GUI, is it possible to switch back to text-based tabline rendering?

Bad initial render of TUI tabline

Stack versions:

OS: Manjaro i3 17.1.1
GTK: 3.22.26+47+g3a1a7135a2-3
Neovim: v0.2.3-385-gb616ef9b2
Neovim-GTK: master

Minimal setup:

init.vim

set showtabline=2

ginit.vim:

if exists('g:GtkGuiLoaded')
    call rpcnotify(1, 'Gui', 'Font', 'Hack Nerd Font Mono 12')
    call rpcnotify(1, 'Gui', 'Option', 'Tabline', 0)
    call rpcnotify(1, 'Gui', 'Option', 'Popupmenu', 0)
    let g:GuiInternalClipboard = 1
endif

Open nvim-gtk (does not show tabline):
2018-01-09-152503_1366x768_scrot

Type Ex command :help (the command line gets over-rendered by the statusline and the tabline is rendered):
2018-01-09-152510_1366x768_scrot

See I am writing :help again (notice the statusline):
2018-01-09-152521_1366x768_scrot

I open the command-line window q::
2018-01-09-152545_1366x768_scrot

Change the font:
2018-01-09-152551_1366x768_scrot

All is good!:
2018-01-09-152559_1366x768_scrot

If I resize the neovim-gtk window also fix the rendering, like changing the font size:
2018-01-09-152803_1366x768_scrot

Positioning the ext_cmdline in the upper middle of the window

Hi,

I tried out the ext_cmdline branch to see what the upcoming command line would look like, so please disregard this issue if you think it's not relevant.

The current implementation shows the command line as a popup, positioned next to the cursor, and that's confused me a bit since the commands do not tend to be relevant to the character under the cursor (they are usually related to the document or the vim instance itself).

Would it be possible to instead implement the popup in the upper-center part of the window itself. That's how it usually is in other editors and IDEs (vscode, sublime text and intellij come to mind, with what constitutes as an equivalent of a command prompt), with the equivalent of a wildmenu appearing below the popup prompt as a list.

Remember previous window size

My monospace font is pretty big and it results in the text wrapping oddly everytime I open neovim. Is there a way for neovim to remember what size I set it last and open to that?

Feature request: ability to set prefix/suffix for window title

I'm using tiling window managers such as XMonad and i3, I often use folding for windows in i3 (you could look at attached screenshot to see how it looks like), when I have more than one windows of Neovim-gtk it's not obvious which one I actually need until I go and open it because window title is the same for all windows. It would be cool if I for instance call some rpc method to set my own window title suffix or/and prefix.

selection_023

Spanish accents are not shown

Hi,
I am using a spanish layout and the keys are in the right place but accents don't appear.
Usually to set an accent in a letter "a" - "á", you have to press the accent key and the the letter.
It seems that that combination is not working.

Check neovim version for compatibility

I wasn't able to start neovim-gtk today, because I was using old version of neovim. It wasn't obvious when debugging this issue, because the error message is rather generic:

thread 'main' panicked at 'Can't start nvim instance: Error { repr: Custom(Custom { kind: Other, error: NeovimError(1, "No such ui option") }) }', /checkout/src/libcore/result.rs:859

What about checking neovim version before starting it? Or at least mention required version in documentation to avoid runtime delay. This issue would also be resolved by packaging e.g. in RPM, but I guess it's too early for that :)

GUI pop-up menu doesn't work well with YouCompleteMe(Semantic completion engine)

Just as I said in the title, works with the built-in(text-based) menu, but not with the nice GUI one. It is rendered in an invisible location, see the screenshot for a better understanding. The problem is in the interaction with YouCompleteMe (I tried removing all other options and plugins and it still didn't work). Without YCM the built-in menu(with ) works well enough, but with YCM also doesn't work.
screenshot-2017-12-10-21 36 40

The menu is actually bigger than it should be, so it gets outside the window and the screen. I tried moving the window to the side, but the menu is much bigger, so I haven't been able to see its beginning. My guess without looking at the code is that the pop-up menu doesn't "prune" autocomplete items' length, but the reason might be somewhere else.

panic on :colorscheme XXX

When I run neovim-gtk and then issue e.g. ":colorscheme default", it panics.

 $ cargo run --release
    Finished release [optimized] target(s) in 0.0 secs
     Running `target/release/nvim-gtk`
thread 'main' panicked at 'internal error: entered unreachable code: Resize event only can be produced by try_nvim_resize', src/shell.rs:839:33
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Feature suggestion: Automatic checktime when window is focussed

Many years ago when I used MacVim, one of the benefits over console vim was that it automatically refreshed files when it regained focus. This can be great if you switch git branches or something then switch back. Instead of needing to remember to :checkt it does it for you.

Feature suggestion: Custom header bar buttons

It would be great to be able to add header bar buttons from e.g. the nvim config file. I believe this would probably require a nvim plugin for the communication with the UI.

With this, you could change the displayed buttons depending on the file type and potentially the mode the user is in.

Panic on startup: index out of bounds in src/ui_model/mod.rs

I'm using rust stable. I can't reproduce this reliably, but for some reason, it crashes on startup, both with and without a file argument.

Name Details
Neovim version Development version, from commit neovim/neovim@43d3276
rustup --version 1.6.0 (a11c01e8c 2017-08-30)
cargo --version 0.21.0 (5b4b82ae 2017-08-12)
rustc --version 1.20.0 (fd3d6973f4 2017-08-27)
Operating system Arch Linux

https://github.com/daa84/neovim-gtk/blob/0f4234a622d01b79fac4afd94e6561a15c68e1e8/src/ui_model/mod.rs#L76:25

Here's the backtrace. I installed it from the AUR, so that might explain why it's not showing other source code (it's not running from the same path it was built in):

thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/ui_model/mod.rs:76:25
stack backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: g_main_context_dispatch
  14: <unknown>
  15: g_main_context_iteration
  16: g_application_run
  17: <unknown>
  18: <unknown>
  19: <unknown>
  20: __libc_start_main
  21: <unknown>

EDIT: add neovim version

Running :Denite hangs and crashes ui

Denite works fine in neovim-qt and gnome-terminal, here's the terminal output:

Event set_icon([String(Utf8String { s: Ok("") })]) Event set_title([String(Utf8String { s: Ok("nvimrc (~/dotfiles) - NVIM") })]) ERROR 2018-02-20T07:02:19Z: nvim_gtk::nvim::ext: Unknown error type: Wait timeout (nvim_get_hl_by_name) ERROR 2018-02-20T07:02:29Z: nvim_gtk::nvim::ext: Unknown error type: Wait timeout (nvim_get_hl_by_name) ERROR 2018-02-20T07:02:39Z: nvim_gtk::nvim::ext: Unknown error type: Wait timeout (nvim_get_hl_by_name) ERROR 2018-02-20T07:02:49Z: nvim_gtk::nvim::ext: Unknown error type: Wait timeout (nvim_get_hl_by_name) ERROR 2018-02-20T07:02:59Z: nvim_gtk::nvim::ext: Unknown error type: Wait timeout (nvim_get_hl_by_name) ERROR 2018-02-20T07:03:09Z: nvim_gtk::nvim::ext: Unknown error type: Wait timeout (nvim_get_hl_by_name) Event set_icon([String(Utf8String { s: Ok("") })]) Event set_title([String(Utf8String { s: Ok("[denite] (~/dotfiles) - NVIM") })]) Event set_icon([String(Utf8String { s: Ok("") })]) Event set_title([String(Utf8String { s: Ok("nvimrc (~/dotfiles) - NVIM") })]) thread '<unnamed>' panicked at 'called Result::unwrap()on anErrvalue: "SendError(..)"', src/libcore/result.rs:906:4 note: Run withRUST_BACKTRACE=1for a backtrace. thread '<unnamed>' panicked at 'Can't join dispatch thread: Any', src/libcore/result.rs:906:4 thread 'main' panicked at 'Error run input command to nvim: GenericError("Wait timeout (nvim_input)")', src/libcore/result.rs:906:4 Uncaught panic, exiting [1] 10255 abort (core dumped) nvim-gtk

Home/End don't work

Pressing the Home or End keys does not change the cursor position as expected in the editor or on the ex command line.

Not resizing properly in i3

When launching neovim-gtk from terminal in tiling mode, it will consider the size of the previous instance, instead of the size of this instance's window. As a result of this, the airline-tabline on the top won't be shown unless I exit neovim-gtk and relaunch it to be on the exact same size as before.
Furthermore, if I last opened it in a small tile, when I open it again in full screen mode, it will be shown as in the picture.
captura de pantalla de 2018-02-13 20-40-54

I don't know if this error is related: ERROR:<unknown>: Error while reading: I/O error while reading marker byte: failed to fill whole buffer. It's shown every time I close with :q.

Chocolatey packages

Adding to #50 would be for windows prebuilt binaries to be distributed through chocolatey. This would also align with one of the delivery mechanisms for neovim.

No icon when app is open

App has its icon in application list, but when started the icon which appears in the task list is the generic icon, not the neovim-gtk one (the last one):

neovim_gtk_icon

Am I doing something wrong?

Panic on comment longer than 160 chars in CoffeeScript file

Typing a comment longer than 160 chars on a new line between lines 5 and 6 in this sample file triggers a panic every time:

  1 describe 'TradingStrategy::DispatchDemandForecast', ->                                                                                                     
  2                                                                                                                                                            
  3   describe '#desiredState', ->                                                                                                                             
  4                                                                                                                                                            
  5       it 'raises a not implemented error', ->                                                                                                                
  6         expect(=> @strategy.desiredState()).toThrowError('not implemented')                                                                                  

self.cell_to_item[cell_idx]

Nov 13 10:35:33 wes-thinkpad org.daa.NeovimGtk.desktop[15725]: thread 'main' panicked at 'index out of bounds: the len is 160 but the index is 160', src/ui_model/line.rs:172:9

It's possible that the Yggdroot/indentLine plugin is contributing to the problem. I have these settings:

let g:indentLine_enabled = 0
let g:indentLine_char = ''
let g:indentLine_color_term = 239
let g:indentLine_color_gui = '#616161'
if has("autocmd")
  " Set foldmethod to indentation for CoffeeScript files
  autocmd BufNewFile,BufReadPost *.coffee setlocal foldmethod=indent

  au FileType slim IndentLinesEnable
  au FileType coffee IndentLinesEnable
endif

Hiding the title bar

The title bar is ginormous.

A setting to hide it completely would be much appreciated.

Move help menu to the headerbar

Hi,
I'm using Fedora and the menu item "help" appears in gtk2 style bar alone, so it's using all space for only one item. I don't know how it looks in ubuntu but in plain GNOME it is waste of space.
Thanks.
image

Persistent configuration

I successfully followed these instructions to configure the font and disable the external tabline. I was unable to add these declarations in $HOME/.config/nvim/ginit.vim so as they are automatically fired when neovim-gtk is open, though. Could you give me some pointers?

Bug: neovim-gtk crashes resizing window

I noticed that neovim-gtk crashes sometimes when I resize the window. Not happens everytime, and looks that since I disable the native tabline, happens a lot less.

thread 'main' panicked at 'slice index starts at 21 but ends at 15', /checkout/src/libcore/slice/mod.rs:752:4 note: Run with RUST_BACKTRACE=1for a backtrace. Uncaught panic, exiting fish: 'nvim-gtk' terminated by signal SIGABRT (Abort)

Neovim config not loaded

My init.vim is located at /home/computer/.config/nvim. Keymappings and theme don't get loaded when running with cargo run --release. OS is Ubuntu 16.04.

Edit: Some keymappings actually work, but those with <F1>, <F2> etc. don't work.

Feature Suggestion: Tabs in headerbar

To keep in line with gnome 3's minimal design, it seems neovim-gtk would fit in better if tabs were in the header/titlebar area instead of the quick buttons that are there by default.

Compose key does not work

Thanks for writing neovim-gtk! I was really pleased to see that it both supports ligatures and accepts Pragmata Pro as a font, which is not declared as monospaced and thus rejected by other programs (like neovim-qt).

I noticed the compose key does not work, do you think this could be fixed? For the record, a compose key is a dead key used to type characters not present on the keyboard. For instance compose + e + ' will insert an accentuated 'e' ('é'), more on this here. I have no issues with other GTK applications.

Set WM_CLASS to NeovimGtk

Currently the WM_CLASS property is set to ".", "." please set the WM_CLASS property to match WM_NAME.

$ xprop
...
WM_NORMAL_HINTS(WM_SIZE_HINTS):
                program specified minimum size: 70 by 48
                program specified base size: 0 by 0
                window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = ".", "."
WM_ICON_NAME(STRING) = "NeovimGtk"
_NET_WM_ICON_NAME(UTF8_STRING) = "NeovimGtk"
WM_NAME(STRING) = "NeovimGtk"
_NET_WM_NAME(UTF8_STRING) = "NeovimGtk"

Memory leak?

After few hours of working I realized that neovim-gtk ate about 1GiB of RAM, when on start it's less than 16MiB, it's probably memory leak.

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.