M
M
Mor2022-01-19 15:06:49
linux
Mor, 2022-01-19 15:06:49

Vim plugin only works in sudo. Why is the statusline plugin not showing up in Vim as a regular user?

Editing the configuration file /etc/vimrc.

After writing changes to a file, everything works the same under sudo and under a normal user.

Next, I'm trying to install the vim-airline plugin in vim.

Then I added the vim-airline plugin:

"///Plug\\\

call plug#begin()

Plug 'NLKNguyen/papercolor-theme'
Plug 'vim-airline/vim-airline'

call plug#end()

"Airline settings
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1


I installed it using Plug:

:PlugInstall

I wrote the changes to a file and re-entered vim under sudo, the plugin works, the statusline is displayed correctly, in general, everything is as it should be. Then, to check, I went into vim as a normal user and ... this plugin is not there, the standard statusline remains. (((

Interestingly, before installing the statusline plugin, I installed the color scheme plugin, it worked (and still works) both under sudo and under a normal user the same way.

Well, after all that, I thought that the config was not being pulled into the user, for test, commented out the line numbering “set number”, wrote down the changes, logged into vim separately under user and under sudo, in both cases the line numbering disappeared

.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nihi1ist, 2022-01-19
@nihi1ist

Most likely the problem is with the users. Vim launched via sudoworks with the directory /root/.vim. You will most likely find your plugin there.
For myself, in the root home directory, I made sim links to /home/user/.vimand /home/user/.vimrc (where user, username) while preserving the original names. That's how it works. Before creating sim links, you need to delete / rename the source files / directories

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question