Inicio > vim > Correción ortográfica en Vim

Correción ortográfica en Vim

Sábado, 6 de diciembre de 2008 Dejar un comentario Ir a comentarios

Si seguisteis los pasos que escribí sobre el plugin latex-suite para vim, seguramente os interese saber como activar un corrector ortográfico en el mismo. Existen multitud de correctores ortográficos dentro de linux, y la mayoría de estos son adaptables a vim. En esta entrada veremos algunas algunas formas de activar un corrector ortográfico en Vim y como usarlo correctamente. Veréis la multitud de posibilidades que nos presentan dichos correctores ortográficos.

El primer paso es descargar los diccionarios del idioma español de este ftp (todos los archivos que comienzan con es), y los colocamos en /usr/share/vim/vim[71|72]/spell. Una vez hecho esto, si deseamos que la corrección ortográfica este activa siempre que habramos vim, debemos añadir las siguientes líneas a nuestro fichero .vimrc:

runtime plugins/spellfile.vim
setlocal spell spelllang=es

Aunque aquellos que utilicen vim sobre todo para programar cómo yo, quizás prefieran activar la corrección directamente desde el editor. Para ello se especifican los siguientes comandos. El primero activa el corrector y el segundo el idioma:

:spell
:setlocal spell spelllang=es

Además si queremos tener un fichero donde se vayan agregando las palabras que no sean reconocidas en un principio, podemos hacerlo con el siguiente comando:

:set spellfile=~/.vim/dict.add

O también agregar la misma línea sin los dos puntos “:” en nuestro fichero .vimrc. Una vez tenemos funcionando el corrector ortográfico, podemos usar los siguientes atajos de teclado en el modo normal de vim:

  • ]s – Siguiente falta ortográfica
  • [s - Anterior falta ortográfica
  • z= - Mostrar sugerencias para una palabra incorrecta.
  • zg - Añadir una palabra al diccionario.
  • zug - Deshacer la adición de una palabra al diccionario.
  • zw - Eliminar una palabra del diccionario.

Eso es todo por el momento, si tenéis alguna sugerencia más o cualquier duda no dudéis en comentar.

Fuentes:

If you follow the steps I wrote about the latex-suite for vim, surely you'll be interested to kown how to activate a spell checker in it. There are may spellcheckers in linux, and most of these are adaptable to vim. In this entry we'll se some ways of activating a spellchecker in vim and how to use it properly. You'll se the several posibilities that such spellcheckers offers us.

The first step is to download the dictionaries of the Spanish language of from this ftp (only those files which start with "es"), and put them in the /usr/share/vim/vim[71|72]/spell folder. Once done, if we want the spell check is activated whenever vim is opened, we must add the following lines to our .vimrc file:

runtime plugins/spellfile.vim
setlocal spell spelllang=es

Although those who use vim especially to program as me, may prefer to turn on the spell checker directly from the editor. This will be specify with the following commands. The first one turn on the spell checker and the second one select the language:

:spell
:setlocal spell spelllang=es

Besides, if we want to have a file where they are adding the words that are not recognized at first instance, we can do with the following command:

:set spellfile=~/.vim/dict.add

Or add the same line without the colon “:” in our .vimrc file. Once we have the spell checker running, we can use the following shortcuts en the normal mode of vim:

  • ]s — next misspelled word
  • [s — previous misspelled word
  • z= — view spelling suggestions for a misspelled word
  • zg — add a word to the dictionary
  • zug — undo the addition of a word to the dictionary
  • zw – del a word of the dictionary.

That’s all for now, if you have any suggestions or questions don’t hesitate to comment.

Sources:

GD Star Rating
loading...
Correción ortográfica en Vim, 5.5 out of 10 based on 4 ratings
Share
Categories: vim Tags: , ,
  1. Elmo
    Domingo, 7 de diciembre de 2008 a las 03:27 | #1
    GD Star Rating
    loading...

    Muy buena entrada para complementar la anterior.
    VIM mola !

  2. Viernes, 2 de enero de 2009 a las 19:20 | #2
    GD Star Rating
    loading...

    HdmKcx Thanks for good post

  3. Miércoles, 25 de marzo de 2009 a las 05:45 | #3
    GD Star Rating
    loading...

    Saludos,
    Excelente ayuda, tanto la extensión para latex como lo del corrector ortográfico. Gracias

  1. Sin trackbacks aún.