Skip to content

Instantly share code, notes, and snippets.

@LittleNewton
Last active July 21, 2022 07:51
Show Gist options
  • Save LittleNewton/83c0899c2777e562d8583fc4ca6a6f4a to your computer and use it in GitHub Desktop.
Save LittleNewton/83c0899c2777e562d8583fc4ca6a6f4a to your computer and use it in GitHub Desktop.
Vim 配置文件
"
" Description: Personal Vim .vimrc configuration file
" Author: 刘鹏
" Date: 2021, Oct. 9
" Corresponding: littleNewton6@gmail.com
"
"================================ Syntax BEGIN ================================
" 开启语法检测
syntax enable
syntax on
"================================ Syntax END ================================
"================================ Filetype BEGIN ================================
" 开启文件类型检测
filetype on
filetype indent on
filetype plugin indent on
"================================ Filetype END ================================
"================================ Indect BEGIN ================================
" 缩进设置
set tabstop=4
set shiftwidth=4
set expandtab
set smarttab
"================================ Indect END ================================
"================================ Search BEGIN ================================
" 高亮搜索结果
set hlsearch
" 增量搜索
set incsearch
"================================ Search END ================================
"================================ Copy & Paste BEGIN ================================
" 复制、粘贴设置
set paste
set clipboard=unnamed
"================================ Copy & Paste END ================================
autocmd InsertEnter * se cul
set number
set encoding=utf-8
"======================== VIM Plug =================================
call plug#begin('~/.vim/plugged')
" (1) 开始界面美化
Plug 'mhinz/vim-startify'
" (2) 状态栏美化
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" (3) 增加代码缩进线条
Plug 'Yggdroot/indentLine'
let g:indentLine_enabled = 1
let g:indentLine_char_list = ['┆', '┊']
" (4) 代码自动补全插件
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
" (5) 文件目录辅助插件
Plug 'preservim/nerdtree'
" Vim Awesome 网站
call plug#end()
nnoremap <leader>v :NERDTreeFind<cr>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
@LittleNewton
Copy link
Author

首先安装 vim-plug 插件管理器:

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

然后进入 vim,命令行内执行:

:PlugInstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment