1. 程式人生 > >vim的簡單配置

vim的簡單配置

reat ash %s nco cmd 改進 create 定制 配置文件

vim是一個類似於vi的著名的功能強大、高度可定制的文本編輯器,在vi的基礎上改進和增加了很多特性。
作為一個Linux愛好者,vim是最為常用的文本編輯器,默認vim的配置文件.vimrc不存在,我們可以根據自己的需要配置該文件。
[root@sam01| ~/python/test]# cat /root/.vimrc
set encoding=utf-8
set number
syntax enable
set background=dark
autocmd BufNewFile *.sh,*.py exec "call SetTitle()"
func SetTitle()
    if &filetype == 
sh call setline(1,"\#!/usr/bin/env bash") call append(line("."), "\# author: Sam") call append(line(".")+1, "\# created time: ".strftime("%Y-%m-%d %H:%M:%S")) call append(line(".")+2, " ") elseif &filetype == python call setline(1,"\#!/usr/bin/env python"
) call append(line("."), "\# -*- coding:utf-8 -*-") call append(line(".")+1, "\# author: Sam") call append(line(".")+2, "\# created time: ".strftime("%Y-%m-%d %H:%M:%S")) call append(line(".")+3, " ") endif endfunc autocmd BufNewFile * normal G

vim的簡單配置