Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't find snippets nearly as convenient as the built-in auctex keybindings. C-c C-e itemize <enter> item1 <alt-enter> item2 gives me (properly indented for surrounding context):

    \begin{itemize}
    \item item1
    \item item2
    \end{itemize}
I could probably convince vim to do that, but auctex does it out of the box with no additional configuration required.

Likewise, I could probably set makeprg to latexmk or rubber or some other DWIM script, but that ought to Just Work as easily as auctex's C-c C-c, and shouldn't require a pile of configuration.

I haven't even found a way to bind <A-Enter> in vim's insert mode, because vim can't distinguish that from <Esc><Enter>.



In vim, using xptemplate:

  item<TAB>item1<TAB><TAB>item2<C-d>
results in exactly the same thing. True, I had to spend 5 minutes writing a snippet to do that,[1] but that was because the default snippet behaved differently (though arguably just as intuitevely).

xptemplate comes with a bunch of LaTeX snippets (and ones for about 50 other languages), but it's easy enough to add more yourself, especially when the desired behavior is as simple as you describe. It gets trickier when you have lots of nested snippets, menus, conditionals, etc. But the tools are there as features, and you don't have to write the features themselves yourself, just use them.

As for latexmk, depending on how complex your needs are, you may not have to configure it, just run it. A "latexmk -pdf foo.tex" will probably do what you want. Configuring it or using other/more options give you more control, which is a good thing. AucTeX, by the way, has a latexmk plugin.

[1] - It would have gone a lot faster had it not been a couple of years since I wrote an xptemplate snippet.


> While on the subject of configuration, if you are not a fan of configuring your editor, I'm not sure I understand what you're doing using Emacs.

I don't mind configuring something when I actually want to change its behavior, but I'm a big fan of sensible and helpful defaults that Just Work. I'm not complaining that there isn't a vim mode that works exactly like auctex out-of-the-box; I'm annoyed that there doesn't seem to be one that has equivalent functionality out-of-the-box. I could reinvent it using templates/snippets, but I didn't have to do so with auctex.

> As for latexmk, depending on how complex your needs are, you may not have to configure it, just run it. A "latexmk -pdf foo.tex" will probably do what you want.

I understand that I wouldn't have to configure latexmk (or rubber, or any number of other DWIM scripts for LaTeX), but I'd still need to configure vim to use one of them and have a convenient keybinding for them. I'd also prefer not to rely on an external script; I'd rather have something built into vim and configurable within vim.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: