Compare commits

...

2 commits

Author SHA1 Message Date
Danielle McLean
0d1e22d515
Switch from NERDtree to fern.vim, which is async and very pluggable 2023-10-23 13:51:10 +11:00
Danielle McLean
4c4116c6af
Explicitly hide default icon so third-party icon plugins work right 2023-10-23 13:50:24 +11:00
3 changed files with 25 additions and 7 deletions

View file

@ -84,12 +84,17 @@ g:csv_no_conceal = 1
g:vim_svelte_plugin_use_typescript = 1 g:vim_svelte_plugin_use_typescript = 1
g:LatexBox_Folding = 1 g:LatexBox_Folding = 1
g:NERDTreeHijackNetrw = 1
g:ale_set_balloons = 1 g:ale_set_balloons = 1
nmap <silent> <C-k> <Plug>(ale_previous_wrap) nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap) nmap <silent> <C-j> <Plug>(ale_next_wrap)
g:fern#renderer = 'nerdfont'
augroup glyphPalette
autocmd!
autocmd FileType fern g:glyph_palette#apply()
augroup END
g:mucomplete#can_complete = { g:mucomplete#can_complete = {
default: { default: {
omni: (t) => strlen(&l:omnifunc) > 0 && t =~# '\m\k\%(\k\|\.\)$' omni: (t) => strlen(&l:omnifunc) > 0 && t =~# '\m\k\%(\k\|\.\)$'

View file

@ -28,7 +28,6 @@ minpac#add('lifepillar/vim-mucomplete')
minpac#add('lotabout/skim') minpac#add('lotabout/skim')
minpac#add('lotabout/skim.vim') minpac#add('lotabout/skim.vim')
minpac#add('mhinz/vim-signify') minpac#add('mhinz/vim-signify')
minpac#add('scrooloose/nerdtree')
minpac#add('sjl/vitality.vim') minpac#add('sjl/vitality.vim')
minpac#add('tpope/vim-apathy') minpac#add('tpope/vim-apathy')
minpac#add('tpope/vim-commentary') minpac#add('tpope/vim-commentary')
@ -51,8 +50,15 @@ minpac#add('00dani/SchemaStore.vim')
minpac#add('rbong/vim-crystalline') minpac#add('rbong/vim-crystalline')
minpac#add('lambdalisue/battery.vim') minpac#add('lambdalisue/battery.vim')
minpac#add('lambdalisue/glyph-palette.vim')
minpac#add('lambdalisue/nerdfont.vim') minpac#add('lambdalisue/nerdfont.vim')
minpac#add('lambdalisue/fern.vim')
minpac#add('lambdalisue/fern-hijack.vim')
minpac#add('lambdalisue/fern-renderer-nerdfont.vim')
minpac#add('lambdalisue/fern-git-status.vim')
minpac#add('lambdalisue/fern-ssh')
minpac#add('alvan/vim-closetag') minpac#add('alvan/vim-closetag')
minpac#add('LaTeX-Box-Team/LaTeX-Box') minpac#add('LaTeX-Box-Team/LaTeX-Box')
minpac#add('vhda/verilog_systemverilog.vim') minpac#add('vhda/verilog_systemverilog.vim')

View file

@ -2,6 +2,13 @@ vim9script
import autoload ($XDG_CACHE_HOME .. '/vim/pack/minpac/start/vim-crystalline/autoload/crystalline.vim') as cr import autoload ($XDG_CACHE_HOME .. '/vim/pack/minpac/start/vim-crystalline/autoload/crystalline.vim') as cr
def DropIfDefault(status: string, default: string): string
if status == default
return ''
endif
return status
enddef
def PrependIfVisible(status: string, prefix: string): string def PrependIfVisible(status: string, prefix: string): string
if empty(status) if empty(status)
return '' return ''
@ -41,7 +48,7 @@ def StatuslineLeft(window: number, inactive: bool): string
const bufnr = window->winbufnr() const bufnr = window->winbufnr()
const b = bufnr->getbufvar('&') const b = bufnr->getbufvar('&')
const fileName = [ const fileName = [
bufname(bufnr)->g:nerdfont#find()->AppendIfVisible(' '), bufname(bufnr)->g:nerdfont#find()->DropIfDefault(g:nerdfont#default)->AppendIfVisible(' '),
b.buftype == '' ? '%t' : '%f', b.buftype == '' ? '%t' : '%f',
b.modifiable && b.modified ? cr.ModeHiItem('Modified') .. '+' .. cr.ModeHiItem('Fill') : '', b.modifiable && b.modified ? cr.ModeHiItem('Modified') .. '+' .. cr.ModeHiItem('Fill') : '',
b.readonly ? " \uf023" : '', # nf-fa-lock b.readonly ? " \uf023" : '', # nf-fa-lock
@ -78,7 +85,6 @@ enddef
def ConfigurePlugins(): void def ConfigurePlugins(): void
g:battery#component_format = '%s %v%%' g:battery#component_format = '%s %v%%'
g:nerdfont#default = ''
g:crystalline_theme = 'gruvbox8' g:crystalline_theme = 'gruvbox8'
enddef enddef
@ -107,12 +113,13 @@ def InitTab()
width += 2 width += 2
endif endif
const icon = bufname(bufnr)->g:nerdfont#find()->PrependIfVisible(' ') const icon = bufname(bufnr)->g:nerdfont#find()->DropIfDefault(g:nerdfont#default)->PrependIfVisible(' ')
if width + strchars(icon) >= maxWidth const iconWidth = strchars(icon)
if width + iconWidth >= maxWidth
return [tabDisplay, width] return [tabDisplay, width]
endif endif
return [icon .. tabDisplay, width + strchars(icon)] return [icon .. tabDisplay, width + iconWidth]
enddef enddef
enddef enddef