位置在 /etc/vimrc 中,不过这个是全局的。
个人用户的位置就在 ~/.vimrc。
注释使用的是 " 用一个双引号表示注释。
下面是我的一些个人配置:
" All system-wide defaults are set in $VIMRUNTIME/archlinux.vim (usually just
" /usr/share/vim/vimfiles/archlinux.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vimrc), since archlinux.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing archlinux.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages.
runtime! archlinux.vim
" If you prefer the old-style vim functionalty, add 'runtime! vimrc_example.vim'
" Or better yet, read /usr/share/vim/vim80/vimrc_example.vim or the vim manual
" and configure vim to your own liking!
" do not load defaults if ~/.vimrc is missing
"let skip_defaults_vim=1
" vim插件安装
call plug#begin('~/.vim/plugged')
" 一种主题
Plug 'morhetz/gruvbox'
Plug 'vim-airline/vim-airline'
Plug 'mhinz/vim-startify'
" Markdown支持
Plug 'plasticboy/vim-markdown'
" Markdown Preview
Plug 'iamcco/markdown-preview.nvim',{'do':'cd app && npm install'}
" Markdown生成目录
Plug 'mzlogin/vim-markdown-toc'
" wakatime插件
Plug 'wakatime/vim-wakatime'
" 快速注释插件,直接使用gcc注释,或者使用gc+动作进行注释
Plug 'tpope/vim-commentary'
" LSP,给提示词的
Plug 'neoclide/coc.nvim',{'branch':'release'}
call plug#end()
"关闭vim对于vi的兼容
set nocompatible
"设置backspace键功能
"set backspace=eol,start,indent
"显示行号
set number
"高亮显示当前行
set cursorline
"让一行内容不换行
set nowrap
"tab设为4个空格
"vim默认tab是8个空格
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set smarttab
"新一行与上一行缩进一致
set autoindent
"显示括号匹配
set showmatch
" 用来搜索的,其实对于打代码没什么用处
" 高亮查找匹配
set hlsearch
set incsearch
" 不区分大小写,除非首字母是大写
set ignorecase
set smartcase
" 额外保存撤回
set undofile
"set visualbell
" 开启语法高亮
syntax on
" 开启颜色主题
set t_Co=256
" 右下角显示部分命令
set showcmd
" 命令可以使用tab补全
set wildmenu
set wildmode=list:longest,full
" 显示tab和行尾的多余空格
set list
set listchars=tab:>·,trail:·
" 检测文件类型
filetype on
" 文件编码
set encoding=utf-8
" 设置光标上下的最小边距,让视野不到最下面
set scrolloff=8
" 这个是左右的
set sidescrolloff=5