1.基本語法 2.自動加入文件頭 在etc/vimic 源碼: 3.修改為不提示自動創建(也可以提示自動創建) 源碼: 3.shell的高亮顯示 ...
1.基本語法
語法高亮
:syntax on/off
顯示行號
set number/nonumber
自動縮進
set autoindent
set cindent
2.自動加入文件頭
在etc/vimic
源碼:
## vim 頭部自動生成 function AddTitle() call setline(1,"#!/usr/bin/env bash") call append(1,"# -*- coding: utf-8 -*-") call append(2,"#Filename: " . expand("%")) call append(3,"#Author: Liuchao") call append(4,"#Email: [email protected]") call append(5,"#Date: " . strftime("%Y-%m-%d")) call append(6,"#Desc: ") call append(7,"") call append(8,"source /devOps/shell/common/functions") call append(9," ") endf ## 提示按'F4',會調用AddTitle函數 map <F4> : call AddTitle() <cr>
3.修改為不提示自動創建(也可以提示自動創建)
源碼:
autocmd BufNewFile *.php,*.sh exec ":call AddTitle()"
function AddTitle()
call setline(1,"#!/usr/bin/env bash")
call append(1,"# -*- coding: utf-8 -*-")
call append(2,"#Filename: " . expand("%"))
call append(3,"#Author: Liuchao")
call append(4,"#Email: [email protected]")
call append(5,"#Date: " . strftime("%Y-%m-%d"))
call append(6,"#Desc: ")
call append(7,"")
call append(8,"source /devOps/shell/common/functions")
call append(9," ")
endf
3.shell的高亮顯示