一种我喜欢的vim的配置

来源:互联网 发布:论文表格数据来源 编辑:程序博客网 时间:2024/05/23 14:41

vim默认配置功能较少,以下提供一种我自己喜欢的vim的配置。

打开vi ~/.vimrc(有可能没有这个文件,自己创建就好)

set nu              "show numbersyntax on           "syntax highlightset cursorline      "have cursorlineset cindent         "set smartindent     "set autoindent      "
set ignorecaseset hlsearch        "highlight search wordset shiftwidth=4    "set tabstop=4       "tab = 4map <silent> <F10> :TlistToggle<cr>     "use <Fn> to open/close Tlist"let Tlist_Auto_Open=1                  "每次自动打开Tlistlet Tlist_Show_One_File = 1             "不同时显示多个文件的tag,只显示当前文件的let Tlist_Exit_OnlyWindow = 1           "如果taglist窗口是最后一个窗口,则退出vim"let Tlist_Use_Right_Window = 1         "在右侧窗口中显示taglist窗口set showmatch       "设置自动检测括号是否匹配set incsearchset rulerset laststatus=2    "显示当前文件名autocmd BufReadPost *    \ if line("'\"") > 0 && line("'\"") <= line("$") |        \   exe "normal g`\"" |            \ endif                     "自动跳转到上次文件打开的位置"set fdm=syntax
然后vi一个文件,会发现很漂亮哦

0 0