From: "Ivan lopes" <address@hidden>
Reply-To: address@hidden
To: shell-script <address@hidden>
Subject: [shell-script] Re: script shell com vim
Date: Thu, 30 Aug 2007 22:06:05 -0300
MIME-Version: 1.0
X-Originating-IP: 209.85.146.182
X-Sender: address@hidden
Received: from n13a.bullet.sp1.yahoo.com ([69.147.64.112]) by
bay0-mc12-f17.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Thu,
30 Aug 2007 18:06:11 -0700
Received: from [216.252.122.217] by n13.bullet.sp1.yahoo.com with NNFMP; 31
Aug 2007 01:06:09 -0000
Received: from [209.73.164.83] by t2.bullet.sp1.yahoo.com with NNFMP; 31
Aug 2007 01:06:09 -0000
Received: from [66.218.67.108] by t7.bullet.scd.yahoo.com with NNFMP; 31
Aug 2007 01:06:08 -0000
Received: (qmail 98436 invoked from network); 31 Aug 2007 01:06:06 -0000
Received: from unknown (66.218.66.71) by m44.grp.scd.yahoo.com with QMQP;
31 Aug 2007 01:06:06 -0000
Received: from unknown (HELO wa-out-1112.google.com) (209.85.146.182) by
mta13.grp.scd.yahoo.com with SMTP; 31 Aug 2007 01:06:06 -0000
Received: by wa-out-1112.google.com with SMTP id l24so772536waf for
<address@hidden>; Thu, 30 Aug 2007 18:06:05 -0700 (PDT)
Received: by 10.114.93.17 with SMTP id q17mr224423wab.1188522365277;
Thu, 30 Aug 2007 18:06:05 -0700 (PDT)
Received: by 10.115.111.7 with HTTP; Thu, 30 Aug 2007 18:06:05 -0700 (PDT)
X-Message-Delivery: Vj0zLjQuMDt1cz0wO2k9MDtsPTA7YT0w
X-Message-Info:
JGTYoYF78jGQEDLaumGixLsACb7eYJX0MQTefjBKgT/4wXupggponVkTtH3PvHH89KMLF9mpme8w6q5TiyKxPg==
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=hotel;
d=yahoogrupos.com.br;b=pKBVV4eE88f8h/gyO127v/UZBzfRxt3OFo9mlK2zB2U4pn3+fdaC6OUtyKvB3ZRS7Cf6ClcM5i4Tr1i7ECt++7rS6P2jsGXUJz+9XNOR7WeYRTMy/MWIHQjK85O2t02y;
X-Yahoo-Newman-Id: 1941312-m2845
X-Apparently-To: address@hidden
References: <address@hidden>
X-eGroups-Msg-Info: 1:12:0:0:0
X-Yahoo-Profile: ivanczar78
Mailing-List: list address@hidden; contact
address@hidden
Delivered-To: mailing list address@hidden
List-Id: <shell-script.yahoogrupos.com.br>
Precedence: bulk
List-Unsubscribe: <mailto:address@hidden>
X-Yahoo-Newman-Property: groups-email-ff-m
Return-Path:
sentto-1941312-2845-1188522367-gemayellira=address@hidden
X-OriginalArrivalTime: 31 Aug 2007 01:06:11.0315 (UTC)
FILETIME=[1EBE1430:01C7EB6B]
"
////////////////////////////////////////////////////////////////////////////
" WideMsg() prints [long] message up to (&columns-1) length
function WideMsg(msg)
let x=&ruler | let y=&showcmd
set noruler noshowcmd
redraw
echo a:msg
let &ruler=x | let &showcmd=y
endfunction
" call WideMsg("This should be a very loooong line of text")
"
////////////////////////////////////////////////////////////////////////////
esqueciiiii
On 8/30/07, Ivan lopes <address@hidden> wrote:
> Amigos, sou totalmente fanatico pelo VIM e shell, logo eu ficava
> de saco cheio, de ter que ir no man varias vezes para saber oque
> siguinifica tal parametro do comando tal ... e resolvi compartilhar
> com vcs essa dica ...
>
> VAMOS AO QUE INTERESSA ...
>
> ta editando aquele escript do coracao e vc ve a seguinte linha
>
> grep -v -colour ....
>
> ai vc aperta ?, isso, interrogacao, que vai aparecer no seu vim
> a descricao dos parametros -v e -colour
>
> " comeca aqui
> map <expr> ? WhatIsThis(getline('.'))
>
> function WhatIsThis(line)
>
> let line = getline('.')
>
> let command = filter(split(line, '\s\+'), 'v:val !~ "\\A\\+"')
>
> if len(command) > 1
> let command[0] = expand('<cWORD>')
>
> endif
>
> let option = filter(split(line, '\s\+'), 'v:val =~ "^-\\+"')
>
> let times = 0
> while times < len(option)
> call GetInMan(command[0], option[times])
>
> let times += 1
>
> endwhile
>
> return col('.')
> endfunction
>
> function GetInMan(command, option)
> let cmd = a:command
> let opt = a:option
> call WideMsg (system('man -7 '.cmd.' 1| col -b| sed
"/^\s*'.opt.'\>/,/^$/!d"'))
> endfunction
>
>
>
> --
> [ ]'s
> Ivan Carlos Da Silva Lopes
>
> Engenheiro Eletronico e Computacao
> UFRJ
>
--
[ ]'s
Ivan Carlos Da Silva Lopes
Engenheiro Eletronico e Computacao
UFRJ