Sunday, December 8, 2013

Re: autocompletion for html (and other things)

On 07.12.13 22:47, George Zakhour wrote:
> On Saturday, December 7, 2013 10:03:39 PM UTC+2, Gallagher Polyn wrote:
> > How can I configure vim to allow me to type this...
> >
> > <html>
> >
> > ...and have the closing tag created, too...
> >
> > </html>

That seems to be too much typing for my taste. If you just consider it
as an insert mode abbreviation, we can already achieve good efficiency.
In .vimrc or a more application-specific config file, add the line:

iab ht <html> </html>

Now, typing ht<space> gives: "<html> </html>" (i.e. RHS <> are literal)

Gallagher, will that do?
You'll have to move the cursor back in between, to insert the content.
I figure it'd take a macro to do that automatically.

> Vim is a text-editor not an IDE. Auto-completion is a feature of an IDE not a text-editor.

George, how can it be then, that hitting ^p after "auto", while typing
this sentence causes vim to provide autocompletion options of
"autocompletion" and "automatically"? Hmm?

Erik

--
In many African nations you could see the giant portraits of leaders towering
over public spaces. In South Africa's townships it was in the homes, in the
private spaces where Madiba's portrait could be seen most prominently.
- http://www.abc.net.au/news/2013-12-06/benson-vale-nelson-mandela-a-man-of-heroic-compromise/4776674

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: