mirror of https://github.com/Hilbis/Hilbish
feat: change cursor shape based on vim mode
parent
f8f8cd0b59
commit
0b1b5bff2d
|
@ -1,8 +1,9 @@
|
||||||
-- Default Hilbish config
|
-- Default Hilbish config
|
||||||
local lunacolors = require 'lunacolors'
|
local lunacolors = require 'lunacolors'
|
||||||
local bait = require 'bait'
|
local bait = require 'bait'
|
||||||
|
local ansikit = require 'ansikit'
|
||||||
|
|
||||||
function doPrompt(fail)
|
local function doPrompt(fail, mode)
|
||||||
hilbish.prompt(lunacolors.format(
|
hilbish.prompt(lunacolors.format(
|
||||||
'{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆ '
|
'{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. '∆ '
|
||||||
))
|
))
|
||||||
|
@ -16,3 +17,12 @@ bait.catch('command.exit', function(code)
|
||||||
doPrompt(code ~= 0)
|
doPrompt(code ~= 0)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
bait.catch('hilbish.vimMode', function(mode)
|
||||||
|
if mode ~= 'insert' then
|
||||||
|
ansikit.cursorStyle(ansikit.blockCursor)
|
||||||
|
else
|
||||||
|
ansikit.cursorStyle(ansikit.lineCursor)
|
||||||
|
end
|
||||||
|
|
||||||
|
doPrompt(false, mode)
|
||||||
|
end)
|
||||||
|
|
Loading…
Reference in New Issue