vim 配置

本文详细介绍了 Vim 编辑器的配置文件 vimrc 的设置,包括语法高亮、自动缩进、行号显示等功能,以及针对不同文件类型和插件的定制设置,如 pydiction 和 CTags 的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


source /usr/share/vim/vim72/vimrc_example.vim

 

if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
   set fileencodings=ucs-bom,utf-8,latin1
endif
set encoding=utf-8

set nocp
set is

colorscheme desert  
set guifont=Monospace:h10  
syntax on

set backspace=indent,eol,start
set history=50    "历史记录
set autoindent    "自动缩进
set smartindent    "智能缩进
set showcmd        "显示正在执行的命令
set nu            "行号
set cursorline    "高亮当前行
set ruler        "标尺
set noerrorbells "禁止错误声音

set mouse=a        "鼠标
set selection=exclusive
set selectmode=mouse,key


set incsearch    "搜索高亮
set showmatch    "括号高亮
set matchtime=5    "括号高亮时间
set ignorecase    "忽略大小写
set scrolloff=3        "光标上下行数


set shortmess=atI    "启动时的提示
set autoread    "自动读取
setlocal noswapfile    "不生成swap
set bufhidden=hide    "buffer丢弃时隐藏
set nobackup        "不自动备份
set fo+=mB    "打开断行模块对亚洲语言支持

set formatoptions=tcrqn2
set tabstop=4        "制表符宽度
set shiftwidth=4
set softtabstop=4
set sw=4            "自动缩进4空格

 


" ================gvim setting===============

if has("gui_running")
    set guioptions-=T        "关闭工具栏
endif


" ====================plugin==================
filetype plugin indent on
filetype plugin on

" pydiction                                                           
let g:pydiction_location='~/.vim/tools/pydiction/complete-dict'                                   
if has("autocmd") 
    autocmd FileType python set complete+=k/path/to/pydiction iskeyword+=.,(
endif  

 

" CTags
"let Tlist_Auto_Open = 1
let Tlist_Ctags_Cmd = '/usr/bin/ctags' " Location of ctags
let Tlist_Sort_Type = "name" " order by
let Tlist_Show_One_File = 1   "only show one file taglist
let Tlist_Use_Right_Window = 1 " split to the right side of the screen
"let Tlist_Compart_Format = 1 " show small meny
let Tlist_Exist_OnlyWindow = 1 " if you are the last, kill yourself
"let Tlist_File_Fold_Auto_Close = 0 " Do not close tags for other files
"let Tlist_Enable_Fold_Column = 1 " Do not show folding tree
"let g:ctags_path='D:\Vim\Intellisense\cppft\ctags.exe'
"let g:ctags_statusline=1

" minibufexpl
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1


" python fold
map <F3> zo
map <F4> zc

 

转载于:https://www.cnblogs.com/c9com/archive/2010/10/03/1841718.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值