robin/ivy
my custom neovim config
git clone https://git.robinwobin.dev/robin/ivy
8d3fece
main
1vim . on ( "VimResized" , "@ivy.editor.window.autoresize" , { 2desc ="Automatically resize windows when the host window size changes." , 3} , function () 4vim . cmd ( [[ wincmd = ]] ) 5end ) 6 7vim . on ( { "RecordingEnter" , "RecordingLeave" } , "@ivy.editor.macro.print" , { 8desc ="Notify when recording macro" , 9} , function ( ev ) 10local done =ev . event == "RecordingLeave" 11local msg =done and "Macro recorded" or "Recording macro..." 12vim . api . nvim_echo ( { { msg , "MsgArea" } } , false , { 13title ="Macro" , 14kind ="progress" , 15status =done and "success" or "running" , 16source ="ivy" , 17} ) 18end ) 19 20vim . on ( { "WinEnter" , "TermOpen" } , "@ivy.editor.terminal.startinsert" , { 21pattern ="term://*" , 22desc ="start insert mode in terminal" , 23} , function ( ev ) 24if 25vim . api . nvim_get_current_buf () ~= ev . buf 26or vim . bo [ ev . buf ]. buftype ~= "terminal" 27then 28return 29end 30vim . cmd ( "startinsert" ) 31end ) 32 33vim . on ( "BufWritePre" , "@ivy.editor.file.auto_create_parent_path" , { 34desc ="create path to file" , 35} , function () 36local dir =vim . fn . expand ( "<afile>:p:h" ) 37---@cast dir string 38 39if dir : find ( "%l+://" ) == 1 then 40return 41end 42 43if vim . fn . isdirectory ( dir ) == 0 then 44vim . fn . mkdir ( dir , "p" ) 45end 46end ) 47 48vim . on ( "FileType" , "@ivy.editor.ft.help" , { 49pattern ="help" , 50desc ="allow editing local help files" , 51} , function ( ev ) 52if vim . fs . relpath ( vim . fn . getcwd (), vim . fn . bufname ( ev . buf )) then 53vim . _with ( { buf =ev . buf } , function () 54vim . bo . buftype ="" 55vim . bo . readonly =false 56vim . bo . modifiable =true 57-- assuming there is only one window with the open buffer 58vim . wo . conceallevel =0 59end ) 60end 61end )