<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Renato Carvalho .NET &#187; Console</title>
	<atom:link href="http://www.renatocarvalho.net/tag/console/feed" rel="self" type="application/rss+xml" />
	<link>http://www.renatocarvalho.net</link>
	<description>E no twitter @rmichnik</description>
	<lastBuildDate>Wed, 21 Jul 2010 00:47:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Sidebar folder list no mutt? Sim senhor!</title>
		<link>http://www.renatocarvalho.net/sidebar-folder-list-no-mutt-sim-senhor.html</link>
		<comments>http://www.renatocarvalho.net/sidebar-folder-list-no-mutt-sim-senhor.html#comments</comments>
		<pubDate>Fri, 14 Sep 2007 17:39:58 +0000</pubDate>
		<dc:creator>Renato Michnik de Carvalho</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mutt]]></category>

		<guid isPermaLink="false">http://renato.rootlinux.com.br/sidebar-folder-list-no-mutt-sim-senhor.html</guid>
		<description><![CDATA[Para quem não conhece, o mutt é um cliente de email que roda em console, muito bom, flexível, configurável, usável, otimizável e *ável. Navegando na net procurando por novidades sobre o mutt, me deparei com o site do Lunar-Linux em que um maluco criou um path para que seja exibido do lado esquerdo do mutt [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://renato.rootlinux.com.br/uploads/mutt-icon2.png" alt="mutt-icon2.png" align="left" />Para quem não conhece, o mutt é um cliente de email que roda em console, muito bom, flexível, configurável, usável, otimizável e *ável.</p>
<p>Navegando na net procurando por novidades sobre o mutt, me deparei com o site do <a href="http://www.lunar-linux.org">Lunar-Linux</a> em que um maluco criou um path para que seja exibido do lado esquerdo do mutt um sidebar com a lista das suas &#8220;pastas&#8221; de email que você pode conferir na imagem abaixo.</p>
<p style="text-align: center"><a title="mutt-sidebar2.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/mutt-sidebar2.jpg"><img src="http://renato.rootlinux.com.br/uploads/mutt-sidebar2.thumbnail.jpg" alt="mutt-sidebar2.jpg" /></a></p>
<p>Notem que além dele listar as &#8220;pastas&#8221; em sua esquerda ele conta quantas mensagens antigas e quantas novas há armazenadas, lembrando que eu utilizo o formato maildir de arquivamento das minhas mensagens ao invés do formato mbox.</p>
<p>A instala<span class="centro_resposta">ção ocorreu sem nenhum problema, segui exatamente o que o autor diz no site:</span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-O</span> - <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>ftp.mutt.org<span style="color: #000000; font-weight: bold;">/</span>mutt<span style="color: #000000; font-weight: bold;">/</span>devel<span style="color: #000000; font-weight: bold;">/</span>mutt-1.5.16.tar.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz - $ <span style="color: #7a0874; font-weight: bold;">cd</span> .<span style="color: #000000; font-weight: bold;">/</span>mutt-1.5.16
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-O</span> - http:<span style="color: #000000; font-weight: bold;">//</span>lunar-linux.org<span style="color: #000000; font-weight: bold;">/</span>~tchan<span style="color: #000000; font-weight: bold;">/</span>mutt<span style="color: #000000; font-weight: bold;">/</span>patch-1.5.16.sidebar.20070704.txt <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">patch</span> <span style="color: #660033;">-p1</span>
$ .<span style="color: #000000; font-weight: bold;">/</span>configure
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ .<span style="color: #000000; font-weight: bold;">/</span>mutt
$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>optional, <span style="color: #000000; font-weight: bold;">&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span>you need to be root <span style="color: #000000; font-weight: bold;">for</span> this<span style="color: #000000; font-weight: bold;">&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></td></tr></table></div>

<p>Após a instalação  do mutt devidamente patcheado, vamos editar o seu ~/.muttrc ou ~/.mutt/muttrc, depende de como ta sua configuração, e adicionar as seguintes linhas:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># set up the sidebar, default not visible</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">sidebar_width</span>=<span style="color: #000000;">30</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">sidebar_visible</span>=no
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">sidebar_delim</span>=<span style="color: #ff0000;">'|'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># which mailboxes to list in the sidebar</span>
mailboxes =inbox =ml
&nbsp;
<span style="color: #666666; font-style: italic;"># color of folders with new mail</span>
color sidebar_new yellow default
&nbsp;
<span style="color: #666666; font-style: italic;"># ctrl-n, ctrl-p to select next, prev folder</span>
<span style="color: #666666; font-style: italic;"># ctrl-o to open selected folder</span>
<span style="color: #7a0874; font-weight: bold;">bind</span> index \CP sidebar-prev
<span style="color: #7a0874; font-weight: bold;">bind</span> index \CN sidebar-next
<span style="color: #7a0874; font-weight: bold;">bind</span> index \CO sidebar-open
<span style="color: #7a0874; font-weight: bold;">bind</span> pager \CP sidebar-prev
<span style="color: #7a0874; font-weight: bold;">bind</span> pager \CN sidebar-next
<span style="color: #7a0874; font-weight: bold;">bind</span> pager \CO sidebar-open
&nbsp;
<span style="color: #666666; font-style: italic;"># I don't need these.  just for documentation purposes.  See below.</span>
<span style="color: #666666; font-style: italic;"># sidebar-scroll-up</span>
<span style="color: #666666; font-style: italic;"># sidebar-scroll-down</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># b toggles sidebar visibility</span>
macro index b <span style="color: #ff0000;">'toggle sidebar_visible'</span>
macro pager b <span style="color: #ff0000;">'toggle sidebar_visible'</span>
<span style="color: #666666; font-style: italic;"># Remap bounce-message function to &quot;B&quot;</span>
<span style="color: #7a0874; font-weight: bold;">bind</span> index B bounce-message
&nbsp;
<span style="color: #666666; font-style: italic;"># Mario Holbe suggests:</span>
<span style="color: #666666; font-style: italic;"># macro index b 'toggle sidebar_visible'</span>
<span style="color: #666666; font-style: italic;"># macro pager b 'toggle sidebar_visible'</span>
<span style="color: #666666; font-style: italic;">#</span></pre></td></tr></table></div>

<p>Modifique o que achar necessário,  agora reinicie o mutt e aperte a tecla &#8220;b&#8221; e&#8230; voilà! O mutt agora possui a lista dos diretórios como mostrado na imagem acima :-)</p>
<ul class="related_post"><li><a href="http://www.renatocarvalho.net/utilizando-folding-no-vim.html" title="Utilizando folding no vim">Utilizando folding no vim</a></li><li><a href="http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html" title="Integrando o manual do php ao VIM">Integrando o manual do php ao VIM</a></li><li><a href="http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html" title="Autocompletando no vim + dicionário PHP">Autocompletando no vim + dicionário PHP</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.renatocarvalho.net/sidebar-folder-list-no-mutt-sim-senhor.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utilizando folding no vim</title>
		<link>http://www.renatocarvalho.net/utilizando-folding-no-vim.html</link>
		<comments>http://www.renatocarvalho.net/utilizando-folding-no-vim.html#comments</comments>
		<pubDate>Mon, 06 Aug 2007 12:03:18 +0000</pubDate>
		<dc:creator>Renato Michnik de Carvalho</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[software livre]]></category>

		<guid isPermaLink="false">http://renato.rootlinux.com.br/utilizando-folding-no-vim.html</guid>
		<description><![CDATA[Vamos imaginar o seguinte, você abrindo um arquivo com diversas linhas, diversas &#8220;funções/métodos&#8221; e se não estiver com as marcações para folding, você verá que a apresentação não é uma das melhores. Agora abra o arquivo MDB2.php que está no pacote PEAR::MDB2 que com suas mais de 4.000 linhas, devidamente marcados com os foldings, olha [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://renato.rootlinux.com.br/uploads/vim.gif" alt="vim.gif" align="left" />Vamos imaginar o seguinte, você abrindo um arquivo com diversas linhas, diversas &#8220;funções/métodos&#8221; e se não estiver com as marcações para folding, você verá que a apresentação não é uma das melhores.</p>
<p>Agora abra o arquivo MDB2.php que está no pacote <a href="http://pear.php.net/package/MDB2">PEAR::MDB2</a> que com suas mais de 4.000 linhas, devidamente marcados com os foldings, olha como fica joiado</p>
<p><a title="folding.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/folding.jpg"></a></p>
<p style="text-align: center"><a title="folding.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/folding.jpg"><img title="folding.jpg" src="http://renato.rootlinux.com.br/uploads/folding.thumbnail.jpg" border="0" alt="folding.jpg" /></a></p>
<p>Mas como fazer para que seu arquivo fique assim? Basta adicionar ao seu .vimrc o seguinte:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">fdm</span>=marker</pre></td></tr></table></div>

<p>Existem <a href="http://www.vim.org/htmldoc/fold.html">diversas</a> formas de marcações para o folding, não vou descrever todas as formas, apenas a que eu uso, acho interessante e prática, mas cada um pode utilizar a que achar melhor ok.</p>
<p>A geração dos foldings são muito fáceis, primeiro coloque o vim em modo visual <strong>&lt;ESC&gt;v</strong> e selecione a área que deseja que seja criado o folding, depois basta apertar as telcas <strong>zf </strong>e pronto, o folding está criado. Para abrir ou fechar o folding, use <strong>za</strong>, quer abrir todos os foldings <strong>zR</strong> e para fechar <strong>zM</strong>. Basicamente e muito simplificado os comandos mais utilizados seriam esses (IMHO).</p>
<p>Uma coisa que gosto de fazer em meus códigos é colocar um pequeno comentário na mesma linha da declaração da função e logo após criar o folding, o resultado é ótimo, veja, como fica organizado o código.</p>
<p style="text-align: center"><a title="folding-php1.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/folding-php1.jpg"><img title="folding-php1.jpg" src="http://renato.rootlinux.com.br/uploads/folding-php1.thumbnail.jpg" border="0" alt="folding-php1.jpg" /></a></p>
<p><a title="folding-php21.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/folding-php21.jpg"></a></p>
<p style="text-align: center"><a title="folding-php21.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/folding-php21.jpg"><img title="folding-php21.jpg" src="http://renato.rootlinux.com.br/uploads/folding-php21.thumbnail.jpg" border="0" alt="folding-php21.jpg" /></a></p>
<p>Como disse, da para fazer o folding de <a href="http://www.vim.org/htmldoc/fold.html">diversas</a> maneiras, publiquei a maneira que <strong>eu </strong>acho mais simples e prática, se você tiver algo a acrescentar ao artigo, poste nos comentários :-) T+</p>
<ul class="related_post"><li><a href="http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html" title="Integrando o manual do php ao VIM">Integrando o manual do php ao VIM</a></li><li><a href="http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html" title="Autocompletando no vim + dicionário PHP">Autocompletando no vim + dicionário PHP</a></li><li><a href="http://www.renatocarvalho.net/personalizando-seu-vimrc.html" title="Personalizando seu .vimrc">Personalizando seu .vimrc</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.renatocarvalho.net/utilizando-folding-no-vim.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrando o manual do php ao VIM</title>
		<link>http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html</link>
		<comments>http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html#comments</comments>
		<pubDate>Fri, 03 Aug 2007 13:20:50 +0000</pubDate>
		<dc:creator>Renato Michnik de Carvalho</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Vim]]></category>
		<category><![CDATA[software livre]]></category>

		<guid isPermaLink="false">http://renato.rootlinux.com.br/integrando-o-manual-do-php-ao-vim-offline.html</guid>
		<description><![CDATA[Continuando com a série de artigos sobre o vim, vamos fazer algo simplismente fodástico, integrar o manual do php! Que tal você simplismente digitar 1 :help funcao_php e ele mostrar exatamente a função no manual? Joia não? Então, para isso basta você adicionar ao seu .vimrc as seguintes linhas: 1 2 3 if has&#40;&#34;autocmd&#34;&#41; autocmd [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://renato.rootlinux.com.br/uploads/vim.gif" alt="vim.gif" align="left" />Continuando com a série de artigos sobre o vim, vamos fazer algo simplismente fodástico, integrar o manual do php! Que tal você simplismente digitar</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">:<span style="color: #7a0874; font-weight: bold;">help</span> funcao_php</pre></td></tr></table></div>

<p>e ele mostrar exatamente a função no manual? Joia não? Então, para isso basta você adicionar ao seu .vimrc as seguintes linhas:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> has<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #ff0000;">&quot;autocmd&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
autocmd BufNewFile,Bufread <span style="color: #000000; font-weight: bold;">*</span>.php,<span style="color: #000000; font-weight: bold;">*</span>.php3,<span style="color: #000000; font-weight: bold;">*</span>.php4 <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">keywordprg</span>=<span style="color: #ff0000;">&quot;help&quot;</span>
endif</pre></td></tr></table></div>

<p>Feito isso, diga para o vim onde ta seus manuais (você pode ter mais de um, é claro, e também de outras linguagens), no caso, o do php que é a linguagem que eu utilizo diariamente, portanto foi o convidado da vez.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">helptags <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>USUARIO<span style="color: #000000; font-weight: bold;">/</span>.vim<span style="color: #000000; font-weight: bold;">/</span>doc</pre></td></tr></table></div>

<p>Agora so falta o manual, que como sou um cara legal, vou deixar tudo mastigado para você, <a href="http://planetxml.de/php_manual.txt">clique aqui</a> e salve o arquivo no seu ~/.vim/doc</p>
<p>Pronto! Tudo certo, faça um teste agora, abra um arquivo php e digite :help funcao&lt;cr&gt; e pronto, você terá uma lista das funções, e digo mais, se você seguiu o <a href="http://renato.rootlinux.com.br/autocompletando-no-vim-dicionario-php.html">artigo anterior</a> que falo sobre utilizar a tecla TAB para autocompletar, você poderá digitar apenas o início da função e terá uma lista de funções correspondentes, como na imagem abaixo</p>
<p><a title="vim-helptags.jpg" href="http://renato.rootlinux.com.br/uploads/vim-helptags.jpg" rel="lightbox[46]"></a></p>
<div style="text-align: center"><a title="vim-helptags.jpg" rel="lightbox" href="http://renato.rootlinux.com.br/uploads/vim-helptags.jpg"><img src="http://renato.rootlinux.com.br/uploads/vim-helptags.thumbnail.jpg" alt="vim-helptags.jpg" /></a></div>
<div><a title="vim-helptags.jpg" href="http://renato.rootlinux.com.br/uploads/vim-helptags.jpg" rel="lightbox[46]"> </a></div>
<p>Ah, mas você gostaria que o seu manual estivesse com a última atualização do mundo, do universo e ainda com todos os comentários? Então, adicione a linha abaixo ao seu .vimrc e coloque o cursor encima de uma função php e aperte F10 e veja, lembrando que há a dependencia do navegador para console <a href="http://lynx.browser.org/">lynx.</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">map  <span style="color: #ff0000;">&quot;vyiw:new:execute &quot;</span>r<span style="color: #000000; font-weight: bold;">!</span><span style="color: #c20cb9; font-weight: bold;">lynx</span> <span style="color: #660033;">--dump</span> http:<span style="color: #000000; font-weight: bold;">//</span>br.php.net<span style="color: #000000; font-weight: bold;">/</span>manual<span style="color: #000000; font-weight: bold;">/</span>en<span style="color: #000000; font-weight: bold;">/</span>function.<span style="color: #ff0000;">&quot;.@v.&quot;</span>.php<span style="color: #ff0000;">&quot;:set nonu:1</span></pre></td></tr></table></div>

<p>Pronto, espero que tenham gostado, T+</p>
<ul class="related_post"><li><a href="http://www.renatocarvalho.net/utilizando-folding-no-vim.html" title="Utilizando folding no vim">Utilizando folding no vim</a></li><li><a href="http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html" title="Autocompletando no vim + dicionário PHP">Autocompletando no vim + dicionário PHP</a></li><li><a href="http://www.renatocarvalho.net/personalizando-seu-vimrc.html" title="Personalizando seu .vimrc">Personalizando seu .vimrc</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Autocompletando no vim + dicionário PHP</title>
		<link>http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html</link>
		<comments>http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html#comments</comments>
		<pubDate>Thu, 02 Aug 2007 19:59:06 +0000</pubDate>
		<dc:creator>Renato Michnik de Carvalho</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programação]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://renato.rootlinux.com.br/autocompletando-no-vim-dicionario-php.html</guid>
		<description><![CDATA[Nesse artigo sobre o vim, falei um pouco sobre a personalização do .vimrc, agora vamos adicionar um dicionário das funções php para que você consiga autocompletar suas funções como aqueles editores pesados como o phpeclipse faz, mas ao invés de usarmos o CTRL+espaço, vamos usar apenas o TAB. Crie os diretórios para plugin e doc [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://renato.rootlinux.com.br/uploads/vim.gif" alt="vim.gif" align="left" />Nesse artigo sobre o vim, falei um pouco sobre a personalização do .vimrc, agora vamos adicionar um dicionário das funções php para que você consiga autocompletar suas funções como aqueles editores pesados como o phpeclipse faz, mas ao invés de usarmos o CTRL+espaço, vamos usar apenas o TAB.</p>
<ol>
<li>Crie os diretórios para plugin e doc no vim
<ul>
<li>mkdir -p ~/.vim/doc</li>
<li>mkdir -p ~/.vim/plugin</li>
</ul>
</li>
<li>Baixe e instale o plugin para o vim <a href="http://www.vim.org/scripts/script.php?script_id=1643">SuperTab. </a></li>
<li>Baixe a lista das funções php do site do <a href="http://lerdorf.com/funclist.txt">Lerdorf</a> e salve em ~/.vim/doc</li>
</ol>
<p>Agora para tudo funcionar, basta inserir a linha abaixo no seu .vimrc:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="text" style="font-family:monospace;">if has(&quot;autocmd&quot;)
autocmd FileType php  set complete-=k/home/USUARIO/.vim/doc/funclist.txt complete+=k/home/USUARIO/.vim/doc/funclist.txt
endif</pre></td></tr></table></div>

<p>Lembre de trocar USUARIO pelo seu usuário no sistema.</p>
<p>Pronto, se você fez tudo corretamente, faça um teste:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vim</span> teste.php</pre></td></tr></table></div>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
eregi_re
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>deve ficar:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">eregi_replace</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>T+</p>
<ul class="related_post"><li><a href="http://www.renatocarvalho.net/utilizando-folding-no-vim.html" title="Utilizando folding no vim">Utilizando folding no vim</a></li><li><a href="http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html" title="Integrando o manual do php ao VIM">Integrando o manual do php ao VIM</a></li><li><a href="http://www.renatocarvalho.net/personalizando-seu-vimrc.html" title="Personalizando seu .vimrc">Personalizando seu .vimrc</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Personalizando seu .vimrc</title>
		<link>http://www.renatocarvalho.net/personalizando-seu-vimrc.html</link>
		<comments>http://www.renatocarvalho.net/personalizando-seu-vimrc.html#comments</comments>
		<pubDate>Wed, 01 Aug 2007 17:42:53 +0000</pubDate>
		<dc:creator>Renato Michnik de Carvalho</dc:creator>
				<category><![CDATA[Console]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Vim]]></category>

		<guid isPermaLink="false">http://renato.rootlinux.com.br/personalizando-seu-vimrc.html</guid>
		<description><![CDATA[Se tem algo que me faz gosto em programar, é a extensibilidade do editor vim, há anos uso ele diariamente e confesso que no início foi um pouco dificil de me acostumar, mas depois que se acostuma os ganhos em agilidade são imensos, estou pensando em fazer vários mini tutoriais a respeito do vim, o [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://renato.rootlinux.com.br/uploads/vim.gif" alt="vim.gif" align="left" />Se tem algo que me faz gosto em programar, é a extensibilidade do editor vim, há anos uso ele diariamente e confesso que no início foi um pouco dificil de me acostumar, mas depois que se acostuma os ganhos em agilidade são imensos, estou pensando em fazer vários mini tutoriais a respeito do vim, o que acham?  O propósito desse artigo é falar um pouco sobre a personalização do seu .vimrc.  Antes de tudo, abra um terminal e digite os 2 comandos abaixo:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> .vimrc</pre></div></div>

<p>Pronto, com o arquivo aberto vamos la!  Bem, como programador php, a maioria dos arquivos que eu abro são com extensões .php o que o vim syntaxia ele automaticamente pois eu tenho a linha abaixo habilitada</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">syntax on</pre></div></div>

<p>Mas e quando um merda santo resolve criar uma classe php e coloca como extensão .cls, .inc ou ainda .module? Ai o vim não syntaxia automaticamente, lascou né? Não, basta colocar:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">au BufRead,BufNewFile <span style="color: #000000; font-weight: bold;">*</span>.cls,<span style="color: #000000; font-weight: bold;">*</span>.inc,<span style="color: #000000; font-weight: bold;">*</span>.module <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">filetype</span>=php</pre></div></div>

<p>Aqui transformando os arquivos com extensões .tpl e .html como html</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">au BufRead,BufNewFile <span style="color: #000000; font-weight: bold;">*</span>.tpl,<span style="color: #000000; font-weight: bold;">*</span>.html <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">filetype</span>=html</pre></div></div>

<p>Resolvido o problema da syntax, vamos colocar mais algumas opções, lembrando que as aspas duplas querem dizer comentários ok.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">set</span> nu <span style="color: #ff0000;">&quot;colocar as linhas automaticamente&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> cindent <span style="color: #ff0000;">&quot;indentação no estilo C&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> is hls ic scs <span style="color: #ff0000;">&quot;opções de busca&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> sm <span style="color: #ff0000;">&quot;mostra o início do bloco que acabou de ser fechado, sm é o mesmo que ShowMatch&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">wildmode</span>=longest,list <span style="color: #ff0000;">&quot;para completar com TAB igualzinho o bash faz&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> ai <span style="color: #ff0000;">&quot;auto indent&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">shiftwidth</span>=<span style="color: #000000;">4</span> <span style="color: #ff0000;">&quot;se mudar o valor eu te mato :-P, numero de espaço usado quando rolar o autoindent&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">softtabstop</span>=<span style="color: #000000;">4</span> <span style="color: #ff0000;">&quot;se mudar aqui, tb te mato! numero de espaços que deve-se dar quando apertar o TAB&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">tabstop</span>=<span style="color: #000000;">4</span> <span style="color: #ff0000;">&quot;por favor, também nao mude isso! numero de espações que deve-se voltando quando apertar o backspace num tab&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">bs</span>=<span style="color: #000000;">2</span> <span style="color: #ff0000;">&quot;para o backspace se comportar como a gente gosta&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">fdm</span>=marker <span style="color: #ff0000;">&quot;o modo como o folding deverá trabalhar, prometo escrever um artigo falando sobre o folding no vim&quot;</span>
<span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">termencoding</span>=utf8 <span style="color: #ff0000;">&quot;Yeah!! UTF-8 em tudo!&quot;</span>
filetype plugin on
filetype indent on</pre></div></div>

<p>Sou um preguiçoso, por isso me tornei programador, então, vai ai algums atalhos que uso constantemente para debugar partes dos meus scripts</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&quot; atalhos
abbreviate epre echo &quot;&amp;lt;pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; print_r($); echo &quot;&amp;lt;/pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; die();
abbreviate epres echo &quot;&amp;lt;pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; print_r($_SESSION); echo &quot;&amp;lt;/pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; die();
abbreviate eprep echo &quot;&amp;lt;pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; print_r($_POST); echo &quot;&amp;lt;/pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; die();
abbreviate epreg echo &quot;&amp;lt;pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; print_r($_GET); echo &quot;&amp;lt;/pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; die();
abbreviate eprer echo &quot;&amp;lt;pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; print_r($res); echo &quot;&amp;lt;/pre&amp;gt;&amp;lt;hr&amp;gt;&quot;; die();
abbreviate ds die($sql);</pre></td></tr></table></div>

<p>Agora vamos mapear mais alguns atalhos?</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #ff0000;">&quot;isso aqui é FERA quando tem algum zoiudo vendo o que vc ta fazendo, aperte F8 e a tela fica embaralhada e F8 para voltar ao normal&quot;</span>
map  ggVGg?
<span style="color: #ff0000;">&quot;isso é FODA, coloque  o cursor encima de alguma funcao PHP e aperte o F10 e ele vai buscar no site do php.net a definição para ela, sinistro heim?&quot;</span>
map  <span style="color: #ff0000;">&quot;vyiw:new:execute &quot;</span>r<span style="color: #000000; font-weight: bold;">!</span><span style="color: #c20cb9; font-weight: bold;">lynx</span> <span style="color: #660033;">--dump</span> http:<span style="color: #000000; font-weight: bold;">//</span>br.php.net<span style="color: #000000; font-weight: bold;">/</span>manual<span style="color: #000000; font-weight: bold;">/</span>en<span style="color: #000000; font-weight: bold;">/</span>function.<span style="color: #ff0000;">&quot;.@v.&quot;</span>.php<span style="color: #ff0000;">&quot;:set nonu:1
&quot;</span>sabe aqueles ^M xaropes que ficam no final de arquivos salvos pelo windows? Aperte F2 e suma com eles :-D<span style="color: #ff0000;">&quot;
map  :%s/<span style="color: #000099; font-weight: bold;">\r</span>//g
&quot;</span>útil para quando vc deixa a tecla CAPS LOCK ativada e nao viu, umas abreviações porretas<span style="color: #ff0000;">&quot;
cab W w | cab Q q | cab Wq wq | cab wQ wq | cab WQ wq
Bem, por hora é só, aguarde que teremos outros artigos sobre o vim, tem muita coisa para falar dele, t+</span></pre></div></div>

<ul class="related_post"><li><a href="http://www.renatocarvalho.net/utilizando-folding-no-vim.html" title="Utilizando folding no vim">Utilizando folding no vim</a></li><li><a href="http://www.renatocarvalho.net/integrando-o-manual-do-php-ao-vim-offline.html" title="Integrando o manual do php ao VIM">Integrando o manual do php ao VIM</a></li><li><a href="http://www.renatocarvalho.net/autocompletando-no-vim-dicionario-php.html" title="Autocompletando no vim + dicionário PHP">Autocompletando no vim + dicionário PHP</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.renatocarvalho.net/personalizando-seu-vimrc.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
