[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Very useful patch for grep :-)
From: |
Stepan Koltsov |
Subject: |
Very useful patch for grep :-) |
Date: |
Mon, 2 Apr 2001 11:36:19 +0400 |
User-agent: |
Mutt/1.2.5i |
I wrote small, but very useful patch for grep (and I want for U applied it
to grep :-) Alain Magloire advised me to send it here (I hope that anybody
helps me to convince him to apply this patch to grep). (Alain Magloire is
maintainer of gnu grep, if anybody doesn't know).
I added key -D (or --filename-once), that print "-- filename:" instead of "--"
with options such as -C, for example:
W/o using my patch:
address@hidden:/usr/share/vim/vim56/doc]% grep -C3 using *.txt | head -15
autocmd.txt- *GUIEnter*
autocmd.txt-GUIEnter After starting the GUI succesfully, and
after
autocmd.txt- opening the window. It is triggered
before
autocmd.txt: VimEnter when using gvim. Can be used
to
autocmd.txt- position the window from a .gvimrc
file:autocmd.txt-> :autocommand GUIEnter * winpos 100 50
autocmd.txt- *VimEnter*
--
autocmd.txt-> let myfiletypefile = "~/vim/myfiletypes.vim"
autocmd.txt-
autocmd.txt- Your file will then be sourced after the default FileType
autocommands have
autocmd.txt: been installed. This allows you to overrule any of the
defaults, by using
autocmd.txt- ":au!" to remove any existing FileType autocommands for the same
pattern.
autocmd.txt- Only the autocommand to source the scripts.vim file is given
later. This
autocmd.txt- makes sure that your autocommands in "myfiletypefile" are used
before
address@hidden:/usr/share/vim/vim56/doc]%
U'll value this if U read this in term. with width ~ 80 cols.
Using my patch:
address@hidden:/usr/share/vim/vim56/doc]% grep -DC3 using *.txt | head -15
-- autocmd.txt:
*GUIEnter*
GUIEnter After starting the GUI succesfully, and after
opening the window. It is triggered before
VimEnter when using gvim. Can be used to
position the window from a .gvimrc file:
> :autocommand GUIEnter * winpos 100 50
*VimEnter*
-- autocmd.txt:
> let myfiletypefile = "~/vim/myfiletypes.vim"
Your file will then be sourced after the default FileType autocommands have
been installed. This allows you to overrule any of the defaults, by using
":au!" to remove any existing FileType autocommands for the same pattern.
Only the autocommand to source the scripts.vim file is given later. This
address@hidden:/usr/share/vim/vim56/doc]%
If I do that writing full path name
(grep -C3 using /usr/share/vim/vim56/doc/*.txt) it become unable to read
output :-)
If anybody don't like vim, I can write other example :-)
This is very useful patch (sent as attachment).
I'm sorry for my bad English, I don't like to go University to English
lessons :-)
Stepan K.
--
mailto: address@hidden
ICQ: 26521795
... Я самый умный и красивый. Кто не верит -- заходите в гости и
... смотрите :)
grep-2.4.2-yozh.patch
Description: Text document
- Very useful patch for grep :-),
Stepan Koltsov <=