ryanoasis / vim-devicons

Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
MIT License
5.64k stars 265 forks source link

devicons on mac doesn't work #180

Closed sunliang711 closed 8 years ago

sunliang711 commented 8 years ago

why can't I see the icons,please help me,this is the screenshot image image image

And I use ./install.sh to install all fonts of nerd fonts.

my .vimrc:

set nocompatible              " be iMproved, required
filetype off                  " required

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"       Basic Config
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set laststatus=2
syntax on
set incsearch
set hlsearch
set relativenumber
"如果用ssh的连接工具,比如putty xshell连接远程服务器
"打开vim的话,它的t_Co会设置成8,这样airline的状态栏
"就不会有五颜六色了,所以这里设置成256来让airline正
"确的显示颜色
set t_Co=256
set nobackup
set wrap
set confirm
set shiftwidth=4
set tabstop=4
set expandtab
set smarttab
set backspace=indent,eol,start whichwrap+=<,>,[,]
let mapleader=','

let os = substitute(system("uname"),"\n","","")
if os ==? "Darwin"
    "光标形状,否则在iterm2中显示的不容易看清
    " let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
    " let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
    "for macvim
    "这个字体要首先安装,官方地址:https://github.com/powerline/fonts
    "用git clone下载之后,执行里面的install.sh
    " set guifont=Source\ Code\ Pro\ for\ Powerline:h16
    set guifont=Anonymous\ Pro\ for\ Powerline:h16
endif

hi PmenuSel guifg=#dddddd guibg=#5978f2 ctermfg=black ctermbg=yellow

augroup LastPosition
    au!
    autocmd BufReadPost *
        \ if line("'\"") > 1 && line("'\"") <= line("$")|
        \ execute "normal! g`\""|
        \ endif

augroup END

nnoremap <silent> <leader>n :bn<CR>
nnoremap <silent> <leader>p :bp<CR>
nnoremap <silent> <leader>e :tab e ~/.vimrc<CR>

set termencoding=utf8
set encoding=utf8
set fileencodings=utf8,ucs-bom,gbk,cp936,gb2312,gb18030

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'L9'
"查找文件
Plugin 'ctrlpvim/ctrlp.vim'
"状态栏
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
"括号补全
Plugin 'jiangmiao/auto-pairs'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"   html 相关插件
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"自动补全xml html标签
Plugin 'docunext/closetag.vim'
"始终高亮包含当前光标位置的html标签
Plugin 'Valloric/MatchTagAlways'

"注释插件
"快捷键gc(visual模式下)gcc(Normal 模式下)
Plugin 'tpope/vim-commentary'
"起始页插件
Plugin 'mhinz/vim-startify'
"同时高亮所有的匹配单词
Plugin 'haya14busa/incsearch.vim'
"对齐插件 :Tab /<char-to-be-alignment>
Plugin 'godlygeek/tabular'
"头文件源文件切换插件
Plugin 'vim-scripts/a.vim'

Plugin 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle'  }
"快速给词加环绕符号,例如单引号 双引号括号
"常用命令
"替换命令: cs<old-char><new-char>  cst<new-char>  t表示html标签(tag)
"删除命令: ds<deleted-char>
"添加命令: csw<new-char>    w表示write
"添加整行: yss<new-char>
Plugin 'tpope/vim-surround'
"使用surround操作之后,使用.号重复操作
Plugin 'tpope/vim-repeat'

"自动添加结尾 比如有些语言输入if,会自动添加endif
Plugin 'tpope/vim-endwise'

"给其他插件比如ctrlp nerdtree startify增加图标
Plugin 'ryanoasis/vim-devicons'

"文档生成工具
"常用命令: :Dox自动生成函数说明  :DoxAuthor自动生成文件说明
Plugin 'vim-scripts/DoxygenToolkit.vim'

" Plugin 'Valloric/YouCompleteMe'
" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"         CtrlP
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:ctrlp_map = '<leader>f'
let g:ctrlp_working_path_mode = '0'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"         Vim-airline
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"the fonts airline used is here ->  https://github.com/powerline/fonts
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" let g:airline_theme="luna" 
let g:airline_detect_modified=1
let g:airline_detect_paste=1

let g:airline#extensions#default#layout = [
            \ [ 'a', 'b', 'c' ],
            \ [ 'x', 'y', 'z' ]
            \ ]
" 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_left_sep = ''
 let g:airline_left_alt_sep = ''
 let g:airline_right_sep = ''
 let g:airline_right_alt_sep = ''
let g:airline_symbols = {}
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''

" let g:airline_symbols.crypt = '🔒'
" let g:airline_symbols.linenr = '␊'
" let g:airline_symbols.linenr = '␤'
" let g:airline_symbols.linenr = '¶'
" let g:airline_symbols.maxlinenr = '☰'
" let g:airline_symbols.maxlinenr = ''
" let g:airline_symbols.branch = '⎇'
" let g:airline_symbols.paste = 'ρ'
" let g:airline_symbols.paste = 'Þ'
" let g:airline_symbols.paste = '∥'
" let g:airline_symbols.spell = 'Ꞩ'
" let g:airline_symbols.notexists = '∄'
" let g:airline_symbols.whitespace = 'Ξ'

"除了section_b之外,默认都有设置,而且设置的也都蛮好用的
"就不改它们了,这里在section_b处显示当前时间
let g:airline_section_b = '<0X%B> %{strftime("[%H:%M %m/%d/%Y]")}'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"以下的设置可以测试出section a,b,c,gutter,x,y,z在statusline中的具体位置
" let g:airline_section_a = 'section a'
" let g:airline_section_b = 'section b'
" let g:airline_section_c = 'section c'
" let g:airline_section_gutter = 'section gutter'
" let g:airline_section_x = 'section x'
" let g:airline_section_y = 'section y'
" let g:airline_section_z = 'section z'
" let g:airline_section_error = 'section error'
" let g:airline_section_warning = 'section warning'
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"       incsearch.vim config
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"       DoxyGenToolKit Config
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:DoxygenToolkit_briefTag_pre="@brief  "
let g:DoxygenToolkit_paramTag_pre="@param "
let g:DoxygenToolkit_returnTag="@returns   "
let g:DoxygenToolkit_blockHeader="--------------------------------------------------------------------------"
let g:DoxygenToolkit_blockFooter="--------------------------------------------------------------------------"
let g:DoxygenToolkit_authorName="孙亮 email:sunliang711@gmail.com"
let g:DoxygenToolkit_licenseTag="GPL 2.0"

let s:licenseTag = "Copyright(C)\<enter>"
let s:licenseTag = s:licenseTag . "For free\<enter>"
let s:licenseTag = s:licenseTag . "All right reserved\<enter>"
let g:DoxygenToolkit_licenseTag = s:licenseTag
let g:DoxygenToolkit_briefTag_funcName="yes"
let g:doxygen_enhanced_color=1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"      YouCompleteMe Config 
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:ycm_global_ycm_extra_conf='~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 0
let g:ycm_error_symbol = '>>'
let g:ycm_warning_symbol = '>*'
let g:ycm_seed_identifiers_with_syntax = 1 
let g:ycm_complete_in_comments = 1
let g:ycm_complete_in_strings = 1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"
"      Nerdtree Config 
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Toggle NerdTree
nnoremap <silent> <S-Tab> :NERDTreeToggle<CR>
ryanoasis commented 8 years ago

It looks like your guifont I'd set to a powerline font not a nerd font.

Try this:

:set guifont?

For more debugging help see the Wiki FAQ

sunliang711 commented 8 years ago

After setting the terminal font to a sort of nerd font,it works,thank you!!

ryanoasis commented 8 years ago

No problem 😄 glad you got it working 👍

c3-pennsu commented 3 years ago

I am on macvim, and I need to go to the menu and set font under "edit" -> "show font" to work but thanks.