1" Configuration file for vim2set modelines=0 " CVE-2007-24383
4" Normally we use vim-extensions. If you want true vi-compatibility5" remove change the following statements6set nocompatible " Use Vim defaults instead of 100% vi compatibility7set backspace=2 " more powerful backspacing8
9" Don't write backup file if vim is being called by "crontab -e"10au BufWrite /private/tmp/crontab.* set nowritebackup nobackup11" Don't write backup file if vim is being called by "chpass"12au BufWrite /private/etc/pw.* set nowritebackup nobackup13
14" 自定义设置15" set mouse=a79 collapsed lines
16
17let skip_defaults_vim=118
19syntax enable " 打开语法高亮20syntax on " 开启文件类型侦测21
22colorscheme desert " 着色模式:灰色背景23set guifont=Monaco:h1424
25set autoindent " 自动对齐26set backspace=2 " 设置退格键可用27set cindent shiftwidth=4 " 自动缩进4空格28set smartindent " 智能自动缩进29set ai! " 设置自动缩进30set nu! " 显示行号31set showmatch " 显示括号配对情况32" set mouse=a " 启用鼠标33set ruler " 右下角显示光标位置的状态行34set incsearch " 查找book时,当输入/b时会自动找到35set hlsearch " 开启高亮显示结果36set incsearch " 开启实时搜索功能37set nowrapscan " 搜索到文件两端时不重新搜索38set nocompatible " 关闭兼容模式39set cursorline " 突出显示当前行40set hidden " 允许在有未保存的修改时切换缓冲区41set list " 显示Tab符,使用一高亮竖线代替42set listchars=tab:\|\ " 显示Tab符,使用一高亮竖线代替43set noswapfile " 设置无交换区文件"44set writebackup " 设置无备份文件45set nobackup " 设置无备份文件46set autochdir " 设定文件浏览器目录为当前目录47set foldmethod=syntax " 选择代码折叠类型48set foldlevel=100 " 禁止自动折叠49set laststatus=2 " 开启状态栏信息50set cmdheight=2 " 命令行的高度,默认为1,这里设为251set showtabline=2 " 设置默认显示标签52set clipboard+=unnamed " 与系统公用剪贴板53set autoread " 当文件在外部被修改,自动更新该文件54set scrolloff=5 " 设定光标离窗口上下边界 5 行时窗口自动滚动55set guioptions-=T " 去掉上方工具栏56set autochdir " 自动切换到当前目录"57set autoread " 自动检测并加载外部对文件的修改"58set autowrite " 自动检测并加载外部对文件的修改"59set showcmd " 命令栏显示命令 "60set ignorecase smartcase " 搜索时智能忽略大小写61set tabstop=4 " (ts) 设置一个 <tab> 显示为多少个空格62set expandtab " (et) 把 <tab> 转换为空格63set shiftwidth=4 " (sw) 设置自动缩进的宽度(以及 << 和 >> 命令)64set number65set relativenumber66
67" [总是使用系统粘贴板]68set clipboard=unnamedplus69
70" [删除而不是剪切]71nnoremap d "_d72vnoremap d "_d73nnoremap D "_D74vnoremap D "_D75nnoremap c "_c76vnoremap c "_c77nnoremap C "_C78vnoremap C "_C79xnoremap p pgvy80
81" [括号补全]82inoremap ' ''<ESC>i83inoremap " ""<ESC>i84inoremap ( ()<ESC>i85inoremap [ []<ESC>i86inoremap { {}<ESC>i87
88" [vim-plug]89call plug#begin()90Plug 'mg979/vim-visual-multi', {'branch': 'master'}91call plug#end()92
93" [添加 Packer]94lua require('plugins')
default-init-vim
Article title:default-init-vim
Article author:Julyfun
Release time:Jan 15, 2024
Copyright 2025
Sitemap