Here is my vimrc file:

call plug#begin('$HOME/vimfiles/plugged')
Plug 'vim-airline/vim-airline'
Plug 'itchyny/lightline.vim'
Plug 'kien/ctrlp.vim'
Plug 'python-mode/python-mode'
Plug 'rdnetto/YCM-Generator', { 'branch': 'stable'}
Plug 'davidhalter/jedi-vim'
Plug 'octol/vim-cpp-enhanced-highlight'
Plug 'Valloric/YouCompleteMe'
Plug 'jeaye/color_coded'
call plug#end()

set encoding=utf-8
syntax on colorscheme gruvbox
set backspace=indent,eol,start
inoremap ii <Esc> inoremap II <Esc>
set number
set langmenu=en_US let $LANG = 'en_US'
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim

This is the error I get with "set encoding=utf-8", after command ":PlugInstall":


I use Windows 10

Edit: Well, interestingly enough, the problem apparently was in the picture I sent, but below the blue rectangle I put, I had the letter "á" in my path and changing that worked.

  • 3
    If you use set encoding, it should be one of the first things in your vimrc. That changes the internal encoding used for data in Vim. Changing it after there may already be non-ASCII data in memory is just asking for trouble (crashes, errors, etc.).
    – jamessan
    Commented Sep 2, 2017 at 18:50

1 Answer 1


From :help 'encoding':

NOTE: Changing this option will not change the encoding of the existing text in Vim. It may cause non-ASCII text to become invalid. It should normally be kept at its default value, or set when Vim starts up. See multibyte. To reload the menus see :menutrans.

So either set it at the first line, or don't set it at all.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.