验证中...
Languages: VimL
Categories: 常用工具包
Latest update 2018-12-09 10:02
vimrc_none
Raw Copy
filetype plugin indent on " 自适应不同语言的智能缩进
autocmd BufWritePost $MYVIMRC source $MYVIMRC " 让配置变更立即生效
" 基础设置 {{{
set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936 "文件编码格式检测检测
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
set completeopt=menuone,longest
let helptags=$VIM.".vim/doc"
set helplang=cn
set termencoding=utf-8
set encoding=utf-8
set history=500 " 操作记录保存数
set splitright " 纵向分屏时候 右侧新建窗口
set autoread " 自动加载
au FocusLost * :up " 自动保存
set incsearch " 开启实时搜索功能
set ignorecase " 搜索时大小写不敏感
set nocompatible " 关闭兼容模式
set wildmenu " vim 自身命令行模式智能补全
let mapleader="," " 定义快捷键的前缀,即<Leader>
"set colorcolumn=81 " 单行长度提醒
set belloff=all " 关闭错误音效
"set fixendofline
"set langmap
"set termguicolors
" 禁止显示滚动条
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
" 禁止显示菜单和工具条
set guioptions-=m
set guioptions-=T
set laststatus=2 " 总是显示状态栏
set ruler " 显示光标当前位置
" 开启行号显示
set relativenumber
set number
" 高亮显示当前行/列
"set cursorline
"set cursorcolumn
set hidden
set hlsearch " 高亮显示搜索结果
set wrap " 折行
syntax enable " 开启语法高亮功能
syntax on " 允许用指定语法高亮配色方案替换默认方案
" 缩进----
set expandtab " 将制表符扩展为空格
set tabstop=4 " 设置编辑时制表符占用空格数
set shiftwidth=4 " 设置格式化时制表符占用空格数
set softtabstop=4 " 让 vim 把连续数量的空格视为一个制表符
" 折叠相关
set nofoldenable " 启动 vim 时关闭折叠代码
"set foldmethod=manual " 折叠规则
autocmd FileType c,cpp,perl set foldmethod=syntax
autocmd FileType vim set foldmethod=marker
autocmd FileType python set foldmethod=indent
" 光标移动到底部时候保持一定距离
set scrolloff=3
set sidescrolloff=6
if exists('$TMUX')
set term=xterm-256color
endif
if &term =~ '256color'
"Page keys http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/FAQ
set t_ut=
endif
"}}}
" 快捷键修改 {{{
" <leader> y / p 复制/粘贴 到系统剪切板
nnoremap <Leader>y "+y
nmap <Leader>p "+p
" [[ 移动操作优化
map [[ ?{<CR>w99[{
map ][ /}<CR>b99]}
map ]] j0[[%/{<CR>
map [] k$][%?}<CR>
" 窗口跳转
nnoremap <C-l> <C-W>l
nnoremap <C-h> <C-W>h
nnoremap <C-k> <C-W>k
nnoremap <C-j> <C-W>j
" }}}
" 字体 相关 {{{
if has('unix')
"set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 13.5
"set guifont=Fira\ Mono\ for\ Powerline\ 16
set guifont=Fira\ Mono\ for\ Powerline\ 13.5
endif
" 配色方案
colorscheme desert
" }}}

Comment list( 0 )

You need to Sign in for post a comment

Help Search

183227_9af5e6a8_1826025 111910_4d91f001_1826025