diff options
Diffstat (limited to 'fnl')
-rw-r--r-- | fnl/settings/autocmds.fnl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl index cd3a27e..27d6c2d 100644 --- a/fnl/settings/autocmds.fnl +++ b/fnl/settings/autocmds.fnl @@ -31,7 +31,22 @@ (vim.keymap.set :t :<C-h> "<Cmd>wincmd h<CR>" {}) (vim.keymap.set :t :<C-j> "<Cmd>wincmd j<CR>" {}) (vim.keymap.set :t :<C-k> "<Cmd>wincmd k<CR>" {}) - (vim.keymap.set :t :<C-l> "<Cmd>wincmd l<CR>" {}))}]]) + (vim.keymap.set :t :<C-l> "<Cmd>wincmd l<CR>" {}))}] + [[:InsertLeave :WinEnter] + {:callback (fn [] + (let [(ok cl) (pcall vim.api.nvim_win_get_var 0 + :auto-cursorline)] + (if (and ok cl) + (do + (set vim.wo.cursorline true) + (vim.api.nvim_win_del_var 0 :auto-cursorline)))))}] + [[:InsertEnter :WinLeave] + {:callback (fn [] + (let [cl vim.wo.cursorline] + (if cl + (do + (vim.api.nvim_win_set_var 0 :auto-cursorline cl) + (set vim.wo.cursorline false)))))}]]) (each [_ autocmd (ipairs autocmds)] (match autocmd |