configfiles/vim/.vimrc

119 lines
2.9 KiB
VimL

set nocompatible
filetype off
" init vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Let Vundle manage Vundle
Plugin 'VundleVim/Vundle.vim'
" My plugins
Plugin 'scrooloose/nerdtree' " FileBrowser on the left side
Plugin 'ervandew/supertab' "Auto completion
Plugin 'jeetsukumaran/vim-buffergator' "Easy buffer switching
Plugin 'ap/vim-templates' "File templates
Plugin 'godlygeek/tabular' "Tabularize
Plugin 'MarcWeber/vim-addon-mw-utils' " Dependency for snipmate
Plugin 'tomtom/tlib_vim' "Dependency for snipmate
Plugin 'garbas/vim-snipmate' "Snippets
Plugin 'easymotion/vim-easymotion' "Easy Motion
" End init vundle
call vundle#end()
filetype plugin indent on
" General configurations
set whichwrap+=<,>,[,]
set autoread "auto read file if changed
set wildmenu "Command completion
set gdefault " substitute all by default
set noruler
set laststatus=2 " Add Status line always
set number "Show linenumbers
set backspace=eol,start,indent "Make backspace behave like it's supposed to
set incsearch "Search while typing pattern
set lazyredraw "No redrawing while running macros
set magic "Allow magic modelines
set showmatch
set mat=2
set noerrorbells "No visual nuisance
set novisualbell
set t_vb=
set tm=500
set encoding=utf8 "Always use utf8
set ffs=unix,dos,mac
set nobackup "Don't need a backup, I live on the edge
set nowb
set noswapfile
set expandtab "Tabbing
set smarttab
set ai "auto indent
set si "smart indent
set wrap "wrap lines
set shiftwidth=4
set tabstop=4
set lbr
set tw=500
set t_Co=256
syntax enable
colorscheme desert
" Leader commands
let mapleader = ","
nnoremap <silent> <leader><space> :noh<cr>
nnoremap <silent> <leader>c :%s/\s\+$//e<cr>
nnoremap <silent> <leader>v :%s/\n\{3,}/\r\r/e<cr>
nnoremap <silent> <leader>p :set invpaste paste?<cr>
nnoremap <leader>a :Tabularize /
vnoremap <leader>a :'<,'>Tabularize /
nnoremap <leader>w <C-w>v<C-w>l
" Don't need a help
inoremap <F1> <nop>
nnoremap <F1> <nop>
vnoremap <F1> <nop>
" Just a nuisance
nnoremap q: <nop>
" No moving in insert mode allowed
ino <down> <Nop>
ino <up> <Nop>
ino <left> <Nop>
ino <right> <Nop>
" Different use of undo
nnoremap U <c-r>
" We don't need useless whitespace at the of the line
highlight WhitespaceEOL ctermbg=Red guibg=Red
match WhitespaceEOL /\s\+$/
" Rice
set statusline=%m
set statusline+=\ %f
set statusline+=%=
set statusline+=%l
set statusline+=\ %c
hi StatusLine cterm=None ctermfg=green ctermbg=none
hi Search cterm=NONE
hi IncSearch cterm=underline ctermbg=none ctermfg=green
"Supertab
hi Pmenu ctermfg=green ctermbg=black
hi PmenuSel ctermfg=white ctermbg=black
hi PmenuSbar ctermfg=white ctermbg=black cterm=none
let g:SuperTabNoCompleteAfter = ['^',',','\s']
"NERDTree tabs
nmap <silent> <leader>e :NERDTreeToggle<CR>
"EasyMotion
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)