"Cancel vi compatibility set nocompatible "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 "indentation set tabstop=4 set softtabstop=4 set shiftwidth=4 set noexpandtab set smartindent "set encoding to utf8 set encoding=utf-8 "enable mouse set mouse=a "show at least 6 lines before and after cursor pos set scrolloff=6 "show info on in which mode you're in set showmode "show partial command set showcmd "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 "highlight search match set showmatch "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 if has("multi_byte") set lcs=tab:▸\ ,eol:¬ endif "set spelling options set spelllang=cs set mousemodel=popup " ================= " syntax highliting " ================= syntax on colorscheme evening " ===================== " show redundant spaces " ===================== au BufEnter * match RedundantSpaces /\s\+$\| \+\ze\t/ highlight RedundantSpaces ctermbg=red guibg=red " =========== " 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 " =========== " key mapping " =========== imap I map :w imap :wa map {gq} imap {gq}a map mmgggqG'm imap mmgggqG'ma map :bp imap :bpa map :bn imap :bna map :set textwidth=80 map :set textwidth=0 "esc boost inoremap kj inoremap KJ inoremap Kj inoremap kJ "don't you hate when you accidentally hit F1? inoremap nnoremap vnoremap "...and when you're to speed? command WQ wq command Wq wq command W w command Q q "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 else set relativenumber endif endfunc nnoremap :call NumberToggle() " ================= " external function " ================= source ~/.vim/hicursorwords.vim