1
0
mirror of https://github.com/gryf/.vim.git synced 2025-12-18 03:50:30 +01:00

Moja prawie współczesna konfiguracja. Dużo rzeczy :)

This commit is contained in:
2010-04-11 20:41:45 +02:00
parent 74c5c4085f
commit 63717266b9
173 changed files with 61061 additions and 1933 deletions

View File

@@ -0,0 +1,29 @@
function! WordFrequency() range
let all = split(join(getline(a:firstline, a:lastline)), '\k\+')
let frequencies = {}
for word in all
let frequencies[word] = get(frequencies, word, 0) + 1
endfor
new
setlocal buftype=nofile bufhidden=hide noswapfile tabstop=4
for [key,value] in items(frequencies)
call append('$', value."\t".key)
endfor
sort i
endfunction
command! -range=% WordFrequency <line1>,<line2>call WordFrequency()
function! CreateDict() range
let all = split(join(getline(a:firstline, a:lastline)), '[^A-Za-zęóąśłżźćńĘÓĄŚŁŻŹĆŃ]\+')
let frequencies = {}
for word in all
let frequencies[word] = get(frequencies, word, 0) + 1
endfor
new
setlocal buftype=nofile bufhidden=hide noswapfile
for [key,value] in items(frequencies)
call append('$', key)
endfor
sort i
endfunction
command! -range=% CreateDict <line1>,<line2>call CreateDict()