vim: custom profiles for sudoedit and plugins #4520
rene-descartes2021
started this conversation in
Show and tell
Replies: 2 comments
-
The Firejail configuration in
We must do a few things to allow Vim to function with plugin additions (I use space-vim), do some combination of:
"Disable Vim from writing to .viminfo
set viminfo=
"You may have to configure plugins to write their cache to a different location
" than ~/.vim, e.g. by setting $TMPDIR, read their docs & file issues with them if you get problems with them
Only give write access to $ firejail --profile=/etc/firejail/vim.profile --read-write=~/.vim/plugged vim -es +'PlugInstall' +qall |
Beta Was this translation helpful? Give feedback.
0 replies
-
Related: #4841 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I noticed Vim isn't in firecfg. It was added here and later removed here. Documented here.
The idea I use is a script
~/bin/vim-unsandboxed
, which I use to edit files otherwise sandboxed by Firejail:The
-u /etc/vim/vimrc
argument loads the systemwide vimrc, and does not load any user-installed plugins with possible security vulnerabilities/exploits (I have ~50 plugins pulled from git repositories!). I guess --clean might be better, but on Debian that results innomodeline
not being set via/usr/share/vim/vim81/debian.vim
. I'm not sure if Vim had been patched to disallow that vulnerability. So, I'm not sure what the best option or other considerations would be.On the CLI I call
vim
for normal development, and when I need to edit a file in e.g. ~/.config or ~/bin I callvim-unsandboxed
. Seems to work well, enabling me to sandbox all those plugins useful for developing code (plugins which often embed other languages than Vimscript, such as Python).And one should never use
sudo vim
, one should instead usesudoedit
. The above script pertains to the editing of files in the HOME directory sandboxed by firejail.Beta Was this translation helpful? Give feedback.
All reactions