aboutsummaryrefslogtreecommitdiff
path: root/autoload/utils.vim
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2022-08-26 18:44:11 +0800
committerGitHub <noreply@github.com>2022-08-26 18:44:11 +0800
commitfb9a0bb2ddb689066e6ba1a827f2b1b27fe672ca (patch)
tree9e7c39d21c30a163dd8dd6aeb23d036c201b3df5 /autoload/utils.vim
parent6539e72a5d36c308f859a30a97a52deb22f16090 (diff)
parent59525c5577abf54a28882961b53cbf5e4dacf584 (diff)
Merge pull request #78 from jdhao/theme
refactor: theme.vim --> theme.lua
Diffstat (limited to 'autoload/utils.vim')
-rw-r--r--autoload/utils.vim26
1 files changed, 0 insertions, 26 deletions
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