首页 > 系统服务 > 详细

【vim配置】.vimrc

时间:2014-12-24 18:29:26      阅读:176      评论:0      收藏:0      [点我收藏+]

【vim配置】.vimrc

set nocompatible
set enc=utf-8
"-show line number
"set number
"-enable filetype plugin
filetype plugin on
set history=500
syntax on
set autoindent
set smartindent
"-show brackets match
set showmatch
"-show status
set ruler
"-close highline match
"set nohls
"-enable quick search
set incsearch
"-enable paste mode
set paste
"set tabstop=4
set ts=4
"set shiftwidth=4
set sw=4
"set expandtab
set et

if has("autocmd")
filetype plugin indent on
endif
autocmd filetype python setlocal et sta sw=4 sts=4
"-smart append title by file type
func SetTitle()
if &filetype == ‘sh‘
call setline(1, "\#!/bin/bash")
call append(line("."), "\# ")
call append(line(".")+1, "")
else
call setline(1, "\#!/usr/local/bin/python3")
call append(line("."), "\# ")     
call append(line(".")+1, "")
endif
endfunc

autocmd BufNewFile *.py,*.sh exec ":call SetTitle()"
"-go to the end of file
autocmd BufNewFile * normal G
"-press F2 to delete empty line
nnoremap <F2> :g/^\s*$/d<CR>


【vim配置】.vimrc

原文:http://nosmoking.blog.51cto.com/3263888/1594836

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!