From e741680edb0524f601a91d65ef90a0af0915a0c3 Mon Sep 17 00:00:00 2001 From: Christoph Schiessl Date: Mon, 2 Aug 2021 20:55:41 +0200 Subject: [PATCH] add new config option g:nvim_tree_symlink_arrow (fixes #283) (#512) --- README.md | 1 + doc/nvim-tree-lua.txt | 4 ++++ lua/nvim-tree/renderer.lua | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0fed83d0..52262e3e 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ let g:nvim_tree_lsp_diagnostics = 1 "0 by default, will show lsp diagnostics in let g:nvim_tree_disable_window_picker = 1 "0 by default, will disable the window picker. let g:nvim_tree_hijack_cursor = 0 "1 by default, when moving cursor in the tree, will position the cursor at the start of the file on the current line let g:nvim_tree_icon_padding = ' ' "one space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font. +let g:nvim_tree_symlink_arrow = ' >> ' " defaults to ' ➛ '. used as a separator between symlinks' source and target. let g:nvim_tree_update_cwd = 1 "0 by default, will update the tree cwd when changing nvim's directory (DirChanged event). Behaves strangely with autochdir set. let g:nvim_tree_window_picker_exclude = { \ 'filetype': [ diff --git a/doc/nvim-tree-lua.txt b/doc/nvim-tree-lua.txt index a39929fc..071a5527 100644 --- a/doc/nvim-tree-lua.txt +++ b/doc/nvim-tree-lua.txt @@ -310,6 +310,10 @@ of the file on the current line. One space by default, used for rendering the space between the icon and the filename. Use with caution, it could break rendering if you set an empty string depending on your font. +|g:nvim_tree_symlink_arrow| *g:nvim_tree_symlink_arrow* + +Defaults to ' ➛ '. Used as a separator between symlinks' source and target. + |g:nvim_tree_update_cwd| Can be 0 or 1. 0 by default. diff --git a/lua/nvim-tree/renderer.lua b/lua/nvim-tree/renderer.lua index 1ee258db..2913b53e 100644 --- a/lua/nvim-tree/renderer.lua +++ b/lua/nvim-tree/renderer.lua @@ -335,8 +335,9 @@ local function update_draw_data(tree, depth, markers) elseif node.link_to then local icon = get_symlink_icon() local link_hl = git_hl or 'NvimTreeSymlink' + local arrow = vim.g.nvim_tree_symlink_arrow or ' ➛ ' table.insert(hl, { link_hl, index, offset, -1 }) - table.insert(lines, padding..icon..node.name.." ➛ "..node.link_to) + table.insert(lines, padding..icon..node.name..arrow..node.link_to) index = index + 1 else