Comments on: 3 Tiny Vim Plugins That Will Make Your Life Easier http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/ I will not fix your computer. Tue, 04 Aug 2020 22:34:33 +0000 hourly 1 https://wordpress.org/?v=4.7.26 By: Ben Lindsay http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-300551 Wed, 16 Mar 2016 01:41:57 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-300551

@ Matt Mendell:
Thanks Matt! That works perfectly. Now I can get rid of the CTRL-Space mapping I had set to do that.

Reply  |  Quote
]]>
By: Matt Mendell http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-300539 Thu, 10 Mar 2016 15:21:15 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-300539

In the first example, to get the closing bracket on the subsequent line, need to set AutoCloseExpandEnterOn. This isn’t documented, I’ve sent the author a patch.

Example in .vimrc:
let g:AutoCloseExpandEnterOn=”([”

I constantly found myself hitting enter twice, then escape, then up one line, then back to insert mode.
A small tweak, but I’m constantly on the lookout to squeeze out more performance.

Ben L, I believe this answers your question as well.

Reply  |  Quote
]]>
By: Ben L http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-298963 Sat, 24 Oct 2015 21:58:35 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-298963

Great advice! Question: In your vim-AutoClose functionality screencast thing, after you create the brackets, the carriage return placed the closing bracket 2 lines down and placed your cursor 1 line down and indented nicely. The parentheses and bracket auto-closing works fine, but when I press Enter from within the bracket pair, the usual thing happens where I simply create a new line with the closing bracket as the first character. Any idea why this wouldn’t work for me? Thanks!

Reply  |  Quote
]]>
By: loadaverage http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-115655 Wed, 09 Jul 2014 20:38:11 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-115655

grrr, it ate my html tags in the example above..
and it eats it also in between code tags,
a rather unfortunate non-feature of this comment system :(
bbforum syntax to the rescue!


[div]{[/div]

Reply  |  Quote
]]>
By: loadaverage http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-115652 Wed, 09 Jul 2014 20:31:31 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-115652

autoclose does not work for me when inside html tags:

{

this is not closed and that is a pitty as in django templates this is all there is :)
thanks for the delimitmate tip, i will surely try it.

i find the snippets feature one of the most useful, although i am not
settled with the plugin itself to do it. ultisnip core dumps my vim..

what is the plugin doing the vertical line thing? :)

Reply  |  Quote
]]>
By: yakiang http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-70399 Wed, 09 Apr 2014 13:01:39 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-70399

Raimondi/delimitMate is actually much better than autoclose.

Reply  |  Quote
]]>
By: ron wilson http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-70055 Mon, 07 Apr 2014 15:40:35 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-70055

i tried all three of these and i can’t get matchit to work. it’s clearly loading but even editing a plain vanilla html file it won’t jump between tags using %.

Reply  |  Quote
]]>
By: Sheriff Fatman http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-69332 Thu, 03 Apr 2014 09:51:39 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-69332

As a Clojure hobbyist, I prefer paredit to autoclose, but I’m not sure if it counts as tiny.

It doesn’t just automatically insert closing brackets, it keeps brackets balanced: you can only delete brackets in pairs, and then only if they’re empty (you can still do d% to delete a pair of brackets AND its contents). You can also do something akin to Emac’s “slurpage” and “barfage” by jumping brackets back and forth over sub-expressions, expanding and shrinking the brackets’ extent.

It also has a neat option whereby closing brackets spread over several lines can be quickly gathered up at the end of one line, in good Lisp style.

It saves a heck of a lot of “unexpected EOF” errors. If you’re going to code Lisp in Vim, I’d argue it’s almost essential.

Reply  |  Quote
]]>
By: TinyI http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-69225 Wed, 02 Apr 2014 17:05:33 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-69225

Just installed closetag and match it. They’ll come in handy when I’m debugging my client’s self-written HTML! Already had autoclose for quite a while; its one of them things you install and then forget about. It just does its single better than IDEs I’ve found – had this annoying problem in eclipse (a short while ago – used to work with some Mr. Donning-Kruegers who said Eclipse was the best thing that happened to them and believed it – till I vimmed) where you’d have do avoid typing in your flow or otherwise, you’d be duplicating closes for things.

Two I would have added to the list personally;

Neatstatus (the one you wrote actually)
Fugitive

Neatstatus gives me the info I need when I’m editing stuff so when I’m doing includes or forget what mode I’m in, its perfect. I find it to be very non-intrusive too. It doesn’t give me any problems – just sits there and helps me when I need it.

Fugitive is a git wrapper plugin thingie written by Tim Pope (the pathogen guy) which for its Git Blame inside vim alone makes it a very good addition (although makes me scream at myself quite a bit when I realise I’m the one that screwed something up) besides everything else it can do.

Reply  |  Quote
]]>
By: Chris Wellons http://www.terminally-incoherent.com/blog/2014/04/02/3-tiny-vim-plugins-that-will-make-your-life-easier/#comment-69211 Wed, 02 Apr 2014 15:07:44 +0000 http://www.terminally-incoherent.com/blog/?p=16911#comment-69211

To compare with Emacs, each of these features ships with Emacs some way or another.

For pair balancing there’s electric-pair-mode. That’s pretty simple, though, just inserting the matching closing character automatically. There are much smarter pair matching modes available separately, the two biggest probably being paredit (for lisps) and autopair (for everything else).

HTML tag closing (or any other SGML-derived format) is built into html-mode. It’s just “C-c /” (nxml-finish-element).

For jumping around tags, there are a bunch of nxml-* and sgml-* interactive functions. Most of these aren’t bound to keys by default, though, so you’ll have to make up key bindings yourself. I use them internally in Skewer’s HTML mode to compute a CSS selector for the tag currently around the point. It jumps up through tags one at a time, keeping track of what kind of tags are visited until it hits the root.

Reply  |  Quote
]]>