Cleanup todos and the changes fixing some of them

This commit is contained in:
Daniel Flanagan 2020-11-21 16:40:42 -06:00
parent cb0a4a269c
commit 2513ea60ae
Signed by: lytedev
GPG key ID: 5B2020A0F9921EF4
4 changed files with 40 additions and 29 deletions

View file

@ -1,12 +1,11 @@
scriptencoding utf-8
set fileencoding=utf8 set fileencoding=utf8
let $vimdir = $XDG_CONFIG_HOME.'/nvim' let $vimdir = $XDG_CONFIG_HOME.'/nvim'
if empty(glob($vimdir.'/autoload/plug.vim')) if empty(glob($vimdir.'/autoload/plug.vim'))
silent !curl -fLo $vimdir/autoload/plug.vim --create-dirs silent !curl -fLo $vimdir/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $vimdir.'init.vim' autocmd VimEnter * PlugInstall --sync | source $vimdir.'init.vim'
endif endif
let g:completion_enable_auto_popup = 0 let g:completion_enable_auto_popup = 0
@ -156,44 +155,60 @@ set foldtext=NeatFoldText()
" TODO: only update this portion when needed instead of every render? " TODO: only update this portion when needed instead of every render?
function! StatusLineBufferByNum(bufnum) function! StatusLineBufferByNum(bufnum)
let l:prefix = '%#InactiveBuffer#' let l:prefix = ' %#InactiveBuffer#'
let l:suffix = '%* ' let l:suffix = '%* '
let l:bufinfo = getbufinfo(a:bufnum)[0] 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 if l:bufinfo['hidden'] == 0 && index(l:bufinfo['windows'], g:statusline_winid) >= 0
let l:prefix = '%#ActiveBuffer# ' let l:prefix = '%#ActiveBuffer# '
let l:suffix = ' %* ' let l:suffix = ' %*'
endif endif
return l:prefix . fnamemodify(bufname(a:bufnum), ':t') . l:suffix return l:prefix . fnamemodify(bufname(a:bufnum), ':t') . l:suffix
endfunction endfunction
au BufReadPost * | if stridx(&ft, 'commit') >= 0 | exe "startinsert!" | endif 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() function! StatusLineBuffers()
let l:since_active = 0 let l:active_index = -1
let l:acc = [] 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) let l:entry = StatusLineBufferByNum(bufnum)
if l:entry =~ "^%#ActiveBuffer#"
"
endif
let l:acc = add(l:acc, l:entry) let l:acc = add(l:acc, l:entry)
if l:since_active > 0 if l:entry =~ "^%#ActiveBuffer#"
let l:since_active = l:since_active + 1 let l:active_index = index(l:acc, l:entry)
endif endif
endfor endfor
return join(l:acc, '') 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 endfunction
function! StatusLine() function! StatusLine()
try " try
return StatusLineBuffers().'%*%=%c,%l/%L (%p%%)' return StatusLineBuffers().'%*%=%c,%l/%L (%p%%)'
catch " catch
return 'buflisterr%*%=%c,%l/%L (%p%%)' " return 'buflisterr%*%=%c,%l/%L (%p%%)'
endtry " endtry
endfunction endfunction
" set laststatus=0 showtabline tabline=%!StatusLine() " set laststatus=0 showtabline tabline=%!StatusLine()

View file

@ -20,6 +20,8 @@ set -Ux ERL_AFLAGS "-kernel shell_history enabled -kernel shell_history_file_byt
set -Ux LESS "-r" set -Ux LESS "-r"
set -Ux LS_COLORS 'ow=01;36;40' # more sane ls colors set -Ux LS_COLORS 'ow=01;36;40' # more sane ls colors
set -Ux EDITOR nvim 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!' 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' has_command fd && set -Ux FZF_DEFAULT_COMMAND 'fd --type f --hidden --follow --exclude .git'

View file

@ -65,7 +65,7 @@ yay -Sy \
alsa-utils `# Audio Utilities` \ alsa-utils `# Audio Utilities` \
alsa-plugins `# Plugins for ALSA` \ alsa-plugins `# Plugins for ALSA` \
pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \ pulseaudio pavucontrol pulsemixer `# Audio Backend and Controls` \
neovim `# Text Editors` \ neovim-git `# Text Editors` \
sc-im `# Spreadsheets` \ sc-im `# Spreadsheets` \
unzip `# Simple Unzipping` \ unzip `# Simple Unzipping` \
tmux `# Terminal Multiplexer` \ tmux `# Terminal Multiplexer` \

View file

@ -16,16 +16,10 @@ curl -s -L https://git.lyte.dev/lytedev/dotfiles/raw/branch/master/bin/init-dotf
# To Do # To Do
+ nvim statusline overflow
+ **Learn to use `journalctl`** + **Learn to use `journalctl`**
+ Vim sessions?
+ Fix sway workspaces on desktop + Fix sway workspaces on desktop
+ Neovim LSP + Neovim LSP
+ Setup `nnn`
+ Move to NixOS (WIP) or Guix? Declarative is the future! + 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] + Better/more secure remote management configuration in dotfiles? [1][1]
+ Setup network file share? + Setup network file share?
+ Add vim in the terminal as the handler for many MIME types (xdg-open and such) + Add vim in the terminal as the handler for many MIME types (xdg-open and such)