Can't run nerdtree and lightline on MacOS Catalina using macvim 8.2.319

34 views
Skip to first unread message

James Dekker

unread,
Apr 8, 2020, 8:35:06 PM4/8/20
to vim_mac
Am using macvim 8.2.319 (installed it by running the downloaded dmg file) on macOS Catalina (10.15.4).

My .gvimrc file:

set guifont=JetBrains\ Mono:h15
set nu!

call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
call plug#end()

map <C-t> :NERDTreeToggle<CR>

My When I try to load it using either:

. .gvimrc 

or 

source .gvimrc

It outputs the following error:

-bash: .gvimrc: line 4: syntax error near unexpected token `('
-bash: .gvimrc: line 4: `call plug#begin('~/.vim/plugged')'

When I run macvim by doing this:

gvim Hello.py

The line numbers are set but I can't see liteline anywhere (I did do a PlugInstall and PlugUpdate).

When I try to open NERD tree by clicking on Control-t, it states this:

E492: Not an editor command: NERDTreeToggle

By, the way, I don't have a .vimrc file created... 

Why are the NERDTree and liteline plug-ins not working on macvim?

Yee Cheng Chin

unread,
Apr 12, 2020, 3:31:51 AM4/12/20
to vim...@googlegroups.com
Hmm, there are a lot of things going on here. First of all, do you have vim-plug actually installed? Does it work in terminal Vim? You probably want to put the plug initializations in your vimrc instead of gvimrc. gvimrc should only be for GUI specific options.

Also, gvimrc is loaded automatically by MacVim (or any gVim). You shouldn't need to load it in manually.

I'm not sure why you are getting a syntax error though. My guess is there are some whitespace / newline issues, but it's hard to tell unless you attach a file (you probably want to file an issue at https://github.com/macvim-dev/macvim/issues instead).

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/caf3a56d-c658-4bd7-ac28-02dcb346db58%40googlegroups.com.

Rod Hoon

unread,
Apr 12, 2020, 12:15:42 PM4/12/20
to vim...@googlegroups.com
Hi, James--


On Wed, Apr 8, 2020 at 5:35 PM James Dekker <james....@gmail.com> wrote:
My When I try to load it using either:

. .gvimrc 

or 

source .gvimrc

It outputs the following error:

-bash: .gvimrc: line 4: syntax error near unexpected token `('
-bash: .gvimrc: line 4: `call plug#begin('~/.vim/plugged')'
 
The error looks like it is caused by running ". .gvimrc" or "source .gvimrc" at the Bash command prompt.
If you want to source the gvimrc, you should probably do "source ~/.gvimrc" or "source $MYGVIMRC" at the : prompt inside Vim.

On Sun, Apr 12, 2020 at 12:31 AM Yee Cheng Chin <ychin....@gmail.com> advised:
You probably want to put the plug initializations in your vimrc instead of gvimrc. gvimrc should only be for GUI specific options.
 
I'm not a Vim expert, so this is a guess: Putting the plug initialization in vimrc  may help, because vimrc and gvimrc are run at different points in the startup process.

James Dekker

unread,
Apr 13, 2020, 12:47:34 AM4/13/20
to vim...@googlegroups.com
Thank you, Yee Cheng Chin!

Yes, putting the same contents inside ~./vimrc worked:

set nu
set ruler
set rulerformat=%l\:%c  
set autoindent
syntax on
set nocompatible
set t_Co=256
set tabstop=4
set laststatus=2
set encoding=utf-8    

if has("gui_running")
  if has("gui_gtk2")
    set guifont=Inconsolata\ 12
  elseif has("gui_macvim")
    set guifont=JetBrains\ Mono\ Regular:h14
  elseif has("gui_win32")
    set guifont=Consolas:h11:cANSI
  endif
endif

colorscheme pencil

set background=light
let g:airline_theme = 'pencil'


call plug#begin('~/.vim/plugged')
Plug 'itchyny/lightline.vim'
Plug 'preservim/nerdtree'
call plug#end()


map <C-t> :NERDTreeToggle<CR>

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages