Sunday, November 27, 2011

Re: How to customize CTRL-W CTRL-F?

On 27/11/11 18:28, Peng Yu wrote:
> Hi,
>
> I want to customize the behavior of CTRL-W CTRL-F. For example, it is
> of the pattern #include<header.h>, I will search for C and C++ header
> file directories. If it is of the pattern import os, I'll search for
> python library directories for file os.py.
>
> More generally, it a line match for some pattern, I will call an
> external program (the program could be written as a vim function) to
> resolve the file to be opened.
>
> :help CTRL-W_f doesn't tell me how to customize it. Could anybody let
> me know how to do so? Thanks!
>
> Regards,
> Peng
>

About customizing key bindings (or bindings for key sequences), see
:help map.txt

About defining a custom function in Vim, see the help section starting
at :help user-functions

About regular expressions in Vim, see the help section starting at :help
pattern-overview (or :help rn-ov if you are, like me, a lazy typist) for
a summary and the rest of the same helpfile for the encyclopaedic
treatment of the matter.

About calling an external program in order to use its stdout output, see
:help system()

It's been too long since I've been Linux-only, I don't remember if
system() is or isn't one of the cases where, on Windows, calling an
external program requires opening a cmd.exe window which you'll have to
close by hitting any key after it finishes. I also can't tell if you are
on Windows or not: if you aren't, this paragraph does not apply to you.


Best regards,
Tony.
--
Love is the triumph of imagination over intelligence.
-- H. L. Mencken

--
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