Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I use Vim with Vim-Latex plugin to edit my LaTeX documents. I have the problem that whenever I want to insert a double quote ("), it automatically get replace by (``). Any idea how can I disable that while still having Vim-Latex enabled?

share|improve this question
1  
Try pressing " twice in a row, that should give you back the non-smart quote... –  Seamus Jan 9 '11 at 11:40
    
Nope, this does not work. –  math Apr 3 at 11:36
add comment

3 Answers

up vote 8 down vote accepted

Add let g:Tex_SmartKeyQuote=0 to $VIM/ftplugin/tex.vim (create that file if necessary), where $VIM corresponds to ~/.vim for unixy operating systems and ~/vimfiles for Windows.

There are more configuration variables, see the latexsuite manual.

share|improve this answer
    
Thanks man. But to be honest, I liked it that it replaces " with ``, but the thing is that I wanted to disable it because it would do that even in comments. Is there anyway around that?! That is, keep it enabled, but disable it when I want with a short-cut key or something like that. –  Promather Jan 8 '11 at 22:08
1  
I don't know. Actually, I would recommend to use \enquote from the csquotes package instead of `` and ''. –  Caramdir Jan 8 '11 at 22:11
6  
You can always use CTRL+V" to insert " without expansion. See :he i_CTRL-V for details. –  Aditya Jan 9 '11 at 1:41
1  
@Aditya That should probably be an answer, since it addresses his problem perfectly. I think it's exactly what he was looking for since he specifically asked for a "short-cut key". –  Adrian Petrescu Jan 9 '11 at 7:36
    
Pasting a " still expanded to ``, but if you first do setl paste, the double quote will be pasted as intended. –  Bram Schoenmakers Jul 12 '12 at 12:50
add comment

I usually type \", since in that context the " is not replaced by "smart quotes," and then delete the \. This is convenient enough for me, since I rarely need the " character, and I don't want to change Vim-LaTeX's default behavior.

share|improve this answer
add comment

I know you already accepted an answer, but just for those who use vim for LaTeX, but (like me) don't use the Vim-LaTeX plugin, I use the following, which I put inside my personal $HOME/.vim/ftplugin/tex.vim. It handles quotation marks pretty well (at least for my purposes), and deactivates itself in comments and following \. I began with some code from the "auctex.vim" plugin, but have I have added a lot to it and customized it a lot myself.

" Function for smart-quotes: double
function! s:TexQuotes()
    if getline('.')[0:col(".")] =~ '\(^\|[^\\]\)%'
       let kinsert = "\""
    else
        let kinsert = "\'\'"
        let left = getline('.')[col('.')-2]
        if left =~ '^\(\|\s\|{\|(\|\[\|&\)$'
            let kinsert = "\`\`"
        elseif left == "\\"
            let kinsert = "\""
        endif
    endif
    return kinsert
endfunction
" mapping for quotation marks
inoremap <buffer> " <C-R>=<SID>TexQuotes()<CR>
" Function for smart-quotes: single
function! s:TexSingQuotes()
    if getline('.')[0:col(".")] =~ '\(^\|[^\\]\)%'
       let schminsert = "'"
    else
        let schminsert = "'"
        let left = getline('.')[col('.')-2]
        if left =~ '^\(\|\s\|{\|(\|\[\|&\)$'
            let schminsert = '`'
        endif
    endif
    return schminsert
endfunction
" mapping for single quotation mark
inoremap <buffer> ' <C-R>=<SID>TexSingQuotes()<CR>

This could probably be cleaned up a bit. I wrote it when I was first learning the tiny bit of vimscript language that I know.

You could probably use it alongside the vim-latex plugin, so long as you disable its smart-quote feature, but I haven't tried.

share|improve this answer
    
Thanks @frabjous. –  Promather Jan 9 '11 at 8:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.