You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
2.4 KiB

3 years ago
3 years ago
  1. # vim-config-beagle
  2. The Vim editor can be configured for a basic or advnaced usage. This first approximation is a medium term configuration that enables number lines, syntax on and spell-check options on. Also, some plug-ins are installed to work with `org` files and some kind of File-Explorer Tree (NerdTree) by using the Vim-Plug Framework. Thus, first let's install the Vim-Plug first.
  3. ## Installing the Vim-Plug
  4. To install the Vim-Plug(for details check [Vim-Plug-Web](https://github.com/junegunn/vim-plug)), paste the next on terminal
  5. ```
  6. curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
  7. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  8. ```
  9. ## The `.vimrc` file
  10. The contents of the file is shown next:
  11. ```
  12. " General
  13. set number " Show line numbers
  14. set linebreak " Break lines at word (requires Wrap lines)
  15. set showbreak=+++ " Wrap-broken line prefix
  16. set textwidth=100 " Line wrap (number of cols)
  17. set showmatch " Highlight matching brace
  18. set visualbell " Use visual bell (no beeping)
  19. " Use vim defaults (drop compatibility with vi)
  20. set nocompatible
  21. syntax on " Enable syntax highlight
  22. " more powerfull backspace
  23. set ruler " Show cursor position
  24. set modeline " Enable modelines
  25. set showcmd " Show incomplete commands
  26. set ttymouse=xterm2 " Make mouse works inside screen terminal emulator
  27. "Spell
  28. au BufRead *.txt setlocal spell
  29. au BufRead *.org setlocal spell
  30. au BufRead *.md setlocal spell
  31. set langmenu=en_US
  32. " Autofix some mistakes
  33. cab W w
  34. cab Wq wq
  35. cab wQ wq
  36. cab WQ wq
  37. cab Q q
  38. " Plugins manager
  39. call plug#begin()
  40. " NerdTree
  41. Plug 'preservim/NERDTree'
  42. Plug 'tpope/vim-speeddating'
  43. Plug ' jceb/vim-orgmode'
  44. call plug#end()
  45. ```
  46. paste it on the `.vimrc` file, if it does not exist, create it at `~/.vimrc`. After save the file run on Vim editor `:PlugInstall` and the editor will install the Plug-ins defined on lines 46 to 48.
  47. # How to use the Plugins
  48. ## NERDTree
  49. ## Vim-orgmode
  50. ## Spell Checking
  51. Spell checking wouldn’t be very useful if you didn’t have any help correcting the misspelled words, or a way to tell the program that the word is actually correct. Let’s start with correcting words.
  52. To move to a misspelled word, use ]s and [s. The ]s command will move the cursor to the next misspelled word, the [s command will move the cursor back through the buffer to previous misspelled words.
  53. Once the cursor is on the word, use z=, and Vim will suggest a list of alternatives that it thinks may be correct.