0%

vim 的基本使用

基本配置

1
2
set encoding=utf-8set rulerset numberset nowrapset ciset ts=4set sw=4syntax enableset history=1000set wildmenuset expandtabset helplang=cnset sts=4set showmatchset hlsearchfiletype onfiletype plugin onfiletype indent onset autowriteset cursorlineset autoreadset scrolloff=2set autoindent
set backspace=indent,eol,startcolorscheme molokailet g:molokai_original = 1let g:rehash256 = 1set guifont=Source\ Code\ Pro\ Regular:h16set background=darkif has("autocmd") au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endifendif

主题

查看主题

执行以下命令(将 vim80 替换为自己的版本,可以到相应目录下 ls 一下即可)

1
ls /usr/share/vim/vim80/colors

列表中的文件就是可使用的 vim 主题。

添加主题

下载相对应的主题文件到 /usr/share/vim/vim80/colors 或者到 ~/.vim/colors即可。

如拷贝 https://github.com/tomasr/molokai/blob/master/colors/molokai.vim 到对应的文件夹便可以使用 molokai 主题了。

使用主题

1
colorscheme molokai