From 59525c5577abf54a28882961b53cbf5e4dacf584 Mon Sep 17 00:00:00 2001 From: jdhao Date: Fri, 26 Aug 2022 18:42:30 +0800 Subject: refactor: theme.vim --> theme.lua --- autoload/utils.vim | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'autoload') diff --git a/autoload/utils.vim b/autoload/utils.vim index 65bdf6a..b09b55d 100644 --- a/autoload/utils.vim +++ b/autoload/utils.vim @@ -27,21 +27,6 @@ function! utils#HasColorscheme(name) abort return !empty(globpath(&runtimepath, l:pat)) endfunction -" Generate random integers in the range [Low, High] in pure vim script, -" adapted from https://stackoverflow.com/a/12739441/6064933 -function! utils#RandInt(Low, High) abort - " Use lua to generate random int. It is faster. Ref: https://stackoverflow.com/a/20157671/6064933 - call v:lua.math.randomseed(localtime()) - return v:lua.math.random(a:Low, a:High) -endfunction - -" Selection a random element from a sequence/list -function! utils#RandElement(seq) abort - let l:idx = utils#RandInt(0, len(a:seq)-1) - - return a:seq[l:idx] -endfunction - " Custom fold expr, adapted from https://vi.stackexchange.com/a/9094/15292 function! utils#VimFolds(lnum) abort " get content of current line and the line below @@ -198,14 +183,3 @@ function! utils#MultiEdit(patterns) abort endfor endfor endfunction - -function! utils#add_pack(name) abort - let l:status = v:true - try - execute printf("packadd! %s", a:name) - catch /^Vim\%((\a\+)\)\=:E919/ - let l:status = v:false - endtry - - return l:status -endfunction -- cgit v1.2.3