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

Can't open files in vim #68

Open
PavlosCh opened this issue Feb 2, 2023 · 10 comments
Open

Can't open files in vim #68

PavlosCh opened this issue Feb 2, 2023 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@PavlosCh
Copy link

PavlosCh commented Feb 2, 2023

This might be a user error but it's not obvious to me from the documentation how to open a file.
I have added both exports below to my bashrc.

export LLAMA_EDITOR=vim
export EDITOR=vim

I am assuming we navigate to a file and hit enter? Nothing seems to happen thought when I hit enter.
I am using Ubuntu v18 if that might have an impact.

Thanks in advance!

@antonmedv
Copy link
Owner

Can’t tell what’s wrong. Can you try to debug? Without it can’t fix it)

@kave-me
Copy link

kave-me commented Feb 2, 2023

I have the same issue for vim and code -w, I'm using fish as my command line shell.

Could you please instruct me where to look or which file I should monitor for debugging the events that are not behaving as expected?

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy

$ fish -v
fish, version 3.3.1

@antonmedv
Copy link
Owner

We need to add debug logs in cmd section. On opening there should be some error.

@SH0PK33P3R
Copy link

I was experiencing the same when installing the package via snap.
After downloading & building it manually, opening files in vim works!

  • fish version: 3.1.0
  • llama version: 1.4.0
  • Environment variable: EDITOR=vim

@carvilsi
Copy link

Had same issue with Ubuntu 23.04 when installed with snap and llama: v1.4.0.
After remove it from snap and installed via go, works.

@Jplferreyra
Copy link

Wame problem here, can't open files with any editor (tried vim, nvim, subl).
Installation from snap, Ubuntu 20.04.

@nsbruce
Copy link

nsbruce commented Aug 22, 2023

One cause might be the difference between shell variables and environment variables. If EDITOR is set in a .zshrc file or similar the snap won't see that since it starts it's own shell.

~ echo $EDITOR
nvim
~ env | grep EDITOR  # notice there is nothing returned
~ snap run --shell walk
# we drop down into snaps shell here
user@host:/home/user$ echo $EDITOR # notice there is nothing returned
user@host:/home/user$ env | grep EDITOR
user@host:/home/user$ exit
# back to normal shell
~ export EDITOR=nvim
~ snap run --shell walk
user@host:/home/user$ echo $EDITOR
nvim

The next thing to figure out is how to expose the editor. My default snap doesn't have access to vi let alone neovim or my dotfiles.

From inside the snap shell:

user@host:/home/user$ vi
bash: /usr/bin/vi: Permission denied

@nsbruce
Copy link

nsbruce commented Aug 23, 2023

I don't think this issue should be closed @antonmedv. I've pointed out how to get the environment variable into walk but in the isolated snap environment the editor can't be launched with the current configuration.

@antonmedv antonmedv reopened this Aug 23, 2023
@antonmedv antonmedv added the help wanted Extra attention is needed label Aug 27, 2023
@andykras
Copy link

Had same issue with Ubuntu 23.04 when installed with snap and llama: v1.4.0. After remove it from snap and installed via go, works.

It worked for me, thanks! I think it's worth adding this to the BKM section somewhere

@antonmedv
Copy link
Owner

Yeap. it looks like this is a restriction of snap platform. And getting --classic snap is difficult. Adding all the permissions for snap is not possible (vim, vim files and any other editor in EDITOR var).

So I'm thinking to delete snap distribution of walk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

8 participants