liuchengxu / space-vim

:four_leaf_clover: Lean & mean spacemacs-ish Vim distribution
https://liuchengxu.github.io/space-vim/
MIT License
2.85k stars 255 forks source link

airline is only enabled only after any keystroke in vim #410

Closed c02y closed 5 years ago

c02y commented 5 years ago

Before you continue, ensure you have read the README and wiki carefully. Note that low quality issue feedback might be closed directly.

Environment

Please complete these steps and check these boxes (by putting an x inside the brackets) before filing your issue:

Put the contents of :version below:

:version
VIM - Vi IMproved 8.1 (2018 May 18)
Included patches: 1-1467
Compiled by 'http://www.opensuse.org/'
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +clientserver      +diff              +folding           +libcall           +mouse_gpm         +packages          +ruby/dyn          +termguicolors     +virtualedit       -xpm
+arabic            +clipboard         +digraphs          -footer            +linebreak         -mouse_jsbterm     +path_extra        +scrollbind        +terminal          +visual            +xsmp_interact
+autocmd           +cmdline_compl     +dnd               +fork()            +lispindent        +mouse_netterm     +perl              +signs             +terminfo          +visualextra       +xterm_clipboard
+autochdir         +cmdline_hist      -ebcdic            +gettext           +listcmds          +mouse_sgr         +persistent_undo   +smartindent       +termresponse      +viminfo           -xterm_save
-autoservername    +cmdline_info      +emacs_tags        -hangul_input      +localmap          -mouse_sysmouse    +postscript        +startuptime       +textobjects       +vreplace
+balloon_eval      +comments          +eval              +iconv             +lua/dyn           +mouse_urxvt       +printer           +statusline        +textprop          +wildignore
+balloon_eval_term +conceal           +ex_extra          +insert_expand     +menu              +mouse_xterm       +profile           -sun_workshop      +timers            +wildmenu
+browse            +cryptv            +extra_search      +job               +mksession         +multi_byte        +python/dyn        +syntax            +title             +windows
++builtin_terms    +cscope            -farsi             +jumplist          +modify_fname      +multi_lang        +python3/dyn       +tag_binary        +toolbar           +writebackup
+byte_offset       +cursorbind        +file_in_path      +keymap            +mouse             -mzscheme          +quickfix          -tag_old_static    +user_commands     +X11
+channel           +cursorshape       +find_in_path      +lambda            +mouseshape        +netbeans_intg     +reltime           -tag_any_white     +vartabs           -xfontset
+cindent           +dialog_con_gui    +float             +langmap           +mouse_dec         +num64             +rightleft         -tcl               +vertsplit         +xim
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "/etc/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/us
r/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libxkbcommon -I/usr/include/wayland -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0
 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include   -O2 -Wall -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -g -Wall -pipe -fno-strict-aliasing -U_FORTIFY_SOUR
CE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28.1/x86_64-linux-thread-multi/CORE   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-3 -lgdk-3 -lpango
cairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lSM -lICE -lXt -lX11 -lSM -lICE  -lm  -lselinux   -ltinfo -lacl -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib
/perl5/5.28.1/x86_64-linux-thread-multi/CORE  -L/usr/local/lib64 -fstack-protector-strong  -L/usr/lib/perl5/5.28.1/x86_64-linux-thread-multi/CORE -lperl -lm -ldl -lcrypt -lpthread

Put the contents of :SpaceInfo below:

    Current FileType:
    Global Variables:
    let g:spacevim = {
        base = '/home/chz/.space-vim',
        excluded = [],
        gui = 0,
        info = '/home/chz/.space-vim/core/autoload/spacevim/info.vim',
        layers_base = '/layers',
        loaded = ['spacevim', 'fzf', 'better-defaults', 'which-key', 'airline'],
        manifest = {'wasm': {'dir': '/home/chz/.space-vim/layers/+lang/wasm'}, 'spacevim': {'dir': '/home/chz/.space-vim/layers/+distributions/spacevim'}, 'ctrlp': {'dir': '/home/chz/.space-vim/layers/+vim/ctrlp'
}, 'go': {'dir': '/home/chz/.space-vim/layers/+lang/go'}, 'code-snippets': {'dir': '/home/chz/.space-vim/layers/+programming/code-snippets'}, 'graphviz': {'dir': '/home/chz/.space-vim/layers/+lang/graphviz'}, 'so
lidity': {'dir': '/home/chz/.space-vim/layers/+lang/solidity'}, 'git': {'dir': '/home/chz/.space-vim/layers/+version-control/git'}, 'github': {'dir': '/home/chz/.space-vim/layers/+version-control/github'}, 'light
line': {'dir': '/home/chz/.space-vim/layers/+themes/lightline'}, 'games': {'dir': '/home/chz/.space-vim/layers/+fun/games'}, 'java': {'dir': '/home/chz/.space-vim/layers/+lang/java'}, 'javascript': {'dir': '/home
/chz/.space-vim/layers/+lang/javascript'}, 'scala': {'dir': '/home/chz/.space-vim/layers/+lang/scala'}, 'auto-completion': {'dir': '/home/chz/.space-vim/layers/+completion/auto-completion'}, 'ruby': {'dir': '/hom
e/chz/.space-vim/layers/+lang/ruby'}, 'emoji': {'dir': '/home/chz/.space-vim/layers/+fun/emoji'}, 'file-manager': {'dir': '/home/chz/.space-vim/layers/+tools/file-manager'}, 'typescript': {'dir': '/home/chz/.spac
e-vim/layers/+lang/typescript'}, 'lsp': {'dir': '/home/chz/.space-vim/layers/+tools/lsp'}, 'docker': {'dir': '/home/chz/.space-vim/layers/+tools/docker'}, 'deoplete': {'dir': '/home/chz/.space-vim/layers/+complet
ion/deoplete'}, 'programming': {'dir': '/home/chz/.space-vim/layers/+programming/programming'}, 'chinese': {'dir': '/home/chz/.space-vim/layers/+misc/chinese'}, 'which-key': {'dir': '/home/chz/.space-vim/layers/+vim/which-key'}, 'syntax-checking': {'dir': '/home/chz/.space-vim/layers/+checkers/syntax-checking'}, 'ycmd': {'dir': '/home/chz/.space-vim/layers/+tools/ycmd'}, 'formatting': {'dir': '/home/chz/.space-vim/layers/+programming/formatting'}, 'html': {'dir': '/home/chz/.space-vim/layers/+lang/html'}, 'better-defaults': {'dir': '/home/chz/.space-vim/layers/+distributions/better-defaults'}, 'text-align': {'dir': '/home/chz/.space-vim/layers/+vim/text-align'}, 'vue': {'dir': '/home/chz/.space-vim/layers/+lang/vue'}, 'goyo': {'dir': '/home/chz/.space-vim/layers/+fun/goyo'}, 'better-motion': {'dir': '/home/chz/.space-vim/layers/+vim/better-motion'}, 'python': {'dir': '/home/chz/.space-vim/layers/+lang/python'}, 'cscope': {'dir': '/home/chz/.space-vim/layers/+tools/cscope'}, 'airline': {'dir': '/home/chz/.space-vim/layers/+themes/airline'}, 'ctags': {'dir': '/home/chz/.space-vim/layers/+tools/ctags'}, 'c-c++': {'dir': '/home/chz/.space-vim/layers/+lang/c-c++'}, 'unite': {'dir': '/home/chz/.space-vim/layers/+completion/unite'}, 'editing': {'dir': '/home/chz/.space-vim/layers/+programming/editing'}, 'latex': {'dir': '/home/chz/.space-vim/layers/+lang/latex'}, 'markdown': {'dir': '/home/chz/.space-vim/layers/+lang/markdown'}, 'clojure': {'dir': '/home/chz/.space-vim/layers/+lang/clojure'}, 'erlang': {'dir': '/home/chz/.space-vim/layers/+lang/erlang'}, 'elm': {'dir': '/home/chz/.space-vim/layers/+lang/elm'}, 'rust': {'dir': '/home/chz/.space-vim/layers/+lang/rust'}, 'haskell': {'dir': '/home/chz/.space-vim/layers/+lang/haskell'}, 'elixir': {'dir': '/home/chz/.space-vim/layers/+lang/elixir'}, 'tmux': {'dir': '/home/chz/.space-vim/layers/+tools/tmux'}, 'fzf': {'dir': '/home/chz/.space-vim/layers/+tools/fzf'}},
        nvim = 0,
        os = {'linux': 1, 'windows': 0, 'mac': 0},
        plugins = ['liuchengxu/space-vim-dark', 'liuchengxu/space-vim-theme', 'liuchengxu/vim-better-default', 'junegunn/fzf', 'junegunn/fzf.vim', 'kshenoy/vim-signature', 'tpope/vim-rsi', 'xtal8/traces.vim', 'dominikduda/vim_current_word', 't9md/vim-choosewin', 'mhinz/vim-startify', 'ntpeters/vim-better-whitespace', 'haya14busa/is.vim', 'osyo-manga/vim-anzu', 'liuchengxu/vim-which-key', 'vim-airline/vim-airline-themes', 'vim-airline/vim-airline'],
        private_base = '/private',
        timer = 1,
        tmux = 1,
        topics = {'+themes': ['airline', 'lightline'], '+tools': ['cscope', 'ctags', 'docker', 'file-manager', 'fzf', 'lsp', 'tmux', 'ycmd'], '+programming': ['code-snippets', 'editing', 'formatting', 'programming'], '+misc': ['chinese'], '+completion': ['auto-completion', 'deoplete', 'unite'], '+distributions': ['better-defaults', 'spacevim'], '+version-control': ['git', 'github'], '+fun': ['emoji', 'games', 'goyo'], '+lang': ['c-c++', 'clojure', 'elixir', 'elm', 'erlang', 'go', 'graphviz', 'haskell', 'html', 'java', 'javascript', 'latex', 'markdown', 'python', 'ruby', 'rust', 'scala', 'solidity', 'typescript', 'vue', 'wasm'], '+checkers': ['syntax-checking'], '+vim': ['better-motion', 'ctrlp', 'text-align', 'which-key']},
        version = '0.9.0',
        vim8 = 1,
    }
    let g:spacevim#plug#airline#symbols = {
        branch = 'βŽ‡',
        crypt = 'πŸ”’',
        dirty = '!',
        ellipsis = '...',
        keymap = 'Keymap:',
        linenr = 'ΒΆ',
        maxlinenr = ' ㏑',
        modified = '+',
        notexists = 'Ι†',
        paste = 'Þ',
        readonly = '⊝',
        space = ' ',
        spell = 'SPELL',
        whitespace = 'Ξ',
    }
    let g:spacevim_layers = ['fzf', 'better-defaults', 'which-key', 'airline']
    let g:spacevim_plug_home = '~/.vim/plugged'

Problem Description

I found out that airline is only enabled only after any keystroke in vim. Is there any variable or configuration that I can use to disable this feature?

If you design to make vim loaded faster, what if I don't care about the time, since the changes of status line after keystroke in vim annoy me.

liuchengxu commented 5 years ago

Actually this trick could only result in some delay in loading airline, not having to wait some keystroke. Anyway I have added an option for disabling the trick:

let g:spacevim_speed_up_via_timer = 0

function! UserInit() abort
endfunction

function! UserConfig() abort
endfunction
c02y commented 5 years ago

Thanks, it works perfectly.