Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to PlugUpdate everytime I open gvim #540

Closed
8 tasks
dileepkr opened this issue Oct 18, 2016 · 10 comments
Closed
8 tasks

Need to PlugUpdate everytime I open gvim #540

dileepkr opened this issue Oct 18, 2016 · 10 comments

Comments

@dileepkr
Copy link

Explain the problem here ...

Hi,

I used Vim plug for Gvim 7.4, the issue is, when I open gvim the plugins will not work, but when I do PlugUpdate the plugins start working.

I have to do PlugUpdate every time to get the plugins working. Is there a fix for this issue?

Thanks.

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Feb 11 2014 16:58:41)
Compiled by usrintel@plxv1013
Huge version with GTK2 GUI.  Features included (+) or not (-):
+arabic          +cmdline_info    -ebcdic          +fork()          +listcmds        +mouse_netterm   +persistent_undo +signs           +terminfo        +vreplace
+autocmd         +comments        +emacs_tags      +gettext         +localmap        +mouse_sgr       +postscript      +smartindent     +termresponse    +wildignore
+balloon_eval    +conceal         +eval            -hangul_input    -lua             -mouse_sysmouse  +printer         -sniff           +textobjects     +wildmenu
+browse          +cryptv          +ex_extra        +iconv           +menu            +mouse_urxvt     +profile         +startuptime     +title           +windows
++builtin_terms  +cscope          +extra_search    +insert_expand   +mksession       +mouse_xterm     +python          +statusline      +toolbar         +writebackup
+byte_offset     +cursorbind      +farsi           +jumplist        +modify_fname    +multi_byte      -python3         -sun_workshop    +user_commands   +X11
+cindent         +cursorshape     +file_in_path    +keymap          +mouse           +multi_lang      +quickfix        +syntax          +vertsplit       -xfontset
+clientserver    +dialog_con_gui  +find_in_path    +langmap         +mouseshape      -mzscheme        +reltime         +tag_binary      +virtualedit     +xim
+clipboard       +diff            +float           +libcall         +mouse_dec       +netbeans_intg   +rightleft       +tag_old_static  +visual          +xsmp_interact
+cmdline_compl   +digraphs        +folding         +linebreak       +mouse_gpm       +path_extra      +ruby            -tag_any_white   +visualextra     +xterm_clipboard
+cmdline_hist    +dnd             -footer          +lispindent      -mouse_jsbterm   +perl            +scrollbind      +tcl             +viminfo         -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/intel/pkgs/vim/7.4/share/vim"

  • Type:
    • [Yes ] Bug
    • Enhancement
    • Feature Request
    • Question
  • OS:
    • All/Other
    • [Yes] Linux
    • OS X
    • Windows
  • Vim:
    • Terminal Vim
    • [Yes] GVim
    • Neovim
@junegunn
Copy link
Owner

There must be an error in your configuration, like missing call plug#end(). Please post your .vimrc.

@dileepkr
Copy link
Author

I have the call plug#end(). I have attached my gvimrc
gvimrc.txt

@junegunn
Copy link
Owner

Your configuration works fine on my MacVim. Which plugin do you find not working?

@dileepkr
Copy link
Author

All of the plugins wont work, I have to do PlugUpdate or PlugInstall to get them working in the active gvim window.

@nfischer
Copy link
Contributor

@dileepkr I just tried your config on gvim on Ubuntu. Syntastic and NERDTree start up fine, so it doesn't sound like a vim-plug issue.

@dileepkr
Copy link
Author

hmm, sounds like some vim issue on my side. has anyone faced such issue earlier?

@dileepkr
Copy link
Author

Ha! finally found a solution for the issue.
I had to put the vim plug statements in .vimrc not .gvimrc .
This fixed my issue.

@johnelliott
Copy link

johnelliott commented Nov 4, 2016

Should you be able to use Plug in gvimrc?

I wanted to do so to simplify vimrc when using it with remote hosts. I found the same issue as @dileepkr and I ended up putting the call to Plug back inside .vimrc inside a has('mccvim_gui') to get the result I wanted.

@junegunn
Copy link
Owner

junegunn commented Nov 4, 2016

A detailed explanation on the startup process can be found in :help startup.

  1. Set the 'shell' and 'term' option
  2. Process the arguments
  3. Execute Ex commands, from environment variables and/or files (vimrc)
  4. Load the plugin scripts.
  5. Set 'shellpipe' and 'shellredir'
  6. Set 'updatecount' to zero, if "-n" command argument used
  7. Set binary options
  8. Perform GUI initializations (gvimrc)
  9. Read the viminfo file
  10. Read the quickfix file
  11. Open all windows
  12. Execute startup commands

As you can see, GUI initialization where .gvimrc is loaded is done after plugin scripts are loaded in step 4. So if you have plug#end() in .gvimrc, &runtimepath is updated after step 4 and plugins will not be correctly loaded.

@johnelliott
Copy link

Thanks @junegunn for the explanation 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants