From 493b816849e81b1ad7c57467aef75aecabe308ea Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Mon, 9 Jul 2018 10:26:01 +0200 Subject: [PATCH] Sensible vimrc --- .vim/vimrc | 156 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 90 insertions(+), 66 deletions(-) diff --git a/.vim/vimrc b/.vim/vimrc index 8fe7d6c..b450e30 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -1,52 +1,34 @@ -syntax on +set nocompatible filetype plugin indent on +syntax enable -" General options +" Use :help 'option' to see the documentation for the given option. +set shell=/bin/bash set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin -set fileformats=unix,dos,mac set printoptions=paper:letter -set shell=/bin/bash -set backspace=2 -set breakindent showbreak=\ + -set clipboard=unnamed - -set guioptions+=a -"set guioptions-=m "menu bar -set guioptions-=T "toolbar -set guioptions-=r "scroolbar - -set complete-=i " searching includes can be slow -set history=200 -set incsearch " incremental search -set lazyredraw -set linebreak -set mouse=nvi -set mousemodel=popup +set fileformats=unix,dos,mac +set history=1000 +set tabpagemax=50 +set t_Co=256 +set background=dark +set updatetime=250 +set wildignore+=tags,.*.un~,*.pyc set number -set scrolloff=1 +set sessionoptions-=options +set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+ +set formatoptions+=j +setglobal tags-=./tags tags-=./tags; tags^=./tags; +set lazyredraw set shiftround set shortmess=aoOtI -set showmatch -set sidescrolloff=5 -set smartcase -"setglobal tags=./tags; -set timeoutlen=500 " leader key timeout -set ttimeoutlen=50 " make esc work faster -set visualbell -set virtualedit=block -set updatetime=250 -set winaltkeys=no -set wildignore+=tags,.*.un~,*.pyc -" folding -set foldmethod=syntax -set foldlevel=1 -set foldclose=all -set foldopen+=jump +" edit +set virtualedit=block +set clipboard=unnamed " buffers silent !mkdir -p ~/.vim/undo -set viminfo+=n~/./vim/viminfo +set viminfo+=n~/.vim/viminfo set undodir=~/.vim/undo set undofile set nohidden @@ -56,12 +38,76 @@ set autoread set autowrite set autowriteall -" command and status line -set showcmd -set cmdheight=2 +" indent +set autoindent +set smarttab +set breakindent showbreak=\ + +set linebreak + +" search +set incsearch +set ignorecase +set smartcase +set showmatch +set complete-=i + +" command and status line set laststatus=2 +set ruler set wildmenu set wildmode=longest:full,full +set showcmd +set cmdheight=2 + +" scroll +set scrolloff=1 +set sidescrolloff=5 +set display+=lastline + +" fold +set foldmethod=syntax +set foldlevel=1 +set foldclose=all +set foldopen+=jump,search + +" mouse +set mouse=a +set mousemodel=extend + +" keyboard +set backspace=indent,eol,start +set ttimeout +set ttimeoutlen=100 +set timeout +set timeoutlen=500 +set winaltkeys=no +set visualbell + +" gvim +if (has("gui_running")) + highlight Normal guibg=black guifg=white + set guioptions+=a + set guioptions-=m "menu bar + set guioptions-=T "toolbar + set guioptions-=r "scroolbar + set encoding=utf-8 + if exists("&guifont") + if has("mac") + set guifont=monaco:h11 + elseif has("unix") + set guifont=inconsolata\ 11 + elseif has("win32") +" set guifont=consolas:h11,courier\ new:h10 + set guifont=consolas:h10:cANSI:qDRAFT + endif + endif +endif + +" block cursor in normal mode +let &t_ti.="\e[1 q" +let &t_SI.="\e[5 q" +let &t_EI.="\e[1 q" +let &t_te.="\e[0 q" " make "set makeprg=cmake\ --build\ . @@ -80,7 +126,6 @@ let mapleader = "," " Normal mode Mappings nnoremap * :silent grep \| copen nnoremap t :tags -nnoremap za nnoremap nnoremap nnoremap @@ -88,9 +133,10 @@ nnoremap nnoremap :bnext nnoremap :bNext -" Insert Mappings +" Insert mode Mappings +inoremap u -" Command Mappings +" Command mode Mappings " Command aliases cnoreabbrev w!! w !sudo tee "%" @@ -147,28 +193,6 @@ nnoremap b :CtrlPBuffer nnoremap m :CtrlPMRU -" Colors and Fonts -highlight Normal guibg=black guifg=white -set background=dark -set t_Co=256 -if (&t_Co > 2 || has("gui_running")) - if exists("&guifont") - if has("mac") - set guifont=monaco:h11 - elseif has("unix") - set guifont=inconsolata\ 11 - elseif has("win32") -" set guifont=consolas:h11,courier\ new:h10 - set guifont=consolas:h10:cANSI:qDRAFT - endif - endif -endif - -" block cursor in normal mode -let &t_ti.="\e[1 q" -let &t_SI.="\e[5 q" -let &t_EI.="\e[1 q" -let &t_te.="\e[0 q" " autocommands autocmd BufReadPost quickfix nnoremap -- 2.43.0