aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2023-09-04 23:05:06 +0200
committersrdusr <trevorgray@srdusr.com>2023-09-04 23:05:06 +0200
commite0dcd0fc39801174067cac09d340f952ae9fa62e (patch)
tree7f6553a85cc305259f13a5cd3981a82879ebd1de /lua/plugins
parent0e2e166fca112354fa30fec33089149f435ac434 (diff)
downloaddotfiles-e0dcd0fc39801174067cac09d340f952ae9fa62e.tar.gz
dotfiles-e0dcd0fc39801174067cac09d340f952ae9fa62e.zip
Made cursorline configurable and allow refreshing
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/nvim-tree.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua
index cc0b104..79bc366 100644
--- a/lua/plugins/nvim-tree.lua
+++ b/lua/plugins/nvim-tree.lua
@@ -306,6 +306,33 @@ local function copy_file_to(node)
-- Copy the file
vim.fn.system({ 'cp', '-R', file_src, file_out })
end
+
+local function edit_and_close(node)
+ api.node.open.edit(node, {})
+ api.tree.close()
+end
+
+vim.api.nvim_create_augroup('NvimTreeRefresh', {})
+vim.api.nvim_create_autocmd('BufEnter', {
+ pattern = 'NvimTree_1',
+ command = 'NvimTreeRefresh',
+ group = 'NvimTreeRefresh',
+})
+
+vim.api.nvim_create_autocmd({ 'CursorHold' }, {
+ pattern = 'NvimTree*',
+ callback = function()
+ local def = vim.api.nvim_get_hl_by_name('Cursor', true)
+ vim.api.nvim_set_hl(
+ 0,
+ 'Cursor',
+ vim.tbl_extend('force', def, {
+ blend = 100,
+ })
+ )
+ vim.opt.guicursor:append('a:Cursor/lCursor')
+ end,
+})
-- Highlight Groups
vim.api.nvim_command('highlight NvimTreeNormal guibg=none')