Muchas gracias por el vimrc Diego, lo miraré atentamente ;-)<br><br>La dirección del blog venía en la firma del mail, por ahorrar letras no lo añadí .....<br>pero sin problemas la paso : <a href="http://www.lacoctelera.com/tomaslucas">
www.lacoctelera.com/tomaslucas</a><br><br>Saludos.<br><br><br><br><div><span class="gmail_quote">On 20/03/07, <b class="gmail_sendername">Diego Kuperman</b> &lt;<a href="mailto:diego@kuperman.com.ar">diego@kuperman.com.ar
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Tomás Lucas Arcos wrote:<br>&gt; Aprovecho para decir que yo empecé ayer a probar Vim en W$ (job), por
<br>&gt; favor no me torturéis por ello ;-)<br>&gt; y en cuanto pueda lo haré en mi laptop con Ubuntu ;-))<br>&gt; Por cierto, si alguien tiene un vimrc o gvimrc configurado espacialmente<br>&gt; para facilitar el programar con perl, le agradecería me lo pasase.
<br><br>Pues... tengo un .vimrc que fui copiando de lo que fui encontrando por<br>ahi durante bastante tiempo y me siento comodo con el. Creo que la mayor<br>parte se la he copiado a COG de <a href="http://braga.pm">braga.pm
</a>!<br>Si alguien lo prueba con F1 tiene una ayuda de las F&#39;s mapeadas ;)<br><br>Lo que mas uso y me resulta muy comodo son dos cosas muy simples:<br><br>1) Cuando edito un nuevo fichero con extension .pl me pone el shebang y
<br>setea +x (Ver a partir de la linea 178 del attach)<br><br>2) perltidy mapeado a F5 :)<br><br>map &lt;silent&gt; &lt;F5&gt; :%!perltidy&lt;CR&gt;<br><br>En el &quot;Best Practices&quot; hay una seccion con configuracion para el vim
<br>pero no recuerdo que traia interesante ;)<br><br>&gt; Además ya he subido las fotos que hice en la quedada del jueves y que<br>&gt; podéis ver junto a un pequeño comentario en mi blog (os aseguro que no<br>&gt; es un spam).
<br>&gt;<br>Y cual es la url de tu blog para poder verlas!?<br><br>&gt; Un saludo para todos, estoy deseando que llegue la próxima quedada.<br>&gt;<br>Bueno, ya falta una semana menos ;)<br><br>Abrazo!<br>Diego<br><br>&quot; Use Vim settings, rather then Vi settings (much better!).
<br>&quot; This must be first, because it changes other options as a side effect.<br>set nocompatible<br><br>&quot; my personal help<br>fu! Helpme()<br>&nbsp;&nbsp;echo &quot; &quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F1&nbsp;&nbsp;- This help&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;
<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F2&nbsp;&nbsp;- Toggle paste / nopaste&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F3&nbsp;&nbsp;- Tag explorer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TAB&gt; - next split window&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F4&nbsp;&nbsp;- Generate syntax colored HTML&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gw&nbsp;&nbsp;&nbsp;&nbsp;- swap current and next word&quot;
<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F5&nbsp;&nbsp;- Use Perltidy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;C-K&gt; - split window upper&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F6&nbsp;&nbsp;- Reload .vimrc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;C-J&gt; - split window below&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F7&nbsp;&nbsp;- Aun no hace nada&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;C-H&gt; - split window on the left&quot;
<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F8&nbsp;&nbsp;- Aun no hace nada&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;C-L&gt; - split window on the right&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F9&nbsp;&nbsp;- Previous buffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \&quot;&nbsp;&nbsp;&nbsp;&nbsp; - beautifies text&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F10 - Next buffer&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;C-M&gt; - maximize window&quot;
<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F11 - Light / Dark background&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;C-N&gt; - make all windows equal size&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;F12 - Number / Unumber lines&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;&nbsp; - line wrapping on / off&quot;<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;&lt;&nbsp;&nbsp; - decreases indentation by 4 spaces&quot;
<br>&nbsp;&nbsp;echo &quot;&nbsp;&nbsp;&gt;&nbsp;&nbsp; - increases indentation by 4 spaces&quot;<br>&nbsp;&nbsp;echo &quot; &quot;<br>endf<br><br>map &lt;silent&gt; &lt;F1&gt; :exe Helpme()&lt;CR&gt;<br><br>set pastetoggle=&lt;F2&gt;<br><br>nnoremap &lt;silent&gt; &lt;F3&gt; :TagExplorer&lt;CR&gt;
<br><br>&quot; generate syntax colored HTML<br>map &lt;silent&gt; &lt;F4&gt; :runtime! syntax/2html.vim&lt;CR&gt;<br><br>&quot; Tide up Perl code using Perltidy (actually, a hacked Perltidy O:-) )<br>map &lt;silent&gt; &lt;F5&gt; :%!perltidy&lt;CR&gt;
<br><br>&quot; Reload .vimrc (overrides previous options, but does not remove them)<br>map &lt;silent&gt; &lt;F6&gt; :so $HOME/.vimrc&lt;BAR&gt;echo &quot;Reloaded .vimrc&quot;&lt;CR&gt;<br><br>if (has(&quot;perl&quot;))<br>
<br>perl &lt;&lt; PERL<br>use Text::Beautify;<br>sub beautify {<br>&nbsp;&nbsp;$_ = Text::Beautify::beautify($_);<br>}<br>PERL<br>map &lt;silent&gt; &quot; :perldo beautify($_)&lt;CR&gt;<br><br>endif &quot; has(&quot;perl&quot;)<br>
<br>&quot; next / previous file<br>map &lt;silent&gt; &lt;F10&gt; :n&lt;CR&gt;<br>map &lt;silent&gt; &lt;F9&gt; :N&lt;CR&gt;<br><br>&quot; dark / light background<br>map &lt;silent&gt; &lt;F11&gt; :let &amp;background = ( &amp;background == &quot;dark&quot;? &quot;light&quot; : &quot;dark&quot; )&lt;CR&gt;
<br><br>&quot; numbering / unumbering lines<br>map &lt;silent&gt; &lt;F12&gt; :set invnumber&lt;BAR&gt;echo (&amp;number ? &quot;Showing&quot; : &quot;Not showing&quot;) &quot;numbers&quot;&lt;CR&gt;<br><br>&quot; line wrapping
<br>map &lt;silent&gt; - :set invwrap&lt;BAR&gt;echo &quot;value of wrap is&quot; (&amp;wrap ? &quot;on&quot; : &quot;off&quot;)&lt;CR&gt;<br>&quot; map &lt;silent&gt; - :set invwrap&lt;BAR&gt;set wrap?&lt;CR&gt;<br><br>&quot; pressing up in a long line gets you to the above line &quot;in the screen&quot;, etc.
<br>noremap j gj<br>noremap k gk<br>noremap &lt;Up&gt; gk<br>noremap &lt;Down&gt; gj<br>inoremap &lt;Up&gt; &lt;C-O&gt;gk<br>inoremap &lt;Down&gt; &lt;C-O&gt;gj<br><br>&quot; switching between windows in an easier way<br>
&quot; (still need to map &lt;C-UP&gt;, or something like that)<br>map &lt;Tab&gt; &lt;C-W&gt;&lt;C-W&gt;<br>map &lt;C-K&gt; &lt;C-W&gt;k<br>map &lt;C-J&gt; &lt;C-W&gt;j<br>map &lt;C-H&gt; &lt;C-W&gt;h<br>map &lt;C-L&gt; &lt;C-W&gt;l
<br><br>&quot; maximize a window<br>map &lt;C-M&gt; &lt;C-W&gt;&lt;Bar&gt;&lt;C-W&gt;_&lt;BAR&gt;:echo &quot;Window maximized&quot;&lt;CR&gt;<br><br>&quot; make all windows (almost) equally high and wide<br>map &lt;C-N&gt; &lt;C-W&gt;=&lt;BAR&gt;:echo &quot;All windows equally sized&quot;&lt;CR&gt;
<br><br>&quot; reverse status bar colors (useful when working with several windows)<br>:hi StatusLine ctermfg=white term=reverse cterm=reverse gui=reverse<br>:hi StatusLineNC ctermfg=blue term=reverse cterm=reverse gui=reverse
<br><br>&quot; make search results appear in the middle of the screen<br>nmap n nzz<br>nmap N Nzz<br>nmap * *zz<br>nmap # #zz<br>nmap g* g*zz<br>nmap g# g#zz<br><br>&quot; allow the . to execute once for each line of a visual selection
<br>&quot;vnoremap . :normal .&lt;CR&gt;<br>vnoremap . :&lt;C-U&gt;execute &quot;&#39;&lt;,&#39;&gt;g/^/norm!&quot; . virtcol(&quot;&#39;&lt;&quot;) . &quot;\|.&quot;&lt;CR&gt;&lt;BAR&gt;:noh&lt;CR&gt;<br><br>&quot; type gw to swap the current word and the next one (english alphabet only)
<br>nmap &lt;silent&gt; gw &quot;_yiw:s/\(\%#\w\+\)\(\W\+\)\(\w\+\)/\3\2\1/&lt;cr&gt;&lt;c-o&gt;&lt;c-l&gt;<br><br>&quot; some definitions<br>set backspace=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; allow backspacing over everything in insert mode
<br>set history=1000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; keep 1000 lines of command line history<br>set ruler&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; show the cursor position all the time<br>set incsearch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; do incremental searching<br>set ic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; ignore case in search patterns
<br>set scs&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; smart search (override &#39;ic&#39; when pattern has uppers)<br>set showcmd&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; display incomplete commands<br>set nobackup&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; do not keep a backup file, use versions instead
<br>set laststatus=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; always display the status line<br>set nosol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; cursor is kept in the same column (if possible)<br>&quot;set scr=5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; CTRL-U and CTRL-D scroll 5 lines at a time
<br>set sw=2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; indentation now takes just 2 spaces at a time<br>set nrformats=&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot; only decimal numbers will be considered for increment<br><br>&quot; Agregado por dk<br>set background=dark
<br>set tabstop=4<br>set expandtab<br>set ai<br>set shiftwidth=4<br>set smarttab<br>set showmatch<br>&quot;set mouse=a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot; Use the mouse to position, resize of splits, visual select and more :)<br><br>&quot; pressing &lt; or &gt; will let you indent/unident selected lines
<br>vnoremap &lt; &lt;gv<br>vnoremap &gt; &gt;gv<br><br>&quot; some common typos<br>command! Qa qa<br>command! Q q<br>command! W w<br>command! Wq wq<br>&quot; command! qq quit<br><br>&quot; selecting all text<br>map &lt;C-A&gt; 1GvG$
<br><br>&quot; &lt;C-B&gt; removes highlight<br>map &lt;silent&gt; &lt;C-B&gt; :noh&lt;CR&gt;<br><br>&quot; syntax highlighting on, when the terminal has colors<br>&quot; also switch on highlighting the last used search pattern.
<br>if &amp;t_Co &gt; 2||has(&quot;gui_running&quot;)<br>syntax on<br>set hlsearch<br>endif<br><br>&quot; Only do this part when compiled with support for autocommands.<br>if has(&quot;autocmd&quot;)<br><br>&quot; Enable file type detection.
<br>&quot; Use the default filetype settings, so that mail gets &#39;tw&#39; set to 72,<br>&quot; &#39;cindent&#39; is on in C files, etc.<br>&quot; Also load indent files, to automatically do language-dependent indenting.
<br>&quot; filetype plugin indent on<br><br>&quot; For all text files set &#39;textwidth&#39; to 78 characters.<br>autocmd FileType text setlocal textwidth=78<br><br>&quot; When editing a file, always jump to the last known cursor position.
<br>&quot; Don&#39;t do it when the position is invalid or when inside an event handler<br>&quot; (happens when dropping a file on gvim).<br>autocmd BufReadPost *<br>\ if line(&quot;&#39;\&quot;&quot;) &gt; 0 &amp;&amp; line(&quot;&#39;\&quot;&quot;) &lt;= line(&quot;$&quot;)|
<br>\ exe &quot;normal g`\&quot;&quot;|<br>\ endif<br><br>endif &quot; has(&quot;autocmd&quot;)<br><br>&quot; test lines<br>ab shpl #!/usr/bin/perl<br>ab shrb #!/usr/bin/ruby<br>ab shsh #!/bin/sh<br>ab shpy #!/usr/bin/python
<br><br>&quot; automatically give executable permissions based on file extension<br>au BufWritePost *.\(?:sh\|py\|pl\|rb\) :silent !chmod a+x &lt;afile&gt;<br><br><br>&quot; Misc script header function<br>&nbsp;&nbsp;&nbsp;&nbsp;fun! &lt;SID&gt;ScriptHeader(lang)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call setline(1, &quot;#!/usr/bin/&quot; . a:lang)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call append(1, &quot;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;endfun<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&quot; Call header function on listed file types<br>&nbsp;&nbsp;&nbsp;&nbsp;&quot; XXX: could use BufNewFile if BufEnter is too inclusive
<br>&nbsp;&nbsp;&nbsp;&nbsp;au BufEnter *.py if getline(1) == &quot;&quot; | call s:ScriptHeader(&quot;python&quot;) | endif<br>&nbsp;&nbsp;&nbsp;&nbsp;au BufEnter *.pl if getline(1) == &quot;&quot; | call s:ScriptHeader(&quot;perl&quot;)&nbsp;&nbsp; | endif<br>&nbsp;&nbsp;&nbsp;&nbsp;au BufEnter *.rb if getline(1) == &quot;&quot; | call s:ScriptHeader(&quot;ruby&quot;)&nbsp;&nbsp; | endif
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&quot; Shell header<br>&nbsp;&nbsp;&nbsp;&nbsp;fun! &lt;SID&gt;ShellHeader()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call setline(1, &quot;#!/bin/sh&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;call append(1, &quot;&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;endfun<br><br>&nbsp;&nbsp;&nbsp;&nbsp;au BufEnter *.sh if getline(1) == &quot;&quot; | call s:ShellHeader() | endif
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&quot; Seteo omnifunc para los que no tienen omni especifico<br>&nbsp;&nbsp;&nbsp;&nbsp;if has(&quot;autocmd&quot;) &amp;&amp; exists(&quot;+omnifunc&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;autocmd Filetype *<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;&nbsp; if &amp;omnifunc == &quot;&quot; |
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setlocal omnifunc=syntaxcomplete#Complete |<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\&nbsp;&nbsp; endif<br>&nbsp;&nbsp;&nbsp;&nbsp;endif<br><br>_______________________________________________<br>Madrid-pm mailing list<br><a href="mailto:Madrid-pm@pm.org">
Madrid-pm@pm.org</a><br><a href="http://mail.pm.org/mailman/listinfo/madrid-pm">http://mail.pm.org/mailman/listinfo/madrid-pm</a><br></blockquote></div><br><br clear="all"><br>-- <br>Blog: <a href="http://www.lacoctelera.com/tomaslucas">
www.lacoctelera.com/tomaslucas</a><br><br>Los Tres Chiflados (NRT).