From 15389e9834d8b890d6860a50df0b8a32390aa387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Thu, 1 May 2014 19:48:00 +0200 Subject: Completely new version of vimrc --- .vimrc | 158 +++++++++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 124 insertions(+), 34 deletions(-) diff --git a/.vimrc b/.vimrc index 3d8121d..db484ff 100644 --- a/.vimrc +++ b/.vimrc @@ -1,46 +1,115 @@ -set nocompatible "Zrusit kompatibilitu s vi +"Cancel vi compatibility +set nocompatible -set ruler "Zobrazuj pozici kurzoru -set showmode "V jakem jsem modu, pro lepsi orientaci -set showcmd "Postupne ukazuj prikaz +"Move .swp files to /tmp - SSD will like it! +set backupdir=/tmp +set directory=/tmp +set history=10000 +set undofile +set undodir=/tmp +set undolevels=1000 "maximum number of changes that can be undone +set undoreload=10000 "maximum number lines to save for undo on a buffer reload -set linebreak "Zalamuj radky pouze ve slovech +"indentation +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set noexpandtab +set smartindent -set number "Ukazuj cisla radku -set showmatch "Paruj zavorky +"set encoding to utf8 +set encoding=utf-8 -set smartindent "Chytre odsazovani u zdrojaku -set tabstop=4 "Kolik mezer je siroky znak tab -set softtabstop=4 "Kolik mezer se ma smazat pri backspace -set shiftwidth=4 "Pocet mezer pouzity k odsazeni -set noexpandtab "Pouzivej taby misto mezer +"enable mouse +set mouse=a -syntax on "Zapnou zvyraznovani -colorscheme evening "Zvolit format zvyraznovani +"show at least 6 lines before and after cursor pos +set scrolloff=6 -set ignorecase "Ignoruj pri vyhledavani -set incsearch "Pri vyhledavani prubezne prvni shodu -set wrapscan "Pri dosazeni konce hledej od zacatku +"show info on in which mode you're in +set showmode -set autowrite "Ulozit automaticky pri prechodu do jineho bufferu -set confirm "Operace :q a :e nefailuji, ale zeptat se +"show partial command +set showcmd -set mouse=a +"show cursor position +set ruler + +"complete commands on tab +set wildmenu +set wildmode=list:longest + +"tell vim we have fast terminal - smoother +set ttyfast + +"make vim behave nicely with backspace +set backspace=indent,eol,start + +"always show status +set laststatus=2 + +"show both absolute and relative line numbers +set number +set relativenumber + +"ignore case on search +set ignorecase + +"if all chars are lc, ignore case +set smartcase -set spelllang=cs "Pokud budu nekdy pouzivat jazyk tak nejspis cestinu -set mousemodel=popup "Umoznuje na mysitko ve gvimu zeditovat spatne vyspelovane slovo +"highlight search match +set showmatch -set list "Zodbrazi kontrolni znaky -set listchars=tab:▸\ ,eol:¬ "Nastavi kontrolni znaky na dane symboly +"show match during type +set incsearch + +"search from start on eof +set wrapscan + +"auto-save on buffer change +set autowrite + +"operations like :q or :e will ask, not fail +set confirm + +"break lines only in words +set linebreak + +"set nice chars for tabs and eols +set list +set listchars=tab:▸\ ,eol:¬ +if has("multi_byte") + set lcs=tab:▸\ ,eol:⤦ +endif + +"set spelling options +set spelllang=cs +set mousemodel=popup + +"show redundant spaces +au BufEnter * match RedundantSpaces /\s\+$\| \+\ze\t/ +highlight RedundantSpaces ctermbg=red guibg=red -" ======================================================================== +" ================= +" syntax highliting +" ================= +syntax on +colorscheme evening + +" =========== +" key hacking +" =========== +set =O1;2R " Vim nezná všechny znaky, které může posílat terminál. Je nutné ho prvně naučit, " co po něm terminál vlastně chce. Toho se docílí tak jako na následujícím řádku. -" To co je za = se vygeneruje tak, že stisknu v INSERT modu Ctrl+v a následně požadovanou zkratku -set =O1;2R -" ======================================================================== -au BufEnter * match RedundantSpaces /\s\+$\| \+\ze\t/ "Oznac nadbytecne mezery -highlight RedundantSpaces ctermbg=red guibg=red +" To co je za = se vygeneruje tak, že stisknu v INSERT modu Ctrl+v a následně +" požadovanou zkratku + + +" =========== +" key mapping +" =========== imap I map :w imap :wa @@ -52,11 +121,29 @@ map :bp imap :bpa map :bn imap :bna -imap 2Ff/pF 2Ff/pF map :set textwidth=80 map :set textwidth=0 -" ======================================================================= + +"esc boost +inoremap kj +inoremap KJ +inoremap Kj +inoremap kJ + +"windows changing +nnoremap h +nnoremap j +nnoremap k +nnoremap l + +"edit operations +imap 2Ff/pF 2Ff/pF + +" ==================== +" function definitions +" ==================== + function! NumberToggle() if(&relativenumber == 1) set number @@ -66,5 +153,8 @@ function! NumberToggle() endfunc nnoremap :call NumberToggle() -" ======================================================================= + +" ================= +" external function +" ================= source ~/.vim/hicursorwords.vim -- cgit v1.2.3