luaprompt is a good REPL of lua. This project provides:
- A prompt with powerlevel10k style.
- A wakatime plugin to statistic how much time you write lua in REPL.
Besides lua's REPL, there are many programs written in lua which provide their REPLs. This project provides some wrapper scripts to use this plugin for them:
Tips: you can skip loading unnecessary plugins in your vimrc by:
let s:l_flag = 0
for arg in v:argv
if s:l_flag == 1
let g:script_name = fnamemodify(arg, ':t')
break
endif
if arg ==# '-l'
let s:l_flag = 1
endif
endfor
if get(g:, 'script_name', '') ==# 'nvimp'
finish
endif
~/.config/luaprc.lua
:
local prompt = require "prompt"
local prompt_style = require "prompt-style"
prompt.prompts = { prompt_style.generate_ps1(), " " }
If there is a git repository, the project name can be achieved by git. Else use
the base name of current working directory.
You can call (require "prompt-style").wakatime("wakatime-cli XXX")
to
customize it.
paru -S lua{,51,52,53}-prompt-style
NOTE: REPLs use some specific version of lua.
luarocks install prompt-style
- neolua: Another lua interpreter
based on neovim like
nvimp
. It doesn't provide a REPL like lua.