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> <<a href="mailto:diego@kuperman.com.ar">diego@kuperman.com.ar
</a>> 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>> Aprovecho para decir que yo empecé ayer a probar Vim en W$ (job), por
<br>> favor no me torturéis por ello ;-)<br>> y en cuanto pueda lo haré en mi laptop con Ubuntu ;-))<br>> Por cierto, si alguien tiene un vimrc o gvimrc configurado espacialmente<br>> 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'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 <silent> <F5> :%!perltidy<CR><br><br>En el "Best Practices" hay una seccion con configuracion para el vim
<br>pero no recuerdo que traia interesante ;)<br><br>> Además ya he subido las fotos que hice en la quedada del jueves y que<br>> podéis ver junto a un pequeño comentario en mi blog (os aseguro que no<br>> es un spam).
<br>><br>Y cual es la url de tu blog para poder verlas!?<br><br>> Un saludo para todos, estoy deseando que llegue la próxima quedada.<br>><br>Bueno, ya falta una semana menos ;)<br><br>Abrazo!<br>Diego<br><br>" Use Vim settings, rather then Vi settings (much better!).
<br>" This must be first, because it changes other options as a side effect.<br>set nocompatible<br><br>" my personal help<br>fu! Helpme()<br> echo " "<br> echo " F1 - This help "
<br> echo " F2 - Toggle paste / nopaste"<br> echo " F3 - Tag explorer <TAB> - next split window"<br> echo " F4 - Generate syntax colored HTML gw - swap current and next word"
<br> echo " F5 - Use Perltidy <C-K> - split window upper"<br> echo " F6 - Reload .vimrc <C-J> - split window below"<br> echo " F7 - Aun no hace nada <C-H> - split window on the left"
<br> echo " F8 - Aun no hace nada <C-L> - split window on the right"<br> echo " F9 - Previous buffer \" - beautifies text"<br> echo " F10 - Next buffer <C-M> - maximize window"
<br> echo " F11 - Light / Dark background <C-N> - make all windows equal size"<br> echo " F12 - Number / Unumber lines - - line wrapping on / off"<br> echo " < - decreases indentation by 4 spaces"
<br> echo " > - increases indentation by 4 spaces"<br> echo " "<br>endf<br><br>map <silent> <F1> :exe Helpme()<CR><br><br>set pastetoggle=<F2><br><br>nnoremap <silent> <F3> :TagExplorer<CR>
<br><br>" generate syntax colored HTML<br>map <silent> <F4> :runtime! syntax/2html.vim<CR><br><br>" Tide up Perl code using Perltidy (actually, a hacked Perltidy O:-) )<br>map <silent> <F5> :%!perltidy<CR>
<br><br>" Reload .vimrc (overrides previous options, but does not remove them)<br>map <silent> <F6> :so $HOME/.vimrc<BAR>echo "Reloaded .vimrc"<CR><br><br>if (has("perl"))<br>
<br>perl << PERL<br>use Text::Beautify;<br>sub beautify {<br> $_ = Text::Beautify::beautify($_);<br>}<br>PERL<br>map <silent> " :perldo beautify($_)<CR><br><br>endif " has("perl")<br>
<br>" next / previous file<br>map <silent> <F10> :n<CR><br>map <silent> <F9> :N<CR><br><br>" dark / light background<br>map <silent> <F11> :let &background = ( &background == "dark"? "light" : "dark" )<CR>
<br><br>" numbering / unumbering lines<br>map <silent> <F12> :set invnumber<BAR>echo (&number ? "Showing" : "Not showing") "numbers"<CR><br><br>" line wrapping
<br>map <silent> - :set invwrap<BAR>echo "value of wrap is" (&wrap ? "on" : "off")<CR><br>" map <silent> - :set invwrap<BAR>set wrap?<CR><br><br>" pressing up in a long line gets you to the above line "in the screen", etc.
<br>noremap j gj<br>noremap k gk<br>noremap <Up> gk<br>noremap <Down> gj<br>inoremap <Up> <C-O>gk<br>inoremap <Down> <C-O>gj<br><br>" switching between windows in an easier way<br>
" (still need to map <C-UP>, or something like that)<br>map <Tab> <C-W><C-W><br>map <C-K> <C-W>k<br>map <C-J> <C-W>j<br>map <C-H> <C-W>h<br>map <C-L> <C-W>l
<br><br>" maximize a window<br>map <C-M> <C-W><Bar><C-W>_<BAR>:echo "Window maximized"<CR><br><br>" make all windows (almost) equally high and wide<br>map <C-N> <C-W>=<BAR>:echo "All windows equally sized"<CR>
<br><br>" 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>" 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>" allow the . to execute once for each line of a visual selection
<br>"vnoremap . :normal .<CR><br>vnoremap . :<C-U>execute "'<,'>g/^/norm!" . virtcol("'<") . "\|."<CR><BAR>:noh<CR><br><br>" type gw to swap the current word and the next one (english alphabet only)
<br>nmap <silent> gw "_yiw:s/\(\%#\w\+\)\(\W\+\)\(\w\+\)/\3\2\1/<cr><c-o><c-l><br><br>" some definitions<br>set backspace=2 " allow backspacing over everything in insert mode
<br>set history=1000 " keep 1000 lines of command line history<br>set ruler " show the cursor position all the time<br>set incsearch " do incremental searching<br>set ic " ignore case in search patterns
<br>set scs " smart search (override 'ic' when pattern has uppers)<br>set showcmd " display incomplete commands<br>set nobackup " do not keep a backup file, use versions instead
<br>set laststatus=2 " always display the status line<br>set nosol " cursor is kept in the same column (if possible)<br>"set scr=5 " CTRL-U and CTRL-D scroll 5 lines at a time
<br>set sw=2 " indentation now takes just 2 spaces at a time<br>set nrformats= " only decimal numbers will be considered for increment<br><br>" 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>"set mouse=a " Use the mouse to position, resize of splits, visual select and more :)<br><br>" pressing < or > will let you indent/unident selected lines
<br>vnoremap < <gv<br>vnoremap > >gv<br><br>" some common typos<br>command! Qa qa<br>command! Q q<br>command! W w<br>command! Wq wq<br>" command! qq quit<br><br>" selecting all text<br>map <C-A> 1GvG$
<br><br>" <C-B> removes highlight<br>map <silent> <C-B> :noh<CR><br><br>" syntax highlighting on, when the terminal has colors<br>" also switch on highlighting the last used search pattern.
<br>if &t_Co > 2||has("gui_running")<br>syntax on<br>set hlsearch<br>endif<br><br>" Only do this part when compiled with support for autocommands.<br>if has("autocmd")<br><br>" Enable file type detection.
<br>" Use the default filetype settings, so that mail gets 'tw' set to 72,<br>" 'cindent' is on in C files, etc.<br>" Also load indent files, to automatically do language-dependent indenting.
<br>" filetype plugin indent on<br><br>" For all text files set 'textwidth' to 78 characters.<br>autocmd FileType text setlocal textwidth=78<br><br>" When editing a file, always jump to the last known cursor position.
<br>" Don't do it when the position is invalid or when inside an event handler<br>" (happens when dropping a file on gvim).<br>autocmd BufReadPost *<br>\ if line("'\"") > 0 && line("'\"") <= line("$")|
<br>\ exe "normal g`\""|<br>\ endif<br><br>endif " has("autocmd")<br><br>" 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>" automatically give executable permissions based on file extension<br>au BufWritePost *.\(?:sh\|py\|pl\|rb\) :silent !chmod a+x <afile><br><br><br>" Misc script header function<br> fun! <SID>ScriptHeader(lang)
<br> call setline(1, "#!/usr/bin/" . a:lang)<br> call append(1, "")<br> endfun<br><br> " Call header function on listed file types<br> " XXX: could use BufNewFile if BufEnter is too inclusive
<br> au BufEnter *.py if getline(1) == "" | call s:ScriptHeader("python") | endif<br> au BufEnter *.pl if getline(1) == "" | call s:ScriptHeader("perl") | endif<br> au BufEnter *.rb if getline(1) == "" | call s:ScriptHeader("ruby") | endif
<br><br> " Shell header<br> fun! <SID>ShellHeader()<br> call setline(1, "#!/bin/sh")<br> call append(1, "")<br> endfun<br><br> au BufEnter *.sh if getline(1) == "" | call s:ShellHeader() | endif
<br><br> " Seteo omnifunc para los que no tienen omni especifico<br> if has("autocmd") && exists("+omnifunc")<br> autocmd Filetype *<br> \ if &omnifunc == "" |
<br> \ setlocal omnifunc=syntaxcomplete#Complete |<br> \ endif<br> 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).