美文网首页Latex
MacOS Vim插件 airline相关的Powerline

MacOS Vim插件 airline相关的Powerline

作者: Yao_Fairytale | 来源:发表于2018-09-13 16:31 被阅读0次

    安装Powerline字体包

    git clone https://github.com/powerline/fonts.git ~/.fonts
    sh ~/.fonts/install.sh
    

    在.vimrc 中配置airline,打开macvim后输入 set guifont=*便会跳出字体选择界面,选择带powerline后缀的字体。然后再次输入命令set guifont=按tab就可以看到该字体的完整命令行语句。由于想齐箭头,我选择了MesloLGSDZForPowerline字体

    ""-------------------------------------------------------------
    " AIRLINE
    " ------------------------------------------------------------
    " enable powerline fonts
    let g:airline_powerline_fonts = 1
    " enable tabline
    let g:airline#extensions#tabline#enabled = 1
    let g:airline#extensions#tabline#left_sep = ' '
    let g:airline#extensions#tabline#left_alt_sep = '|'
    " show tab number in tab line
    let g:airline#extensions#tabline#tab_nr_type = 1
    let g:airline#extensions#tabline#formatter = 'default'
    let g:airline#extensions#vimtex#left = ""
    let g:airline#extensions#vimtex#right = ""
    "
    set laststatus=2 " Show the statusline
    set noshowmode " Hide the default mode text
    "  airline symbols dictionary
    if !exists('g:airline_symbols')
        let g:airline_symbols = {}
    endif
    if has("gui_running")
      set guifont=MesloLGSDZForPowerline-Regular:h16
    endif
    let g:airline_left_sep = ''
    let g:airline_left_alt_sep = ''
    let g:airline_right_sep = ''
    let g:airline_right_alt_sep = ''
    let g:airline_symbols.branch = ''
    let g:airline_symbols.readonly = ''
    let g:airline_symbols.linenr = ''
    
    

    如果要在terminal中使用powerline字体,在preference中选择带powerline后缀的字体即可。


    更改terminal字体

    相关文章

      网友评论

        本文标题:MacOS Vim插件 airline相关的Powerline

        本文链接:https://www.haomeiwen.com/subject/utzwgftx.html