> On Wed, 20 Jul 2011, 何聪辉 wrote:
> > Hi, I am using vim as the simple IDE, and use qmake and make tool to
> > configure my project. If a directory named "Foo", and inside the
> > directory, there exists some headers and source files, I use the
> > command "qmake -project", and it will generate a file called
> > "Foo.pro", After I type "qmake", it will automatically generate the
> > Makefile that I want, and by default, the target of the Makefile is
> > the name of the directory, that is, "Foo". Now I want to do some
> > mapping, say map <C-F5> to execute the executable file, "Foo". So I
> > need to get the name of the directory. How can i achieve that?
>
> You want:
>
> %:p:h:t
> or
> expand('%:p:h:t')
>
> (depending on context)
>
> --
> Best,
> Ben
Looking at help it seems :t cannot be used with :h
help %:h
:h Head of the file name (the last component and any separators
removed).
Cannot be used with :e, :r or :t.
-Bill
--
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
No comments:
Post a Comment