vim-airline / vim-airline

lean & mean status/tabline for vim that's light as air
MIT License
17.78k stars 1.1k forks source link

Undefined variable: g:airline_symbols on vim launch #1712

Closed GregLegere closed 6 years ago

GregLegere commented 6 years ago

environment

vimrc file

set nocompatible " be iMproved, required filetype off " required

set rtp+=$VIM/vimfiles/plugin/bundle/Vundle.vim/ call vundle#begin('$VIM/vimfiles/plugin/bundle/Vundle.vim/')

Plugin 'VundleVim/Vundle.vim' Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes'

call vundle#end() " required filetype plugin indent on " required

let g:airline#extensions#tabline#enabled = 1

actual behavior

On open, numerous errors occur.

I have tried adding the following into the ctrlspace.vim file, as well as vimrc, and init.vim within airline.

let g:airline_symbols = {} let g:airline_symbols.space = ' '

I'm currently loading the plugin with vundle, but have tried putting the package downloaded from here in both the plugin directory, and the vundle/bundle directory. Behaviour remains the same. I've looked through google and here where other people had similar behaviour, and tried the suggestions where applicable.

Adding those into the ctrlspace.vim file does fix all of the issues about those files being undefined, but the portion about the functions, etc. remain.

error output

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\ctrlspac e.vim:

line 6:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.space

line 7:

E121: Undefined variable: s:spc

E15: Invalid expression: s:spc . s:spc . s:spc

line 8:

E117: Unknown function: ctrlspace#context#Configuration

E15: Invalid expression: ctrlspace#context#Configuration().Symbols.CS

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\tabline\ buffers.vim:

line 6:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.space

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\tabline\ formatters\default.vim:

line 10:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.modified

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\tabline\ tabs.vim:

line 6:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.space

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\vimtex. vim:

line 7:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.space

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\virtuale nv.vim:

line 6:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.space

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\whitesp ace.vim:

line 9:

E121: Undefined variable: g:airline_symbols

E116: Invalid arguments for function get(g:, 'airline#extensions#whitespace

symbol', g:airline_symbols.whitespace)

E15: Invalid expression: get(g:, 'airline#extensions#whitespace#symbol', g:airline_symbols.whitespace)

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\extensions\ycm.vi m:

line 6:

E121: Undefined variable: g:airline_symbols

E15: Invalid expression: g:airline_symbols.space

Error detected while processing $VIM\vimfiles\ plugin\bundle\Vundle.vim\vim-airline\autoload\airline\themes\dark.vim:

line 66:

E117: Unknown function: airline#themes#generate_color_map

E15: Invalid expression: airline#themes#generate_color_map(s:airline_a_nor mal, s:airline_b_normal, s:airline_c_normal)

line 102:

E117: Unknown function: airline#themes#generate_color_map

E15: Invalid expression: airline#themes#generate_color_map(s:airline_a_inse rt, s:airline_b_insert, s:airline_c_insert)

line 111:

E716: Key not present in Dictionary: insert)

E116: Invalid arguments for function copy(g:airline#themes#dark#palette.in sert)

E15: Invalid expression: copy(g:airline#themes#dark#palette.insert)

line 112:

E716: Key not present in Dictionary: replace.airline_a = [ s:airline_b_insert[0]

expected behavior

Vim to launch as expected, and have the airline plugin functional.

edits

Made some corrections to grammar/layout

chrisbra commented 6 years ago

g:airline_symbols is always defined. Something in your installation is very corrupt. This one looks suspicous:

call vundle#begin('$VIM/vimfiles/plugin/bundle/Vundle.vim/')

Do not clone any plugin inside a plugin directory. Those have a special meaning for Vim.

GregLegere commented 6 years ago

I caught that myself and tried moving it around to a few different directories and removed the "vundle.vim" portion for that section so it wouldn't drop plugins inside a plugin folder.

Unfortunately the issues have persisted, but still a couple things to try regarding the locations since I think that may be related.

The issue occurs taking vundle out of the picture as well and manually cloning the airline into the plugin directory, but to be fair, I may have put those in the wrong place as well so I'll give that another shot.

I'll test some more tomorrow and update the main post with additional details (or resolution if I figure it out)

Thanks

chrisbra commented 6 years ago

do not clone in inside a plugin folder. Since you are using vim8, I would simply clone it below ~/vimfiles/pack/dist/start/ It should work from there out of the box using the buildin package manager.

GregLegere commented 6 years ago

Thanks Christian! I see what I was doing wrong, got it working.