Force neovim to source .zshrc before it starts

ive a little issue. ive set up neovim pretty much the way i want it and use it multiple hours daily for work. most of the times i use fzf or ranger via floaterm from within nvim to open new files. however- from time to time i open files directly from within dolphin.

in order for dolphin to open files with neovim inside a terminal i created a little application .desktop file.
it simply opens neovim with the command “tilix -e nvim%f” which works jsut fine. everything is the same as using it directly within tilix.

one issue tho- it doesnt display the colors for fzf and ranger correctly. the fzf colors are set up in my zshrc file. the syntax colortheme in the preview windows gets controlled via a bat theme. this is also configured in the zshrc file.

but when i open nvim threw dolphin, tilix doesnt source the zshrc file. so these colors stick out like a sore thumb and drive me nuts each time i see em cuz they are exactly the opposite to my dark theme.

so- is there a way to add something to the command i open neovim in my application file? i tried “source ~/.zshrc && tilix -e nvim%f” and “tilix -e zsh -c nvim%f” without much success.

also tried gui neovim version but obviously the issue is the same.

also tried to basically add the color commands etc to the shortcuts directly in my init.vim file but the author of fzf knew why he wrote it must be declared in the zshrc file.

Now I don’t know much about vim family but I would think having zsh as default shell is a requirement

chsh -s /usr/bin/zsh

thats of course already set up this way.

the thing is when i open tilix it sources the zshrc file. when i then open neovim it has the right config.

however- when i run tilix with neovim from dolphin, tilix doesnt source the zshrc file automatically. so i need to add this command somehow into the “Exec” portion of the application. i just dont know what the exact command is i need to use to force tilix to source the zshrc file prior to opening nvim

That would be a tilix problem - not directly a system issue.

found the answer- if anyone else has this issue in the future- heres what did the trick for me.

the exec command needs to be:

/usr/bin/tilix -e zsh -c ‘. ~/.zshrc; nvim %F’

if u arent using tilix u obviously need to change it to the path of your terminal. simply tilix -e zsh -c… doesnt work.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.