Chinaunix首页 | 论坛 | 博客
  • 博客访问: 103143
  • 博文数量: 75
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 560
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 09:52
文章分类

全部博文(75)

文章存档

2026年(37)

2025年(6)

2022年(2)

2017年(14)

2016年(16)

我的朋友

分类: C/C++

2025-06-23 17:38:35

"行显示
set nu
"启用鼠标
set mouse=a
"开启光亮光标行
set cursorline
"hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
"开启高亮光标列
"set cursorcolumn
"hi CursorColumn cterm=NONE ctermbg=darkred ctermfg=white guibg=darkred guifg=white
syntax on " 语法高亮
"解决vim无法使用退格键问题
set backspace=indent,eol,start
" 为C程序提供自动缩进
" set smartindent
" 使用C样式的缩进
"set cindent
"自动补全
":inoremap ( ()i
":inoremap ) =ClosePair(')')
":inoremap { {}O
":inoremap } =ClosePair('}')
"function! ClosePair(char)
" if getline('.')[col('.') - 1] == a:char
" return "\"
" else
" return a:char
" endif
"endfunction
set tabstop=4 "设置tab健的长度为4
set ruler "设置标尺
set linebreak "关闭自动折行
set tags=tags;
set tags+=./tags " 表示在当前工作目录下搜索tags文件
map <F5> ms:call WESTOS()<cr>'s ##指定快捷键
function WESTOS()
call append(0,"###################################")
call append(1,"# Autho:lsir #")
call append(2,"# Create_Date: ".strftime("%Y-%m-%d %H:%M:%S"). '#')
call append(3,"# Version:1.0 #")
call append(4,"# Mail:mail.lsir.pc #")
call append(5,"# Description: #")
call append(6,"###################################")
endfunction
inoremap <C-o> <Esc>o
inoremap <C-l> <Right>
inoremap <C-h> <Left>
inoremap <C-k> <Up>
inoremap <C-j> <Down>
inoremap <C-b> <PageUp>
inoremap <C-f> <PageDown>
inoremap jj <ESC>
let Tlist_Inc_Winwidth=0
let Tlist_Use_Right_Window=1
let Tlist_File_Fold_Auto_Close=1
let Tlist_Auto_Open=0 "启动vim后自动打开Tlist列表
let Tlist_Exit_OnlyWindow=1 "如果taglist窗口是{BANNED}最佳后一个窗口,则退出vim
let Tlist_GainFocus_On_ToggleOpen=1 "焦点在taglist上
:map tl :TlistToggle
set foldmethod=marker
set shiftwidth=4 "设置<<缩进为4个空格
set nofoldenable "开启vim自动打开所有折叠
filetype plugin on
set fileformats=unix,dos
set hls "开启高亮
set fileencodings=ucs-bom,gbk,utf-8,cp936 "读文件时猜测文件编码
"set fileencoding=gb2312 "文件的保存编码
阅读(36) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~