I installed Vim on Ubuntu via Linux Subsystem on Windows 10, so I can use it for work. I changed the home directory to the Windows user directory and symlinked the Ubuntu home to it. I use VimPlug and installed several plugins, which works well. But now I am getting a lot of errors including the on in the title.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Error detected while processing /mnt/c/Users/user/.vim/plugged/c-support/ftdetect/template.vim:
line 18:
E492: Not an editor command: ^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-go/ftdetect/gofiletype.vim:
line 2:
E492: Not an editor command: ^M
line 4:
E15: Invalid expression: &cpo^M
line 5:
E488: Trailing characters: cpo&vim^M
line 6:
E492: Not an editor command: ^M
line 11:
E492: Not an editor command: ^M
line 20:
E492: Not an editor command: ^M
line 21:
E488: Trailing characters
line 35:
E492: Not an editor command: ^M
line 37:
E121: Undefined variable: s:cpo_save
E15: Invalid expression: s:cpo_save^M
line 38:
E488: Trailing characters
line 39:
E492: Not an editor command: ^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-easy-align/plugin/easy_align.vim:
line 23:
E492: Not an editor command: ^M
line 24:
E15: Invalid expression: exists("g:loaded_easy_align_plugin")^M
line 143:
E171: Missing :endif
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-github-dashboard/plugin/github_dashboard.vim:
line 1:
E15: Invalid expression: !has('ruby')^M
line 12:
E171: Missing :endif
Error detected while processing /mnt/c/Users/user/.vim/plugged/c-support/plugin/c.vim:
line 34:
E492: Not an editor command: ^M
line 38:
E492: Not an editor command: ^M
line 40:
E15: Invalid expression: v:version < 700^M
line 3050:
E170: Missing :endfor
Error detected while processing /mnt/c/Users/user/.vim/plugged/YCM-Generator/plugin/ycm-generator.vim:
line 1:
E492: Not an editor command: ^M
line 2:
E15: Invalid expression: expand("<sfile>:p:h:h") . "/config_gen.py"^M
line 3:
E492: Not an editor command: ^M
line 6:
E492: Not an editor command: ^M
line 7:
E488: Trailing characters
line 23:
E492: Not an editor command: ^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-go/plugin/go.vim:
line 2:
E15: Invalid expression: exists("g:go_loaded_install")^M
line 311:
E488: Trailing characters
line 314:
E171: Missing :endif
Error detected while processing /mnt/c/Users/user/.fzf/plugin/fzf.vim:
line 23:
E492: Not an editor command: ^M
line 24:
E15: Invalid expression: exists('g:loaded_fzf')^M
line 542:
E488: Trailing characters
line 953:
E488: Trailing characters
line 954:
E171: Missing :endif
error detected while processing /mnt/c/Users/user/.vim/plugged/vim-rainbow/plugin/rainbow.vim:
line 6:
E492: Not an editor command: ^M
line 26:
E15: Invalid expression: ^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M ]^M
E15: Invalid expression: exists('g:rainbow_guifgs')? g:rainbow_guifgs : [^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M ]^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/c-support/ftdetect/template.vim:
line 18:
E492: Not an editor command: ^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-go/ftdetect/gofiletype.vim:
line 2:
E492: Not an editor command: ^M
line 4:
E15: Invalid expression: &cpo^M
line 5:
E488: Trailing characters: cpo&vim^M
line 6:
E492: Not an editor command: ^M
line 11:
E492: Not an editor command: ^M
line 20:
E492: Not an editor command: ^M
line 21:
E488: Trailing characters
line 35:
E492: Not an editor command: ^M
line 37:
E121: Undefined variable: s:cpo_save
E15: Invalid expression: s:cpo_save^M
line 38:
E488: Trailing characters
line 39:
E492: Not an editor command: ^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-easy-align/plugin/easy_align.vim:
line 23:
E492: Not an editor command: ^M
line 24:
E15: Invalid expression: exists("g:loaded_easy_align_plugin")^M
line 143:
E171: Missing :endif
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-github-dashboard/plugin/github_dashboard.vim:
line 1:
E15: Invalid expression: !has('ruby')^M
line 12:
E171: Missing :endif
Error detected while processing /mnt/c/Users/user/.vim/plugged/c-support/plugin/c.vim:
line 34:
E492: Not an editor command: ^M
line 38:
E492: Not an editor command: ^M
line 40:
E15: Invalid expression: v:version < 700^M
line 3050:
E170: Missing :endfor
Error detected while processing /mnt/c/Users/user/.vim/plugged/YCM-Generator/plugin/ycm-generator.vim:
line 1:
E492: Not an editor command: ^M
line 2:
E15: Invalid expression: expand("<sfile>:p:h:h") . "/config_gen.py"^M
line 3:
E492: Not an editor command: ^M
line 6:
E492: Not an editor command: ^M
line 7:
E488: Trailing characters
line 23:
E492: Not an editor command: ^M
Error detected while processing /mnt/c/Users/user/.vim/plugged/vim-go/plugin/go.vim:
line 2:
E15: Invalid expression: exists("g:go_loaded_install")^M
line 311:
E488: Trailing characters
line 314:
E171: Missing :endif
Error detected while processing /mnt/c/Users/user/.fzf/plugin/fzf.vim:
line 23:
E492: Not an editor command: ^M
line 24:
E15: Invalid expression: exists('g:loaded_fzf')^M
line 542:
E488: Trailing characters
line 953:
E488: Trailing characters
line 954:
E171: Missing :endif
error detected while processing /mnt/c/Users/user/.vim/plugged/vim-rainbow/plugin/rainbow.vim:
line 6:
E492: Not an editor command: ^M
line 26:
E15: Invalid expression: ^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M ]^M
E15: Invalid expression: exists('g:rainbow_guifgs')? g:rainbow_guifgs : [^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M '#458588',^M '#b16286',^M '#cc241d',^M '#d65d0e',^M ]^M
You must save your .vimrc in unix fileformat (LF line ending).
Please ask user questions on the vim_use mailinglist or use vi.stackexchange.com. This here is a bug tracker for problems with Vim. We cannot provide individual help here. Closing.
Closed #6156.
Apparently you got the "Windows" set of runtime files (with <CR><NL>
ends-of-lines) and Vim believes it's running on a "Unix-like" OS:
For systems with a Dos-like
<EOL>
(<CR><NL>
), when reading files that
are ":source"ed and for vimrc files, automatic<EOL>
detection may be
done:
- When 'fileformats' is empty, there is no automatic detection. Dos
format will be used.- When 'fileformats' is set to one or more names, automatic detection
is done. This is based on the first<NL>
in the file: If there is a
<CR>
in front of it, Dos format is used, otherwise Unix format is
used.
All this, however, happens only in Vim "for Windows". OTOH, runtime files "for Unix" (with only <NL>
ends-of-lines) can be used by any Vim. So not only your vimrc, but any script to be sourced, must have a <NL>
without <CR>
at the end of every line.
Well, this Vim is installed on the Ubuntu subsystem for Linux and it probably pulls the Windows version of the plugins, because all data from the internet downloaded by Windows and then handed over to the subsystem. Is this possible?
I would like to use Vim on my PC for work. On Windows itself I have a few issues with plugins and if I run it on the subsystem, this happens. Bottom line for me is that Vim on Windows is horrible. I have no issues on my personal Linux machine at all.
How can I solve this now? I already tried to get rid of the ^M terminators following the guide on Vim‘s website. None of them work.
you can use :w ++ff=unix
to convert the files. Or use a tool like dos2unix
or what it is called.
Having said that, I am using my vim dotfiles on unix and windows for15 years or longer and have always used unix line endings. No problems whatsoever. But please ask usage questions either at the vim_use mailinglist or at vi.stackexchange.com
I think I already tried that without success. Will try again though. On Windows I also don’t have this problem. I think it is due to the Windows subsystem, which is a Linux installed from the Microsoft store.
you can use
:w ++ff=unix
to convert the files. Or use a tool likedos2unix
or what it is called.Having said that, I am using my vim dotfiles on unix and windows for15 years or longer and have always used unix line endings. No problems whatsoever. But please ask usage questions either at the vim_use mailinglist or at vi.stackexchange.com
This answer solved the issue for me
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
In my case I accidentally had core.autocrlf
set to true
, and since plugged uses git internally, it caused all the files to be checked out with CRLF line endings.
—
Reply to this email directly, view it on GitHub.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.
In my case I accidentally had
core.autocrlf
set totrue
, and since plugged uses git internally, it caused all the files to be checked out with CRLF line endings.
for me setting core.autocrlf to false did the trick
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I can confirm
git config --global core.autocrlf false
and reinstall spacevim
curl -sLf https://spacevim.org/install.sh | bash
works on WSL.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
I'm pretty sure that u r aware of the problem from the replies above, and those are the steps that worked for me and I'm leaving them here just in case someone else had the same issue, I'm using WSL & neovim...
clearing plugged dir
adding those couple of lines to .vimrc will make sure that any .vim file is converted to Unix
autocmd FileType vim setlocal fileformat=unix
set fileformat=unix
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
To convert a file from "Windows" fileformat to "Unix" fileformat (and remove any end-of-line ^M):
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.
Oops...
:e ++ff=dos foobar.vim " or :new for new window " This will accept both <CR><NL> or <NL> alone for end-of-line :w ++ff=unix " This will write the current file with <NL> alone on all lines
Best regards,
Tony.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.