Gerardo Marx Chávez-Campos 6b6844ed01 | 3 years ago | |
---|---|---|
.vimrc | 3 years ago | |
README.md | 3 years ago |
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.
To install the Vim-Plug(for details check Vim-Plug-Web), paste the next on terminal
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
.vimrc
fileThe contents of the file is shown next:
" General
set number " Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
" Use vim defaults (drop compatibility with vi)
set nocompatible
syntax on " Enable syntax highlight
" more powerfull backspace
set ruler " Show cursor position
set modeline " Enable modelines
set showcmd " Show incomplete commands
set ttymouse=xterm2 " Make mouse works inside screen terminal emulator
"Spell
au BufRead *.txt setlocal spell
au BufRead *.org setlocal spell
au BufRead *.md setlocal spell
set langmenu=en_US
" Autofix some mistakes
cab W w
cab Wq wq
cab wQ wq
cab WQ wq
cab Q q
" Plugins manager
call plug#begin()
" NerdTree
Plug 'preservim/NERDTree'
Plug 'tpope/vim-speeddating'
Plug ' jceb/vim-orgmode'
call plug#end()
paste it on the .vimrc
file, if it does not exist, create it at ~/.vimrc
. After save the file run on Vim editor `Plug
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.
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.
Once the cursor is on the word, use z=, and Vim will suggest a list of alternatives that it thinks may be correct.