set nocompatible if has('autocmd') filetype plugin indent on endif if has('syntax') && !exists('g:syntax_on') syntax enable endif " Use :help 'option' to see the documentation for the given option. set autoindent set backspace=indent,eol,start set complete-=i set showmatch set showmode set smarttab set nrformats-=octal set shiftround set ttimeout set ttimeoutlen=50 set incsearch " Use to clear the highlighting of :set hlsearch. if maparg('', 'n') ==# '' nnoremap :nohlsearch endif set laststatus=2 set ruler set showcmd set wildmenu set autoread set encoding=utf-8 set tabstop=2 shiftwidth=2 expandtab "set listchars=tab:▒,trail: "set list inoremap u set number set hlsearch set ignorecase set smartcase " Don't use Ex mode, use Q for formatting map Q gq " In many terminal emulators the mouse works just fine, thus enable it. if has('mouse') set mouse=a endif " do not history when leavy buffer set hidden " FIXME: (broken) ctrl s to save noremap :update vnoremap :update inoremap :update set nobackup set nowritebackup set noswapfile set fileformats=unix,dos,mac " exit insert mode inoremap set completeopt=menuone,longest,preview " " Basic shortcuts definitions " most in visual mode / selection (v or ⇧ v) " " Find map / " indend / deindent after selecting the text with (⇧ v), (.) to repeat. vnoremap > vnoremap < " comment / decomment & normal comment behavior vmap gc " Disable tComment to escape some entities let g:tcomment#replacements_xml={} " Text wrap simpler, then type the open tag or '," vmap S " Cut, Paste, Copy vmap d vmap p vmap y " Undo, Redo (broken) nnoremap :undo inoremap :undo nnoremap :redo inoremap :redo " Tabs nnoremap :tabprevious inoremap :tabpreviousi nnoremap :tabnext inoremap :tabnexti nnoremap :tabnew inoremap :tabnewi nnoremap :tabclose inoremap :tabclosei " lazy ':' map \ : let mapleader = ',' nnoremap p :set paste nnoremap o :set nopaste " this machine config if filereadable(expand("~/.vimrc.local")) source ~/.vimrc.local endif