Skip to content

Instantly share code, notes, and snippets.

@pastak
Created November 7, 2013 04:45
Show Gist options
  • Save pastak/7349098 to your computer and use it in GitHub Desktop.
Save pastak/7349098 to your computer and use it in GitHub Desktop.
set number
"括弧入力時の対応する括弧を表示
set showmatch
"Bundle関係
set nocompatible
filetype off
if has('vim_starting')
set runtimepath+=~/.vim/neobundle.vim.git
call neobundle#rc(expand('~/.bundle'))
endif
NeoBundle 'git://git.code.sf.net/p/vim-latex/vim-latex'
NeoBundle 'aharisu/vim_goshrepl'
NeoBundle 'amdt/vim-niji'
filetype plugin on
filetype indent on
" ペーストするときにコメントになるのを防ぐ!
autocmd FileType * set formatoptions-=ro
" 文字コードの自動認識
" from ずんWiki http://www.kawaz.jp/pukiwiki/?vim#content_1_7
set encoding=utf-8
set fileencoding=utf-8
if &encoding !=# 'utf-8' " utf-8をデフォルトに
set encoding=japan
set fileencoding=japan
endif
if has('iconv')
let s:enc_euc = 'euc-jp'
let s:enc_jis = 'iso-2022-jp'
" iconvがeucJP-msに対応しているかをチェック
if iconv("¥x87¥x64¥x87¥x6a", 'cp932', 'eucjp-ms') ==# "¥xad¥xc5¥xad¥xcb"
let s:enc_euc = 'eucjp-ms'
let s:enc_jis = 'iso-2022-jp-3'
" iconvがJISX0213に対応しているかをチェック
elseif iconv("¥x87¥x64¥x87¥x6a", 'cp932', 'euc-jisx0213') ==# "¥xad¥xc5¥xad¥xcb"
let s:enc_euc = 'euc-jisx0213'
let s:enc_jis = 'iso-2022-jp-3'
endif
" fileencodingsを構築
if &encoding ==# 'utf-8'
let s:fileencodings_default = &fileencodings
let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
let &fileencodings = &fileencodings .','. s:fileencodings_default
unlet s:fileencodings_default
else
let &fileencodings = &fileencodings .','. s:enc_jis
set fileencodings+=utf-8,ucs-2le,ucs-2
if &encoding =~# '^¥(euc-jp¥|euc-jisx0213¥|eucjp-ms¥)$'
set fileencodings+=cp932
set fileencodings-=euc-jp
set fileencodings-=euc-jisx0213
set fileencodings-=eucjp-ms
let &encoding = s:enc_euc
let &fileencoding = s:enc_euc
else
let &fileencodings = &fileencodings .','. s:enc_euc
endif
endif
let &fileencodings = 'utf-8' . ',' . &fileencodings " XXX: adhocな対応
" 定数を処分
unlet s:enc_euc
unlet s:enc_jis
endif
" 日本語を含まない場合は
" fileencoding
" に
" encoding
" を使うようにする
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^¥x01-¥x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
" 改行コードの自動認識
set fileformats=unix,dos,mac
syntax enable
""
"" Vim-LaTeX
""
set shellslash
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
let g:Imap_UsePlaceHolders = 1
let g:Imap_DeleteEmptyPlaceHolders = 1
let g:Imap_StickyPlaceHolders = 0
let g:Tex_DefaultTargetFormat = 'pdf'
"let g:Tex_FormatDependency_pdf = 'pdf'
let g:Tex_FormatDependency_pdf = 'dvi,pdf'
"let g:Tex_FormatDependency_pdf = 'dvi,ps,pdf'
let g:Tex_FormatDependency_ps = 'dvi,ps'
let g:Tex_CompileRule_pdf = 'ptex2pdf -l -ot "-kanji=utf8 -guess-input-enc -synctex=1 -interaction=nonstopmode -file-line-error-style" $*'
"let g:Tex_CompileRule_pdf = 'ptex2pdf -l -u -ot "-kanji=utf8
"-no-guess-input-enc -synctex=1 -interaction=nonstopmode
"-file-line-error-style" $*'
"let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 -interaction=nonstopmode
"-file-line-error-style $*'
"let g:Tex_CompileRule_pdf = 'lualatex -synctex=1 -interaction=nonstopmode
"-file-line-error-style $*'
"let g:Tex_CompileRule_pdf = 'luajitlatex -synctex=1 -interaction=nonstopmode
"-file-line-error-style $*'
"let g:Tex_CompileRule_pdf = 'xelatex -synctex=1 -interaction=nonstopmode
"-file-line-error-style $*'
"let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
"let g:Tex_CompileRule_pdf = 'ps2pdf.bat $*.ps'
let g:Tex_CompileRule_ps = 'dvips -Ppdf -o $*.ps $*.dvi'
let g:Tex_CompileRule_dvi = 'platex -kanji=utf8 -guess-input-enc -synctex=1 -interaction=nonstopmode -file-line-error-style $*'
"let g:Tex_CompileRule_dvi = 'uplatex -kanji=utf8 -no-guess-input-enc
"-synctex=1 -interaction=nonstopmode -file-line-error-style $*'
let g:Tex_BibtexFlavor = 'pbibtex -kanji=utf8'
"let g:Tex_BibtexFlavor = 'upbibtex'
"let g:Tex_BibtexFlavor = 'bibtex'
"let g:Tex_BibtexFlavor = 'bibtexu'
let g:Tex_MakeIndexFlavor = 'mendex -U $*.idx'
"let g:Tex_MakeIndexFlavor = 'makeindex $*.idx'
"let g:Tex_MakeIndexFlavor = 'texindy $*.idx'
let g:Tex_ViewRule_pdf = 'texworks'
"let g:Tex_ViewRule_pdf = 'rundll32 shell32,ShellExec_RunDLL SumatraPDF
"-reuse-instance -inverse-search "C:\vim\gvim.exe -n -c \":RemoteOpen +\%l
"\%f\""'
"let g:Tex_ViewRule_pdf = 'rundll32 shell32,ShellExec_RunDLL firefox
"-new-window'
"let g:Tex_ViewRule_pdf = 'powershell -Command "& {$p =
"[System.String]::Concat(''"""'',[System.IO.Path]::GetFullPath($args),''"""'');Start-Process
"chrome -ArgumentList (''--new-window'',$p)}"'
"let g:Tex_ViewRule_pdf = 'pdfopen --rxi --file'
let g:Tex_ViewRule_ps = 'rundll32 shell32,ShellExec_RunDLL SumatraPDF -reuse-instance'
let g:Tex_ViewRule_dvi = 'cmd /c start $*.dvi'
"警告エラー無視
let g:Tex_IgnoredWarnings =
\'Underfull'."\n".
\'Overfull'."\n".
\'specifier changed to'."\n".
\'You have requested'."\n".
\'Missing number, treated as zero.'."\n".
\'There were undefined references'."\n".
\'Citation %.%# undefined'."\n".
\"Font shape \`JT1/gt/m/it\' undefined"."\n".
\"Font shape \`JY1/gt/m/it\' undefined"."\n".
\"Font shape \`JT1/mc/m/it\' undefined"."\n".
\"Font shape \`JY1/mc/m/it\' undefined"."\n".
\'LaTeX Font Warning: Some font shapes were not available, defaults substituted.'
let g:Tex_IgnoreLevel = 12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment