Coder Social home page Coder Social logo

smolck / uivonim Goto Github PK

View Code? Open in Web Editor NEW
612.0 10.0 12.0 8.97 MB

Fork of the Veonim Neovim GUI

License: GNU Affero General Public License v3.0

JavaScript 4.72% TypeScript 90.11% HTML 1.04% Lua 1.61% GLSL 0.79% Vim Script 1.74%
neovim neovim-guis electron typescript gui webgl2

uivonim's Introduction

Uivonim header

Typecheck Test Gitter

NOTE: Due to neovim/neovim#13196, if you have conceallevel set to a value higher than 0 CPU usage may be abnormally high. See #39 (comment).

Uivonim is a fork of Veonim, "a simple modal IDE built on Neovim and VSCode extensions" written in Electron with WebGL GPU rendering and multithreading. The goal of Uivonim is to use Veonim as a base for building a feature-rich cross-platform GUI that leverages the latest Neovim features (floating windows, builtin LSP, Lua) without reliance on VSCode extensions.

main

Goals

  • 100% compatibility with Neovim (see #9421)
  • All configuration done via vimrc with vimscript/Lua/remote plugins
  • GUI features and eyecandy
  • Full support for international keyboard layouts and dead keys (tested on macOS and Linux)
  • Fast, building upon the work done by @breja, with things like WebGL GPU rendering and multithreading
  • Extensibility via a Lua API providing access to frontend GUI features such as LSP hover/signature help/symbols and a fuzzy finder UI

Getting Started

Download the latest GitHub release, or build from source (see the "build" section at the bottom of this README). Alternatively, if you use Arch Linux, there is an AUR package for uivonim, kindly created by @SilverRainZ (see #55).

Build

Install the following things:

  • node/npm
  • latest Neovim (i.e., nightly or built from master)

Then run:

  • npm ci - standard issue download 5 million node_modules
  • npm run prod (optional) - run release build w/out packaging
  • npm run package - use electron-builder to create a binary package

Binaries available in dist.

Development

  • npm ci - install deps as mentioned above
  • npm run dev - run dev build

If you have any questions about Uivonim's code, making a change, etc., feel free to ping me (@smolck) on Gitter.

Feature Showcase

See the wiki for setup for the signature help, float, etc. features.

Signature Help

signature_help

Hover

hover

Code Actions

code_action

References

references

Nyancat

:Uivonim nc

nyancat

Other Cool Projects

Special Thanks

An absolutely massive thank you to @breja for all of the work you did on the original Veonim project; without your work (including the amazing achievement of making Electron snappy!) and vision for the original project, Uivonim would not exist. Thank you!

uivonim's People

Contributors

clason avatar dependabot[bot] avatar dundargoc avatar smolck 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

uivonim's Issues

Complex script like devanagari support

It would be nice to support complex scripts like devanagari (देवनागरी लिपी)
image

The left pane is vscode rendering same file as uivonim in the right pane. As you can see the text in the right is pane is barely redable.

Highlighting inconsistency/flickering

ATM highlighting is pretty broken, where colors can be changing all the time, change underneath the cursor; overall they just don't render correctly (except for :colorscheme veonim?). It seems dependent on the colorscheme, but I'm not sure of the exact cause. Removing the colorizer (src/workers/neovim-colorizer.ts) didn't fix it apparently, nor did commenting out most of src/services/colorizer.ts (which was/is a temporary fix for some errors leftover from the colorizer remove).

minimap

Someone had to ask! It would be cool. :)

Improve text rendering

Currently, text rendering seems to be ok only for specific font-sizes. Examples:

h12
Screenshot from 2020-10-30 16-08-46

h15
Screenshot from 2020-10-30 16-07-05

h16
Screenshot from 2020-10-30 16-10-42

The rendering is probably not handling non-integer pixel value incorrectly. It should probably round them to the neared integer value. h16 works because 16 / 1.333333.. == 12 (point to pixel conversion) but other values dont, eg 15 / 1.33333... == 11.25.

Edit: this seems to contain decent hints how to improve things: https://stackoverflow.com/questions/25956272/better-quality-text-in-webgl

Cursor jumps in terminal

When typing in a :terminal buffer, the cursor jumps back to a previous character on every keystroke (including cursor movement and backspace).

Get error E12 when trying using `:edit` command.

Get following error message when using :e on the neovim README.md:

Error detected while processing OptionSet Autocommands for "*":E12: Command not allowed from exrc/vimrc in current dir or tag search. Press ENTER or type command to continue

The problem is that I get this error message regardless of which folder I use it from. I'm using the latest Appimage version and tried moving around the executable but the issue persist. This problem doesn't exists on nightly neovim.

Improve external popup menu appearance

  • In the TUI, word and menu are printed in separate columns; would be nice to have this for the external menu as well.
  • Menu only shows a subset of entries but does not scroll if end is reached.
  • Single-character completion items are shown as numbers (their ASCII char codes) instead
    - [ ] Support base64-encoded images in Markdown for the documentation window EDIT(smolck): Not sure how many LSPs (if any?) support this so'll leave it for now.
  • Re-enable word-wrapping for multi-line pum (menu) entries, with consistent alignment of all cells (either centered or -- better? -- top-aligned)

Connection to server?

uivonim looks awesome!

Does support something like --server=hostname:port in neovim-qt to connect to a remote neovim session?

Thanks!

Cursor character not looking ok

The cursor character doesn't use the same font as the editor therefore it doesn't display characters the same way. Also it's not positioned correctly.

Screenshot from 2020-10-31 23-29-04

Sometimes rendering is gone

I think after my screen turns off, and I come back to my laptop, all the rendering is gone. I mean, the editor area is blank. I still see the custom UI stuff on the bottom and top edges though, just nothing happens in the middle.

Have you experienced this?

Key repeat not working on MacOS

I'm currently on MacOS 11.1 and the key repeat isn't working: holding a key only sends a single char event. Not a big deal, it's like a "hardcore mode" built in, but some users might find it useful :)

Keep up the great work!

A JavaScript error occurred in the main process

Hello, I use Windows 11 pro, I downloaded through scoop uivonim and immediately upon entering I get this error:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: connect ENOENT
ed8f-44f3-a2e4-1 cd 14cd48a85-sock
at PipeConnectWrap.afterConnect [as oncomplete] (node:net: 1142: 16)

image

Project Status

Hello! I have been keeping my eye on the project for a while now and had very high hopes from it as it would've been the perfect editor for me.

Can you please confirm the project status ?

WSL: Uivonim commands not working

As discussed in #99 commands such as :Uivonim nc and :Uivonim explorer don't run when in WSL. Attached is the full developer console log but no errors seem to come up when trying to run the commands.

Interesting to note that the tab complete works for Uivonim but wont complete any of the arguments eg nc or explorer. I have confirmed that these work with my windows config but are not working when passing the --wsl flag.

image

Cannot open uivonim from the command-line with parameters

I’m using the arm64 build I made as discussed in #411; I can’t seem to open it from the command-line with parameters.

Neither of these works:

> open -a uivonim chat.md
> /Applications/uivonim.app/Contents/MacOS/uivonim chat.md

I would expect the file chat.md to be opened; it is not. As I have startify in my configuration, I see that (which should not be the case).

Eventually, it would be useful for there to be a command (:Uivonim install-helper) that installs a helper script (similar to code for VScode).

The script for code is this:

#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

function realpath() { python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
CONTENTS="$(dirname "$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")")"
ELECTRON="$CONTENTS/MacOS/Electron"
CLI="$CONTENTS/Resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?

The rough equivalent of that script would result in this: /Applications/uivonim.app/Contents/MacOS/uivonim /Applications/uivonim.app/Contents/Resources/app/build/main/main.js chat.md, which also doesn’t work. Changing the command to include ELECTRON_RUN_AS_NODE=1 fails:

> ELECTRON_RUN_AS_NODE=1 /Applications/uivonim.app/Contents/MacOS/uivonim /Applications/uivonim.app/Contents/Resources/app/build/main/main.js chat.md
node:internal/modules/cjs/loader:937
  throw err;
  ^

Error: Cannot find module 'electron'
Require stack:
- /Applications/uivonim.app/Contents/Resources/app/build/main/main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:934:15)
    at Module._load (node:internal/modules/cjs/loader:779:27)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1006:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/Applications/uivonim.app/Contents/Resources/app/build/main/main.js:3:17)
    at Module._compile (node:internal/modules/cjs/loader:1110:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1140:10)
    at Module.load (node:internal/modules/cjs/loader:982:32)
    at Module._load (node:internal/modules/cjs/loader:823:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Applications/uivonim.app/Contents/Resources/app/build/main/main.js'
  ]
}

Messaging code cleanup

@Breja Is there any particular reason why you didn't use node-client for the messaging/msgpack-rpc side of veonim? If not I might consider switching to that if it's feasible, although I'm not sure; thoughts?

Windows Release

The build instructions don't work on Windows and manually running the commands (without node scripts) errors out.

Automatic building can be added to the current GH actions workflow.

Mouse does not work

Mouse just doesn't seem to do anything.
No clicks, no scrolling. Built from master at c85671e on M1Max, built with latest brew install neovim --HEAD.
Is there some special config I should be adding/removing, or some hints on what I should look at?

Update current directory on opening files

The builtin statusline has indicators for git branches and changes, but these are based on the current directory, not the directory of the currently opened file. (To see this, start veonim from its own repo and then :e dir/file -- the repo is still uivonim's; you explicitly need to :cd dir to update the git information.)

WSL support

Would it be possible/how hard would it be to hook this up to Neovim running in WSL. I have my whole config in the WSL side of things and would love to have this app running on the windows side.
Not sure if this covered by #2 or not so I thought I'd check. If its possibly a good first issue I would be willing to have a crack at it too 😊

High CPU usage w/conceallevel set

First thing I noticed is that when I open uivonim I have nvim running at 100% CPU.

The first thing that jumped is that it spent a lot of time in build_stl_str_hl, the function that renders the statusline. I disabled the code in my config doing that, and the CPU usage dropped to ~70-80%, so any vimscript for the statusline needs to be disabled.

After inspection, it seems that neovim is doing A LOT of win_update() even though I'm sitting still and touching nothing. When there isn't any user input, neovim shouldn't be doing anything! Maybe is there something in uivonim continuously pinging neovim? Here are a few backtraces from interrupting the running process at random moments:
Screenshot from 2020-10-30 15-29-34

Make statusline customizable from Lua

Maybe have some sort of an API like this:

require'uivonim'.setup_statusline {
    {}; -- Left components in here
    {}; -- Middle components in here
    {}; -- Right components in here
}

One question: how to go about this once ext_statusline is implemented in neovim?

cc: @tjdevries, let me know if you would prefer a different API style

Builds from `master` don’t work on MacOS (Apple Silicon)

I’m trying to build master so that I can have a native arm64 build, and it’s not working. My current Neovim version is from Homebrew (NVIM v0.5.1, Build type: Release, LuaJIT 2.1.0-beta3). My default node.js is also the Homebrew node.js, currently at v16.10.0.

nom i produces a diff in package-lock.json:

diff --git i/package-lock.json w/package-lock.json
index bf1214ee2011..6c80d17b466c 100644
--- i/package-lock.json
+++ w/package-lock.json
@@ -5,6 +5,7 @@
   "requires": true,
   "packages": {
     "": {
+      "name": "uivonim",
       "version": "0.28.0",
       "license": "AGPL-3.0-only",
       "dependencies": {

npm run package works and produces a .app and .dmg file. There’s one error for which I added stats: { errorDetails: true } and see

Critical dependency: the request of a dependency is an expression
    at CommonJsRequireContextDependency.getWarnings (/Users/austin/mess/2021/39/uivonim/node_modules/webpack/lib/dependencies/ContextDependency.js:82:18)
    at Compilation.reportDependencyErrorsAndWarnings (/Users/austin/mess/2021/39/uivonim/node_modules/webpack/lib/Compilation.js:2685:24)
    at /Users/austin/mess/2021/39/uivonim/node_modules/webpack/lib/Compilation.js:2293:28
    at _next2 (eval at create (/Users/austin/mess/2021/39/uivonim/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:25:1)
    at eval (eval at create (/Users/austin/mess/2021/39/uivonim/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:52:1)
    at /Users/austin/mess/2021/39/uivonim/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:403:11
    at /Users/austin/mess/2021/39/uivonim/node_modules/neo-async/async.js:2830:7
    at Object.each (/Users/austin/mess/2021/39/uivonim/node_modules/neo-async/async.js:2850:39)
    at /Users/austin/mess/2021/39/uivonim/node_modules/webpack/lib/FlagDependencyExportsPlugin.js:368:18
    at /Users/austin/mess/2021/39/uivonim/node_modules/neo-async/async.js:2830:7
 @ ./src/renderer/index.ts 9:13-39

When I run uivonim (open dist/mac-arm64/uivonim.app), I get the following result:

First run

The message is that app/runtime/uivonim.vim cannot be loaded; the file is in Contents/Resources/app/build/runtime/uivonim.vim.

Uncaught Exception:
Error: Error making request to nvim_get_hl_by_name
at NeovimClient.request (/Users/austin/mess/2021/39/uivonim/dist/mac-arm64/uivonim.app/Contents/Resources/app/node_modules/neovim/lib/api/Base.js:75:23)
at NeovimClient.getHighlightByName (/Users/austin/mess/2021/39/uivonim/dist/mac-arm64/uivonim.app/Contents/Resources/app/node_modules/neovim/lib/api/Neovim.js:261:21)
at /Users/austin/mess/2021/39/uivonim/dist/mac-arm64/uivonim.app/Contents/Resources/app/build/main/workers/instance.js:53:77
at MessagePort.<anonymous> (/Users/austin/mess/2021/39/uivonim/dist/mac-arm64/uivonim.app/Contents/Resources/app/build/main/workers/messaging/worker-client.js:49:24)
at MessagePort.[nodejs.internal.kHybridDispatch] (internal/event_target.js:398:41)
at MessagePort.exports.emitMessage (internal/per_context/messageport.js:18:26)

If I make the following modification:

diff --git i/src/main/core/master-control.ts w/src/main/core/master-control.ts
index ad01947b9344..3909440d87c2 100644
--- i/src/main/core/master-control.ts
+++ w/src/main/core/master-control.ts
@@ -39,7 +39,7 @@ const spawnNvimInstance = (
   useWsl: boolean,
   nvimBinary?: string
 ) => {
-  const runtimeDir = resolve(__dirname, '..', '..', '..', 'runtime')
+  const runtimeDir = resolve(__dirname, '..', '..', 'runtime')
   const args = [
     '--cmd',
     `let $PATH .= ':${runtimeDir}/${process.platform}' | let &runtimepath .= ',${runtimeDir}'`,

This is what shows up:

after fix

So there’s a problem with the build that’s easily fixed.

What I can’t figure out is how to stop the developer panel from opening. Suggestions?

Implement dead keys on Linux (and Windows?)

Dead keys are keys that emit special modifier events that can modify certain (but not all) subsequent keys. For example, on a German keyboard layout, these are ´, backtick, ^, and ~, and entering ´ followed by a outputs á (while a second ´ or a space outputs a literal ´).

These keys currently don't work in the main text entry (either for composition, literal output, or as normal mode mappings). They do work in the external command line, though (which uses system input).

Impossible to type "<"

Using Manjaro Architect build. Installation from YAY (uivonim-git package).

Impossible to type "<" symbol in INSERT mode. ">", on the other hand, works fine. Regular console neovim works fine with "<". No plugins and no additional configuration provided in init.vim.

[MacOS Catalina] Only works if run from terminal, asks for unnecessary permissions

On MacOS Catalina, after copying to the Applications directory, the app can be successfully run using open -a uivonim in the terminal.

If you try to launch the application by double clicking it in Finder, or through a launcher like Spotlight or Alfred, it will first ask for a bunch of permissions it shouldn't need, and then get stuck.

Here are the unnecessary permissions it requests:

  • Contacts
  • Calendars
  • Reminders
  • Photos

It also requests permission to accept incoming network connections.

And here is the state it gets stuck in:

Screen Shot 2020-11-26 at 11 07 02 AM

In this state there is no cursor, and it will not respond to any form of input. You cannot type : to enter a command or open a file.

Extensibility Tracking Issue

List of things to expose a Lua API for (not exhaustive list):

  • Statusline (see #4)
  • Finder/picker (as in :Uivonim files, :Uivonim grep-word, etc.)
  • LSP features (signature hint, hover, diagnostics, etc.; also provide implementation for them in runtime/lua, see #1)
  • (Floating) Markdown/HTML/image viewer (see neovim/neovim#12991)
  • Action menu
  • Displaying images/overlays/GIFs in certain (row, col) positions? Kind of like :Uivonim nc but for anything.
  • Particle effects and/or other effects (maybe? this one isn't a strong suggestion; just an idea I've had that is probably mostly useless)
  • UI font sizes, paddings (where it makes sense & if it makes sense), positioning (?), etc.
  • Sending HTML over to Uivonim to be sanitized and displayed as-is (?)

Should provide generic API usable from Lua plugins (core LSP, telescope.nvim, snippets.nvim).

Start with:

  • Separating UI from functionality in src/components/*.ts to reduce overlap and allow external functions to hook into the former.

exception when startup

startup show this error

[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
Error: connect ENOENT \\.\pipe\veonim-instanceb9cbeffd-c681-4467-98a4-f544b4ce7601-sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1142:16)

Zoom in and out

Hi, is there a way to zoom in and out? like Ctrl + and Ctrl - or Ctrl Shift - which is the usually behavior on terminal or even in most GUI editors.

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.