#Vim Tips:

interesting options to add to your .vimrc

I hope it will be useful for anyone

"Mis Reglas Básicas:

syntax on

filetype on

filetype plugin on

filetype plugin indent on

set number

set tabstop=4

set softtabstop=4

set shiftwidth=4

set expandtab

set autoindent

set smartindent

set foldmethod=indent

set foldlevel=99

set showcmd

set autochdir

set showmatch

set hidden

set hlsearch

set incsearch

nmap ,/ :nohlsearch

set ignorecase

set smartcase

set ruler

set wildmenu

set wildmode=list:full

set wildignore=*.swp,*.bak,*.pyc,*.class

set nobackup

set noswapfile

set noundofile

set spelllang=es,en

set spellsuggest=best

set helplang=es

set encoding=utf-8

set fileencoding=utf-8

"set fileformats="unix,dos,mac"

"set fileformat=unix

set backspace=indent,eol,start

" To save, press ctrl-s.

nmap :w

imap :wa

" Is has mouse

if has('mouse')

set mouse=a

endif

"Set general format

if has("gui_running")

set lines=37

set columns=126

"set guioptions-=m

set guioptions-=T

colorscheme desert

else

set background=dark

"colorscheme desert

endif

set lazyredraw

set laststatus=2

set cmdheight=2

set cursorline

" Avoid accidental hits of while aiming for

map!

" Quickly close the current window

nnoremap q :q

" Font. Very important.

if has('win32') || has('win64')

set guifont=Consolas:h12:cANSI

elseif has('unix')

set guifont="Monospace 10"

endif

" OTRAS OPCIONES

let mapleader=','

nnoremap ; :

set title

set visualbell

set noerrorbells

" Remap j and k to act as expected when used on long, wrapped, lines

nnoremap j gj

nnoremap k gk

" Easy window navigation

map h

map j

map k

map l

nnoremap w vl

" Yank/paste to the OS clipboard with ,y and ,p

nmap y "*y

nmap Y "*yy

nmap p "*p

nmap P "*P

" Quick alignment of text

nmap al :left

nmap ar :right

nmap ac :center

" Nerdtree File explorer plugin

map :NERDTreeToggle:NERDTreeMirror

map e :NERDTreeFind

nmap nt :NERDTreeFind

let NERDTreeShowBookmarks=1

let NERDTreeIgnore=['\.pyc', '\~$', '\.swo$', '\.swp$', '\.git', '\.hg', '\.svn', '\.bzr']

let NERDTreeChDirMode=0

let NERDTreeQuitOnOpen=1

let NERDTreeShowHidden=1

let NERDTreeKeepTreeInNewTab=1

Reply to this note

Please Login to reply.

Discussion

No replies yet.