<?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>Calcifer &#187; vim</title>
	<atom:link href="http://blog.calcifer.com.ar/tag/vim/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.calcifer.com.ar</link>
	<description></description>
	<lastBuildDate>Sat, 02 Oct 2010 05:32:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Vim scripting con Python</title>
		<link>http://blog.calcifer.com.ar/2010/02/vim-scripting-con-python/</link>
		<comments>http://blog.calcifer.com.ar/2010/02/vim-scripting-con-python/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 01:20:00 +0000</pubDate>
		<dc:creator>lvidarte</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.calcifer.com.ar/?p=549</guid>
		<description><![CDATA[Vim permite agregar funcionalidades mediante varios lenguajes externos, entre ellos Perl, Python, Ruby y Tcl. Para poder hacer uso de esta característica es necesario haber compilado Vim con el soporte para el lenguaje necesario (con el flag-python, para soporte python). En debian existe un paquete llamado vim-nox (no X) que contiene una versión compilada con [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vim.org/" title="Vim the editor" class="external">Vim</a> permite agregar funcionalidades mediante varios lenguajes externos, entre ellos Perl, Python, Ruby y Tcl. Para poder hacer uso de esta característica es necesario haber compilado Vim con el soporte para el lenguaje necesario (con el flag<code>-python</code>, para soporte python). En debian existe un paquete llamado <a href="http://packages.debian.org/stable/vim-nox" title="Debian Package: vim-nox" class="external">vim-nox</a> (no X) que contiene una versión compilada con soporte para los cuatro lenguajes mencionados:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">sudo apt-get install vim-nox</div></div>
<p>Para comprobar que efectivamente se encuentre habilitado el soporte para Python ejecutar Vim y en modo comando escribir:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:echo has(&quot;python&quot;)</div></div>
<p>Un 1 indica que Vim interpreta Python ;)</p>
<p>Es muy recomendable leer la ayuda en línea:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:help python</div></div>
<p>También se puede acceder vía web desde <a href="http://vimdoc.sourceforge.net/htmldoc/if_pyth.html" title="Vim documentation: if_pyth" class="external">http://vimdoc.sourceforge.net/htmldoc/if_pyth.html</a></p>
<h3>Ejecución de código Python</h3>
<p>La ejecución de una línea de código Python se realiza según la sintaxis:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:[range]py[thon] {stmt}</div></div>
<p>Ejemplo:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:python print &quot;hello world&quot;</div></div>
<p>Aquí el prompt mostrará el mensaje &#8220;hello world&#8221;.</p>
<p>En cambio para escribir código en varias líneas hay que usar la siguiente forma:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">[range]:py[thon] &lt;&lt; {endmarker}<br />
{script}<br />
{endmarker}</div></div>
<p>Ejemplo:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:python &lt;&lt; EOF<br />
def get_user():<br />
&nbsp; import os<br />
&nbsp; return os.getenv('USER')<br />
EOF</div></div>
<p>De esta manera la función queda guardada en la memoria de la sesión actual. Luego su uso podría ser el siguiente:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py user = get_user()</div></div>
<p>Tambien es posible cargar y/o ejecutar código desde un archivo externo. La sintaxis es:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:[range]pyf[ile] {file}</div></div>
<p>Ejemplo:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:pyfile myscript.py</div></div>
<p>Si<code>myscript.py</code>necesitara parámetros la forma de pasárselos es la siguiente:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py import sys<br />
:py sys.argv = ['foo', 'bar']<br />
:pyf myscript.py</div></div>
<h3>El módulo vim</h3>
<p>La comunicación entre Python y Vim se realiza a través del módulo vim, el cual hay que importar antes de usar:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:python import vim</div></div>
<p>Como indica la ayuda de Vim, el módulo implementa dos métodos (<code>vim.command(str)</code>y<code>vim.eval(str)</code>), tres constantes (<code>vim.buffers</code>,<code>vim.windows</code>y<code>vim.current</code>) y un objeto error (<code>vim.error</code>). Las tres constantes mencionadas no son realmente constantes sino variables que pueden ser reasignadas pero, como dice también la ayuda, esto sería absurdo ya que se perdería acceso a los objetos de Vim que referencian. Por otra parte cabe recordar que no existen constantes en Python. Como cita el libro &#8220;<a href="http://www.gulic.org/almacen/diveintopython-5.4-es/object_oriented_framework/class_attributes.html" title="Capítulo 5.8. - Presentación de los atributos de clase" class="external">Inmersión en Python</a>&#8220;:</p>
<blockquote><p>Todo puede cambiar si lo intenta con ahínco. Esto se ajusta a uno de los principios básicos de Python: los comportamientos inadecuados sólo deben desaconsejarse, no prohibirse.</p></blockquote>
<p><span id="more-549"></span><br />
A continuación transcribo un detalle de cada una de las constantes mencionadas:</p>
<dl>
<dt>vim.buffers</dt>
<dd>
Objeto de tipo secuencia que provee acceso al listado de buffers actuales. El objeto soporta las siguiente operaciones:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py b = vim.buffers[i] &nbsp; &nbsp; # Indexación (Read-Only)<br />
:py b in vim.buffers &nbsp; &nbsp; &nbsp; # Prueba de existencia<br />
:py n = len(vim.buffers) &nbsp; # Número de elementos<br />
:py for b in vim.buffers: &nbsp;# Acceso secuencial</div></div>
</dd>
<dt>vim.windows</dt>
<dd>
Objeto de tipo secuencia que provee acceso al listado de ventanas actuales. El objeto soporta las mismas operaciones que vim.buffers:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py w = vim.windows[i] &nbsp; &nbsp; # Indexación (RO)<br />
:py w in vim.windows &nbsp; &nbsp; &nbsp; # Prueba de existencia<br />
:py n = len(vim.windows) &nbsp; # Número de elementos<br />
:py for w in vim.windows: &nbsp;# Acceso secuencial</div></div>
</dd>
<dt>vim.current</dt>
<dd>
Objeto que provee acceso (vía atributos específicos) a distintos objetos actuales:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">vim.current.line &nbsp; &nbsp;# (RW) String<br />
vim.current.buffer &nbsp;# (RO) Buffer<br />
vim.current.window &nbsp;# (RO) Window<br />
vim.current.range &nbsp; # (RO) Range</div></div>
</dd>
</dl>
<h3>Ejemplos básicos de uso del módulo vim</h3>
<p>Usando<code>vim.current.line</code>:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py from string import upper<br />
:py vim.current.line = upper(vim.current.line)</div></div>
<p>Usando<code>vim.current.buffer</code>:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py b = vim.current.buffer &nbsp; &nbsp; &nbsp;# obtiene buffer actual<br />
:py name = b.name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # nombre de archivo del buffer actual<br />
:py num = len(b) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# total de líneas en el buffer<br />
:py line = b[n] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # obtiene la línea n+1<br />
:py lines = b[n:m] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# obtiene una lista de líneas<br />
:py b[n] = str &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# reemplaza la línea n+1<br />
:py b[n:m] = [str1, str2, str3] # reemplaza varias líneas a la vez<br />
:py b[0:0] = [&quot;hola mundo&quot;] &nbsp; &nbsp; # inserta una línea al comienzo<br />
:py b.append(&quot;fin&quot;) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # inserta una línea al final<br />
:py del b[n] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# borra la línea n+1<br />
:py del b[n:m] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# borra varias líneas a la vez<br />
:py b[:] = None &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # borra el buffer completo</div></div>
<p>Usando<code>vim.current.window</code>:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py cw = vim.current.window &nbsp; &nbsp; &nbsp;# obtiene la ventana actual<br />
:py cw.height = 30 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # setea el alto de la ventana<br />
:py cw.width = 80 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# setea el ancho<br />
:py pos = cw.cursor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# posicion del cursor (row, col)</div></div>
<h3>Script para subrayado de títulos</h3>
<p>El siguiente script (<a href="http://blog.calcifer.com.ar/uploads/2010/02/heading.vim" title="">heading.vim</a>) lo escribí para no tener que, manualmente, subrayar títulos y delimitar bloques de texto. Especialmente quería que reconociera cuando se tratara de texto dentro de comentarios de código fuente y que respetara los caracteres especiales al comienzo (y final) de los mismos.</p>
<p>El script tiene una función que decora la línea actual colocando él o los caracteres decoradores tanto arriba como debajo de la misma (comportamiento por defecto). El largo (también por defecto) es el largo de la línea, pero se puede fijar un límite (ejemplo 80 columnas) y pedirle que ocupe todo el espacio disponible. Esta opción funciona bien sólamente cuando el indentado es con espacios. La opción uppercase funciona como se espera.</p>
<p>El código es el siguiente:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px;height:500px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">&quot; ============================================================================<br />
&quot; File: &nbsp; &nbsp; &nbsp; &nbsp;heading.vim<br />
&quot; Version: &nbsp; &nbsp; 0.1<br />
&quot; Description: vim global plugin that provides a way to create headings.<br />
&quot; Maintainer: &nbsp;Leonardo Vidarte &lt;lvidarte at gmail dot com&gt;<br />
&quot; Last Change: 21 February, 2010<br />
&quot; ============================================================================<br />
if has('python')<br />
python &lt;&lt; EOF<br />
def heading(decorator='=', top=True, bottom=True, limit=0, uppercase=False):<br />
<br />
&nbsp; &nbsp; import vim<br />
&nbsp; &nbsp; from string import upper, rstrip, lstrip<br />
<br />
&nbsp; &nbsp; if not top and not bottom:<br />
&nbsp; &nbsp; &nbsp; &nbsp; return None # nothing to do<br />
<br />
&nbsp; &nbsp; (row, col) = vim.current.window.cursor<br />
&nbsp; &nbsp; line = vim.current.buffer[row-1].rstrip()<br />
&nbsp; &nbsp; line_length = len(line.decode('utf8'))<br />
&nbsp; &nbsp; title = line.lstrip()<br />
&nbsp; &nbsp; word_length = len(title.decode('utf8'))<br />
&nbsp; &nbsp; whitespace = line[0:line_length - word_length]<br />
<br />
&nbsp; &nbsp; if limit &gt; 0:<br />
&nbsp; &nbsp; &nbsp; &nbsp; decorator *= limit<br />
&nbsp; &nbsp; &nbsp; &nbsp; total_length = limit<br />
&nbsp; &nbsp; else:<br />
&nbsp; &nbsp; &nbsp; &nbsp; decorator *= word_length<br />
&nbsp; &nbsp; &nbsp; &nbsp; total_length = line_length<br />
<br />
&nbsp; &nbsp; if title[0:3] in ('// ', '/* ', '-- '):<br />
&nbsp; &nbsp; &nbsp; &nbsp; decoline = whitespace + title[0:3] + decorator<br />
&nbsp; &nbsp; elif title[0:2] in ('//', '/*', '--', '# ', '* ', '&quot; '):<br />
&nbsp; &nbsp; &nbsp; &nbsp; decoline = whitespace + title[0:2] + decorator<br />
&nbsp; &nbsp; elif title[0:1] in ('#', '*', '&quot;'):<br />
&nbsp; &nbsp; &nbsp; &nbsp; decoline = whitespace + title[0:1] + decorator<br />
&nbsp; &nbsp; else:<br />
&nbsp; &nbsp; &nbsp; &nbsp; decoline = whitespace + decorator<br />
<br />
&nbsp; &nbsp; # Special case: comments like C /* hello world */<br />
&nbsp; &nbsp; cend = ''<br />
&nbsp; &nbsp; if title[0:2] == '/*':<br />
&nbsp; &nbsp; &nbsp; &nbsp; if title[-3:] == ' */':<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cend = ' */'<br />
&nbsp; &nbsp; &nbsp; &nbsp; elif title[-2:] == '*/':<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cend = '*/'<br />
<br />
&nbsp; &nbsp; decoline = decoline[0:total_length - len(cend)] + cend<br />
&nbsp; &nbsp; final_heading = []<br />
<br />
&nbsp; &nbsp; if top:<br />
&nbsp; &nbsp; &nbsp; &nbsp; final_heading.append(decoline)<br />
<br />
&nbsp; &nbsp; if uppercase:<br />
&nbsp; &nbsp; &nbsp; &nbsp; final_heading.append(line.upper())<br />
&nbsp; &nbsp; else:<br />
&nbsp; &nbsp; &nbsp; &nbsp; final_heading.append(line)<br />
<br />
&nbsp; &nbsp; if bottom:<br />
&nbsp; &nbsp; &nbsp; &nbsp; final_heading.append(decoline)<br />
<br />
&nbsp; &nbsp; del vim.current.buffer[row-1]<br />
&nbsp; &nbsp; vim.current.buffer[row-1:0] = final_heading<br />
<br />
&nbsp; &nbsp; # Set final cursor position<br />
&nbsp; &nbsp; if top and bottom:<br />
&nbsp; &nbsp; &nbsp; &nbsp; vim.current.window.cursor = (row + 2, 0)<br />
&nbsp; &nbsp; else:<br />
&nbsp; &nbsp; &nbsp; &nbsp; vim.current.window.cursor = (row + 1, 0)<br />
<br />
H = heading # shortcut<br />
EOF<br />
<br />
&quot; ============================================================================<br />
&quot; Vim maps (see :help leader)<br />
&quot; ============================================================================<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;hh :python heading()&lt;CR&gt;<br />
<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;h1 :python heading('#', uppercase=True)&lt;CR&gt;<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;h2 :python heading('*', uppercase=True)&lt;CR&gt;<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;h3 :python heading('=')&lt;CR&gt;<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;h4 :python heading('-')&lt;CR&gt;<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;h5 :python heading('~', top=False)&lt;CR&gt;<br />
<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;HH :python heading(limit=78)&lt;CR&gt;<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;Hb :python heading(limit=78, top=False)&lt;CR&gt;<br />
nnoremap &lt;silent&gt; &lt;Leader&gt;Ht :python heading(limit=78, bottom=False)&lt;CR&gt;<br />
<br />
endif</div></td></tr></tbody></table></div>
<p>Para usarlo hay que colocar el archivo <a href="http://blog.calcifer.com.ar/uploads/2010/02/heading.vim" title="">heading.vim</a> en el directorio<code>~/.vim/plugins</code>.</p>
<h4>Ejemplos de uso</h4>
<p>1. Texto normal</p>
<pre>Título</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H()</div></div>
<pre>======
Título
======</pre>
<p>2. Comentario en línea (Python, Bash, Perl, PHP, Ruby)</p>
<pre>    # Comment</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H()</div></div>
<pre>    # =======
    # Comment
    # =======</pre>
<p>3. Comentario en bloque, estilo javadoc (C, C++, Java, Javascript, CSS, PHP, SQL)</p>
<pre>    /**
     * Comment
     */</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H('#', uppercase=True)</div></div>
<pre>    /**
     * #######
     * COMMENT
     * #######
     */</pre>
<p>4. Comentario en línea (C, C++, Java, Javascript, CSS, PHP, SQL)</p>
<pre>/* Comment */</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H('~+')</div></div>
<pre>/* ~+~+~+~ */
/* Comment */
/* ~+~+~+~ */</pre>
<p>5. Comentario en línea (C, Java, Javascript, PHP)</p>
<pre>// Comment</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H(limit=40)</div></div>
<pre>// =====================================
// Comment
// =====================================</pre>
<p>6. Comentario en línea (Vim script)</p>
<pre>" Comment</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H(top=None)</div></div>
<pre>" Comment
" ======</pre>
<p>7. Comentario en línea (Lua, SQL)</p>
<pre>-- Comment</pre>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:py H()</div></div>
<pre>-- =======
-- Comment
-- =======</pre>
<h4>Atajos de teclado</h4>
<p>El script también define algunos atajos en modo normal para Vim. Para los mismos se usa la tecla especial<code>&lt;Leader&gt;</code>que es definida por la variable<code>mapleader</code>y que generealmente es el caracter<code>\</code>.</p>
<table>
<tr>
<th>Atajo</th>
<th>Comando</th>
</tr>
<tr>
<td>\hh</td>
<td>:python heading()</td>
</tr>
<tr>
<td>\h1</td>
<td>:python heading(&#8216;#&#8217;, uppercase=True)</td>
</tr>
<tr>
<td>\h2</td>
<td>:python heading(&#8216;*&#8217;, uppercase=True)</td>
</tr>
<tr>
<td>\h3</td>
<td>:python heading(&#8216;=&#8217;)</td>
</tr>
<tr>
<td>\h4</td>
<td>:python heading(&#8216;-&#8217;)</td>
</tr>
<tr>
<td>\h5</td>
<td>:python heading(&#8216;~&#8217;, top=False)</td>
</tr>
<tr>
<td>\HH</td>
<td>:python heading(limit=78)</td>
</tr>
<tr>
<td>\Hb</td>
<td>:python heading(limit=78, top=False)</td>
</tr>
<tr>
<td>\Ht</td>
<td>:python heading(limit=78, bottom=False)</td>
</tr>
</table>
<h3>Lectura adicional</h3>
<ul>
<li><a href="http://www.builderau.com.au/program/python/soa/Extending-Vim-with-Python/0,2000064084,339283181,00.htm">Extending Vim with Python</a></li>
<li><a href="http://www.tummy.com/Community/Presentations/vimpython-20070225/vim.html">Python and vim: Two great tastes that go great together</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.calcifer.com.ar/2010/02/vim-scripting-con-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snippets en Vim con snipMate</title>
		<link>http://blog.calcifer.com.ar/2009/03/snippets-en-vim-con-snipmate/</link>
		<comments>http://blog.calcifer.com.ar/2009/03/snippets-en-vim-con-snipmate/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 04:13:42 +0000</pubDate>
		<dc:creator>lvidarte</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.calcifer.com.ar/?p=392</guid>
		<description><![CDATA[Basado en el editor TextMate (mac), snipMate.vim es un plugin que permite insertar pedazos de código de uso frecuente simplemente tipeando parte del mismo y apretando&#60;tab&#62;.
Por ejemplo, supongamos que estamos editando un programa en C y queremos agregar un ciclo for, simplemente escribimosfor&#60;tab&#62;y esto se expandirá en un típico bucle de C
for &#40;i = 0; [...]]]></description>
			<content:encoded><![CDATA[<p>Basado en el editor <a href="http://macromates.com/" class="external">TextMate</a> (mac), <a href="http://www.vim.org/scripts/script.php?script_id=2540" class="external">snipMate.vim</a> es un plugin que permite insertar pedazos de código de uso frecuente simplemente tipeando parte del mismo y apretando<code>&lt;tab&gt;</code>.</p>
<p>Por ejemplo, supongamos que estamos editando un programa en C y queremos agregar un ciclo for, simplemente escribimos<code>for&lt;tab&gt;</code>y esto se expandirá en un típico bucle de C</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;width:435px"><div class="c codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">for</span> <span class="br0">&#40;</span>i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> count<span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="coMULTI">/* code */</span><br />
<span class="br0">&#125;</span></div></div>
<p>Inmediatamente después el cursor quedará resaltando la palabra &#8220;count&#8221; para que podamos reemplazarla por nuestra condición de fin. Un par de tabs más nos llevarán al cuerpo del ciclo donde podremos seguir utlizando snippets como<code>pr&lt;tab&gt;</code>, lo que expandirá en la función printf</p>
<div class="codecolorer-container c blackboard" style="overflow:auto;white-space:nowrap;width:435px"><div class="c codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">for</span> <span class="br0">&#40;</span>i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> <span class="nu0">10</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span class="kw3">printf</span></a><span class="br0">&#40;</span><span class="st0">&quot;%s<span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span><br />
<span class="br0">&#125;</span></div></div>
<p>snipMate tiene una sintáxis muy sencilla (según dicen, muy similar a la usada por TextMate) lo que permite crear nuestros propios snippets, o mejorar los existentes. La versión actual (0.77) trae una colección de snippets para los siguientes lenguajes: C, Obj-C, C++, Sh, TeX, Java, Ruby, Perl, Python, PHP, JavaScript, y HTML.</p>
<p>El proyecto parace estar bastante activo y la última versión es del 30/03/2009.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.calcifer.com.ar/2009/03/snippets-en-vim-con-snipmate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exuberant Ctags con Vim</title>
		<link>http://blog.calcifer.com.ar/2009/02/exuberant-ctags-con-vim/</link>
		<comments>http://blog.calcifer.com.ar/2009/02/exuberant-ctags-con-vim/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 13:00:19 +0000</pubDate>
		<dc:creator>lvidarte</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.calcifer.com.ar/?p=351</guid>
		<description><![CDATA[Exuberant Ctags es una reimplementación de Ctags, originalmente escrito para Unix, el cual genera un índice de palabras clave (tags) encontradas en archivos de código fuente. Dependiendo del lenguaje y el modo en que sea usado Ctags, esas palabras clave pueden ser funciones, variables, clases, interfaces, etc. Luego este índice puede ser usado por Vim [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://ctags.sourceforge.net/" class="external">Exuberant Ctags</a> es una reimplementación de Ctags, originalmente escrito para Unix, el cual genera un índice de palabras clave (tags) encontradas en archivos de código fuente. Dependiendo del lenguaje y el modo en que sea usado Ctags, esas palabras clave pueden ser funciones, variables, clases, interfaces, etc. Luego este índice puede ser usado por <a href="http://vim.org" class="external">Vim</a> (u otro editor de código que soporte Ctags) para llevarnos rápidamente de un lugar a otro dentro de nuestro código, incluso entre distintos archivos.</p>
<p>Exuberant Ctag, escrito por Darren Hiebert, fue distribuído con Vim hasta la versión 6 de este último. Actualmente es un proyecto independiente. Soporta 34 lenguajes de programación y la posibilidad de utilizar <a href="http://en.wikipedia.org/wiki/Regular_expression#POSIX" link="wikipedia">expresiones regulares POSIX</a> para afinar nuestra indexación.</p>
<h3>Instalación</h3>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;width:435px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw2">sudo</span> <span class="kw2">apt-get</span> <span class="kw2">install</span> exuberant-ctags</div></div>
<p>El nombre del programa difiere del nombre del paquete y se llama<code>ctags-exuberant</code>. Aunque puede ser invocado mediante el link simbólico<code>ctags</code>creado durante la instalación.</p>
<h3>Creación del archivo tags</h3>
<p>La forma más sencilla de crear un índice es movernos al directorio donde tenemos los archivos fuente y ejecutar</p>
<div class="codecolorer-container bash blackboard" style="overflow:auto;white-space:nowrap;width:435px"><div class="bash codecolorer" style="font-family:Monaco,Lucida Console,monospace">ctags <span class="re5">-R</span></div></div>
<p>Esto creará el archivo<code>tags</code>conteniendo el índice de todo el código reconocido. La opción<code>-R</code>indica que recorra recursivamente los subdirectorios bajo el actual. Podemos reemplazarla por<code>*</code>para evitar que explore subdirectorios.</p>
<p>Luego de generar el índice sólo nos resta indicarle a Vim el archivo de tags a usar. Esto podemos hacerlo desde el modo comando:<code>:set tags=~/my_project/tags</code>; o bien definirlo en<code>~/.vimrc</code>. También funciona el ejecutar Vim desde el mismo directorio donde se encuentra el archivo de tags.</p>
<h3>Uso desde Vim</h3>
<ul>
<li><code>Ctrl-]</code>sobre el nombre de clase o método nos lleva al archivo con su definición.</li>
<li><code>Ctrl-T</code>nos regresa al archivo anterior.</li>
<li><code>Ctrl-W ]</code>sobre el nombre de clase o método abre el archivo con su definición en la mitad superior de la ventana.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.calcifer.com.ar/2009/02/exuberant-ctags-con-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cambiar tamaño de ventana en Vim</title>
		<link>http://blog.calcifer.com.ar/2007/08/cambiar-tamano-de-ventana-en-vim/</link>
		<comments>http://blog.calcifer.com.ar/2007/08/cambiar-tamano-de-ventana-en-vim/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 21:55:42 +0000</pubDate>
		<dc:creator>lvidarte</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.calcifer.com.ar/2007/08/05/cambiar-tamano-de-ventana-en-vim/</guid>
		<description><![CDATA[Teniendo en cuenta las teclas de dirección de VIM:

hizquierda
jarriba
kabajo
lderecha

Atajos útiles para redimensionar ventanas horizontales (:split)
:map &#38;lt;C-j&#38;gt; &#38;lt;C-W&#38;gt;+
:map &#38;lt;C-k&#38;gt; &#38;lt;C-W&#38;gt;-
Atajos útiles para redimensionar ventanas verticales (:vsplit)
:map &#38;lt;C-h&#38;gt; &#38;lt;C-W&#38;gt;&#38;lt;
:map &#38;lt;C-l&#38;gt; &#38;lt;C-W&#38;gt;&#38;gt;
VIM en 1440&#215;900 píxeles:

]]></description>
			<content:encoded><![CDATA[<p>Teniendo en cuenta las teclas de dirección de VIM:</p>
<ul>
<li><code>h</code>izquierda</li>
<li><code>j</code>arriba</li>
<li><code>k</code>abajo</li>
<li><code>l</code>derecha</li>
</ul>
<p>Atajos útiles para redimensionar ventanas horizontales (<code>:split</code>)</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:map &amp;lt;C-j&amp;gt; &amp;lt;C-W&amp;gt;+<br />
:map &amp;lt;C-k&amp;gt; &amp;lt;C-W&amp;gt;-</div></div>
<p>Atajos útiles para redimensionar ventanas verticales (<code>:vsplit</code>)</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">:map &amp;lt;C-h&amp;gt; &amp;lt;C-W&amp;gt;&amp;lt;<br />
:map &amp;lt;C-l&amp;gt; &amp;lt;C-W&amp;gt;&amp;gt;</div></div>
<p>VIM en 1440&#215;900 píxeles:<br />
<a href='/uploads/2007/08/vim.png' title='Vim 1440×900'><img src='/uploads/2007/08/vim.thumbnail.png' alt='Vim 1440×900' /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.calcifer.com.ar/2007/08/cambiar-tamano-de-ventana-en-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Librándonos del ^M &#8211; mezclando dos y unix</title>
		<link>http://blog.calcifer.com.ar/2007/02/librandonos-del-m-mezclando-dos-y-unix/</link>
		<comments>http://blog.calcifer.com.ar/2007/02/librandonos-del-m-mezclando-dos-y-unix/#comments</comments>
		<pubDate>Tue, 27 Feb 2007 03:36:50 +0000</pubDate>
		<dc:creator>lvidarte</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.calcifer.com.ar/2007/02/27/librandonos-del-m-mezclando-dos-y-unix/</guid>
		<description><![CDATA[Traducción Getting rid of ^M &#8211; mixing dos and unix
Al abrir archivos de otros SO podemos encontrarnos con^Mal final de cada línea:
import java.util.Hashtable; ^M
import java.util.Properties; ^Mimport java.io.IOException;
import org.xml.sax.AttributeList; ^M
import org.xml.sax.HandlerBase; ^Mimport org.xml.sax.SAXException;

/**^M
&#160; * XMLHandler: This class parses the elements contained^M
&#160; * within a XML message and builds a Hashtable^M
Algunos programas no son consistentes en la [...]]]></description>
			<content:encoded><![CDATA[<p class="ref">Traducción <a href="http://www.vim.org/tips/tip.php?tip_id=26" title="" class="external">Getting rid of ^M &#8211; mixing dos and unix</a></p>
<p>Al abrir archivos de otros SO podemos encontrarnos con<code>^M</code>al final de cada línea:</p>
<div class="codecolorer-container java " style="overflow:auto;white-space:nowrap;width:435px"><div class="java codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">import</span> <span class="co2">java.util.Hashtable</span><span class="sy0">;</span> <span class="sy0">^</span>M<br />
<span class="kw1">import</span> <span class="co2">java.util.Properties</span><span class="sy0">;</span> <span class="sy0">^</span>Mimport <span class="co2">java.io.IOException</span><span class="sy0">;</span><br />
<span class="kw1">import</span> <span class="co2">org.xml.sax.AttributeList</span><span class="sy0">;</span> <span class="sy0">^</span>M<br />
<span class="kw1">import</span> <span class="co2">org.xml.sax.HandlerBase</span><span class="sy0">;</span> <span class="sy0">^</span>Mimport <span class="co2">org.xml.sax.SAXException</span><span class="sy0">;</span><br />
<br />
<span class="coMULTI">/**^M<br />
&nbsp; * XMLHandler: This class parses the elements contained^M<br />
&nbsp; * within a XML message and builds a Hashtable^M</span></div></div>
<p>Algunos programas no son consistentes en la manera de insertar saltos de línea, entonces te encontrarás con algunas líneas que tienen un salto de línea y un<code>^M</code>y algunas que tengan un<code>^M</code>y no un salto de línea&#8230; con <a href="http://www.vim.org/" class="external">Vim</a> la limpieza se realiza en dos pasos:</p>
<p>1. reemplazar los ^M al final de cada línea:</p>
<div class="codecolorer-container vim " style="overflow:auto;white-space:nowrap;width:435px"><div class="vim codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sy0">:%</span>s<span class="sy0">/^</span>M<span class="sy0">$//</span>g</div></div>
<p>Usar<code>"C-v C-m"</code>para escribir<code>^M</code>.</p>
<p>2. reemplazar todos los ^M&#8217;s que necesitan un salto de línea:</p>
<div class="codecolorer-container vim " style="overflow:auto;white-space:nowrap;width:435px"><div class="vim codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sy0">:%</span>s<span class="sy0">/^</span>M<span class="sy0">/</span>n<span class="sy0">/</span>g</div></div>
<p>Voila! Archivo limpio.</p>
<p>Mas info en</p>
<div class="codecolorer-container vim " style="overflow:auto;white-space:nowrap;width:435px"><div class="vim codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="sy0">:</span>help ffs</div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.calcifer.com.ar/2007/02/librandonos-del-m-mezclando-dos-y-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comfortable editing with VIM</title>
		<link>http://blog.calcifer.com.ar/2006/10/comfortable-editing-with-vim/</link>
		<comments>http://blog.calcifer.com.ar/2006/10/comfortable-editing-with-vim/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 18:21:32 +0000</pubDate>
		<dc:creator>lvidarte</dc:creator>
				<category><![CDATA[None]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.calcifer.com.ar/2006/10/30/comfortable-editing-with-vim/</guid>
		<description><![CDATA[Tomado del blog de Tobias Schlitt
Next occurrence of a word
If you hit*in command mode and your cursor resides on a word, you are taken to the next occurrence of the word. This is quite nice, if you like to know, where a function is called again.
Find matching brace
VIM 7.0 luckily highlights matching parenthesis, if your [...]]]></description>
			<content:encoded><![CDATA[<p class="from">Tomado del blog de <a href="http://schlitt.info/applications/blog/index.php?/archives/488-Comfortable-PHP-editing-with-VIM-5.html" title="" class="linkexternal">Tobias Schlitt</a></p>
<h3>Next occurrence of a word</h3>
<p>If you hit<code>*</code>in command mode and your cursor resides on a word, you are taken to the next occurrence of the word. This is quite nice, if you like to know, where a function is called again.</p>
<h3>Find matching brace</h3>
<p>VIM 7.0 luckily highlights matching parenthesis, if your cursor resides on a brace, but sometimes you need to quickly jump to that matching brace. You can achieve this by hitting the<code>%</code>sign in command mode.</p>
<h3>Repeat the last change</h3>
<p>It often occurs, that you need to perform 1 change several times, but not often enough to write a short script or to address the changes with a complex regex. In those cases you can perform the change once, move the cursor to the next place and hit the<code>.</code>(dot) char, in command mode.</p>
<p><span id="more-75"></span></p>
<h3>Enhanced functionality with external programs</h3>
<p>This tip is quite commonly known, but I repeat it here, because it&#8217;s really helpful: Although VIM has a huge set of useful functions, it does not have everything. If you don&#8217;t find a utility in VIM, you can simply use extern shell tools to perform certain tasks, by using<code>:!&lt;command&gt;</code>in command or visual mode. For example sorting a range of lines can easily be achieved with the following 2 steps: 1. Select the lines to sort in visual mode. 2. Type<code>:!sort</code>and hit return.</p>
<h3>Indenting and unindeting</h3>
<p>Especially when editing code, it happens often, that you have to indent/unindent a code block. If you use VIM&#8217;s auto-indenting features (like used by my .vimrc), VIM can do that job for you, too. Simply select the lines to (un-)indent in visual mode and hit<code>&lt;</code>to unindent 1 level or<code>&gt;</code>to indent 1 more level. This also works (as usual in VIM) with quantifiers like 4> to indent 4 more levels.</p>
<h3>Remote file editing</h3>
<p>Often you have to quickly edit a file on a remote server. Usually you SSH to that server or mount a remote file system locally, edit the desired file and quit the session again. VIM allows you to do this in 1 step, using SCP. On your shell type<code>vim scp://user@server//path/to/the/file</code>and VIM will edit the file directly through SCP.</p>
<h3>Recover the last visual selection</h3>
<p>It often happens, that you selected some text in visual mode, e.g. to perform a regex on it. Occasionally your regex is incorrect and you have to revert the changes or they don&#8217;t even happen. What you then need is to re-select the text portion again, which might take quite a long time, if you deal with large files. Hitting<code>gv</code>in command mode, takes that work from you and selects the last visual selection again.</p>
<h3>Grep within VIM</h3>
<p>Refactoring happens quite often in dynamic projects. &#8220;Real&#8221; IDE&#8217;s offer a lot of tools for this task. While VIM does not, you can enhance your refactoring process a lot with using regex and this tiny tip: To grep through a lot of files for certain strings and then perform changes on each occurrence, vim offers the<code>:grep command</code>.<code>:grep &lt;string&gt; &lt;files&gt;</code>and VIM will store the list of changes for you and :cn will take you to the next occurance of your string. The :grep command utilizes your systems instance of grep, or a custom command stored in the grepprg configuration variable. There is also an internal implementation of grep available in VIM, which you can use with<code>:vimgrep /&lt;regex&gt;/&lt;flags&gt; &lt;files&gt;</code>. The benefit of the external implementation is, that you can easily customize the command to use, e.g. if you need to ignore certain directories while grepping recursively (for instance .svn dirs). You can also get a list of all occurrences of your grep command, using :ll, which is actually a feature of VIMs quickfix tool. Simply select the next entry you want to jump to and hit return in the location list.</p>
<h3>Placeholders in commands</h3>
<p>Who doesn&#8217;t know the case, where you need to open a file in the same directory, the currently edited file resides in? Sure, you can simply use<code>:split &lt;file&gt;</code>, but if your current working directory is far away from the edited file, you possibly will have to type a long long path again. VIM offers you, to replace certain placeholders in commands automatically, most important:<code>%</code>is replaced with the actual file name (so,<code>:split %</code>will open a new window editing the current file &#8211; I know that just<code>:split</code>does the same, but it&#8217;s a nice example to show what<code>%</code>does). So, how does this help in the described case? The replacement text can also be modified by certain modifiers, like<code>:h</code>, which removes the last portion of a file path (the file name). For instance if you currently edit<code>/home/dotxp/dev/ez/ezc/trunk/ConsoleTools/src/table.php</code>and want to split to<code>/home/dotxp/dev/ez/ezc/trunk/ConsoleTools/src/output.php</code>you can do this easily using<code>:split %:h/output.php</code>. Another useful modifier is<code>:s?&lt;regex&gt;?&lt;replacement&gt;?</code>, which obviously uses a regex to modify the given path. Unlikely the usual replacement command<code>:s</code>, you need to specify the global modifier<code>g</code>before the regex instead of doing so after it. A short example:<code>:split %:gs?trunk?/releases/1.1/?</code>will split to the file table.php of ConsoleTools release 1.1.</p>
<h3>Emergency help</h3>
<p>Appending an exclamation mark (<code>!</code>) to a command (<code>:<command>!</code>) forces VIM to execute the command, even if it might be dangerous to do so. Quite useless, but still funny is<code>:help!</code>.</p>
<h3>Rewrap my text</h3>
<p>I reached a stage, where do not only edit my source code using VIM, but mainly every other kind of text data (like documentation, todo lists, etc.), because I&#8217;m simply so used to its features. When editing plain text, the automatic wrap features (e.g. textwidth) of VIM are quite useful. In some cases, you might edit text later and therefore destroy a nicely wrapped text block. VIM can easily re-perform the wrapping for you: Select the text block in visual mode (using &lt;SHIFT&gt;+&lt;v&gt;) and hit<code>&lt;g&gt;&lt;q&gt;</code>.</p>
<h3>Uppercase letters</h3>
<p>There are a lot of helpful shortcuts on your keyboard, which you might not know about. Every VIM user should now, that<code>&lt;d&gt;</code>deletes something,<code>&lt;y&gt;</code>(yank) copies something and<code>&lt;c&gt;</code>changes something (delete and start inserting) in VIM (all in command mode). Furthermore, most people know that e.g.<code>&lt;d&gt;&lt;w&gt;</code>deletes the next word, etc.. What I did not know for a long time was, that<code>&lt;D&gt;</code>, &lt;Y&#038;gt</code>; and<code>&lt;C&gt;</code>are shortcuts to perform the desired operation until the end of the current line. For instance, simply type<code>&lt;C&gt;</code>to change the contents of the current line from your cursors position on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.calcifer.com.ar/2006/10/comfortable-editing-with-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

