diff --git a/nvim/after/ftplugin/diff.vim b/nvim/after/ftplugin/diff.vim deleted file mode 100644 index ab49c88..0000000 --- a/nvim/after/ftplugin/diff.vim +++ /dev/null @@ -1 +0,0 @@ -setlocal nofoldenable foldmethod=manual diff --git a/nvim/after/ftplugin/markdown.vim b/nvim/after/ftplugin/markdown.vim index f5408c0..5408829 100644 --- a/nvim/after/ftplugin/markdown.vim +++ b/nvim/after/ftplugin/markdown.vim @@ -2,10 +2,9 @@ source :h/text.vim let s:src_file = expand('%') let s:out_file = s:src_file.'.html' -let &l:makeprg = 'markdown2htmldoc' +let &l:makeprg = 'markdown2htmldoc '.shellescape(s:src_file).' '.shellescape(s:out_file) for s:arg in get(g:, 'dotfiles_markdown2htmldoc_options', []) let &l:makeprg .= ' '.shellescape(s:arg) endfor -let &l:makeprg .= ' -- '.shellescape(s:src_file).' '.shellescape(s:out_file) nnoremap Open %.html diff --git a/nvim/after/ftplugin/sass.vim b/nvim/after/ftplugin/sass.vim deleted file mode 100644 index 6e88f83..0000000 --- a/nvim/after/ftplugin/sass.vim +++ /dev/null @@ -1 +0,0 @@ -source :h/scss.vim diff --git a/nvim/after/ftplugin/scss.vim b/nvim/after/ftplugin/scss.vim index 9d5f7f1..94b3fea 100644 --- a/nvim/after/ftplugin/scss.vim +++ b/nvim/after/ftplugin/scss.vim @@ -1,9 +1 @@ source :h/css.vim - -let s:src_file = expand('%') -let s:out_file = s:src_file.'.css' -let &l:makeprg = 'sass' -for s:arg in get(g:, 'dotfiles_dart_sass_options', []) - let &l:makeprg .= ' '.shellescape(s:arg) -endfor -let &l:makeprg .= ' -- '.shellescape(s:src_file).':'.shellescape(s:out_file) diff --git a/nvim/colors/dotfiles.vim b/nvim/colors/dotfiles.vim index bea107b..a48e3af 100644 --- a/nvim/colors/dotfiles.vim +++ b/nvim/colors/dotfiles.vim @@ -5,8 +5,7 @@ execute 'source' fnameescape(g:dotfiles_dir.'/colorschemes/out/vim.vim') - let s:is_gui_color = !has('win32') && !has('win64') && !has('win32unix') && has('termguicolors') && &termguicolors - if s:is_gui_color && exists('$_COLORSCHEME_TERMINAL') + if !&termguicolors && exists('$_COLORSCHEME_TERMINAL') set notermguicolors endif @@ -26,45 +25,39 @@ endfunction let s:colors = g:dotfiles_colorscheme_base16_colors - function s:hi(group, fg, bg, attr, sp) - let fg = {} - let bg = {} - let attr = 'NONE' - let sp = {} + function s:hi(group, fg, bg, attr, guisp) + let args = '' if a:fg isnot '' let fg = s:is_number(a:fg) ? s:colors[a:fg] : {'gui': a:fg, 'cterm': a:fg} + let args .= ' guifg=' . fg.gui . ' ctermfg=' . fg.cterm endif if a:bg isnot '' let bg = s:is_number(a:bg) ? s:colors[a:bg] : {'gui': a:bg, 'cterm': a:bg} + let args .= ' guibg=' . bg.gui . ' ctermbg=' . bg.cterm endif if a:attr isnot '' - let attr = a:attr + let args .= ' gui=' . a:attr . ' cterm=' . a:attr endif - if a:sp isnot '' - let sp = s:is_number(a:sp) ? s:colors[a:sp] : {'gui': a:sp, 'cterm': a:sp} + if a:guisp isnot '' + let guisp = s:is_number(a:guisp) ? s:colors[a:guisp].gui : a:guisp + let args .= ' guisp=' . guisp endif - exec 'hi' a:group - \ 'guifg='.get(fg, 'gui', 'NONE') 'ctermfg='.get(fg, 'cterm', 'NONE') - \ 'guibg='.get(bg, 'gui', 'NONE') 'ctermbg='.get(bg, 'cterm', 'NONE') - \ 'gui='.(attr) 'cterm='.(attr) - \ 'guisp='.get(sp, 'gui', 'NONE') + exec 'hi' a:group args endfunction " }}} " General syntax highlighting {{{ - " TODO: `hi clear` ? - - call s:hi('Normal', 0x5, 0x0, '', '') - call s:hi('Italic', 0xE, '', 'italic', '') - call s:hi('Bold', 0xA, '', 'bold', '') - call s:hi('Underlined', 0x8, '', 'underline', '') - call s:hi('Title', 0xD, '', '', '') + call s:hi('Normal', 0x5, 0x0, '', '') + call s:hi('Italic', 0xE, '', 'italic', '') + call s:hi('Bold', 0xA, '', 'bold', '') + call s:hi('Underlined', 0x8, '', 'underline', '') + call s:hi('Title', 0xD, '', 'NONE', '') hi! link Directory Title - call s:hi('Conceal', 0xC, '', '', '') - call s:hi('NonText', 0x3, '', '', '') + call s:hi('Conceal', 0xC, 'NONE', '', '') + call s:hi('NonText', 0x3, '', '', '') hi! link SpecialKey Special - call s:hi('MatchParen', 'fg', 0x3, '', '') + call s:hi('MatchParen', 'fg', 0x3, '', '') call s:hi('Keyword', 0xE, '', '', '') hi! link Statement Keyword @@ -85,7 +78,7 @@ hi! link SpecialComment Comment call s:hi('Todo', 'bg', 0xA, 'bold', '') call s:hi('Function', 0xD, '', '', '') - call s:hi('Identifier', 0x8, '', '', '') + call s:hi('Identifier', 0x8, '', 'none', '') hi! link Variable Identifier " call s:hi('Include', 0xF, '', '', '') hi! link Include Keyword @@ -95,30 +88,30 @@ hi! link Delimiter NONE call s:hi('Special', 0xC, '', '', '') call s:hi('Tag', 0xA, '', '', '') - call s:hi('Type', 0xA, '', '', '') + call s:hi('Type', 0xA, '', 'none', '') hi! link Typedef Type " }}} " User interface {{{ - call s:hi('Error', 'bg', 0x8, '', '') - call s:hi('ErrorMsg', 0x8, '', '', '') - call s:hi('WarningMsg', 0x9, '', '', '') - call s:hi('TooLong', 0x8, '', '', '') - call s:hi('Debug', 0x8, '', '', '') + call s:hi('Error', 'bg', 0x8, '', '') + call s:hi('ErrorMsg', 0x8, 'NONE', '', '') + call s:hi('WarningMsg', 0x9, 'NONE', '', '') + call s:hi('TooLong', 0x8, '', '', '') + call s:hi('Debug', 0x8, '', '', '') hi! link CocErrorSign Error - call s:hi('CocWarningSign', 'bg', 0xA, '', '') - call s:hi('CocInfoSign', 'bg', 0xD, '', '') + call s:hi('CocWarningSign', 'bg', 0xA, '', '') + call s:hi('CocInfoSign', 'bg', 0xD, '', '') hi! link CocHintSign CocInfoSign - call s:hi('CocFadeOut', 0x3, '', '', '') + call s:hi('CocFadeOut', 0x3, '', '', '') hi! link CocMarkdownLink Underlined call s:hi('FoldColumn', 0xC, 0x1, '', '') call s:hi('Folded', 0x3, 0x1, '', '') - call s:hi('IncSearch', 0x1, 0x9, '', '') - call s:hi('Search', 0x1, 0xA, '', '') + call s:hi('IncSearch', 0x1, 0x9, 'none', '') + call s:hi('Search', 0x1, 0xA, '', '') hi! link Substitute Search call s:hi('ModeMsg', 0xB, '', '', '') @@ -127,7 +120,7 @@ call s:hi('Visual', '', 0x2, '', '') call s:hi('WildMenu', 0x1, 'fg', '', '') - call s:hi('CursorLine', '', 0x1, '', '') + call s:hi('CursorLine', '', 0x1, 'none', '') hi! link CursorColumn CursorLine call s:hi('ColorColumn', '', 0x1, '', '') call s:hi('LineNr', 0x3, 0x1, '', '') @@ -135,7 +128,7 @@ call s:hi('QuickFixLine', '', 0x2, '', '') call s:hi('SignColumn', 0x3, 0x1, '', '') - call s:hi('StatusLine', 0x4, 0x1, '', '') + call s:hi('StatusLine', 0x4, 0x1, 'none', '') call s:hi('StatusLineNC', 0x3, 0x1, '', '') call s:hi('VertSplit', 0x2, 0x2, '', '') call s:hi('TabLine', 0x3, 0x1, '', '') @@ -149,12 +142,13 @@ hi! link ctrlsfLnumMatch ctrlsfMatch let s:spell_fg = s:is_kitty ? '' : 'bg' + let s:spell_bg = s:is_kitty ? 'NONE' : '' let s:spell_attr = s:is_kitty ? 'undercurl' : '' - call s:hi('SpellBad', s:spell_fg, s:is_kitty ? '' : 0x8, s:spell_attr, 0x8) - call s:hi('SpellLocal', s:spell_fg, s:is_kitty ? '' : 0xC, s:spell_attr, 0xC) - call s:hi('SpellCap', s:spell_fg, s:is_kitty ? '' : 0xD, s:spell_attr, 0xD) - call s:hi('SpellRare', s:spell_fg, s:is_kitty ? '' : 0xE, s:spell_attr, 0xE) - unlet s:spell_fg s:spell_attr + call s:hi('SpellBad', s:spell_fg, s:spell_bg, s:spell_attr, 0x8) + call s:hi('SpellLocal', s:spell_fg, s:spell_bg, s:spell_attr, 0xC) + call s:hi('SpellCap', s:spell_fg, s:spell_bg, s:spell_attr, 0xD) + call s:hi('SpellRare', s:spell_fg, s:spell_bg, s:spell_attr, 0xE) + unlet s:is_kitty s:spell_fg s:spell_bg s:spell_attr call s:hi('Sneak', 'bg', 0xB, 'bold', '') hi! link SneakScope Visual diff --git a/nvim/init.vim b/nvim/init.vim index fbbb72a..a1911ba 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -63,17 +63,8 @@ if exists(':Sleuth') " shiftwidth to the unreasonable value picked above, which vim-sleuth " internally compares with its local `s:default_shiftwidth`, sees that both " are the same, and proceeds to execute the indent detection algorithm. - " ALSO Note how I'm not using `BufEnter` as vim-sleuth does because - " apparently `BufWinEnter` leads to better compatibility with the - " indentLine plugin and potentially less useless invocations (see the note - " about window splits in the docs for this event). Oh, one last thing: - " vim-sleuth forgets to assign the tabstop options, which I have to do as - " well. But anyway, boom, my work here is done. - autocmd BufWinEnter * - \ let &l:shiftwidth = s:fake_default_shiftwidth - \| Sleuth - \| let &l:tabstop = &l:shiftwidth - \| let &l:softtabstop = &l:shiftwidth + " Boom, my work here is done. + autocmd BufEnter * let &l:shiftwidth = s:fake_default_shiftwidth | Sleuth augroup END " HACK: In case you are wondering why I'm using Polyglot's bundled vim-sleuth diff --git a/nvim/plugin/editing.vim b/nvim/plugin/editing.vim index 5a81cec..70ba62e 100644 --- a/nvim/plugin/editing.vim +++ b/nvim/plugin/editing.vim @@ -15,8 +15,8 @@ set commentstring=//%s function SetIndent(expandtab, shiftwidth) let &l:expandtab = a:expandtab let &l:shiftwidth = str2nr(a:shiftwidth) - let &l:tabstop = &l:shiftwidth - let &l:softtabstop = &l:shiftwidth + let &l:tabstop = &shiftwidth + let &l:softtabstop = &shiftwidth endfunction command -nargs=1 Indent call SetIndent(1, ) command -nargs=1 IndentTabs call SetIndent(0, ) diff --git a/nvim/plugin/interface.vim b/nvim/plugin/interface.vim index 8e357ce..11671da 100644 --- a/nvim/plugin/interface.vim +++ b/nvim/plugin/interface.vim @@ -123,8 +123,6 @@ endif nnoremap Helptags nnoremap f Files nnoremap b Buffers - " - let $FZF_DEFAULT_OPTS = '--color=16' let g:fzf_layout = { 'down': '~40%' } let g:fzf_preview_window = ['right:noborder', 'ctrl-/'] " }}} diff --git a/script-resources/colortest.awk b/script-resources/colortest.awk index 6f87514..cf66228 100644 --- a/script-resources/colortest.awk +++ b/script-resources/colortest.awk @@ -14,24 +14,20 @@ BEGIN { print ""; } -function print_color(color, idx) { - if (OPT_COLOR_CODES) { - printf "\033[1;30;48;5;%sm %02X \033[0m", color, idx; - } else { - printf "\033[48;5;%sm \033[0m", color; - } +function print_color(color) { + printf "\033[48;5;%sm \033[0m", color } function test_standard_colors() { print "16 standard colors:"; - for (color = 0; color < 16; color += 1) print_color(color, color); + for (color = 0; color < 16; color += 1) print_color(color); print ""; } function test_base16_colorscheme() { print "base16 colorscheme:"; split("0 18 19 8 20 7 21 15 1 16 3 2 6 4 5 17", colors, " "); - for (i = 1; i <= length(colors); i++) print_color(colors[i], i - 1); + for (i = 1; i <= length(colors); i++) print_color(colors[i]); print ""; } @@ -43,8 +39,7 @@ function test_6x6x6_cube() { for (row = 0; row < 6; row++) { for (block_x = 0; block_x < block_grid_w; block_x++) { for (col = 0; col < 6; col++) { - color = col + 6*row + 6*6*block_x + block_grid_w*6*6*block_y - print_color(16 + color, color); + print_color(16 + col + 6*row + 6*6*block_x + block_grid_w*6*6*block_y); } } print ""; @@ -55,7 +50,7 @@ function test_6x6x6_cube() { function test_grayscale() { print "grayscale from black to white in 24 steps:"; for (color = 0; color < 24; color += 1) { - print_color(16 + 6*6*6 + color, color) + print_color(16 + 6*6*6 + color) } print ""; } diff --git a/scripts/colortest b/scripts/colortest index 9f5bc94..99f0f4b 100755 --- a/scripts/colortest +++ b/scripts/colortest @@ -1,6 +1,6 @@ #!/bin/sh -set -eu +set -e script_dir="$(dirname "$0")" diff --git a/scripts/colortest2 b/scripts/colortest2 index 8a439ff..9b685c6 100755 --- a/scripts/colortest2 +++ b/scripts/colortest2 @@ -1,6 +1,6 @@ #!/bin/sh -set -eu +set -e script_dir="$(dirname "$0")" cols="$(tput cols)" diff --git a/scripts/colortest3 b/scripts/colortest3 deleted file mode 100755 index 84a2cef..0000000 --- a/scripts/colortest3 +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -eu - -script_dir="$(dirname "$0")" - -exec awk -v OPT_COLOR_CODES=1 -f "${script_dir}/../script-resources/colortest.awk" diff --git a/zsh/env.zsh b/zsh/env.zsh index baf1882..eca6fb0 100644 --- a/zsh/env.zsh +++ b/zsh/env.zsh @@ -31,6 +31,3 @@ export JQ_COLORS="${(j.:.)jq_colors}" unset jq_colors export HOMEBREW_NO_AUTO_UPDATE=1 - -# https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/tui/tui.go#L496-L515 -export FZF_DEFAULT_OPTS="--color=16"