completely BASH in vi

0 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Oliver Stieber

ungelesen,
28.08.2010, 07:21:5528.08.10
an vim...@vim.org
Hi,
I've just sudo mounted my hard drive to get my music off of it, and then vi /etc/fstab so that it come up at boot time.
and I had the urge to hit tab to complete the entries in the fstba file as I do with bash or many other things.

so then I thought, well if bash already has this feature, how hard would it be to write an extension to vi, so that vi can look at some templates that define completion equivalences for various configuration files or whatever.

 and the I suppose ontop of that said templating language could be portable so that emacs or 'internet explorer' could use it.

So as I was wondering how I would go about writing such a templating language and integrating it with vi, or if such a thing already exists?


Oliver Stieber.

Ben Fritz

ungelesen,
29.08.2010, 23:13:1829.08.10
an vim_dev


On Aug 28, 6:21 am, Oliver Stieber <oliverthe...@gmail.com> wrote:
> Hi,
> I've just sudo mounted my hard drive to get my music off of it, and then vi
> /etc/fstab so that it come up at boot time.
> and I had the urge to hit tab to complete the entries in the fstba file as I
> do with bash or many other things.
>
> so then I thought, well if bash already has this feature, how hard would it
> be to write an extension to vi, so that vi can look at some templates that
> define completion equivalences for various configuration files or whatever.
>

If I understand what you're saying, in this specific case you were
looking for filename completion, but also completion in general.

In Vim, in insert mode, CTRL-X followed by CTRL-F will go into
filename completion.

On the command-line, TAB will do this for you.

If you want other kinds of completion in insert mode, there are
several. See ins-completion (the entire long section) for details.

Oliver Stieber

ungelesen,
30.08.2010, 00:04:5830.08.10
an vim...@googlegroups.com
TAB in BASH does a little more than that, in that it's (often) specific about what it looks up dependant on the command and the previous arguments.

so taking FSTAB as a (bad?) example:
The first entry can be a number of things dependant on the types of filing system available.

The next is a filing system mount point, so a directory

The next is a type so one of cat /proc/filesystems

The next is a number of switches to mount

etc...

in bash if I type ls -- then TAB it gives me a list of arguments, if I type ls then / is gives me something on the filing system.

I'll take a look at ins-completion, I was wondering more if there's a generic way to represent a well formatted file layout and what's expected where. I know there are things like c-tags about.


--
You received this message from the "vim_dev" 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

Oliver Stieber

ungelesen,
30.08.2010, 00:06:4730.08.10
an vim...@googlegroups.com
Hi,
sorry I bothered you.
found SuperTab http://www.vim.org/scripts/script.php?script_id=1643 so will take a look at it first.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten