summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2014-05-01 19:48:00 +0200
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2014-05-01 19:48:00 +0200
commit15389e9834d8b890d6860a50df0b8a32390aa387 (patch)
treed26c77febf2ea75e192acdaa7e0645606d102950
parentvimrc: remove code that doesn't work (diff)
downloadvim_sync-15389e9834d8b890d6860a50df0b8a32390aa387.tar.xz
Completely new version of vimrc
-rw-r--r--.vimrc158
1 files 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 <S-F3>=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 <S-F3>=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 <Home> <esc>I
map <F2> :w<Enter>
imap <F2> <esc>:w<Enter>a
@@ -52,11 +121,29 @@ map <M-PageUp> :bp<Enter>
imap <M-PageUp> <Esc>:bp<Enter>a
map <M-PageDown> :bn<Enter>
imap <M-PageDown> <Esc>:bn<Enter>a
-imap <C-F> </><Esc>2F<lywf>f/pF<i
-imap <C-D> </><Esc>2F<lywf>f/pF<i<Enter><Enter><Up><Tab>
map <F12> :set textwidth=80<Enter>
map <S-F12> :set textwidth=0<Enter>
-" =======================================================================
+
+"esc boost
+inoremap kj <ESC>
+inoremap KJ <ESC>
+inoremap Kj <ESC>
+inoremap kJ <ESC>
+
+"windows changing
+nnoremap <C-h> <C-W>h
+nnoremap <C-j> <C-W>j
+nnoremap <C-k> <C-W>k
+nnoremap <C-l> <C-W>l
+
+"edit operations
+imap <C-F> </><Esc>2F<lywf>f/pF<i
+imap <C-D> </><Esc>2F<lywf>f/pF<i<Enter><Enter><Up><Tab>
+
+" ====================
+" function definitions
+" ====================
+
function! NumberToggle()
if(&relativenumber == 1)
set number
@@ -66,5 +153,8 @@ function! NumberToggle()
endfunc
nnoremap <C-n> :call NumberToggle()<cr>
-" =======================================================================
+
+" =================
+" external function
+" =================
source ~/.vim/hicursorwords.vim