Compare commits

..

No commits in common. "955a4d07f4699632df24000bbbaad4c9e66ce66a" and "4932e97a4da453dd110e4808875aab615b005fd1" have entirely different histories.

13 changed files with 51 additions and 94 deletions

View file

@ -1 +0,0 @@
setlocal nofoldenable foldmethod=manual

View file

@ -2,10 +2,9 @@ source <sfile>: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 <buffer> <F5> <Cmd>Open %.html<CR>

View file

@ -1 +0,0 @@
source <sfile>:h/scss.vim

View file

@ -1,9 +1 @@
source <sfile>: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)

View file

@ -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,42 +25,36 @@
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('Title', 0xD, '', 'NONE', '')
hi! link Directory Title
call s:hi('Conceal', 0xC, '', '', '')
call s:hi('Conceal', 0xC, 'NONE', '', '')
call s:hi('NonText', 0x3, '', '', '')
hi! link SpecialKey Special
call s:hi('MatchParen', 'fg', 0x3, '', '')
@ -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,7 +88,7 @@
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
" }}}
@ -103,8 +96,8 @@
" User interface {{{
call s:hi('Error', 'bg', 0x8, '', '')
call s:hi('ErrorMsg', 0x8, '', '', '')
call s:hi('WarningMsg', 0x9, '', '', '')
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
@ -117,7 +110,7 @@
call s:hi('FoldColumn', 0xC, 0x1, '', '')
call s:hi('Folded', 0x3, 0x1, '', '')
call s:hi('IncSearch', 0x1, 0x9, '', '')
call s:hi('IncSearch', 0x1, 0x9, 'none', '')
call s:hi('Search', 0x1, 0xA, '', '')
hi! link Substitute Search
@ -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

View file

@ -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

View file

@ -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, <q-args>)
command -nargs=1 IndentTabs call SetIndent(0, <q-args>)

View file

@ -123,8 +123,6 @@ endif
nnoremap <silent> <F1> <Cmd>Helptags<CR>
nnoremap <silent> <leader>f <Cmd>Files<CR>
nnoremap <silent> <leader>b <Cmd>Buffers<CR>
" <https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/tui/tui.go#L496-L515>
let $FZF_DEFAULT_OPTS = '--color=16'
let g:fzf_layout = { 'down': '~40%' }
let g:fzf_preview_window = ['right:noborder', 'ctrl-/']
" }}}

View file

@ -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 "";
}

View file

@ -1,6 +1,6 @@
#!/bin/sh
set -eu
set -e
script_dir="$(dirname "$0")"

View file

@ -1,6 +1,6 @@
#!/bin/sh
set -eu
set -e
script_dir="$(dirname "$0")"
cols="$(tput cols)"

View file

@ -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"

View file

@ -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"