fern-symlink is a fern.vim plugin that decorates symbolic-link entries
in the tree drawer by appending -> <resolved-target> after the file name,
and highlights the arrow and target with dedicated syntax groups.
src/
config.vim
main.vim
bin -> ../build/bin/
latest.log -> /var/log/app/2026-04-21.log
Install with your favorite plugin manager. For vim-plug:
Plug 'lambdalisue/vim-fern'
Plug 'hellolzc/vim-fern-symlink'Just install the plugin. Any symbolic link encountered in the fern drawer will be decorated automatically.
All variables are optional; defaults are shown below. Set them in your
vimrc before the plugin loads (or at any time before the first fern redraw).
" Disable automatic initialization on VimEnter.
" If set, you must call fern_symlink#init() manually.
let g:fern_symlink_disable_startup = 0
" Append " -> <target>" to symlink labels.
let g:fern_symlink#show_target = 1
" Arrow glyph inserted between the name and the target.
let g:fern_symlink#arrow = ' -> '
" fnamemodify() modifier applied to the resolved target path.
" ':~' abbreviates $HOME to ~. Use ':.' for a cwd-relative path, or
" '' for the raw absolute path.
let g:fern_symlink#target_modifier = ':~'If your font supports it and you prefer a fancier arrow:
let g:fern_symlink#arrow = ' ➜ '| Group | Default | Purpose |
|---|---|---|
FernSymlinkArrow |
Comment |
The arrow glyph. |
FernSymlinkTarget |
Comment |
The target path. |
Override in your vimrc:
highlight FernSymlinkTarget ctermfg=51 guifg=#00d7ff cterm=italic gui=italicOn each viewer:redraw hook emitted by fern, the plugin walks
helper.fern.visible_nodes, calls getftype() + resolve() on each
node's _path, and rewrites node.label once per node. A buffer-local
processing flag prevents recursive redraws, and a per-node _fern_symlink_done
flag prevents duplicate decoration.
Because the plugin touches label rather than badge, it coexists with
fern-git-status.vim without stepping on its output.
MIT. See LICENSE.