You are not logged in.

#1 2023-02-24 11:23:28

ELODollZ
Member
Registered: 2023-02-06
Posts: 35

vim error coding, i don't understand where the problem is

Context:
I have been trying to set up Latex, with nvim. Doing so i came across "Plug" for nvim and have been trying to set it up, (i didn't default have .vimrc, i so i made it my self)
Things i have created my self.
"Autoload" in vimrc
".vimrc", ".vimrc.plug"

i have placed the code seen beblow in the file:

###Call the .vimrc.plug file
if filereadable(expand("~/.vimrc.plug"))
    source ~/.vimrc.plug
endif

let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
  silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

I get the following error code from nvim, when i try to source it. can't source it from terminal since it thinks it is a bash script (might be the root of the problem)

Error detected while processing /home/$NAME/.vimrc:                                                                                                                                                                              
line    1:
E488: Trailing characters: Call the .vimrc.plug file: ###Call the .vimrc.plug file
Error detected while processing /home/$NAME/.vimrc[3]../home/$NAME/.vimrc.plug:
line    1:
E488: Trailing characters: Fugitive Vim Github Wrapper: ###Fugitive Vim Github Wrapper
line    4:
E488: Trailing characters: Vim Latex Plug: ###Vim Latex Plug
line    7:
E488: Trailing characters: Nvim Latex Plug: ### Nvim Latex Plug
line    9:
E488: Trailing characters: Plugin for vim plugins: ### Plugin for vim plugins
line   52:
E488: Trailing characters: Fugitive Vim Github Wrapper: ###Fugitive Vim Github Wrapper
line   55:
E488: Trailing characters: Vim Latex Plug: ###Vim Latex Plug
line   58:
E488: Trailing characters: Nvim Latex Plug: ### Nvim Latex Plug

Offline

#2 2023-02-24 12:36:32

Adriik
Member
From: Argentina
Registered: 2022-03-10
Posts: 134
Website

Re: vim error coding, i don't understand where the problem is

Vim configuration files use " to comment, and if I have enough coffe in my system, I see you used #.

Last edited by Adriik (2023-02-24 12:37:09)


I'm just someone. Please use [code] [/code] tags.

Offline

#3 2023-02-24 12:40:56

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: vim error coding, i don't understand where the problem is

You can see the errors are all on lines where you used # for comments. .vimrc does not use # for comments. Use " at the beginning of a commented line instead.

" Call the .vimrc.plug file

(edit) snaked again.

Last edited by 2ManyDogs (2023-02-24 12:42:24)

Offline

#4 2023-02-25 13:57:09

ELODollZ
Member
Registered: 2023-02-06
Posts: 35

Re: vim error coding, i don't understand where the problem is

Arhhh thanks alot,
another question, it says when i try to add the automated installation of missing plugins, that the *, in the 3. last line of code, that it is an error. using the * (is it outdated or do i need some dependencise to make it recognize the * )  im not to familiere with vim, so i hope its okay i ask big_smile

" Install vim-plug if not found
if empty(glob('~/.vim/autoload/plug.vim'))
  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif

" Run PlugInstall if there are missing plugins
autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
  \| PlugInstall --sync | source $MYVIMRC
\| endif

Last edited by ELODollZ (2023-02-25 13:58:02)

Offline

Board footer

Powered by FluxBB