Skip to content

Instantly share code, notes, and snippets.

@yuya-matsushima
Created June 16, 2012 05:31
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuya-matsushima/2940078 to your computer and use it in GitHub Desktop.
Save yuya-matsushima/2940078 to your computer and use it in GitHub Desktop.
とりあえずこれだけあれば…的な
" e2esound color scheme based on ir_black
set background=dark
hi clear
if exists("syntax_on")
syntax reset
endif
let g:colors_name = "e2esound"
"hi Example guifg=NONE guibg=NONE gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
" General colors
hi Normal guifg=#f6f3e8 guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi NonText guifg=#555555 guibg=black gui=NONE ctermfg=gray ctermbg=NONE cterm=NONE
hi Cursor guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=reverse
hi CursorIM guifg=black guibg=red gui=NONE ctermfg=black ctermbg=white cterm=reverse
hi LineNr guifg=#4D4D4D guibg=black gui=NONE ctermfg=cyan ctermbg=black cterm=NONE
hi VertSplit guifg=#202020 guibg=#222222 gui=NONE ctermfg=darkblue ctermbg=darkblue cterm=NONE
hi StatusLine guifg=#CCCCCC guibg=#222222 gui=NONE ctermfg=white ctermbg=darkblue cterm=NONE
hi StatusLineNC guifg=black guibg=#222222 gui=NONE ctermfg=black ctermbg=darkblue cterm=NONE
hi Folded guifg=#a0a8b0 guibg=#384048 gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Title guifg=#f6f3e8 guibg=NONE gui=bold ctermfg=NONE ctermbg=NONE cterm=NONE
hi Visual guifg=NONE guibg=darkblue gui=NONE ctermfg=NONE ctermbg=darkblue cterm=NONE
hi SpecialKey guifg=#808080 guibg=#131313 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi WildMenu guifg=green guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE
hi PmenuSbar guifg=black guibg=white gui=NONE ctermfg=black ctermbg=white cterm=NONE
"hi Ignore guifg=gray guibg=black gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi Error guifg=NONE guibg=NONE gui=undercurl ctermfg=white ctermbg=red cterm=NONE guisp=#FF6C60
hi ErrorMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE
hi WarningMsg guifg=white guibg=#FF6C60 gui=BOLD ctermfg=white ctermbg=red cterm=NONE
" Message displayed in lower left, such as --INSERT--
hi ModeMsg guifg=black guibg=#C6C5FE gui=BOLD ctermfg=black ctermbg=cyan cterm=BOLD
if version >= 700 " Vim 7.x specific colors
hi CursorLine guifg=NONE guibg=#333333 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD
hi CursorColumn guifg=NONE guibg=#333333 gui=NONE ctermfg=NONE ctermbg=NONE cterm=BOLD
hi MatchParen guifg=#f6f3e8 guibg=#857b6f gui=BOLD ctermfg=white ctermbg=blue cterm=NONE
hi Pmenu guifg=#f6f3e8 guibg=#444444 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi PmenuSel guifg=#000000 guibg=#cae682 gui=NONE ctermfg=NONE ctermbg=NONE cterm=NONE
hi Search guifg=black guibg=yellow gui=NONE ctermfg=black ctermbg=yellow cterm=NONE
endif
" Syntax highlighting
hi Comment guifg=#666666 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
hi String guifg=#A8FF60 guibg=NONE gui=NONE ctermfg=green ctermbg=NONE cterm=NONE
hi Number guifg=#FF73FD guibg=NONE gui=NONE ctermfg=magenta ctermbg=NONE cterm=NONE
hi Keyword guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi PreProc guifg=#96CBFE guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi Conditional guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi Todo guifg=#8f8f8f guibg=NONE gui=NONE ctermfg=red ctermbg=NONE cterm=NONE
hi Constant guifg=#99CC99 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Identifier guifg=#C6C5FE guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Function guifg=#FFD2A7 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
hi Type guifg=#FFFFB6 guibg=NONE gui=NONE ctermfg=yellow ctermbg=NONE cterm=NONE
hi Statement guifg=#6699CC guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE
hi Special guifg=#E18964 guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
hi Delimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi Operator guifg=white guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
hi Underlined ctermfg=darkgray guifg=darkgray
"テキスト文字数制限
if exists('&colorcolumn')
hi ColorColumn guifg=#cccccc guibg=#222222 gui=NONE ctermfg=black ctermbg=gray cterm=NONE
endif
hi link Character Constant
hi link Boolean Constant
hi link Float Number
hi link Repeat Statement
hi link Label Statement
hi link Exception Statement
hi link Include PreProc
hi link Define PreProc
hi link Macro PreProc
hi link PreCondit PreProc
hi link StorageClass Type
hi link Structure Type
hi link Typedef Type
hi link Tag Special
hi link SpecialChar Special
hi link SpecialComment Special
hi link Debug Special
" Special for Ruby
hi rubyRegexp guifg=#B18A3D guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
hi rubyRegexpDelimiter guifg=#FF8000 guibg=NONE gui=NONE ctermfg=brown ctermbg=NONE cterm=NONE
hi rubyEscape guifg=white guibg=NONE gui=NONE ctermfg=cyan ctermbg=NONE cterm=NONE
hi rubyInterpolationDelimiter guifg=#00A0A0 guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE
hi rubyControl guifg=#6699CC guibg=NONE gui=NONE ctermfg=blue ctermbg=NONE cterm=NONE "and break, etc
hi rubyGlobalVariable guifg=#FFCCFF guibg=NONE gui=NONE ctermfg=lightblue ctermbg=NONE cterm=NONE "yield
hi rubyStringDelimiter guifg=#336633 guibg=NONE gui=NONE ctermfg=lightgreen ctermbg=NONE cterm=NONE
"rubyInclude
"rubySharpBang
"rubyAccess
"rubyPredefinedVariable
"rubyBoolean
"rubyClassVariable
"rubyBeginEnd
"rubyRepeatModifier
"hi link rubyArrayDelimiter Special " [ , , ]
"rubyCurlyBlock { , , }
hi link rubyClass Keyword
hi link rubyModule Keyword
hi link rubyKeyword Keyword
hi link rubyOperator Operator
hi link rubyIdentifier Identifier
hi link rubyInstanceVariable Identifier
hi link rubyGlobalVariable Identifier
hi link rubyClassVariable Identifier
hi link rubyConstant Type
" Special for Java
" hi link javaClassDecl Type
hi link javaScopeDecl Identifier
hi link javaCommentTitle javaDocSeeTag
hi link javaDocTags javaDocSeeTag
hi link javaDocParam javaDocSeeTag
hi link javaDocSeeTagParam javaDocSeeTag
hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
hi javaDocSeeTag guifg=#CCCCCC guibg=NONE gui=NONE ctermfg=darkgray ctermbg=NONE cterm=NONE
"hi javaClassDecl guifg=#CCFFCC guibg=NONE gui=NONE ctermfg=white ctermbg=NONE cterm=NONE
" Special for XML
hi link xmlTag Keyword
hi link xmlTagName Conditional
hi link xmlEndTag Identifier
" Special for HTML
hi link htmlTag Keyword
hi link htmlTagName Conditional
hi link htmlEndTag Identifier
" Special for Javascript
hi link javaScriptNumber Number
" Special for Python
"hi link pythonEscape Keyword
" Special for CSharp
hi link csXmlTag Keyword
" Special for PHP
"set verbosefile=~/vimlog
syntax on
filetype indent on
filetype plugin on
"load colorscheme
source .e2esound.vim
set iminsert=0
set number
set browsedir=buffer
set nocompatible
set hidden
set incsearch
set smartcase
set wrapscan
set imsearch=0
set hlsearch
noremap <esc><esc> :nohlsearch<CR><esc>
set nolist
au FileType html setlocal list
set listchars=eol:$,tab:>\ ,extends:<
set tabstop=2
set expandtab
au FileType php,html,css setlocal noexpandtab
set shiftwidth=2
set autoindent
set cindent
set fileformat=unix
set backspace=2
set whichwrap=b,s,h,l,<,>,[,]
set formatoptions+=mM
set showmatch
set noswapfile
set nobackup
set autoread
set wildmenu
set cmdheight=2
set showcmd
set statusline=\%t\%=\[%l/%L]\[%{&filetype}]\[%{&fileencoding}]
set laststatus=2
set notitle
set diffopt=filler,iwhite
set nf=
set splitbelow
set visualbell t_vb=
set diffopt-=filler diffopt=iwhite,horizontal
set fileencodings=ucs-bom,utf-8,euc-jp,iso-2022-jp,cp932,utf-16,utf-16le
au FileType gitcommit,hgcommit setlocal textwidth=72
au FileType rst setlocal textwidth=80
au FileType javascript,coffee setlocal textwidth=80
au FileType php setlocal textwidth=80
if exists('&colorcolumn')
au FileType rst,gitcommit,hgcommit setlocal colorcolumn=+1
endif
"Popup Color
highlight PMenu ctermbg=0
highlight PMenuSel ctermbg=4
highlight PMenuSbar ctermbg=0
highlight PMenuThumb ctermbg=0
"折り畳み設定
set foldenable
set foldmethod=syntax
"set foldlevel=1
set fillchars=vert:\1
au FileType gitcommit,hgcommit,ref-refe,ref-phpmanual set nofoldenable
au FileType scss,css setlocal foldmethod=marker foldmarker={,}
au FileType html,xhtml set foldmethod=indent
"php限定設定
let php_sql_query=1 "文字列中のSQLをハイライト
"sudoで保存
command! Sudow :w !sudo tee >/dev/null %
noremap ; :
noremap : ;
imap <> <><Left>
"buffer
nnoremap <Leader>n :bn<CR>
nnoremap <Leader>b :bp<CR>
nnoremap <Leader>d :bd<CR>
nnoremap <Leader>l :ls<CR>
au BufWritePost *.php call PHPLint()
au BufWritePost *.rb call RubyLint()
au FileType php noremap <C-l> :call PHPLint()<CR>
au FileType ruby noremap <C-l> :call RubyLint()<CR>
au Filetype php imap <buffer> <? <?php
au FileType * imap <buffer> , ,
set complete+=k
au BufWritePre *.php,*.rb,*.js,*.bat,*.css,*.py call RTrim()
au BufWritePre * call LTrim()
au BufWritePre *.sass,*.scss call SassCorrect()
au BufWritePre *.php,*.js,*.html,*.rb,*.css,*.py setlocal fileformat=unix
au BufWritePre *.php,*.js,*.rb,*.py setlocal fenc=UTF-8
"CD.vim
au BufEnter * execute ":lcd " . expand("%:p:h")
function! PHPLint()
let result = system( &ft . ' -l ' . bufname(""))
echo result
endfunction
function! RubyLint()
let result = system( &ft . ' -c ' . bufname(""))
echo result
endfunction
"行末のスペース&tab削除
function! RTrim()
let s:cursor = getpos(".")
if &filetype == "markdown"
match Underlined /\s\{2}$/
%s/\s\+\(\s\{2}\)$/\1/e
else
%s/\s\+$//e
endif
call setpos(".", s:cursor)
endfunction
"行頭のスペース&tab削除
function! LTrim()
let s:cursor = getpos(".")
%s/^(\t|\s)\+$//e
call setpos(".", s:cursor)
endfunction
"Sassで:の後に必ず1スペース入れる
function! SassCorrect()
let s:cursor = getpos(".")
%s/\(\S\+\):\s\+\(.\+$\)/\1:\2/e
%s/\([^\s\t:]\+\):\(\/\/\|link\|visited\|active\|hover\|focus\|lang\|before\|after\|first\-line\|first\-letter\|first\-child\|last\-child\|target\|enabled\|disabled\|checked\|indeterminate\|root\|nth\-child\(.\+\)\|nth\-last\-child\(.\+\)\|nth\-of\-type\(.\+\)\|nth\-last\-of\-type\(.\+\)\|first\-of\-type\|last-of\-type\|only\-child\|empty\|contains\(\)\|not\(\)\)\@!/\1: \2/e
call setpos(".", s:cursor)
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment