$ vim ~/.vimrc
" setting line number
set number
" setting colors
colorscheme elflord
set t_Co=256
" for .py .sh auto build template
au BufNewFile *.py 0r ~/.pyhead.template
au BufNewFile *.sh 0r ~/.bashhead.template
" for python (Tab equal four space and auto )
function! s:python_custom()
function! s:man(keyword)
execute '!pydoc ' . a:keyword
endfunction
setlocal tabstop=4 expandtab shiftwidth=4 number
setlocal foldmethod=indent foldcolumn=4 foldlevel=3 foldnestmax=3
command! -nargs=1 Man call s:man()
cnoremap K :!pydoc
endfunction
if has("autocmd")
autocmd Filetype python call s:python_custom()
endif
$ vim ~/.pyhead.template
#!/usr/bin/env python3.3
#-*- coding: utf-8 -*-
$ vim ~/.bashhead.template
#!/usr/bin/env bash
加入
vim plugin 可以自動產生
author info
可支援
.python .php .c .java .....等格式
需要套件:
2. AuthorInfo
下載完後,並將NERD_commenter
解壓縮
該資料夾會有兩個資料夾
doc 及
plugin
將
authorinfo.vim 搬到
plugin裡面
再將
doc 及
plugin 搬移到
.vim 中
將
python.vim 搬到
.vim/syntax
這樣安裝完成
再到vimrc
設定及完成
$ vim .vimrc let g:vimrc_author='Hugo' let g:vimrc_email='youremail@gmail.com' let g:vimrc_homepage='http://hugo-linuxs.blogspot.tw/' nmap :AuthorInfoDetect filetype plugin indent on let python_highlight_all = 1
以上設定及完成
vim 一個檔案測試一下
$ vim test.py
按 F4 就會看到效果了
沒有留言:
張貼留言