Giter Site home page Giter Site logo

rhysd / nyaovim Goto Github PK

View Code? Open in Web Editor NEW
2.2K 48.0 57.0 8.22 MB

Web-enhanced Extensible Neovim Frontend

License: Other

Ruby 1.47% JavaScript 1.82% TypeScript 82.79% HTML 1.97% Shell 6.66% Vim Script 5.29%
neovim editor gui electron polymer desktop-app

nyaovim's Introduction

NyaoVim

This is a Neovim frontend built on Electron. The Neovim editor is composed as a Web Component and users can extend the UI with reusable Web Components, HTML, CSS and JavaScript.

:help design-not says:

Use Vim as a component from a shell or in an IDE.

NyaoVim is built in the same spirit. NyaoVim contains the Neovim editor as a Web Component and extends its UI with web technology, as in other modern editors and IDEs (e.g. Atom, VS Code, LightTable).

Goals

  • NyaoVim bundles no extended UI by default. It only provides the nice UI plugin architecture. Users can compose their favorite UI with Web Components, HTML and CSS. It is also easy to make a NyaoVim distribution where useful components are bundled.
  • Do not introduce another plugin manager. HTML for Web Components should be bundled with Vim plugins. Therefore, a Vim plugin manager can handle UI components, letting us bundle JS and Vim script code.
  • Do not lose Vim's comfortability by default. It should be aware of performance.
  • UI component creators can use powerful APIs, packages and tools; Node.js APIs, Electron APIs, Neovim msgpack-rpc APIs), so many npm packages and Chrome DevTools.
  • Cross Platform (Linux, OS X, Windows)

Memo: 'nyao' is 'meow' in Japanese and its pronounce resembles 'neo'. It is also an acronym for 'Not Yet Another Original'.

App Structure

NyaoVim consists of Web Components on Electron as shown in the following figure. At first there is only <neovim-editor> and you can add/remove additional components.

structure

UI Plugin Examples

UI plugins are installable as easily as regular plugins. Each of them is written within 100~300 lines. You can also create reusable Web Components and integrate them into NyaoVim.

nyaovim-markdown-preview screenshot

nyaovim-popup-tooltip screenshot

nyaovim-mini-browser screenshot

Usage

Getting Started

You can install NyaoVim as an npm package. Currently no packaging release is available yet. If you use Windows and haven't installed Neovim yet, please read first tips first.

$ npm install -g nyaovim

npm may require sudo if you installed node pacakge via system package manager.

If you haven't installed Neovim yet, please install it following Neovim's instructions because NyaoVim internally uses the nvim command. Note that nvim v0.1.6 or later is needed.

You can start NyaoVim with the nyaovim command if you install this app with npm.

$ nyaovim [files...]

You would see a minimal Neovim GUI editor (like gVim). This is an Electron app and Neovim is drawn on <canvas>. You can see the DevTools of this app with the 'Developer Tools' menu item.

On first start up of NyaoVim, it creates ~/.config/nyaovim/nyaovimrc.html for UI configuration (%AppData% instead of .config in Windows). Yes, you can extend and configure UI components with HTML and CSS!

Configure Editor Options

I guess you're now thinking 'Hmm, font is not good and too small...'. You can configure some editor options by properties of <neovim-editor> properties. For example, below configures font face and font size by font and font-size properties. Then set line-height to 1.5 (for example, Atom adopts 1.5 as line-height).

<neovim-editor
    id="nyaovim-editor"
    argv="[[argv]]"
    font-size="14"
    font="Ricty,monospace"
    line-height="1.5"
></neovim-editor>

And you can also configure browser window options with browser-config.json (e.g. Preserving window state, Single instance app, and so on). See tips for more detail.

Install UI Plugin

For example, let's install nyaovim-popup-tooltip.

As described in the Goals section, a UI plugin is a normal Neovim plugin. You can install it like any other Neovim plugin. If you use vim-plug, all you need is adding below line to your init.vim.

Plug 'rhysd/nyaovim-popup-tooltip'

Then you need to put the popup tooltip UI on your NyaoVim interface. Please open ~/.config/nyaovim/nyaovimrc.html (%AppData% instead of .config in Windows). As described in the Goals section, a user can build a UI with HTML and CSS with high customization.

Please add <popup-tooltip> tag under <neovim-editor> tag as below

<neovim-editor id="nyaovim-editor" argv="[[argv]]"></neovim-editor>
<popup-tooltip editor="[[editor]]"></popup-tooltip>

<popup-tooltip> is a Polymer component. editor="[[editor]]" is a data binding in Polymer framework to pass editor instance to <popup-tooltip>. It means unidirectional data flow from parent to child.

After installing nyaovim-popup-tooltip as a Neovim plugin and adding UI to HTML, you're all done! Open NyaoVim, move the cursor to any image path, and enter gi. NyaoVim will load the image and show it in a popup tooltip as below.

nyaovim-popup-tooltip screenshot

Documents

There is more in documentation in the docs directory.

Versioning

NyaoVim is now under beta phase. Major version is fixed to 0 until it gets stable release.

Updating minor version means it contains breaking changes. And updating patch version means it contains no breaking change, so you can update version easily.

License

MIT License.

Logo of this app is created based on Neovim logo licensed under CCA 3.0 Unported.

The Neovim logo by Jason Long is licensed under the Creative Commons Attribution 3.0 Unported License.

nyaovim's People

Contributors

autozimu avatar chemzqm avatar chitoku-k avatar e-jigsaw avatar haifengkao avatar miyakogi avatar munyari avatar rf5860 avatar rhysd 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nyaovim's Issues

Azerty

As an azerty keyboard user i use the alt key a lot to access characters. But in Nyaovim the key mapping is wrong for some characters including back slash, curly and square brackets, and more ... instead of getting the character that was requested it results in some variation of the character "ü".

Background is wrong on whitespace on scroll

Hey there, thanks so much for starting this. I wanted to do this ages ago, but... well... life got in the way as usual!

Anyway, I wanted to log this bug: When I scroll down, all the whitespace looks like this:

screen shot 2015-12-30 at 18 14 45

Cannot run nyaovim

I tried to run nyaovim and am getting this error. I'm on Ubuntu 14.04.

$ nyaovim 
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/path.txt'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at Object.<anonymous> (/usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/index.js:4:42)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)

Generates default nyaovimrc at wrong path

NyaoVim 0.0.10
electron : 0.36.3
chrome : 47.0.2526.73
node : 5.1.1
v8 : 4.7.80.23
Arch Linux

Running NyaoVim for the first time, it logs:

Generate default nyaovimrc at /home/user/~/.config/nyaovim/nyaovimrc.html

subsequent times (always):

Generate default nyaovimrc at /home/user/~/.config/nyaovim/~/.config/nyaovim/nyaovimrc.html

I can be wrong, but I expected to be ~/.config/nyaovim/nyaovimrc.html

If I create manually ~/.config/nyaovim/nyaovimrc.html and run again NyaoVim no more initial messages are showed, but the configuration used by it is:

/home/user/~/.config/nyaovim/nyaovimrc.html

ctrl-c doesn't exit input mode

In insert mode pressing ctrl-c doesn't exit insert mode

Expected Behavior

I expect it to act like hitting Esc, exiting insert mode

Actual Behavior

stays in insert mode, if in the middle of a line it splits the line into 2

Steps to Reproduce (including precondition)

enter insert mode
start typing
press ctrl-c

Screenshot on This Problem (if possible)

screenshot 2016-03-17 16 19 18

### Your Environment - OS: Mac OSX El Capitan 10.11.4 Beta (15E61b) - NyaoVim version: NyaoVim version 0.0.19 electron : 0.36.11 chrome : 47.0.2526.110 node : 5.1.1 v8 : 4.7.80.27 - `nvim` version: {Please write here} - Keyboard layout: US

Underline doesn't display

I have underline for incorrect spelling. This underline doesn't display in NyaoVim but displays in terminal neovim.

NyaoVim:
screen shot 2016-02-29 at 8 59 49 pm

neovim:
screen shot 2016-02-29 at 9 00 18 pm

Cannot read property 'once' of undefined

Expected Behavior

It starting

Actual Behavior

It raising this error:
screen shot 2016-04-01 at 00 55 45

Steps to Reproduce (including precondition)

Starting nyaovim installed via npm installed via homebrew on OSX 10.11 (brew installs node/npm which then installs nyaovim).

Screenshot on This Problem (if possible)

screen shot 2016-04-01 at 00 55 45

Your Environment

  • OS: Mac OS X 10.11
  • NyaoVim version: 0.0.19
  • nvim version: 0.1.2
  • Keyboard layout: Colemak

Does not work with Neo2 keymap

The neo2 keymap is an ergonomic keyboard layout.

It works great for most apps, but this one is not passing through special keys like ~:? which are using special modifier keys. Atom had similar issues: atom/atom#3834 which leads me to believe that it is probably an issue with many keymaps, not only Neo.

Problem installing on Ubuntu

I think this is a debian problem in general, but I have only tried installing on Elementary OS and Linux Mint.

When I install it says:

> [email protected] postinstall /usr/local/lib/node_modules/nyaovim/node_modules/electron-prebuilt
> node install.js

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! weird error 127
npm ERR! not ok code 0

I don't know if there's something wrong with my systems or with the code. I don't usually use npm.

Chars alignment

Expected Behavior

I expect each char to be aligned in the middle of each line

Actual Behavior

Chars are aligned to the top

Steps to Reproduce (including precondition)

Simply open it

Screenshot on This Problem (if possible)

nyaovim-issue

Your Environment

  • OS: Ubuntu Linux 14.04 LTS
  • NyaoVim version: 0.0.19
    electron : 0.36.11
    chrome : 47.0.2526.110
    node : 5.1.1
    v8 : 4.7.80.27
  • nvim version: v0.1.3-350-gc94575f
    Build type: Release
  • Keyboard layout: it-it
  • Window manager: Unity
  • Font: Ubuntu Mono 16px, lineheight is the default one

I haven't installed any plugin for neovim yet

Additional Comments

The problem is with any fonts, either monospace and Ubuntu Mono do the same thing.
I've also tried to change the textBaseline in the ctx object, but anything other than 'top' will render badly... Very badly... I think this is due to the math in drawText function, isn't it?

Incorrect rendering after multiline `echo` message

Expected Behavior

File content is correctly rendered when multiline echo message is shown and closed.

Actual Behavior

Some lines are rendered twice. It's necessary to manually refresh the screen to fix it.

Steps to Reproduce (including precondition)

I was not able to reproduce the issue directly with simple commands. I can reproduce it with a plugin.

  1. Install elm-vim plugin
  2. Open Elm file
  3. Use :ElmShowDocs. Here is the function used by this command.
  4. Use Ctrl+L or :redraw! to fix the rendering

Screenshot on This Problem (if possible)

nyaovim-elm-oracle

Your Environment

  • OS: elementary OS Freya (based on Ubuntu 14.04)
  • NyaoVim version: 0.0.19
  • nvim version: 0.1.3-dev
  • Keyboard layout: qwerty
  • Linux: Window manager: Pantheon

Additional Comments (if any)

Thank you for such a cool project!

Installation fails on UbuntuGNOME 15.10+ (electron download broken)

Expected Behavior

The installation should work. While I get that binaries are linked to /usr/bin/* it means that you have to use sudo/root rights in order to get that up and running.

sudo npm install -g nyaovim

Actual Behavior

The installation fails becauset the electron prebuilt download is not available. As it's an EACCES error while using sudo, I guess the problem is either that some sub-script routine is spawned with another username or that the file path is incorrect.

Error: EACCES: permission denied, rename '/usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/electron-tmp-download-13671-1458848039081/electron-v0.36.11-linux-x64.zip' -> '/home/cookiengineer/.electron/electron-v0.36.11-linux-x64.zip'
    at Error (native)
npm WARN install:[email protected] [email protected] postinstall: `node install.js`
npm WARN install:[email protected] Exit status 1
/usr/lib
└── (empty)

npm ERR! code 1

Your Environment

  • OS: UbuntuGNOME 15.10
  • NyaoVim version: latest version on npm
  • nvim version: -
  • Keyboard layout: US / QWERTY
  • Linux: Window manager: GNOME Shell (3.20)

Further Questions / Alternatives

Why are there no binary prebuilds available in the Releases section on github for Linux?
I would love to make some Linux builds, if somebody tells me how to and where the required build scripts for that are.

Custom Font

Expected Behavior

Changing the font doesn't seem to have any effect. I tried both:

    <style>
      /* CSS configurations here */
    #nyaovim-editor: {
        font-family: "Input Mono", monospace;
    }
    </style>

And

    <!-- Component tags here -->
    <neovim-editor id="nyaovim-editor" argv$="[[argv]]" font-size="8" font="Input Mono"></neovim-editor>

Actual Behavior

When I open up developer tools and look at the computed font-family it says "Times New Roman".

Steps to Reproduce (including precondition)

  1. Open up gui in Ubuntu
  2. Open up developer tools

Your Environment

  • OS: Ubuntu 15.04
  • NyaoVim version: 0.0.19
  • nvim version: 0.1.5-dev
  • Keyboard layout: US
  • Linux: Window manager: Unity

Error: spawn /usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/dist/electron ENOENT

Can't start nyaovim from docker image.

Expected Behavior

Nyaovim starts

Actual Behavior

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn /usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/dist/electron ENOENT
    at exports._errnoException (util.js:870:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:441:9)
    at process._tickCallback (node.js:355:17)
    at Function.Module.runMain (module.js:444:11)
    at startup (node.js:136:18)
    at node.js:966:3

Steps to Reproduce (including precondition)

Dockerfile:

FROM alpine:latest
MAINTAINER Nikita Chernyi

RUN apk add --update nodejs git alpine-sdk libtool cmake automake m4 autoconf linux-headers unzip ncurses-dev python py-pip && \
  rm -rf /var/cache/apk/*

WORKDIR /tmp
ENV CMAKE_EXTRA_FLAGS=-DENABLE_JEMALLOC=OFF
ENV CMAKE_BUILD_TYPE=Release
ENV CLI_ARGUMENTS=/

RUN git clone https://github.com/neovim/libtermkey.git && \
  cd libtermkey && \
  make && \
  make install && \
  cd ../ && rm -rf libtermkey

RUN git clone https://github.com/neovim/libvterm.git && \
  cd libvterm && \
  make && \
  make install && \
  cd ../ && rm -rf libvterm

RUN git clone https://github.com/neovim/unibilium.git && \
  cd unibilium && \
  make && \
  make install && \
  cd ../ && rm -rf unibilium

RUN  git clone https://github.com/neovim/neovim.git && \
  cd neovim && \
  make && \
  make install && \
  cd ../ && rm -rf nvim

RUN npm install -g nyaovim

ENTRYPOINT nyaovim $CLI_ARGUMENTS

Commands:

docker build .
docker run -ti --rm -e DISPLAY=$DISPLAY -e CLI_ARGUMENTS=`pwd`/Dockerfile -v /tmp/.X11-unix:/tmp/.X11-unix 4b5a5530a187

Screenshot on This Problem (if possible)

Not needed, see error log above

Your Environment

  • OS: Ubuntu 15.10 amd64
  • NyaoVim version: from NPM
  • nvim version: builded from sources (master branch) today
  • Keyboard layout: Doesn't matter
  • Linux: Window manager: Compiz (default)

Additional Comments (if any)

Please, explain me how to fix this problem?

Thanks!

Thanks for helping bring the world of vim (neovim) to new places!! Your work leads and inspires even more to come...

Fuzzy text after moving window to retina screen

Probably more of an Electron issue, but NyaoVim opens on my primary non-retina screen. After moving it to the retina screen the text is fuzzy. Reloading via the menu or keyboard fixes it.

screen shot 2016-01-28 at 1 33 23 pm

NyaoVim on the left, MacVim on the right.

Only blank window shown when launching

Expected Behavior

When running nyaovim from the command prompt, only a blank window is launched. Does not respond to input.

Actual Behavior

NyaoVim launches as expected

Steps to Reproduce (including precondition)

Install NyaoVim using "npm install -g nyaovim". Open a command prompt and type nyaovim

Screenshot on This Problem (if possible)

{Please write here}

Your Environment

  • OS: {Windows 10, Build 14342}
  • NyaoVim version: {0.0.19}
  • nvim version: {0.1.5-dev}
  • Keyboard layout: {qwerty}
  • Linux: Window manager: {N/A}

Additional Comments (if any)

Neovim-qt works as expected. Using the MSVC 2015 - compiled version of nvim (the MSYS version wouldn't work with neovim-qt or nyaovim)

h,j,k and l movement.

I have just installed Nyaovim and if I keep the h,j,k or l keys depressed, I can only move up, down,left or right one character/line. Is there a way to change the behaviour so that keeping the keys depressed repeats the action until the key is lifted.

Unable to run NyaoVim on Linux/Fedora

Unable to run NyaoVim after a fresh install on a Linux Fedora

Actual Behavior

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: Cannot read property 'getName' of undefined
at Object. (/usr/lib/node_modules/nyaovim/main/main.js:15:31)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at loadApplicationPackage (/usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/dist/resources/default_app/main.js:257:23)
at Object. (/usr/lib/node_modules/nyaovim/node_modules/electron-prebuilt/dist/resources/default_app/main.js:289:5)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)

Steps to Reproduce (including precondition)

with root
npm install -g nyaovim
nyaovim

Your Environment

  • OS: Linux Fedora
  • NyaoVim version: 0.0.19
  • nvim version: NVIM v0.1.4-23-gf47a20a
  • Keyboard layout: azerty
  • Linux: Window manager: KDE

PS: I managed to start nyaovim by cloning the repository and doing a npm start

Unable to open developer tools

Expected Behavior

From the readme:

You would see minimal Neovim GUI editor (as normal gVim). This is Electron app and Neovim is drawn on . You can see DevTools of this app with 'Developer Tools' menu item.

Actual Behavior

No menus are visible. Pressing F12 or ctrl-shift-i has no visible effect.

Screenshot on This Problem (if possible)

screenshot from 2016-06-03 14-49-59

Your Environment

  • OS: Debian Sid
  • NyaoVim version: 0.0.19
  • nvim version: 0.1.3
  • Keyboard layout: UK
  • Linux: Window manager: GNOME Shell 3.20.2

Scrolling through files by holding down `j` or `h` causes slowness

Hey once again!

When I scroll up or down far enough that it causes the buffer to have to re-render the screen, nyaovim begins to lag pretty badly. My OSX config is set so that my key repeat is much faster than most people's using commands similar to these:

# Disable OS X press-and-hold keys to increase key repeat rate.
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false

# Set up a fast key repeat rate.
defaults write NSGlobalDomain KeyRepeat -int 1.5

# Decrease the delay until keys are repeated.
defaults write NSGlobalDomain InitialKeyRepeat -int 12

I've not been able to check on my Linux machine if the same applies there.

Enable terminal UI

Terminal UI is disabled by default:

C:\Users\MyUser>nvim
Terminal UI disabled at compile time, ignoring console input

It's possible to enable the feature? So we can use both (terminal and GUI).

Discussion: file loading & runtime path

Hello,

I was wondering if you would oppose loading .js files directly from ./nyaovim-plugin directories through require()?
If not, I can send a PR, I have it ready locally.

(Oh and by the way, never make the mistake of doing npm install electron; it's the second time I get trapped by that sucker.)

Question: Any way to set line height?

I was looking for a way to set line-height and I did not find any.
I tried to put CSS rule in the Styles section of the .nyaovimrc. However, it didn't work.

Could you please elaborate on how to set line-height? if it is possible

Thanks for this great app. 👍

paste breaks format

When I paste multi line code from the browser into nyaovim it breaks the formatting regardless of 'set paste'

Expected Behavior

I expect it the text to look like the one I pasted instead of everything on a single line

Actual Behavior

All the text is paste into a single line

Steps to Reproduce (including precondition)

grab some text like this
screenshot 2016-03-17 16 22 25

from
http://docs.ansible.com/ansible/playbooks_prompts.html

open nyaovim and enter insert mode
paste in the text from your clipboard

Screenshot on This Problem (if possible)

screenshot 2016-03-17 16 25 45

### Your Environment - OS: Mac OSX 10.11.4 Beta (15E61b) - NyaoVim version: NyaoVim version 0.0.19 electron : 0.36.11 chrome : 47.0.2526.110 node : 5.1.1 v8 : 4.7.80.27 - Keyboard layout: US

PATH is not set when NyaoVim is executed via NyaoVim.app

Issue only for OS X.

When starting NyaoVim clicking NyaoVim.app, app is started without bash. So PATH value is minimal (seems to be /usr/bin:/bin:/usr/sbin:/sbin in my local environment). nvim is usually installed to OS X via Homebrew and it installs nvim to /usr/local/bin. So I must add it to PATH manually on renderer process.

There are 2 ways to do that.

  1. Modify process.env.PATH directly before spawning nvim process
  2. Specify env at call of spawn()
  3. requires a support of neovim-component module.
  • Error
Uncaught Error: spawn nvim ENOENTexports._errnoException
  util.js:856ChildProcess._handle.onexit
  internal/child_process.js:178onErrorNT
  internal/child_process.js:344doNTCallback2
  node.js:465_tickCallback
  node.js:379

Issues with vim-airline

It looks like maybe nyaovim doesn't know what to do with background colors or something? This is what my editor looks like in nyaovim:

nyaovim

and in terminal:

terminal

Can't use rebound omnicomplete

My omnicomplete remap is below. It doesn't seem to work from within nyaoVim, but it works fine in the terminal. Is electron grabbing the ctrl modifiers somehow?

inoremap <expr> <C-Space> pumvisible() \|\| &omnifunc == '' ?
\ "\<lt>C-n>" :
\ "\<lt>C-x>\<lt>C-o><c-r>=pumvisible() ?" .
\ "\"\\<lt>c-n>\\<lt>c-p>\\<lt>c-n>\" :" .
\ "\" \\<lt>bs>\\<lt>C-n>\"\<CR>"
imap <C-@> <C-Space>
set completeopt=menuone,longest

Add hot key to move focus to Vim screen

After focus moving to other UI component on Electron from Neovim screen, we need to click the screen to make focus back.
Although UI plugin should care the focus, we should not expect plugin to handle focus perfectly. (UI plugin may sometimes be not able to determine if focus should be moved to Neovim screen or not.)

So I think it is better to add hot key to focus Neovim screen. User can make focus back to screen without using mouse. User should be able to disable this hot key and change it to other key sequence. I think Esc key is good for default. It affects only when focus is NOT on Neovim screen.

I can implement the hot key by catching window.addEventListener('keydown').

Font not rendering

I have a problem with the font not rendering correctly. I don't know if it's an electron or an nyaovim problem (or a 'my bad' problem :-D).
nyaovim

I removed my init.vim (neovim's vimrc), but the issue is still there.
I don't know if it's related, but the terminal displays this line a lot :

[48303:1223/093014:ERROR:gles2_cmd_decoder.cc(7333)] [.Offscreen-MainThread-0x7fecb3451ed0]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked

Under Mac OSX 10.11.1, and the latest version of nyavim installed with npm.

Case sensitivity of ~/.config/nyaovim

Using Linux (or another case-sensitive filesystem), the config is created in ~/.config/nyaovim, whereas other stuff is created in ~/.config/NyaoVim. This should be consistent and only use one path.

$ find ~/.config/nyaovim
$HOME/.config/nyaovim
$HOME/.config/nyaovim/nyaovimrc.html

$ find ~/.config/NyaoVim
$HOME/.config/NyaoVim
$HOME/.config/NyaoVim/Cookies
$HOME/.config/NyaoVim/Cookies-journal
$HOME/.config/NyaoVim/Local Storage
$HOME/.config/NyaoVim/Local Storage/file__0.localstorage-journal
$HOME/.config/NyaoVim/Local Storage/file__0.localstorage
$HOME/.config/NyaoVim/GPUCache
$HOME/.config/NyaoVim/GPUCache/data_0
$HOME/.config/NyaoVim/GPUCache/data_3
$HOME/.config/NyaoVim/GPUCache/data_1
$HOME/.config/NyaoVim/GPUCache/data_2
$HOME/.config/NyaoVim/GPUCache/index

Error handling at start nvim process

When error occurs on starting nvim process (e.g. ENOENT), NyaoVim shows empty window and does report nothing. NyaoVim should detect the error and show proper message with dialog.

Error handling callback should be implemented to <neovim-editor> at first.

Doesn't render screen when Neovim shows message on start up

nyaovim コマンドにパラメータを与えず起動すると正常に動作しますが、
$ nyaovim test.cpp
のようにファイル名を与えると以下の現象が発生します。

  1. 真っ白な画面が起動する
    image

2a. エンターキーを押してから'a'を押すと終了する
2b. エンターキーを2回押すとファイルを正常に編集できる
2c. HJKLキーを何回押しても白い画面のまま
2d. Hキーを押してからエンターキーを押しても白い画面のまま
2e. Hキーを押してからエンターキーを2回押すとファイルを正常に編集できる
2f. Jキーを押してからエンターキーを1回押すとファイルを正常に編集できる

OS: Windows 10 Pro

Electron caption

Wrong caption

Expected Behavior

NyaoVim

Actual Behavior

Electron

Steps to Reproduce (including precondition)

just open this app

Screenshot on This Problem (if possible)

http://take.ms/OfVkc

Your Environment

  • OS: Any
  • NyaoVim version: last one
  • nvim version: 0.13

Alt + shift opens the menu when I change keyboard layout

Situation

I use setxkbmap to switch keyboard layouts with alt + shift

Actual Behavior

The same shortcut opens the "edit" menu in the editor and redraws screen twice
(once with a full white background and then it fixes itself with the menu rendered).

Expected behaviour

Just the layout to be changed, nothing more.

Issue

Is there a way to prevent this? E.g. use instead a :set guimenu option like in gVim?

Your Environment

  • OS: Arch linux
  • NyaoVim version: Git says pre-alpha-61-g6c31c3c
  • nvim version: 0.1.2
  • Keyboard layout: Both on a US and a cyrillic keyboard layout
  • Linux: Window manager: Awesome WM

GL error on Ubuntu on VirtualBox

Reported in Twitter.

Error log:

pci id for fd 16: 80ee:beef, driver (null)
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo

It seems to occur even if NyaoVim starts with $ nyaovim -u NONE -U NONE.

The top line of text is obscured

Expected Behavior

The first line should be fully visible.

Actual Behavior

The first line extends beyond the top of the screen.

Steps to Reproduce (including precondition)

Launch nyaovim, type some text.

Screenshot on This Problem (if possible)

Your Environment

  • OS: Fedora 23
  • NyaoVim version: 0.0.19
  • nvim version: 0.1.3
  • Keyboard layout: US
  • Linux: Window manager: xmonad

Additional Comments (if any)

This happens whether or not I enable window decorations or show the menu. Possibly related to #39?

Strange behaviour on :split

When i split the window using either :vsplit or :split and after that i try O the buffer gets completely messed up, it works when doing o instead.

Ctrl+Letter does not seem to work on Azerty keyboard on Linux/Fedora

I am starting to play around with NyaoVim and it works great :) expect for all Ctrl + letter action.

Expected Behavior

Ctrl + v to vertically select

Actual Behavior

Only v is catch by neovim

Steps to Reproduce (including precondition)

No particular steps, simply open a file with some content.

Screenshot on This Problem (if possible)

Here the output of Ctrl-v

image

Your Environment

  • OS: Linux/fedora
  • NyaoVim version: NyaoVim version 0.0.19
    electron : 0.37.5
    chrome : 49.0.2623.75
    node : 5.10.0
    v8 : 4.9.385.28
  • nvim version: NVIM v0.1.4-23-gf47a20a
  • Keyboard layout: azerty
  • Linux: Window manager: awesome & KDE

CLI command run in the foreground

I am not sure if this is normal at this stage of development, but when I launch NyaoVim from the command line using nyaovim, everything seems to work, but the terminal is "waiting". In other words, if I press C-c it kills the process and closes the app, C-z puts the process in the background and the main window is not accessible, etc.

I could write a wrapper script but I'm not sure if this is a bug or a Work In Progress side effect:

#!/bin/sh

if test -t 1; then
  exec 1>/dev/null
fi

if test -t 2; then
  exec 2>/dev/null
fi

command nyaovim "$@" &

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.