Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open uivonim from the command-line with parameters #421

Open
halostatue opened this issue Oct 11, 2021 · 6 comments
Open

Cannot open uivonim from the command-line with parameters #421

halostatue opened this issue Oct 11, 2021 · 6 comments

Comments

@halostatue
Copy link

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'
  ]
}
@halostatue
Copy link
Author

This is going to be fairly important for me, because I frequently use gvim chat.md (or whatever) or occasionally gvim -d (diff mode). I really want to use a real neovim GUI on macOS and so far UIvonim is the best I’ve seen so far, but it’s still not quite usable as a replacement for MacVim.app / gvim.

@smolck
Copy link
Owner

smolck commented Oct 11, 2021

Hmm so not totally sure how to go about fixing this, but threw together something real quick, mind giving it a test? https://github.com/smolck/uivonim/tree/fix-421

With that branch this works: ./dist/mac-arm64/uivonim.app/Contents/MacOS/uivonim path/to/whatever/file. Is that the sort of thing you're looking for? Not quite a self-installing script, but it does seem to do what you want?

@halostatue
Copy link
Author

It works reasonably well. It still outputs a lot of logs when run that way. Ideally things can work with open -a uivonim as well; I know that there’s ways to do this, but I’m not sure what would be.

@timoxley
Copy link

timoxley commented Jan 9, 2022

@timoxley
Copy link

timoxley commented Jan 9, 2022

I really want to use a real neovim GUI on macOS and so far UIvonim is the best I’ve seen so far, but it’s still not quite usable as a replacement for MacVim.app / gvim.

+100 this. I've been using macvim for as long as I can remember, maybe 10+ years and this is the first alternative that makes me consider dropping macvim (and I've tried most/all of them). This is great.

@clason
Copy link
Collaborator

clason commented Jan 9, 2022

Just for the sake of completeness -- if all you're looking for is "Macvim-but-with-Neovim", that is https://github.com/qvacua/vimr.

(Which is not as shiny as Uivonim, of course!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants