Currently I'm using Gummi for my latex'ing, but I'd like to move it to vim. Any good tips, guides, relevant vimrc excerpts, plugins or whatever?

asked 05 Nov '13, 13:54

miyalys's gravatar image

miyalys
951213
accept rate: 25%

edited 11 Nov '13, 21:29


I've mapped enter as follows

 map <C-M> :make<CR>

Which allows me to run pdflatex by pressing enter within vim, with the following command:

 autocmd FileType tex setlocal makeprg=pdflatex\ '%'

Further more i'm using Snipmate with vim-snippets and neocomplcache. Other than that, i've got the following few lines in my vimrc, which should be self explanatory.

 autocmd FileType tex setlocal fileencoding=utf-8
 autocmd FileType tex setlocal spell
 autocmd FileType tex setlocal spelllang=da
link

answered 10 Nov '13, 10:36

Telling's gravatar image

Telling
943
accept rate: 20%

Personally I like a vim-setup quite similar to gummy: I'll have 3 windows:

  1. vim myfile.tex # you know what that does
  2. latexmk -pvc -pdf myfile.tex # This command will recompile when stuff changes
  3. evince myfile.pdf # or use whichever pdf reader you like.

This way every time I save myfile.tex or dependant files in vim, latexmk will autocompile, and evince will update my view.

Also.. many distributions have pre-installed with vim the vim-latex suite, which contains a handfull of mapped shortcuts and abbrieviations, find a list of some of them in envmacros.vim and main.vim (probably) located in or near /usr/share/vim/vimfiles/ftplugin/latex-suite/ ... Alternatively, if you run GVim, you may find most of the nifties through the menus.

link

answered 23 Nov '13, 12:57

root's gravatar image

root
914
accept rate: 28%

edited 23 Nov '13, 13:01

I have installed latexmk (will automatically run as many times as needed to get citations and references right) and use the following in ~/.vimrc : " Map F2 to run latexmk augroup tex au BufEnter .tex map <f2> :!latexmk -pdf %<cr> au BufEnter .tex imap <f2> <esc>:!latexmk -pdf %<cr> augroup END

" Wrap long lines set linebreak

" Re-mapping to make movements operate on 1 screen line in wrap mode function! ScreenMovement(movement) if &wrap return "g" . a:movement else return a:movement endif endfunction onoremap <silent> <expr> j ScreenMovement("j") onoremap <silent> <expr> k ScreenMovement("k") onoremap <silent> <expr> 0 ScreenMovement("0") onoremap <silent> <expr> ^ ScreenMovement("^") onoremap <silent> <expr> $ ScreenMovement("$") nnoremap <silent> <expr> j ScreenMovement("j") nnoremap <silent> <expr> k ScreenMovement("k") nnoremap <silent> <expr> 0 ScreenMovement("0") nnoremap <silent> <expr> ^ ScreenMovement("^") nnoremap <silent> <expr> $ ScreenMovement("$") vnoremap <silent> <expr> j ScreenMovement("j")

link

answered 27 Nov '13, 18:23

Rasmus's gravatar image

Rasmus
12217
accept rate: 33%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×122
×12
×4

Asked: 05 Nov '13, 13:54

Seen: 1,202 times

Last updated: 27 Nov '13, 18:23

powered by OSQA