antonmedv / walk

Terminal file manager
MIT License
3.22k stars 89 forks source link

Can't open files in vim #68

Open PavlosCh opened 1 year ago

PavlosCh commented 1 year ago

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 commented 1 year ago

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

kave-me commented 1 year ago

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 commented 1 year ago

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

SH0PK33P3R commented 1 year ago

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

carvilsi commented 1 year ago

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 commented 1 year ago

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

nsbruce commented 1 year ago

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 commented 1 year ago

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.

andykras commented 10 months ago

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 commented 10 months ago

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.