vimenv

configure vim environment
git clone git://git.unixkoans.com/vimenv.git
Log | Files | Refs | Submodules

commit 91ac8419023d950581aa0d70c6cdc0d1e80945c9
parent a25491baa6fc23efa9c9177457a591ec964aad48
Author: Xiaodong Xu <xxdlhy@gmail.com>
Date:   Sat May 14 21:11:53 +0800

Update config

Diffstat:
.gitmodules | 6++++++
_vim/bundle/css-color | 1+
_vim/bundle/gruvbox | 1+
_vim/conf/base.vim | 7+++++--
_vim/conf/funcs.vim | 57++++++++++++++++++++++++---------------------------------
_vimrc | 4++--
6 files changed, 39 insertions(+), 37 deletions(-)
diff --git a/.gitmodules b/.gitmodules @@ -130,3 +130,9 @@ [submodule "_vim/bundle/emmet"] path = _vim/bundle/emmet url = git://github.com/mattn/emmet-vim.git +[submodule "_vim/bundle/css-color"] + path = _vim/bundle/css-color + url = git://github.com/skammer/vim-css-color.git +[submodule "_vim/bundle/gruvbox"] + path = _vim/bundle/gruvbox + url = git://github.com/morhetz/gruvbox.git diff --git a/_vim/bundle/css-color b/_vim/bundle/css-color @@ -0,0 +1 @@ +Subproject commit 417eaf8a20a6208e34ff167f5636b20f8f812ed8 diff --git a/_vim/bundle/gruvbox b/_vim/bundle/gruvbox @@ -0,0 +1 @@ +Subproject commit 91bae6876031ececf151cc4f28aa5fb8c93681e4 diff --git a/_vim/conf/base.vim b/_vim/conf/base.vim @@ -1,6 +1,6 @@ " " author: Xu Xiaodong <xxdlhy@gmail.com> -" modified: 2015 May 21 +" modified: 2016 May 14 " "-- base --" @@ -15,7 +15,10 @@ vmap <s-tab> <gv "nmap _m :call _set_modeline()<cr> " add markdown header -nmap _m :call MarkdownHeader()<cr> +nmap _m :call _markdown_header()<cr> + +" add script header +nmap _h :call _set_sh_header()<cr> " auto update timestamps autocmd BufWritePre * call _last_modified() diff --git a/_vim/conf/funcs.vim b/_vim/conf/funcs.vim @@ -1,6 +1,6 @@ " " author : Xu Xiaodong <xxdlhy@gmail.com> -" modified : 2016 Apr 26 +" modified : 2016 May 14 " "-- update timestamps --" @@ -23,36 +23,6 @@ function! _set_modeline() exe "normal i# vim: ai:et:ts=2:sw=2:sts=2:tw=78:ft=" . filetype endfunction -"-- add ruby head --" - -function! _ruby_head() - let filename = bufname("%") - let date = strftime("%Y %b %d") - exe "normal i#!/usr/bin/env ruby" - exe "normal o#" - exe "normal o# name : " . filename - exe "normal o# author : Xu Xiaodong <xxdlhy@gmail.com>" - exe "normal o# license : GPL" - exe "normal o# created : " . date - exe "normal o# modified : " . date - exe "normal o#" -endfunction - -"-- add perl head --" - -function! _perl_head() - let filename = bufname("%") - let date = strftime("%Y %b %d") - exe "normal i#!/usr/bin/env perl" - exe "normal o#" - exe "normal o# name : " . filename - exe "normal o# author : Xu Xiaodong <xxdlhy@gmail.com>" - exe "normal o# license : GPL" - exe "normal o# created : " . date - exe "normal o# modified : " . date - exe "normal o#" -endfunction - "-- add perl 'use' statement --" " make sure you have @@ -99,9 +69,9 @@ function! _perl_comment() endif endfunction -"-- Markdown header --" +"-- markdown header --" -function! MarkdownHeader() +function! _markdown_header() let date = strftime("%Y-%m-%d %T") exe "normal iTitle: " exe "normal oDate: " . date @@ -112,3 +82,24 @@ exe "normal oSlug: " exe "normal oVia: " exe "normal o" endfunction + +"-- add script header --" + +function! _set_sh_header() + let filetype = input("File type: ", expand('<cword>')) + let filename = bufname("%") + let date = strftime("%Y %b %d") + if (filetype != '') + exe "normal i#!/usr/bin/env " . filetype + exe "normal o#" + else + exe "normal i#" + endif + exe "normal o# name : " . filename + exe "normal o# author : Xu Xiaodong <xxdlhy@gmail.com>" + exe "normal o# license : GPL" + exe "normal o# created : " . date + exe "normal o# modified : " . date + exe "normal o#" + exe "normal o" +endfunction diff --git a/_vimrc b/_vimrc @@ -1,6 +1,6 @@ " " author: Xu Xiaodong <xxdlhy@gmail.com> -" modified: 2015 May 10 +" modified: 2016 May 13 " "-- source --" @@ -40,7 +40,7 @@ if &t_Co < 256 colorscheme miro8 else set background=dark - colorscheme Tomorrow-Night-Eighties + colorscheme Tomorrow-Night endif "-- file --"