Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- " The "m" at the end of Vi
- set nocompatible
- " Enable plugins
- filetype plugin indent on
- " Set the leader, useful for mappings: "<space>" is a good one
- let mapleader = "\<space>"
- " Sets how many lines of history Vim has to remember
- set history=1000
- " Reload buffer when its file is changed from the outside
- set autoread
- " Set UTF8 as standard encoding
- set encoding=utf8
- " Use Unix as the standard file type
- set fileformats=unix,dos,mac
- " Disable backup/swap
- set nobackup
- set nowritebackup
- set noswapfile
- " Add "$" at end of "change" nouns
- set cpoptions+=$
- " Remove startup message
- set shortmess+=I
- " Don't redraw while executing macros (good performance config)
- set lazyredraw
- " Title is name of current file
- set title
- " Set amount of lines above the cursor
- set scrolloff=3
- " Show line numbers (relative if we can)
- set number
- if has('relativenumber')
- set relativenumber
- endif
- " Always show current position
- set ruler
- " Height of the command bar
- set cmdheight=2
- " Status line
- set statusline=%t " tail of the filename
- set statusline+=\ %m " modified flag
- set statusline+=%h " help file flag
- set statusline+=%r " read only flag
- set statusline+=%y " filetype
- set statusline+=[%{strlen(&fenc)?&fenc:'none'}] " file encoding
- set statusline+=[%{&ff}] " file format
- set statusline+=%= " left/right separator
- set statusline+=%c, " cursor column
- set statusline+=%l " cursor line
- set statusline+=\ %P " percent through file
- " Always put a status line in, even if there is only one window
- set laststatus=2
- " Turn on the Wild menu
- set wildmenu
- " Behave shell-like when completing shell
- set wildmode=longest,list
- " Ignore compiled files and backups
- set wildignore=
- set wildignore+=*~
- set wildignore+=*.o
- set wildignore+=*.a
- set wildignore+=*.so
- set wildignore+=*.class
- set wildignore+=*.pyc
- set wildignore+=*.gch
- set wildignore+=*.obj
- " Virtual edit
- set virtualedit=
- set whichwrap+=<,>,h,l " disabled when virtualedit
- " Backspace unindents and joins lines
- set backspace=start,indent,eol
- " Don't notify any errors
- set noerrorbells
- set visualbell
- set t_vb=
- set timeoutlen=500
- " Hide the mouse pointer while typing
- set mousehide
- " Mouse activated
- set mouse=a
- " Enable syntax highlighting
- syntax enable
- " Enable modeline
- set modeline
- " Show matching brackets when text indicator is over them
- set showmatch
- " How many tenths of a second to blink when matching brackets
- set matchtime=2
- " Default fold method
- set foldmethod=indent
- " Max number of fold levels
- set foldnestmax=10
- " Folding everything (disable at start)
- set nofoldenable
- " Again, folding parent levels
- set foldlevel=1
- " Complete menu
- set completeopt=menuone,preview
- " Use spaces instead of tabs
- set expandtab
- " Be smart when using tabs
- set smarttab
- " Indent by 3 spaces/tabs
- set shiftwidth=3
- set softtabstop=3
- set tabstop=3
- " Round indent to multiple of tabstop/shiftwidth
- set shiftround
- " Invisible characters
- set list listchars=tab:>-,trail:.,extends:>
- set showbreak=>\
- " Explicit FTW
- set autoindent
- set smartindent
- set wrap
- " Regex magic
- set magic
- " Ignore case
- set ignorecase
- " Try to be smart about cases
- set smartcase
- " Highlight results
- set hlsearch
- " Makes search act like in modern browsers
- set incsearch
- set wrapscan
- " Colorscheme setup
- colorscheme desert
- " A buffer becomes hidden when it is abandoned
- set hidden
- " Specify the behavior when switching between buffers
- set switchbuf=useopen,usetab
- " Tab display
- set showtabline=0
- " Split towards the right
- set splitright
- " Treat long lines as break lines (useful when moving around in them)
- nnoremap j gj
- nnoremap k gk
- " Remap Vim 0 to first non-blank character
- nmap 0 ^
- " Exchange "`" and "'"
- nnoremap ' `
- nnoremap ` '
- " Resolve inconsistency between "Y" (line), and "D" (eol)
- "nmap D dd
- nmap Y y$
- " Visual block indenting: keep selection after indenting
- vmap > >gv
- vmap < <gv
- " Select pasted text with gV
- nmap gV `[v`]
- " Fast saving
- nmap <silent> <leader>w :write<cr>
- " Close current window
- nmap <silent> <leader>q :quit<cr>
- " vim: ft=vim et
Add Comment
Please, Sign In to add comment