So I installed youcompleteme for vim and when running vim as sudo, everything works as expected. I get autocomplete as well as syntax-highlighting.
However when running vim as normal user, YCM does not appear to be working. I do get syntax-highlighting but I suspect that being due to :syntax on
in my ~/.vimrc
. I do not get the autocomplete I got from YCM when starting as sudo.
This is my ~/.vimrc
:
set tabstop=4
let g:ycm_global_ycm_extra_conf = '~/Documents/code'
let g:ycm_confirm_extra_conf = 0
:syntax on
:set nu
:filetype on
Before you ask, the .ycm_extra_conf.py
is in fact in the specified folder.
Also here is the output of uname -a
: Linux PC 5.14.11-arch1-1 #1 SMP PREEMPT Sun, 10 Oct 2021 00:48:26 +0000 x86_64 GNU/Linux
How can I get YCM's functionality as non-privileged user?
Alright after some trying I found the following: it looks like I made a blunder. After putting let g:ycm_global_ycm_extra_conf = '~/Documents/code/.ycm_extra_config.py'
in my .vimrc
it was fixed.
All it needed was the full path, including the filename.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.