MAC vim安裝gruvbox主題


gruvbox是一款優秀的vim配色方案,但是卻不是vim自帶的配色方案,這里記錄一下安裝過程。

gruvbox官網:https://github.com/morhetz/gruvbox

gruvbox安裝說明:https://github.com/morhetz/gruvbox/wiki/Installation

vim插件管理工具有vim-plug和vundle等,這兩者任意使用一種即可。

1、使用vim-plug安裝

官網:https://github.com/junegunn/vim-plug

首先安裝vim-plug,安裝命令:

# Vim (~/.vim/autoload)
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

然后在~/.vimrc中添加如下配置

call plug#begin()
Plug 'morhetz/gruvbox'
call plug#end()
colorscheme gruvbox
set background=dark

然后在vim中執行:PlugInstall 安裝gruvbox即可。

安裝完后執行:source %生效.vimrc配置文件

2、使用vundle安裝

vundle官網:https://github.com/VundleVim/Vundle.vim

首先安裝vundle,安裝命令:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

然后配置~/.vimrc

set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

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

Plugin 'morhetz/gruvbox'

set bg=dark                     "設置背景為黑色
colorscheme gruvbox             "設置主題為 gruvbox
set guioptions=                 "去掉兩邊的scrollbar
set guifont=Monaco:h17          "設置字體和字的大小

保存配置:w並執行:PluginInstall安裝gruvbox,安裝完成后:source %生效.vimrc配置文件即可。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM