Giter Club home page Giter Club logo

vim-latex-suite's People

Contributors

aetherknight avatar congma avatar cristobaltapia avatar dffischer avatar dietercastel avatar gerw avatar huangzonghao avatar ibbo avatar johfel avatar kaihowl avatar kha avatar m4ci3k2 avatar mdekstrand avatar mika-fischer avatar phloxic avatar ptrv avatar quickmarble avatar rfabbri avatar rutsky avatar sdx23 avatar srinathava avatar strv avatar thedoctar avatar todashuta avatar tpavlic avatar tyll avatar umangv avatar wsfreund avatar yourealwaysbe avatar zuxfoucault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-latex-suite's Issues

@NoSpell for hyperref

It would be nice to disable spell checking inside of \url{} or \href{}

I tried to figure out editing the tex syntax file, but didn't have enough time to really dig into it.

How to add custom templates to custom place?

I'd like to add some custom templates to a custom place aside from ftplugin/latex-suite/templates (outside the repository) to handle them cleanly. And call them with :TTemplate command.

Are there any good ways to achieve this?

Using SnipMate along side the Vim-Latex-Suite

Hi @gerw,

I am a heavy user of latex and I like all the shortcuts and abbreviations made possible by the Suite.

However, the suite seems to be too overwhelming in terms of occupying the key-bundling.

I use SnipMate for all my other programming languages, but I just cannot tune it to work for tex files.

Do you have any idea? Maybe, I only need key to be "released" from being occupied by Vim-Latex-Suite.

Thank you in advance.

-Linfeng

broken refs

one of the last commits seems to have broken the cross-referrencing system, now when one presses within a \ref{}, vim throws an error before showing the list of labels, if one then chooses a label, nothing happens (i thought this might be goyo's fault, but when I reverted to the commit from Apr 29th, everything worked flawlessly)

the error is as follows
Error detected while processing function Tex_Complete..Tex_StartOutlineCompletion:
line 50:
E121: Undefined variable: l:origdir
E15: Invalid expression: 'nnoremap ' .':cd '.l:origdir.'' .':call Tex_FinishOutlineCompletion()'
line 53:
E121: Undefined variable: l:origdir
E15: Invalid expression: 'nnoremap q ' .':cd '.l:origdir.'' .':close' .':call Tex_SwitchToInsertMode()'

it seems to have to do with the last pull request.

best,
crvs

Cursor shift when switching from normal to insert mode

Hi,

I use and like the latex-suite plugin in combination with vim quite much!

However, when switching modes (normal to insert, normal to replace), every second time, the cursor will be shifted one character to the right.

Example:

Case 1:

  • Cursor over m in exmple
  • Press i to go to insert-mode and press a leads to example.

Repeating exacly this one more time (at another word in the text) will result here:

Case 2:

  • Cursor over m in exmple
  • Press i to go to insert-mode and press a leads to exmaple (cursor shifted one to the right when pressing i)

I find myself continiously alternating between case1, case 2...

Any help appreciated. :)

FYI:
vim version: 7.3.429
OS: Ubuntu 12.04

Template menu would not load

I have been using your repository with Vundle for quite some months already and it was working perfectly. However today I was configuring a new linux system and so I downloaded vim-latex-suite from your repository using vim-plug (with vundle was the same) and whenever I would open a .tex file, it would display a list of errors and when ignored, the Tex-Suite menu wouldn't load properly (missing the package, templates, and macros sub-menus). The only thing that worked for me was to replace the new vim-latex-suite folder created by my plugin manager and replace with an older one (that had installed in my mac some months ago). Now everything is running and loading smoothly once again.

Any idea why this might have happened, as for the future I would like to keep using your repository for whenever I have to reinstall/update vim-latex.

Tex_CatFile() does not use readfile, overwrites unnamed register

In vim configured without python, Tex_CatFile() checks for readfile() incorrectly and overwrites the unnamed register at each compile. The following changes fix this check.

--- a/ftplugin/latex-suite/main.vim
+++ b/ftplugin/latex-suite/main.vim
@@ -948,9 +948,12 @@
    endfunction
 endif " }}}
 " Tex_CatFile: returns the contents of a file in a <NL> seperated string {{{
-if has('*readfile')
+if exists('*readfile')
    function! Tex_CatFile(filename)
-       return join(readfile(filename), "\n")
+       if glob(a:filename) == ''
+           return ''
+       endif
+       return join(readfile(a:filename), "\n")
    endfunction
 elseif has('python') && g:Tex_UsePython
    function! Tex_CatFile(filename)

opening .sty files by default

I often have some .sty files in the home folders the documents I'm editing.

It seems, as part of the update to package info, vim-latex-suite will automatically open these files in new buffers as I open the document. So doing:

vim mydocument.tex

will open vim with mydocument.tex, but also all the .sty files in their separate buffers.

I was wondering why this is the default. Seems it happens in vim-latex-suite/ftplugin/latex-suite/packages.vim, around line 144 (the 'exe' call):

	if expand('%:p') != fname
		call Tex_Debug(':Tex_pack_updateall: sview '.fnameescape(fname), 'pack')
		exe 'sview '.fnameescape(fname)
	else
		call Tex_Debug(':Tex_pack_updateall: split', 'pack')
		split
	endif

I can of course comment this out... but was wondering your thoughts on maybe having this not done by default, and/or perhaps having a variable that would dictate if these files should also be opened.

Verbatim not folding

I do not know if this is an issue or a design choice, so bear with me if I am mistaken!
The folding command will not fold Verbatim environments (from fancyvrb).
I have made this hack, however I feel there must be some better way to do it than manually adding all possible environments we want folded.

Anyone cares to explain the folding mechanism? I really could not follow everything in folding.vim

diff --git a/ftplugin/latex-suite/folding.vim b/ftplugin/latex-suite/folding.vim
index 9057cf4..9bc9d2d 100644
--- a/ftplugin/latex-suite/folding.vim
+++ b/ftplugin/latex-suite/folding.vim
@@ -41,9 +41,9 @@ endfunction " }}}
 "      definitions for them. The first item is supposed to be the "shallowest" field
 "      and the last is the "deepest". See g:Tex_FoldedSections for the default
 "      definition of the lst input argument.
-       "
+"
 "      **works recursively**
-       function! Tex_FoldSections(lst, endpat)
+function! Tex_FoldSections(lst, endpat)
        let i = match(a:lst, ',')
        if i > 0
                let s = strpart(a:lst, 0, i)
@@ -113,8 +113,7 @@ function! MakeTexFolds(force)
        endif

        let s = 'verbatim,comment,eq,gather,align,figure,table,thebibliography,'
-                       \. 'keywords,abstract,titlepage,'
-                       \.'Verbatim'
+                       \. 'keywords,abstract,titlepage'
     if !exists('g:Tex_FoldedEnvironments')
                let g:Tex_FoldedEnvironments = s
        elseif g:Tex_FoldedEnvironments[0] == ','
'''

Unable to use all features with Vundle

I tried installing this plugin through Vundle, however, I am unable to use all the features provided here.

The issue as I have seen till date is that the template files located in im-latex-suite/ftplugin/latex-suite\templates are not being loaded. Hence, if I run :TTemplate in my vim editor, I can see no templates for use.

Most of the other features that I have used seem to work. Also, I'm pretty sure Vundle isn't messing up because all my other plugins work fine.

Can someone help me in debugging thr issue?

url problems in bibtools.py on windows

I found there is a problem when using urlopen to open a bib file on windows with python 2.7.9.

What about using pathname2url instead of quote at line 199 in bibtools.py?

More details can be found here

The following patch works for me, python 2.7.9 on windows 10.

diff --git a/ftplugin/latex-suite/bibtools.py b/ftplugin/latex-suite/bibtools.py
index d013d7d..19b7ee2 100644
--- a/ftplugin/latex-suite/bibtools.py
+++ b/ftplugin/latex-suite/bibtools.py
@@ -6,10 +6,10 @@ import re
 import os

 try:
-    from urllib.request import urlopen
+    from urllib.request import urlopen, pathname2url
     from urllib.parse import quote
 except ImportError:
-    from urllib import urlopen
+    from urllib import urlopen, pathname2url
     from urllib import quote

 # Compatibility functions
@@ -196,7 +196,7 @@ class BibFile:
                 self.addfile(f)

     def addfile(self, file):
-        fields = urlopen('file://' + quote(os.path.abspath(file))).read().decode('utf-8').split('@')
+        fields = urlopen('file:' + pathname2url(os.path.abspath(file))).read().decode('utf-8').split('@')
         for f in fields:
             if not (f and re.match('string', f, re.I)):
                 continue

E518 in efm?

When processing the document with <Leader>l, the error message was dumped to vim:

Error detected while processing function Tex_RunLaTeX[33]..Tex_CompileMultipleTi
mes[101]..<SNR>61_SetTexCompilerLevel[20]..<SNR>61_SetLatexEfm:
line   74:
E518: Unknown option: %r

echo &efm output:

%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is rep
orted only once,%-G%f:%l: for each function it appears in.),%-GIn file included
from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%
l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-
G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f(%l):%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D
%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%
f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMa
king %*\a in %f,%f|%l| %m,%-G%.%#,%E! LaTeX %trror: %m,%E! %m,%E%f:%l: %m,%+WLaT
eX %.%#Warning: %.%#line %l%.%#,%+W%.%# at lines %l--%*\d,%+WLaTeX %.%#Warning:
%m,%-Cl.%l %m,%-Cl.%l ,%-C  %m,%-C%.%#-%.%#,%-C%.%#[]%.%#,%-C[]%.%#,%-C%.%#%[{}\
]%.%#,%-C<%.%#>%m,%-GSee the LaTeX%m,%-GType  H <return>%m,%-G ...%.%#,%-G%.%# (
C) %.%#,%-G(see the transcript%.%#),%-G\s%#,%-O %#(%f)%r,%-Q)%r,%-Q%*[^()])%r,%-
Q[%\d%*[^()])%r,%-O(%f)%r,%-O,%-P(%f%r,%-P %\=(%f%r,%-P%*[^()](%f%r,%-P(%f%*[^()
],%-P[%\d%[^()]%#(%f%r

vim version 8.0.5
latex-suite version at current head on master (0bbcc9c).

auxoutline.py

vimlatex throws an error when autocompleting with F9 when the default version of python is 3.x instead of 2.x because of the change in the syntax of "print", so for me it's fixed when I replace "#!usr/bin/python" with "!#/usr/bin/python2.7" don't know if that's the best way to do it though...

Using double backticks for doubleqoutes

If i want to type German umlauts i usally type in e.g. "a to get an ä. The problen with your plugin is, that it iterprets " as ``.
Maybe you could fix this? :)
Thanks so far

Multiple \begin{document} messes with <F5> completion

Look at the following minimal example:

\documentclass{article}
\begin{document}

The \verb!document! environment starts with \verb!\begin{document}!.

\end{document}

Using <F5> to expand an environment between \begin{document} and \verb!\begin{document}! will insert a \usepackage{}, while below \verb!\begin{document}! it will (correctly) insert an environment.

Is it possible to make vim-latex-suite use the first occurrence of \begin{document} to indicate the beginning of the document?

Support for cleveref

The cleveref package doesn't seem to be fully supported. For example, \cref commands are not treated the same as \ref. The syntax highlighting is different and spell check is making the labels as incorrectly spelled (it doesn't do that for \ref).

Wrong variable name in the documentation for custom template folder

In the documentation is written that the variable needed to be changed for the custom template folder is g:Tex_CustomTemplateFolder, but in reality it is g:Tex_CustomTemplateDirectory.

I just happen to noticed this, when I was setting the template folder on another computer.

Idea: Copy extra files when importing a template

A template very often has one or more external files associated to it, like for example a logo or some custom document class. It would be very useful if vim-latex-suite could know which files are associated to which template (maybe write them in the header of the template file, (see below)) and then copy them to the working directory when :TTemplate is called.

The template file could look something like this:

1 <+ +> !comp! !exe!
2 files: img/logo_template_university.png;img/logo_template_institute.png
3 \documentclass{article}
4 ...

Would this be doable?

Forward search takes up to 10 seconds to respond

Forward search through <leader>ls works fine when Sumatra is not opened. However, once I have a Sumatra session running, triggering the forward search will take me about 10 seconds. (It takes very long for the Sumatra window to pop up and highlight the line.)

This only happens to my Windows 8.1 machine. It worked fine on the other computer, using Windows 7. And, the configuration files across the two machines are exactly the same (I just updated this morning).

Any idea?

Thank you in advance.

F9 completion doesn't work when auxilary files in seperate "build" directory

When I compile a simple document test.tex using latexmk, autocompletion of \ref{} using works as expected, presumably because main.aux is visible.

If I now compile using latexmk -output-directory="build", so that all the build files are separated into a "build/" folder, auto-completion no longer works.

Is there a way for vim-latex to search for .aux files in "build" rather than the root directory?

Any help greatly appreciated!

Error: Function <SNR>56_MultiByteStrlen already exists, add ! to replace it

Hello, I 'm getting these errors opening vim:

Error detected while processing /home/username/.vim/bundle/vim-latex-suite/plugin/imaps.vim:
line  809:
E122: Function <SNR>56_MultiByteStrlen already exists, add ! to replace it
line  827:
E122: Function <SNR>56_MultiByteStrpart already exists, add ! to replace it
Press ENTER or type command to continue

After I press ENTER vim opens normally and then the message only reappears when I install a new plugin.
Should I be worried? Should I fix it somehow? How?

My ~/.vimrc is:

"NeoBundle Scripts-----------------------------
"Note: Skip initialization for vim-tiny or vim-small.
" installed running: curl https://raw.githubusercontent.com/Shougo/neobundle.vim/master/bin/install.sh | sh
if !1 | finish | endif

if has('vim_starting')
set nocompatible               " Be iMproved

" Required:
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif

" Required:
call neobundle#begin(expand('~/.vim/bundle/'))

" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'

" My Bundles here:
" Refer to |:NeoBundle-examples|.
" Note: You don't set neobundle setting in .gvimrc!
"
NeoBundle 'bling/vim-airline'
NeoBundle 'gerw/vim-latex-suite'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'tpope/vim-surround'
NeoBundle 'scrooloose/syntastic'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'Lokaltog/vim-easymotion'
"NeoBundle 'Valloric/YouCompleteMe'
NeoBundle 'nathanaelkane/vim-indent-guides'
call neobundle#end()

" Required:
filetype plugin indent on

" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck

" Airline
set laststatus=2
set t_Co=256
let g:airline#extensions#tabline#enabled = 0
"let g:airline_powerline_fonts=1
"let g:airline_theme = 'molokai'
let g:airline_theme = 'powerlineish'
let g:airline_enable_branch = 1
"let g:airline_enable_syntastic  = 1

" LaTeX suite
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin on

" IMPORTANT: win32 users will need to have 'shellslash' set so that latex
" can be called correctly.
set shellslash

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: This enables automatic indentation as you type.
filetype indent on

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'

" Syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_mode_map = { 'mode': 'active',
            \ 'active_filetypes': ['python'],
            \ 'passive_filetypes': [] }
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_auto_refresh_includes = 1
let g:syntastic_python_checkers = ['pyflake']
let g:syntastic_tex_checkers = ['lacheck']

s:origdir overridden when using tex_RunLaTeX

I tried the vim-latex-devel list already but to no avail so far.
Since development on latexsuite seems rather dead, I am thinking of contributing the fix to this fork instead.

The current project I am using vim-latex on has a main file including several sections from files in a folder sections/.
If I call ll while editing sections/foo.tex, vim-latex will return from compilation correctly but also set cwd to sections/. This is unexpected behavior for me. I would not expect compilation to suddenly change the working directory.

I dug into the source code and came to the following conclusion:
s:origdir is used throughout the source code to save the cwd at the beginning of a function and later restore it. Unfortunately, s:origdir is a script-local variable. Therefore, reusing the method of "save cwd to s:origdir and restore" will not work if calls of functions using this method are nested.

This is exactly the source of my unexpected change of cwd after compilation.
tex_RunLaTeX saves the correct cwd to s:origdir. It then changes the working directory. This is followed by calling tex_CompileLaTex() at some point, which will save the wrong cwd again to s:origdir and thus overrides the old, but correct cwd. By extension, the final restore of cwd at the end of tex_RunLaTeX will then restore the the incorrect directory, which in my case is the subdirectory sections/.

As a simple solution, I propose to substitute s:origdir with l:origdir or simply origdir as I see no compelling reason to make origdir a script-local variable. A simple "%s/s:origdir/l:origdir/g" on ftplugin/latex-suite/compiler.vim solved the original issue for me. It also appears to be used in main.vim, texproject.vim, and texviewer.vim. The same fix will probably apply there as well.

Are you willing to accept a pull request on this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.