autocmd BufWritePost $MYVIMRC source $MYVIMRC " 当保存vimrc时让配置变更立即生效"
let mapleader=";" " 定义前缀键
" 这里是vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'Vundle.vim'
Plugin 'scrooloose/nerdtree' "文件目录
Plugin 'mattn/emmet-vim' "前端神器
"Plugin 'davidhalter/jedi-vim' "python 自动补全
"Plugin 'jpalardy/vim-slime' "设置slime
"Plugin 'altercation/vim-colors-solarized' "主题颜色
Plugin 'vim-airline/vim-airline' "airline
"Plugin 'python-mode/python-mode' "pythonmode
""Plugin 'tpope/vim-surround' "增加配对符号
""Plugin 'scrooloose/nerdcommenter' "快速注释
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'w0rp/ale'
""Plugin 'tpope/vim-fugitive'
""majutsushi/tagbar
""kien/ctrlp.vim
""terryma/vim-multiple-cursors
""easymotion/vim-easymotion
""ervandew/supertab
""Rykka/riv.vim
""tpope/vim-dispatch
call vundle#end() " required
filetype plugin indent on " required
""""""""""""""
" inbuild设置
" 设置切换buffer
nnoremap <TAB> :bn<CR>
" 设置符号自动匹配
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
inoremap ( ()<ESC>i
inoremap < <><ESC>i
inoremap [ []<ESC>i
inoremap { {}<ESC>i
" 设置跳出自动补全的括号
func SkipPair()
if getline('.')[col('.') - 1] == ')' || getline('.')[col('.') - 1] == '>' || getline('.')[col('.') - 1] == ']' || getline('.')[col('.') - 1] == '"' || getline('.')[col('.') - 1] == "'" || getline('.')[col('.') - 1] == '}'
return "\<ESC>la"
else
return "\t"
endif
endfunc
" 将tab键绑定为跳出括号
inoremap <TAB> <c-r>=SkipPair()<CR>
"""""""""
" 显示相关
syntax on
set nu " 显示行号
set cc=80 "高亮第80列
set autoindent "自动缩进
set expandtab " tab替换空格
set tabstop=4 " tab的长度为4
set incsearch " 设置实时搜搜
set hlsearch " 高亮被找到的文本
""set showmatch " 显示括号的匹配情况
set cursorline "突出显示当前行"
"set cursorcolumn "突出显示当前列"
set lines=45 columns=118 " 打开时显示的行
""""""""""""
" slime设置
""let g:slime_target = "tmux"
""let g:slime_paste_file = "$HOME/.slime_paste"
""let g:slime_paste_file = tempname()
""let g:slime_default_config = {"socket_name": split($TMUX, ",")[0], "target_pane": ":.1"}
""""""""""""""
" airline设置
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#buffer_nr_show = 1
"""""""""""""""
" 设置NerdTree
map <F3> :NERDTreeToggle<CR>"
let g:NERDTreeWinSize=15
" 设vim-indent-guides
set ts=4 sw=4 et
let g:indent_guides_start_level=1
let g:indent_guides_guide_size=1
let g:indent_guides_enable_on_vim_startup = 1
colorscheme desert
set background=dark
""""""""""""
" 设置emmet
let g:user_emmet_install_global = 0
" 设置ale ale
let g:ale_linters = {'python': ['flake8'], 'reStructuredText': ['rstcheck']}
let g:ale_fixers = {'python': ['remove_trailing_lines', 'trim_whitespace', 'autopep8']}
vimrc
最新推荐文章于 2024-04-03 14:13:19 发布