-
|
I am using Neovim nightly on Windows. Here's my attempt to set the cursor to a vertical bar that blinks every 530ms. vim.api.nvim_create_autocmd({ "VimLeave", "VimSuspend" }, {
callback = function()
vim.opt.guicursor = "a:ver1-blinkwait530-blinkoff530-blinkon530"
end,
})But this doesn't work, can anyone help me? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
|
Changed in Nvim 0.12 , see see also #4396 (comment) , but use |
Beta Was this translation helpful? Give feedback.
-
|
The function Register-CursorResetPromptHook {
if (-not (Test-Path function:\global:CursorResetOrigPrompt)) {
Copy-Item function:\prompt function:\global:CursorResetOrigPrompt -Force
$global:CursorResetPromptScriptBlock = {
Write-Host "`e[0 q" -NoNewline
CursorResetOrigPrompt
}
Set-Content -Path function:\prompt -Value $global:CursorResetPromptScriptBlock -Force
}
}
Register-CursorResetPromptHookPut this in your This is directly inspired from ZLocation module's code. |
Beta Was this translation helpful? Give feedback.
-
|
Same, nvim_ui_send also doesn't work! (autocmd! [:VimLeave :VimSuspend]
{:desc "[Cursor Style] Restore terminal cursor style"
:pattern "*"
:callback (fn []
(set GUI_CURSOR_CACHE (vim.opt.guicursor:get))
(set vim.opt.guicursor {})
;; \x1b[?12l -> disable cursor blink
;; \x1b[6 q -> set cursor style to bar
(vim.api.nvim_ui_send "\x1b[6 q \x1b[?12l")
nil)}) |
Beta Was this translation helpful? Give feedback.
-
|
I use Alacritty + tmux. The only reliable way I've found to restore the cursor shape (bar without blinking in my case) is to use a shell hook: For zsh add this to precmd() { printf '\e[6 q'; }For bash add this to PROMPT_COMMAND='printf "\e[6 q"'Use |
Beta Was this translation helpful? Give feedback.
-
|
Same issue, none of the below work on 0.12 (or course, using PROMPT_COMMAND does work, but sending one more command on each prompt does not seem ideal?). Tested on both Alacritty + Tmux and Ptyxis. The response here #36863 (comment) is that it's the terminal job to restore to default.
|
Beta Was this translation helpful? Give feedback.
Changed in Nvim 0.12 , see
see also #4396 (comment) , but use
nvim_ui_send()with Nvim 0.12: