From 677b38abb904ba0d080436d6c20a1d60b59f2acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Thu, 28 Nov 2013 16:43:46 +0100 Subject: Initial commit --- .gvimrc | 7 +++ .vim/hicursorwords.vim | 119 ++++++++++++++++++++++++++++++++++++++++++++ .vim/spell/cs.utf-8.add | 3 ++ .vim/spell/cs.utf-8.add.spl | Bin 0 -> 63 bytes .vim/spell/cs.utf-8.spl | Bin 0 -> 1204107 bytes .vimrc | 47 +++++++++++++++++ 6 files changed, 176 insertions(+) create mode 100644 .gvimrc create mode 100644 .vim/hicursorwords.vim create mode 100644 .vim/spell/cs.utf-8.add create mode 100644 .vim/spell/cs.utf-8.add.spl create mode 100644 .vim/spell/cs.utf-8.spl create mode 100644 .vimrc diff --git a/.gvimrc b/.gvimrc new file mode 100644 index 0000000..1ceaaa0 --- /dev/null +++ b/.gvimrc @@ -0,0 +1,7 @@ +set lines=50 columns=120 "Tohle je pro potreby gvimu, nastaveni velikosti okna +set textwidth=80 "V pripade gvimu (psani mailu) tohle chceme zaple +set spell "(Zase) Pri psani mailu chceme spellcheck uz od zacatku + +"Premapovano pro psani mailu - to, co by z normalniho vimrc delalo problemy +map mm/-=-=-=-jgqG'm +imap mm/-=-=-=-jgqG'ma diff --git a/.vim/hicursorwords.vim b/.vim/hicursorwords.vim new file mode 100644 index 0000000..06a563d --- /dev/null +++ b/.vim/hicursorwords.vim @@ -0,0 +1,119 @@ +" HiCursorWords -- Highlights words under the cursor. +" +" Maintainer: Shuhei Kubota +" Description: +" This script highlights words under the cursor like many IDEs. +" +" This doesn't provide scope-aware highlighting nor language specific one. +" You can control highlighting by highlighting group names. +" +" Variables: +" +" (A right hand side value is a default value.) +" +" g:HiCursorWords_delay = 200 +" A delay for highlighting in milliseconds. +" Smaller value may cause your machine slow down. +" +" g:HiCursorWords_hiGroupRegexp = '' +" If empty, all words are highlighted. +" If not empty, only the specified highlight group is highlighted. +" (my memo: 'Identifier\|vimOperParen') +" +" To investigate highlight group name, the next variable may help you. +" +" g:HiCursorWords_debugEchoHiName = 0 +" If not 0, echoes the highlight group name under the cursor. +" +" Hightlight groups: +" +" (Do :highlight! as you like.) +" +" WordUnderTheCursor +" +" + +if !exists('g:HiCursorWords_delay') + let g:HiCursorWords_delay = 2 +endif + +if !exists('g:HiCursorWords_hiGroupRegexp') + let g:HiCursorWords_hiGroupRegexp = '' +endif + +if !exists('g:HiCursorWords_debugEchoHiName') + let g:HiCursorWords_debugEchoHiName = 0 +endif + + +highlight! link WordUnderTheCursor Underlined + +augroup HiCursorWords + autocmd! + autocmd CursorMoved,CursorMovedI * call s:HiCursorWords__startHilighting() +augroup END + + +function! s:HiCursorWords__getHiName(linenum, colnum) + let hiname = synIDattr(synID(a:linenum, a:colnum, 0), "name") + let hiname = s:HiCursorWords__resolveHiName(hiname) + return hiname +endfunction + +function! s:HiCursorWords__resolveHiName(hiname) + redir => resolved + silent execute 'highlight ' . a:hiname + redir END + + if stridx(resolved, 'links to') == -1 + return a:hiname + endif + + return substitute(resolved, '\v(.*) links to ([^ ]+).*$', '\2', '') +endfunction + +function! s:HiCursorWords__getWordUnderTheCursor(linestr, linenum, colnum) + "let word = substitute(a:linestr, '.*\(\<\k\{-}\%' . a:colnum . 'c\k\{-}\>\).*', '\1', '') "expand('') + let word = matchstr(a:linestr, '\k*\%' . a:colnum . 'c\k\+') + if word == '' + return '' + endif + return '\V\<' . word . '\>' +endfunction + +function! s:HiCursorWords__execute() + if exists("w:HiCursorWords__matchId") + call matchdelete(w:HiCursorWords__matchId) + unlet w:HiCursorWords__matchId + endif + + let linestr = getline('.') + let linenum = line('.') + let colnum = col('.') + + if g:HiCursorWords_debugEchoHiName + echo s:HiCursorWords__getHiName(linenum, colnum) + endif + + let word = s:HiCursorWords__getWordUnderTheCursor(linestr, linenum, colnum) + if strlen(word) != 0 + if strlen(g:HiCursorWords_hiGroupRegexp) != 0 + \ && match(s:HiCursorWords__getHiName(linenum, colnum), g:HiCursorWords_hiGroupRegexp) == -1 + return + endif + let w:HiCursorWords__matchId = matchadd('WordUnderTheCursor', word, 0) + endif +endfunction + +function! s:HiCursorWords__startHilighting() + let b:HiCursorWords__oldUpdatetime = &updatetime + let &updatetime = g:HiCursorWords_delay + augroup HiCursorWordsUpdate + autocmd! + autocmd CursorHold,CursorHoldI * + \ if exists('b:HiCursorWords__oldUpdatetime') | let &updatetime = b:HiCursorWords__oldUpdatetime | endif + \ | call s:HiCursorWords__execute() + augroup END +endfunction + +" vim: set et ft=vim sts=4 sw=4 ts=4 tw=78 : diff --git a/.vim/spell/cs.utf-8.add b/.vim/spell/cs.utf-8.add new file mode 100644 index 0000000..fee4195 --- /dev/null +++ b/.vim/spell/cs.utf-8.add @@ -0,0 +1,3 @@ +teda +hosting +turris diff --git a/.vim/spell/cs.utf-8.add.spl b/.vim/spell/cs.utf-8.add.spl new file mode 100644 index 0000000..8db063a Binary files /dev/null and b/.vim/spell/cs.utf-8.add.spl differ diff --git a/.vim/spell/cs.utf-8.spl b/.vim/spell/cs.utf-8.spl new file mode 100644 index 0000000..e84cb6b Binary files /dev/null and b/.vim/spell/cs.utf-8.spl differ diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..1ce07c0 --- /dev/null +++ b/.vimrc @@ -0,0 +1,47 @@ +set nocompatible "Zrusit kompatibilitu s vi + +set ruler "Zobrazuj pozici kurzoru +set showmode "V jakem jsem modu, pro lepsi orientaci +set showcmd "Postupne ukazuj prikaz + +set linebreak "Zalamuj radky pouze ve slovech + +set number "Ukazuj cisla radku +set showmatch "Paruj zavorky +set smartindent "Chytre odsazovani u zdrojaku +set tabstop=4 "Tabulatory na 4 - sila zvyku +set shiftwidth=4 "Velikost odsazeni +syntax on "Zapnou zvyraznovani +colorscheme evening "Zvolit format zvyraznovani + +set ignorecase "Ignoruj pri vyhledavani +set incsearch "Pri vyhledavani prubezne prvni shodu +set wrapscan "Pri dosazeni konce hledej od zacatku + +set autowrite "Ulozit automaticky pri prechodu do jineho bufferu +set confirm "Operace :q a :e nefailuji, ale zeptat se + +set mouse=a + +set spelllang=cs "Pokud budu nekdy pouzivat jazyk tak nejspis cestinu +set mousemodel=popup "Umoznuje na mysitko ve gvimu zeditovat spatne vyspelovane slovo +" ======================================================================== +au BufEnter * match RedundantSpaces /\s\+$\| \+\ze\t/ "Oznac nadbytecne mezery +highlight RedundantSpaces ctermbg=red guibg=red +imap I +map :w +imap :wa +map mmgggqG'm +imap mmgggqG'ma +map {gq} +imap {gq}a +map :bp +imap :bpa +map :bn +imap :bna +imap 2Ff/pF 2Ff/pF +map :set textwidth=80 +map :set textwidth=0 +" ======================================================================= +source ~/.vim/hicursorwords.vim -- cgit v1.2.3