In every terminal (kate, cherrytree, xfce etc.) vim is loaded with its config file (theme etc.) Only in Geany's terminal vim doesn't load config file, so no theme etc. I have even made flobal vim config in /etc/vimrc but it is the same. It happens only with vim, helix works as expected for example, lazygit also etc. Maybe someone have idea why this happens. Thanks.
A possible problem is that the shell in VTE is not started as a login shell (by default) and so it doesn't read the relevant startup scripts for environment. And if Geany is started from the windows menu it likely doesn't run in a shell, and so no environment either.
Try adding `--login` to the bash command in `Preferences->Terminal->Shell:`
@elextr Thanks for info, but unfortunately it didn't help. Interesting that Helix editor with config in home folder works but vim not, will check neovim.
does vim work if it is run with `-u` _absolute path to vimrc_
Also in VTE `echo $XXXX` for all `XXXX` being one of the environment variables that Vim uses (if you can figure out what they are from the discombobulated, shattered even, documentation).
@elextr I have tried: home config file in ~/.vimrc (this works everywhere except Geany) global config file in /etc/vimrc (this works everywhere except Geany) custom config file with -u (must say that in this variant there are some errors in /plugin/gtags-cscope.vim from official Arch Linux vim package and gruvbox theme that I want to load) and -Nu (this works everywhere except Geany)
Don't know really why this happens, I have tried in VTE based terminals (XFCE terminal, terminal embedded in Cherrytree editor), Konsole based (Kate), xterm - in every terminal vim works as expected (theme etc.)
Can't find any specific environment variables for vim in Arch Linux documentation.
Mystery ... :)
home config file in ~/.vimrc (this works everywhere except Geany) global config file in /etc/vimrc (this works everywhere except Geany)
It is almost certain that these are not hard coded paths, they will use environment variables. Thats why I suggested you `echo` them in the VTE to be sure those variables are set properly.
You didn't answer the question of how you were running Geany, menu or terminal?
@elextr I have tried to run Geany from menu as usual and from terminal - it the same - vim doesn't load config. I you mean $HOME (for .vimrc) and $XDG_CONFIG_HOME (for ~/.vim/vimrc) - they are both the same in Geany and every other terminal.
custom config file with -u (must say that in this variant there are some errors in /plugin/gtags-cscope.vim from official Arch Linux vim package and gruvbox theme that I want to load)
I missed this one, so if forcing the config file gets errors, that indicates that it normally does not load, and when forced something else in the environment that the vimrc is expecting does not exist, or has an unexpected value.
Maybe spend a boring 10 mins comparing printenv in a normal xfce terminal and printenv in the Geany terminal. There will be at least one entry that is different just to keep you awake ;-)
Also, I am not a vim-ist but does it have some sort of debug mode where it prints what startup files it reads and what commands it executes from each?
@elextr Thanks for pointing about printenv to compare. I found one that caused it. Now vim works the same. ![compare_geany_xfce](https://github.com/user-attachments/assets/97fa22bc-0390-4704-94b5-6f125b305...)
So in Geany TERM=xterm but in every other terminal TERM=xterm-256color.
Closed #3962 as resolved.
@elextr Thanks for pointing about printenv to compare. I found one that caused it. Now vim works the same. So in Geany TERM=xterm but in every other terminal TERM=xterm-256color.
github-comments@lists.geany.org