add new config option g:nvim_tree_symlink_arrow (fixes #283) (#512)

This commit is contained in:
Christoph Schiessl 2021-08-02 20:55:41 +02:00 committed by GitHub
parent d3e76b81e5
commit e741680edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View File

@ -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': [

View File

@ -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.

View File

@ -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