From 115a9e3118e124316309ec42f1462b97a4374a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2EFernando=20S=C3=A1nchez?= Date: Thu, 7 Mar 2013 16:25:52 +0100 Subject: [PATCH] Fixed latex+okular in vim --- vim/ftplugin/tex.vim | 9 +++++++++ vimrc | 39 +++++++++++++++------------------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/vim/ftplugin/tex.vim b/vim/ftplugin/tex.vim index a4838bd..41c8d57 100644 --- a/vim/ftplugin/tex.vim +++ b/vim/ftplugin/tex.vim @@ -7,5 +7,14 @@ endfunction nmap f :call SyncTexForward() map ct yyp:s/begin/end/ +"Latex +let g:tex_flavor = "latex" +set suffixes+=.log,.aux,.bbl,.blg,.idx,.ilg,.ind,.out,.pdf + +let g:LatexBox_latexmk_options="-pvc" +let g:Tex_CompileRule_pdf = 'pdflatex --synctex=1 -interaction=nonstopmode $*' +let g:LatexBox_output_type="pdf" +let g:LatexBox_viewer="okular --unique" +let tlist_tex_settings = 'latex;l:labels;s:sections;t:subsections;u:subsubsections' diff --git a/vimrc b/vimrc index 512b9b1..32227cb 100644 --- a/vimrc +++ b/vimrc @@ -52,19 +52,6 @@ set hlsearch let mapleader="," noremap \ , - -"Latex -let g:tex_flavor = "latex" -set suffixes+=.log,.aux,.bbl,.blg,.idx,.ilg,.ind,.out,.pdf - -let g:LatexBox_latexmk_options="-pvc" -let g:LatexBox_output_type="pdf" -let g:LatexBox_viewer="okular --unique" - - -let tlist_tex_settings = 'latex;l:labels;s:sections;t:subsections;u:subsubsections' - - " Commenting blocks of code. autocmd FileType c,cpp,java,scala,javascript let b:comment_leader = '// ' autocmd FileType sh,ruby,python let b:comment_leader = '# ' @@ -130,17 +117,21 @@ hi SpellBad ctermbg=Red ctermfg=White set statusline=%t%h%m%r%y%{fugitive#statusline()}\%=[%{strlen(&fenc)?&fenc:'none'},%{&ff}]\ \ %c,%l/%L\ %P set laststatus=2 -" Forward search -" function! PDFForward() -" " if filereadable(b:RootFileName.".".b:Ext) -" -" " silent! call system("okular --unique \"".b:RootFileName.".".b:Ext."\"\#src:".line('.').expand("%")." &") -" -" silent! call system(g:LatexBox_viewer . " \"".LatexBox_GetOutputFile()."#src:".line('.')."".expand("%:p")."\" &") -" " else -" " echo "Output file not readable." -" " endif -" endfunction +function! InsertStatuslineColor(mode) + if a:mode == 'i' + hi statusline guibg=Red ctermfg=White guifg=White ctermbg=Red + elseif a:mode == 'r' + hi statusline guibg=Blue ctermfg=White guifg=White ctermbg=Blue + else + hi statusline guibg=Yellow ctermfg=White guifg=Black ctermbg=Yellow + endif +endfunction + +call InsertStatuslineColor('') + +au InsertEnter * call InsertStatuslineColor(v:insertmode) +au InsertLeave * call InsertStatuslineColor('') + " Encryption " set cm=blowfish