vimrc

"""""""""""""""""""" " =>  全局配置 """""""""""""""""""" "關閉兼容模式 set nocompatible "設置歷史紀錄步數 set history=100 "開啓相關插件 filetype on filetype plugin on filetype indent on "當文件在外部被修改時,自動更新該文件 set autoread "激活鼠標的使用 "set mouse=a 這個不要開,開了就不能使用鼠標右鍵的粘貼功能了 """""""""""""""""""" " => 字體和顏色 """""""""""""""""""" "開啓語法 syntax enable "高亮顯示當前行 set cursorline hi cursorline guibg=#00ff00 hi CursorColumn guibg=#00ff00 """""""""""""""""" " => 代碼摺疊功能 """""""""""""""""" "激活摺疊功能 set foldenable "設置按照語法方式摺疊(可簡寫set fdm=XX) set foldmethod=manual "設置摺疊區域的寬度 set foldcolumn=0 "設置摺疊層數爲3 setlocal foldlevel=3 "設置爲自動關閉摺疊 set foldclose=all """""""""""""""""""" " => 文字處理 """""""""""""""""""" "使用空格鍵代替Tab set expandtab "設置所有的Tab和縮進爲4個空格 set tabstop=4 "設定 << 和 >> 命令移動時的寬度爲4 set shiftwidth=4 "使得按退格鍵時可以一次刪掉4個空格 set softtabstop=4 set smarttab "縮進,自動縮進 set ai  "ai=autoindent "智能縮進 set si "自動換行 set wrap "設置軟寬度 set sw=4 """""""""""""""""""" " => vim界面 """""""""""""""""""" "顯示標尺 set ruler "顯示行數 set nu "設置退格 set backspace=eol,start,indent "backspace and cursor keys wrap to set whichwrap+=<,>,h,l "設置魔術 set magic "關閉錯誤信息響鈴 set noerrorbells "設置匹配的括號 set showmatch "搜索時高亮顯示搜素到的內容 set hlsearch "搜索時不區分大小寫 set ignorecase """"""""""""""""""""" "編碼設置 """"""""""""""""""""" "設置編碼 set encoding=utf-8 "設置文件編碼 set fileencoding=utf-8 "設置終端編碼 set termencoding=utf-8 """""""""""""""""""" " => 其他設置 """""""""""""""""""" set laststatus=2 set pastetoggle= autocmd BufNewFile *.py,*.sh exec ":call SetTitle()" func SetTitle()     if expand("%:e") == 'sh'         call setline(1, "#!/bin/bash")         call setline(2, "#Author:AAA")         call setline(3, "#Time:".strftime("%F %T"))     endif endfunc
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章