Cleanup todos and the changes fixing some of them
This commit is contained in:
parent
cb0a4a269c
commit
2513ea60ae
4 changed files with 40 additions and 29 deletions
|
@ -1,4 +1,3 @@
|
|||
scriptencoding utf-8
|
||||
set fileencoding=utf8
|
||||
|
||||
let $vimdir = $XDG_CONFIG_HOME.'/nvim'
|
||||
|
@ -159,9 +158,6 @@ function! StatusLineBufferByNum(bufnum)
|
|||
let l:prefix = ' %#InactiveBuffer#'
|
||||
let l:suffix = '%* '
|
||||
let l:bufinfo = getbufinfo(a:bufnum)[0]
|
||||
if l:bufinfo.listed == 0
|
||||
return '%*'
|
||||
end
|
||||
if l:bufinfo['hidden'] == 0 && index(l:bufinfo['windows'], g:statusline_winid) >= 0
|
||||
let l:prefix = '%#ActiveBuffer# '
|
||||
let l:suffix = ' %*'
|
||||
|
@ -171,29 +167,48 @@ endfunction
|
|||
|
||||
au BufReadPost * | if stridx(&ft, 'commit') >= 0 | exe "startinsert!" | endif
|
||||
|
||||
let l:status_line_max_length = 5
|
||||
let g:status_line_max_length = 5
|
||||
function! StatusLineBuffers()
|
||||
let l:since_active = 0
|
||||
let l:active_index = -1
|
||||
let l:acc = []
|
||||
for bufnum in nvim_list_bufs()
|
||||
for l:bufnum in nvim_list_bufs()
|
||||
let l:bufinfo = getbufinfo(l:bufnum)[0]
|
||||
if l:bufinfo.listed == 0
|
||||
continue
|
||||
end
|
||||
let l:entry = StatusLineBufferByNum(bufnum)
|
||||
if l:entry =~ "^%#ActiveBuffer#"
|
||||
"
|
||||
endif
|
||||
let l:acc = add(l:acc, l:entry)
|
||||
if l:since_active > 0
|
||||
let l:since_active = l:since_active + 1
|
||||
if l:entry =~ "^%#ActiveBuffer#"
|
||||
let l:active_index = index(l:acc, l:entry)
|
||||
endif
|
||||
endfor
|
||||
if l:active_index >= 0
|
||||
" TODO: instead implement this as a wraparound carousel?
|
||||
let l:offset = g:status_line_max_length / 2
|
||||
let l:min_buf_num = max([0, (l:active_index - offset)])
|
||||
let l:max_buf_num = min([(len(l:acc) - 1), (l:min_buf_num + g:status_line_max_length - 1)])
|
||||
let l:min_buf_num = max([0, (l:max_buf_num - g:status_line_max_length + 1)])
|
||||
let l:buflist = join(l:acc[(l:min_buf_num):(l:max_buf_num)], '')
|
||||
let l:prefix = ""
|
||||
let l:suffix = ""
|
||||
if l:min_buf_num > 0
|
||||
let l:prefix = "< "
|
||||
endif
|
||||
if l:max_buf_num < len(l:acc) - 1
|
||||
let l:suffix = " >"
|
||||
endif
|
||||
return l:prefix . l:buflist . l:suffix
|
||||
else
|
||||
return join(l:acc, '')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! StatusLine()
|
||||
try
|
||||
" try
|
||||
return StatusLineBuffers().'%*%=%c,%l/%L (%p%%)'
|
||||
catch
|
||||
return 'buflisterr%*%=%c,%l/%L (%p%%)'
|
||||
endtry
|
||||
" catch
|
||||
" return 'buflisterr%*%=%c,%l/%L (%p%%)'
|
||||
" endtry
|
||||
endfunction
|
||||
|
||||
" set laststatus=0 showtabline tabline=%!StatusLine()
|
||||
|
|
|
@ -20,6 +20,8 @@ set -Ux ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_byt
|
|||
set -Ux LESS "-r"
|
||||
set -Ux LS_COLORS 'ow=01;36;40' # more sane ls colors
|
||||
set -Ux EDITOR nvim
|
||||
set -Ux VISUAL less
|
||||
set -Ux PAGER less
|
||||
set -Ux MANPAGER 'env MANWIDTH="" nvim --cmd "let g:prosession_on_startup=0" +Man!'
|
||||
|
||||
has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'
|
||||
|
|
|
@ -65,7 +65,7 @@ yay -Sy \
|
|||
alsa-utils `# Audio Utilities` \
|
||||
alsa-plugins `# Plugins for ALSA` \
|
||||
pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \
|
||||
neovim `# Text Editors` \
|
||||
neovim-git `# Text Editors` \
|
||||
sc-im `# Spreadsheets` \
|
||||
unzip `# Simple Unzipping` \
|
||||
tmux `# Terminal Multiplexer` \
|
||||
|
|
|
@ -16,16 +16,10 @@ curl -s -L https://git.lyte.dev/lytedev/dotfiles/raw/branch/master/bin/init-dotf
|
|||
|
||||
# To Do
|
||||
|
||||
+ nvim statusline overflow
|
||||
+ **Learn to use `journalctl`**
|
||||
+ Vim sessions?
|
||||
+ Fix sway workspaces on desktop
|
||||
+ Neovim LSP
|
||||
+ Setup `nnn`
|
||||
+ Move to NixOS (WIP) or Guix? Declarative is the future!
|
||||
+ Custom Iosevka font with kitty-compatible ligatures?
|
||||
+ Makefile instead of setup script
|
||||
+ `c` (and similar aliases) could utilize `CDPATH` envvar?
|
||||
+ Better/more secure remote management configuration in dotfiles? [1][1]
|
||||
+ Setup network file share?
|
||||
+ Add vim in the terminal as the handler for many MIME types (xdg-open and such)
|
||||
|
|
Reference in a new issue