vim編輯器的簡單配置
博主的系統是Ubuntu16.04,對vim編輯器進行簡單的配置
先進入/etc/vim/vimrc
在檔案的末尾新增下面的內容
set number
set tabstop=4
syntax on
set cursorline
set ruler
syntax on
"SET Comment START
autocmd BufNewFile *.py,*.sh,*.cpp exec ":call SetComment()" |normal 10Go
func SetComment()
if expand("%:e") == 'py'
call setline(1,"#_*_coding:utf8_*_")
elseif expand("%:e") == 'sh'
call setline(1,'#!/bin/bash')
elseif expand("%:e") == 'cpp'
call setline(1,'//C++ file')
call setline(2,'#include<stdio.h>')
endif
call append(1,'#******************************************************** *****')
call append(2,'#')
call append(3,'# Filename: '.expand("%"))
call append(4,'#')
call append(5,'# Author: Silver')
call append(6,'# Email:-->
重啟系統即可