Skip to content

Instantly share code, notes, and snippets.

@gypark
Created December 2, 2013 09:58
Show Gist options
  • Save gypark/7747344 to your computer and use it in GitHub Desktop.
Save gypark/7747344 to your computer and use it in GitHub Desktop.
" Vim syntax file (for including only)
" html w/ Perl as a preprocessor in __DATA__
" Language: Mojo epl templates stored in Perl __DATA__
" Maintainer: yko <yko@cpan.org>
" Version: 0.04
" Last Change: 2011 Aug 09
" Location: http://github.com/yko/mojo.vim
"
" Thanks to Viacheslav Tykhanovskyi for simplified region syntax
"
" Possible configuration:
"
" let mojo_highlight_data = 1
" let mojo_disable_html = 1
"
" For highlight templates in __DATA__ add following line to your .vimrc:
" let mojo_highlight_data = 1
if !exists("mojo_highlight_data")
finish
endif
if !exists("b:current_syntax")
echoerr "MojolisiousTemplate can only be included in existing syntax"
finish
endif
" Store current syntax name
let cs = b:current_syntax
unlet b:current_syntax
if !exists("mojo_disable_html")
unlet! b:current_syntax
syn include @Html syntax/html.vim
endif
syntax include @Epl syntax/epl.vim
" Set up hl of filename headers
syn match MojoFileNameStart "@@" contained
syn region MojoFileContainer start=/@@/ end=/^__END__\|@@/me=s-1 contains=@Epl,@Html,MojoFileName contained keepend fold
syn region MojoFileName start=/@@/ end="$" keepend contains=MojoFileNameStart contained keepend
" Push Template sections and HTML syntax into @perlDATA cluster
syn cluster perlDATA add=@Html,MojoFileContainer
" Revert current syntax name
let b:current_syntax = cs
" ---- language-env DON'T MODIFY THIS LINE!
""" ========================================================
""" 기본적인 설정들
""" ========================================================
set nocompatible " Vim 디폴트 기능들을 사용함
set backspace=2 " 삽입 모드에서 백스페이스를 계속 허용
set autoindent " 자동 들여쓰기
set cindent " C 언어 자동 들여쓰기
set smartindent " 역시 자동 들여쓰기
set textwidth=76 " 76번째 칸을 넘어가면 자동으로 줄 바꿈
set nowrapscan " 찾기에서 파일의 맨 끝에 이르면 계속하여 찾지 않음
"set nobackup " 백업파일을 만들지 않음
set novisualbell " 비주얼벨 기능을 사용하지 않음
set nojoinspaces " J 명령어로 줄을 붙일 때 마침표 뒤에 한칸만 띔
set ruler " 상태표시줄에 커서 위치를 보여줌
set tabstop=4 " <Tab> 간격
set shiftwidth=4 " 자동 들여쓰기 간격
"set keywordprg=edic " K를 눌렀을 때 실행할 명령어
set showcmd " (부분적인) 명령어를 상태라인에 보여줌
set showmatch " 매치되는 괄호의 반대쪽을 보여줌
set ignorecase " 찾기에서 대/소문자를 구별하지 않음
set incsearch " 점진적으로 찾기
set autowrite " :next 나 :make 같은 명령를 입력하면 자동으로 저장
set title " 타이틀바에 현재 편집중인 파일을 표시
""" ========================================================
""" 파일 인코딩을 한국어로 설정
""" ========================================================
" if $LANG[0] == 'k' && $LANG[1] == 'o'
" set fileencoding=korea
" endif
set fileencoding=UTF-8
""" ========================================================
""" 터미널에 따른 설정 : Xterm이면 16컬러 사용
""" ========================================================
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
set t_Co=16
set t_Sf=^[[3%dm
set t_Sb=^[[4%dm
set t_kb=
fixdel
endif
""" ========================================================
""" 문법 강조기능 사용
""" ========================================================
if has("syntax")
syntax on
endif
""" ========================================================
""" GUI 모드로 실행할 경우
""" ========================================================
if has("gui_running")
set visualbell " 비주얼벨 기능 사용
set hlsearch " 찾는 단어를 하이라이팅
endif
" ---- language-env end DON'T MODIFY THIS LINE!
set textwidth=0
set autoindent
set guioptions=gimrtT
set backspace=2
set viminfo='20,\"50
set hlsearch
set backup
set fileencoding=UTF-8
set wrapscan
set notitle
syntax on
" gypark for Mac
set t_Co=256
" map ;;a /<new>
:.,.s/\[[-.<국>+ 미(영)강,약/;:0-9a-zA-Z^]*\]//g
;;a
map ;;a :s/^/# /g<CR>:let @/ = ""<CR>
map ;;b :s/^# //g<CR>:let @/ = ""<CR>
map ;;B :s/^#//g<CR>:let @/ = ""<CR>
map ;;d :windo set diff scrollbind<CR>
map ;;D :windo set nodiff noscrollbind<CR>
map ;;q :s/^/\/\/ /g<CR>:let @/ = ""<CR>
map ;;w :s/^\/\/ //g<CR>:let @/ = ""<CR>
map ;;n :NERDTreeToggle<CR>
map ;;N :NERDTreeTabsToggle<CR>
set backupdir=~/.vim/backup
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set noignorecase
set pastetoggle=<F10>
set fileencodings=ucs-bom,utf-8,korea
au BufNewFile,BufRead *.pl,*.plx,*.pm
\ set kp=perldoc\ -f tabstop=4 softtabstop=4 shiftwidth=4 backspace=2 expandtab fdm=marker fmr={{{,}}} ft=perl cindent commentstring=\ #\%s complete=.,w,b,u,t
" au BufNewFile,BufRead *.pl,*.plx,*.pm inoremap # X#
au BufNewFile,BufRead *.py
\ set tabstop=4 softtabstop=4 shiftwidth=4 backspace=2 expandtab fdm=marker fmr={{{,}}} cindent commentstring=\ #\%s
au BufNewFile,BufRead *.c,*.cpp
\ set tabstop=4 softtabstop=4 shiftwidth=4 backspace=2 expandtab fdm=marker cindent
au BufNewFile,BufRead *.java
\ set tabstop=4 softtabstop=4 shiftwidth=4 backspace=2 expandtab fdm=marker cindent
" au BufNewFile,BufRead *.pl
" \ set fileencoding=korea
au BufNewFile,BufRead /tmp/*
\ set fileencoding=utf-8
" \ set fileencoding=euc-kr
au BufNewFile,BufRead *.g4
\ set filetype=antlr3 expandtab
" git 커밋메시지는 무조건 첫 라인으로
au BufNewFile,BufRead *.git/COMMIT_EDITMSG
\ 1
au BufNewFile,BufRead *.git/COMMIT_EDITMSG
\ set fileencoding=UTF-8
set formatoptions=tlcrq
map ;;f :set expandtab<CR>:retab<CR>:wn<CR>
" set shell=/bin/bash\ -l
" colorscheme torte
"" StatusLine 설정
" set statusline=%F\ %m%h%r%<%=\ [%{&ff},%{&fenc}]\ [%Y]\ [%l,%v]\ [%L]\ [%p%%]
set statusline=%F\ %m%h%r%<%=\ [%{&ff},%{&fenc}]\ [%Y]\ [%l,%v]\ [%L]\ [%p%%]\ %{SyntasticStatuslineFlag()}
set laststatus=2
" set cursorline
hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold,reverse ctermfg=DarkBlue ctermbg=White guifg=Blue guibg=White
" au InsertEnter * set nocursorline
au InsertEnter * hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold,reverse ctermfg=DarkGreen ctermbg=White guifg=DarkGreen guibg=White
" au InsertLeave * set cursorline
au InsertLeave * hi StatusLine term=bold,reverse cterm=bold,reverse gui=bold,reverse ctermfg=DarkBlue ctermbg=White guifg=Blue guibg=White
" 종료할 때 StatusLine 지워주기
au VimLeave * set laststatus=0
au VimLeave * redraw
" mousewheel 사용
set mouse=a " hold shift to copy xterm
" set ttymouse=xterm2 " necessary for gnu screen & mouse
"
" pathogen
" https://github.com/tpope/vim-pathogen/
call pathogen#infect()
"
" solarized
"
" set t_Co=16
" set background=light
" call togglebg#map("")
" let g:solarized_italic=0
" colorscheme solarized
"
" StatusLine 설정
"
" gvim의 경우
" solarized의 기준에 맞춤
" bg(반전되니까 글자 색상)값은 base02
" dark #073642
" light #eee8d5
" fg(라인 배경색)은 원래 base1인데, mark.vim 의 Cyan(normal모드)과 Green(insert모드)에 맞춤
" Cyan #8ccbea
" Green #a4e57e
" Blue #9999ff
"
" linux vim의 경우
" solarized 때문에 색상값을 줄 수 없음
" 0부터 15 사이에서 테스트해서 비슷하게 주었음
"set statusline=%F\ %m%h%r%<%=\ [%{&ff},%{&fenc}]\ [%Y]\ [%l,%v]\ [%L]\ [%p%%]
"set laststatus=2
"" set cursorline
"hi StatusLine term=reverse term=reverse gui=bold,reverse ctermfg=4 ctermbg=0 guifg=#8ccbea guibg=#073642
"" au InsertEnter * set nocursorline
"au InsertEnter * hi StatusLine ctermfg=2 ctermbg=0 guifg=#a4e57e guibg=#073642
"" au InsertLeave * set cursorline
"au InsertLeave * hi StatusLine ctermfg=4 ctermbg=0 guifg=#8ccbea guibg=#073642
" solarized 쓰기 힘들때
" colorscheme default
" 코멘트의 들여쓰기 문제
filetype plugin indent on
syntax enable
" Mojolicious syntax highlighting (mojo plugin)
let mojo_highlight_data = 1
"colorscheme default
if $LANG == "ko_KR.EUCKR"
colorscheme default
endif
let g:vim_json_syntax_conceal = 1
" set for Hangul IME
" inoremap <ESC> <ESC>:set imdisable<CR>
" nnoremap i :set noimd<CR>i
" nnoremap I :set noimd<CR>I
" nnoremap a :set noimd<cr>a
" nnoremap A :set noimd<CR>A
" nnoremap o :set noimd<CR>o
" nnoremap O :set noimd<CR>O
" if has('multi_byte_ime')
" highlight CursorIM guibg=green guifg=NONE
" endif
" set background=light
" 자동완성 색상 - 선택된 걸 분홍색으로
hi Pmenu ctermbg=242 guibg=DarkGrey
hi PmenuSel ctermbg=blue guibg=Magenta
" 코멘트 색상 변경
if &background == "dark"
hi Comment ctermfg=darkgreen
endif
" 파일명 자동 완성
set wildmode=longest,list,full
set wildmenu
" buffer
" set hidden
" Map ctrl-movement keys to window switching
map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>
" Switch to alternate file
map <C-Tab> :tabnext<cr>
map <C-S-Tab> :tabprevious<cr>
" syntastic
let g:syntastic_mode_map = { 'mode' : 'passive' }
if has("gui_running")
set guifont=Inconsolata:h13
colorscheme solarized
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment