Skip to content

Instantly share code, notes, and snippets.

@dinesh0430
dinesh0430 / neovim-cursor.vim
Created September 8, 2020 09:00
Similar to vim, works for neo-vim.
autocmd VimEnter * silent !echo -ne "\e[3 q"
autocmd VimLeave * silent !echo -ne "\e[3 q"
autocmd VimLeave * let &t_me="\<Esc>]50;CursorShape=1\x7"
autocmd VimLeave * call system('printf "\e[5 q" > $TTY')
" To set the cursor back to bar while exiting neovim
au VimLeave * set guicursor=a:ver25-blinkon250
" Change the cursor behaviour
set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50
@dinesh0430
dinesh0430 / vim-cursor-terminal.vim
Last active September 8, 2020 08:57
Change shape on exit and enter in windows terminal.
if &term =~ '^xterm'
let &t_SI = "\<Esc>[5 q" " Insert mode
let &t_EI = "\<Esc>[0 q" " Normal mode
let &t_SR = "\<Esc>[7 q" " Replace mode
" 1 or 0 -> blinking block
" 3 -> blinking underscore
" 5 -> blinking vertical bar
" 6 -> solid vertical bar
@dinesh0430
dinesh0430 / CapsLockCtrlEscape.ahk
Created July 20, 2020 02:07 — forked from sedm0784/CapsLockCtrlEscape.ahk
AutoHotkey script to map Caps Lock to Escape when it's pressed on its own and Ctrl when used in combination with another key, à la Steve Losh. Adapted from one that does something similar with the Ctrl Key on the Vim Tips Wiki (http://vim.wikia.com/wiki/Map_caps_lock_to_escape_in_Windows?oldid=32281). (Plus contribs from @randy909 & @mmikeww.)
g_LastCtrlKeyDownTime := 0
g_AbortSendEsc := false
g_ControlRepeatDetected := false
*CapsLock::
if (g_ControlRepeatDetected)
{
return
}