dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit 554dcace779a199803af274ec3348268867c8918
parent b2c9a0c4b73fe85b4b1ea64b2981c9d3ef87dd69
Author: Alex Balgavy <a.balgavy@gmail.com>
Date:   Sat, 29 Feb 2020 01:47:39 +0100

vim: separated out a lot of things, 2 new plugins

Moved colorscheme generating functionality to separate vim plugin. Same
with relative file complete. Also some other changes.


Former-commit-id: 6e530ba9b67f94728b9f8460476b1168d61a8e43
Diffstat:
Dscripts/colgen.rb | 260-------------------------------------------------------------------------------
Mvim/after/ftplugin/markdown.vim | 4++--
Dvim/after/ftplugin/vimcolor.vim | 16----------------
Mvim/after/syntax/markdown.vim | 4++++
Dvim/autoload/relative_file_complete.vim | 27---------------------------
Avim/colors/jokull.schemer | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvim/colors/jokull.vim | 106++++++++++++++++++++++++++++++++++++++++----------------------------------------
Dvim/colors/jokull.vimcolor | 63---------------------------------------------------------------
Avim/colors/junipero.schemer | 80+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mvim/colors/junipero.vim | 56++++++++++++++++++++++++++++----------------------------
Dvim/colors/junipero.vimcolor | 67-------------------------------------------------------------------
Dvim/compiler/vimcolor.vim | 8--------
Dvim/ftdetect/vimcolor.vim | 1-
Dvim/plugin/relative_file_complete.vim | 1-
Dvim/plugin/vimcolor.vim | 13-------------
Dvim/syntax/vimcolor.vim | 48------------------------------------------------
Mvim/vimrc | 26++++++++++++++++++++++----
17 files changed, 250 insertions(+), 591 deletions(-)

diff --git a/scripts/colgen.rb b/scripts/colgen.rb @@ -1,260 +0,0 @@ -#!/usr/bin/env ruby -# vim: foldmethod=indent foldlevel=0 -# Vim Colorscheme Generator - -# Colorizer functions ported from https://github.com/chrisbra/Colorizer -module Colorizer - BASIC16 = [ - [ 0x00, 0x00, 0x00 ], - [ 0xCD, 0x00, 0x00 ], - [ 0x00, 0xCD, 0x00 ], - [ 0xCD, 0xCD, 0x00 ], - [ 0x00, 0x00, 0xEE ], - [ 0xCD, 0x00, 0xCD ], - [ 0x00, 0xCD, 0xCD ], - [ 0xE5, 0xE5, 0xE5 ], - [ 0x7F, 0x7F, 0x7F ], - [ 0xFF, 0x00, 0x00 ], - [ 0x00, 0xFF, 0x00 ], - [ 0xFF, 0xFF, 0x00 ], - [ 0x5C, 0x5C, 0xFF ], - [ 0xFF, 0x00, 0xFF ], - [ 0x00, 0xFF, 0xFF ], - [ 0xFF, 0xFF, 0xFF ] - ] - - # Some functions that need to be defined - def xterm2rgb16(color) - # 16 basic colors - r, g, b = 0, 0, 0 - r, g, b = BASIC16[color] - return [r, g, b] - end - def xterm2rgb256(color) - # 16 basic colors - r, g, b = 0, 0, 0 - if color < 16 - return xterm2rgb16(color) - - # color cube color - elsif color >= 16 && color < 232 - color=color-16 - valuerange6 = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ] - r = valuerange6[(color/36)%6] - g = valuerange6[(color/6)%6] - b = valuerange6[color%6] - - # gray tone - elsif color >= 232 && color <= 255 - r = 8 + (color-232) * 0x0a - g, b = r, r - end - - return [r, g, b] - end - def check16colorterm(rgblist, minlist) - min = minlist[0] + minlist[1] + minlist[2] - [[205,0,0], [0,205,0], [205,205,0], [205,0,205], [0,205,205], [0,0,238], [92,92,255]].each do |value| - # euclidian distance would be needed, - # but this works good enough and is faster. - t = value.each_with_index.map { |v, i| (v - rgblist[i]).abs }.sum - return value if min > t - end - return rgblist - end - def roundcolor(arr) - result = [] - minlist = [] - min = 1000 - list = [ 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF ] - arr.each do |item| - r = nil - list.each do |val| - t = (val - item).abs - if (min > t) - min = t - r = val - end - end - result << r if not r.nil? - minlist << min - min = 1000 - end - # Check with the values from the 16 color xterm, if the difference - # is lower - result = check16colorterm(result, minlist) - return result - end - - def rgb2term color - if color == '000000' - return 0 - elsif color == 'FFFFFF' - return 15 - else - r = color[0..1].to_s.to_i(16) - g = color[2..3].to_s.to_i(16) - b = color[4..5].to_s.to_i(16) - - # Try exact match first - colortable = (0..255).map { |x| xterm2rgb256(x) } - i = colortable.index([r, g, b]) - return i if !i.nil? && i > -1 - - # Grey scale ? - if r == g && r == b - # 0 and 15 have already been take care of - if r < 5 - return 0 # black - elsif r > 244 - return 15 # white - end - # grey cube starts at index 232 - return 232+(r-5)/10 - end - - # Round to the next step in the xterm color cube - # euclidian distance would be needed, - # but this works good enough and is faster. - round = roundcolor([r, g, b]) - # Return closest match or -1 if not found - return colortable.index(round) - end - end -end - - -include Colorizer -# Primary color definitions (hi {group}) -primary=[] - -# Linking groups (hi link {group}) -links={} - -# Background is light by default -background="light" - -# Some error checking -if ARGV[0].nil? - abort "Colors file required as argument" -elsif not File.file? ARGV[0] - abort "File #{ARGV[0]} not found." -elsif not ARGV[0].end_with? ".vimcolor" - abort "File extension should be .vimcolor" -end - -# Read the file -lines = File.readlines(ARGV[0]) -nlines = lines.length - -# This will hold custom user-defined color names -colornames = {} - -# Read and parse the definitions from file passed as argument -cursor = 0 -while cursor < nlines - line = lines[cursor] - - # Remove excess whitespace - line.strip! - - if line.start_with? "palette:" - loop do - cursor += 1 - line = lines[cursor] - next if line.empty? || line.start_with?("\"") - - entry = line.strip.split - if not entry[1].end_with? "." - entry[1] = entry[1].gsub ",", "" - colornames[entry[0]] = entry[1] - else - entry[1] = entry[1].gsub ".", "" - colornames[entry[0]] = entry[1] - break - end - end - # Link definitions - # Format: link group1[,group2..] destgroup - elsif line.start_with? "link" - # From-group and to-group - from, to = line.split(" ")[1..-1] - - # For every from-group, create a new link to the to-group - from.split(',').each do |from_group| - links[from_group] = to - end - - # Ignore empty lines & vim-style comments - elsif line.empty? || line.start_with?("\"") - # Do nothing - - # Set the background option - # Format: background light/dark - elsif line.start_with? "background" - background = line.split.last - - # Standard color definitions - # Format: group fg_color, bg_color. attr [, attr] - else - # The full line as an array - line_arr = line.split - - # Get the color group - group = line_arr.first - rest = line_arr[1..-1].join ' ' - - # Get the colors and attributes - colors, attrs = rest.split('.') - - # Separate the foreground & background colors - fg, bg = colors.split(',').map { |x| x.strip } - - # Set background color to NONE if not defined - bg = "NONE" if (bg.nil? or bg.empty?) - - # Resolve variables to the hex value of the color - fg = colornames[fg] if (not fg.start_with? "#" and not fg == "NONE") - bg = colornames[bg] if (not bg.start_with? "#" and not bg == "NONE") - - # Parse the attribute, remove whitespace, join with commas (so result is e.g. 'bold,underline') - attrs = (attrs.nil? ? "NONE" : attrs.split(',').map { |x| x.strip }.join(",")) - - # Add the definition to the array - primary << [group, fg, bg, attrs] - end - - cursor += 1 -end - -# Write the colorscheme file -File.open("#{ENV['HOME']}/.vim/colors/#{ARGV[0].sub(/.*\//, '').sub('.vimcolor', '.vim')}", "w") do |f| - # Write the preamble, along with background value - f.puts <<~EOF - set background=#{background} - if version > 580 - highlight clear - if exists("syntax_on") - syntax reset - endif - endif - let g:colors_name = "#{ARGV[0].sub(/.*\//, '').sub('.vimcolor', '')}" - EOF - - # Write color definitions first - primary.each do |item| - # This will all be on one line, but it's broken up for readability - f.puts "hi #{item[0]} guifg=#{item[1]} guibg=#{item[2]}"\ - " ctermfg=#{item[1] == "NONE" ? "NONE" : rgb2term(item[1][1..-1])}"\ - " ctermbg=#{item[2] == "NONE" ? "NONE" : rgb2term(item[2][1..-1])}"\ - " cterm=#{item[3]} gui=#{item[3]}" - end - - # Then write link definitions - links.each do |from,to| - f.puts "hi! link #{from} #{to}" - end -end - -# Notify the user that the colorscheme was saved -puts "Written to ~/.vim/colors/#{ARGV[0].sub('.vimcolor', '.vim')}" diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim @@ -35,7 +35,7 @@ nnoremap <buffer> <leader><CR> :silent !open "%<.pdf"<CR>:redraw!<CR> " Settings compiler markdown -setlocal wrap textwidth=0 wrapmargin=0 linebreak conceallevel=2 spell +setlocal wrap textwidth=0 wrapmargin=0 linebreak conceallevel=2 shiftwidth=4 spell " Undo_ftplugin if !exists('b:undo_ftplugin') @@ -44,4 +44,4 @@ endif let b:undo_ftplugin .= '| imapc <buffer>' let b:undo_ftplugin .= '| nmapc <buffer>' " let b:undo_ftplugin .= '| execute "au! markdown_autocmds * <buffer>"' -let b:undo_ftplugin .= '| setlocal makeprg< wrap< textwidth< wrapmargin< linebreak< conceallevel< spell<' +let b:undo_ftplugin .= '| setlocal makeprg< wrap< textwidth< wrapmargin< linebreak< conceallevel< shiftwidth< spell<' diff --git a/vim/after/ftplugin/vimcolor.vim b/vim/after/ftplugin/vimcolor.vim @@ -1,16 +0,0 @@ -compiler vimcolor -augroup vimcolor_buffer - autocmd! * <buffer> - autocmd BufWritePost <buffer> silent make | execute 'colorscheme '.expand('%:p:t:r') -augroup END - -map <buffer> <leader>CH <Plug>Colorizer -nnoremap <buffer> <leader>CC :ColorClear<CR> - -if !exists('b:undo_ftplugin') - let b:undo_ftplugin = '' -end -let b:undo_ftplugin .= '|setlocal makeprg< ' -let b:undo_ftplugin .= '|exe "au! vimcolor_buffer * <buffer>"' -let b:undo_ftplugin .= '|mapc <buffer>' -let b:undo_ftplugin .= '|nmapc <buffer>' diff --git a/vim/after/syntax/markdown.vim b/vim/after/syntax/markdown.vim @@ -1 +1,5 @@ syn match markdownError "\w\@<=\w\@=" +syn region markdownMathInline start="\(\\\)\@<!\$\(\$\)\@!" end="\$" +syn region markdownMathBlock start="\$\$" end="\$\$" +hi def link markdownMathInline Special +hi def link markdownMathBlock Special diff --git a/vim/autoload/relative_file_complete.vim b/vim/autoload/relative_file_complete.vim @@ -1,27 +0,0 @@ -" Save cwd, cd to dir enclosing file, then go back to saved dir when complete done -function! relative_file_complete#SaveAndRestoreOnComplete() - " Save the old cwd - let s:olddir = getcwd() - - " Locally switch to the dir enclosing current file - lcd %:p:h - - " Defer changing cwd back until complete is done - augroup relative_file_complete_reset_cwd - au! - au CompleteDone <buffer> call relative_file_complete#Cleanup() - augroup END -endfunction - -" When complete finishes, need to change cwd back and clear autocmd -function! relative_file_complete#Cleanup() - " Go back to the previous dir and remove the saved variable - exe "lcd ".s:olddir - unlet s:olddir - - " Clear the cleanup autocmd and augroup - augroup relative_file_complete_reset_cwd - au! - augroup END - augroup! relative_file_complete_reset_cwd -endfunction diff --git a/vim/colors/jokull.schemer b/vim/colors/jokull.schemer @@ -0,0 +1,61 @@ +" Format is 'group fg_hex, bg_hex. attrs' + +palette: + text #2c2625, + bg #e4e4e4, + darkblue #005493, + lightblue #a8dbfd, + gray #d0d0d0, + lightgreen #d7f1e0, + offwhite #e5e5e5, + justblue #0000FF, + justyellow #FFFF00. + +background light +Normal text, bg +Cursorline NONE, gray +String #009051. italic +Identifier #112d4e +Function #0096ff. bold +Statement #0050a0 +Include #2696bf. bold +Type darkblue +Search NONE, lightgreen +Incsearch NONE, #b7d1b0. bold +Folded #236dff, gray +Tablinefill NONE, gray +Tablinesel NONE, offwhite +Wildmenu darkblue, offwhite. bold +Linenr #9b9b4c, NONE +Preproc NONE +Vertsplit NONE +Todo justblue, justyellow +Nontext #81A1C1 +Statusline NONE, #7abecd +Statuslinenc NONE, lightblue +Visual NONE, #a8caff +Title #225555. bold +Matchparen lightgreen, lightblue +QfFileName #0076ff +Delimiter #5f5f00 +Comment #5f5f5f. italic +link tabline tablinefill +link repeat,conditional,operator statement +link define,macro,precondit include +link debug,special,specialchar,specialcomment,tag,cursorlinenr,number delimiter +link label,storageclass,typedef structure +link character constant +link signcolumn linenr +link netrwdir function +link netrwexe title +link netrwMarkFile incsearch +link spellbad todo +link spellocal,spellrare,spellcap,markdownUrl string +link markdowncode,mkdlink,vimwikilink type +link pmenu statuslinenc +link pmenusel statusline + +Diffadd NONE, #a5ffa5 +Diffdelete NONE, #ffa5a5 +Diffchange text, #c0beff +Difftext NONE, #a0aeff. bold diff --git a/vim/colors/jokull.vim b/vim/colors/jokull.vim @@ -6,66 +6,66 @@ if version > 580 endif endif let g:colors_name = "jokull" -hi Normal guifg=#2c2625 guibg=#e4e4e4 ctermfg=0 ctermbg=254 cterm=NONE gui=NONE -hi Cursorline guifg=NONE guibg=#d0d0d0 ctermfg=NONE ctermbg=252 cterm=NONE gui=NONE -hi String guifg=#009051 guibg=NONE ctermfg=29 ctermbg=NONE cterm=italic gui=italic -hi Identifier guifg=#112d4e guibg=NONE ctermfg=17 ctermbg=NONE cterm=NONE gui=NONE -hi Function guifg=#0096ff guibg=NONE ctermfg=33 ctermbg=NONE cterm=bold gui=bold -hi Statement guifg=#0050a0 guibg=NONE ctermfg=25 ctermbg=NONE cterm=NONE gui=NONE -hi Include guifg=#2696bf guibg=NONE ctermfg=31 ctermbg=NONE cterm=bold gui=bold -hi Type guifg=#005493 guibg=NONE ctermfg=24 ctermbg=NONE cterm=NONE gui=NONE -hi Search guifg=NONE guibg=#d7f1e0 ctermfg=NONE ctermbg=194 cterm=NONE gui=NONE -hi Incsearch guifg=NONE guibg=#b7d1b0 ctermfg=NONE ctermbg=151 cterm=bold gui=bold -hi Folded guifg=#236dff guibg=#d0d0d0 ctermfg=27 ctermbg=252 cterm=NONE gui=NONE -hi Tablinefill guifg=NONE guibg=#d0d0d0 ctermfg=NONE ctermbg=252 cterm=NONE gui=NONE -hi Tablinesel guifg=NONE guibg=#e5e5e5 ctermfg=NONE ctermbg=7 cterm=NONE gui=NONE -hi Wildmenu guifg=#005493 guibg=#e5e5e5 ctermfg=24 ctermbg=7 cterm=bold gui=bold -hi Linenr guifg=#9b9b4c guibg=NONE ctermfg=101 ctermbg=NONE cterm=NONE gui=NONE +hi Normal guifg=#2c2625 guibg=#e4e4e4 ctermfg=0 ctermbg=0 cterm=NONE gui=NONE +hi Cursorline guifg=NONE guibg=#d0d0d0 ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi String guifg=#009051 guibg=NONE ctermfg=0 ctermbg=NONE cterm=italic gui=italic +hi Identifier guifg=#112d4e guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE +hi Function guifg=#0096ff guibg=NONE ctermfg=0 ctermbg=NONE cterm=bold gui=bold +hi Statement guifg=#0050a0 guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE +hi Include guifg=#2696bf guibg=NONE ctermfg=0 ctermbg=NONE cterm=bold gui=bold +hi Type guifg=#005493 guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE +hi Search guifg=NONE guibg=#d7f1e0 ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Incsearch guifg=NONE guibg=#b7d1b0 ctermfg=NONE ctermbg=0 cterm=bold gui=bold +hi Folded guifg=#236dff guibg=#d0d0d0 ctermfg=0 ctermbg=0 cterm=NONE gui=NONE +hi Tablinefill guifg=NONE guibg=#d0d0d0 ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Tablinesel guifg=NONE guibg=#e5e5e5 ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Wildmenu guifg=#005493 guibg=#e5e5e5 ctermfg=0 ctermbg=0 cterm=bold gui=bold +hi Linenr guifg=#9b9b4c guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE hi Preproc guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE cterm=NONE gui=NONE hi Vertsplit guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE cterm=NONE gui=NONE -hi Todo guifg=#0000FF guibg=#FFFF00 ctermfg=21 ctermbg=11 cterm=NONE gui=NONE -hi Nontext guifg=#81A1C1 guibg=NONE ctermfg=109 ctermbg=NONE cterm=NONE gui=NONE -hi Statusline guifg=NONE guibg=#7abecd ctermfg=NONE ctermbg=110 cterm=NONE gui=NONE -hi Statuslinenc guifg=NONE guibg=#a8dbfd ctermfg=NONE ctermbg=153 cterm=NONE gui=NONE -hi Visual guifg=NONE guibg=#a8caff ctermfg=NONE ctermbg=153 cterm=NONE gui=NONE -hi Title guifg=#225555 guibg=NONE ctermfg=23 ctermbg=NONE cterm=bold gui=bold -hi Matchparen guifg=#d7f1e0 guibg=#a8dbfd ctermfg=194 ctermbg=153 cterm=NONE gui=NONE -hi QfFileName guifg=#0076ff guibg=NONE ctermfg=33 ctermbg=NONE cterm=NONE gui=NONE -hi Delimiter guifg=#5f5f00 guibg=NONE ctermfg=58 ctermbg=NONE cterm=NONE gui=NONE -hi Comment guifg=#5f5f5f guibg=NONE ctermfg=59 ctermbg=NONE cterm=italic gui=italic -hi Diffadd guifg=NONE guibg=#a5ffa5 ctermfg=NONE ctermbg=157 cterm=NONE gui=NONE -hi Diffdelete guifg=NONE guibg=#ffa5a5 ctermfg=NONE ctermbg=217 cterm=NONE gui=NONE -hi Diffchange guifg=#2c2625 guibg=#c0beff ctermfg=0 ctermbg=147 cterm=NONE gui=NONE -hi Difftext guifg=NONE guibg=#a0aeff ctermfg=NONE ctermbg=147 cterm=bold gui=bold -hi! link tabline tablinefill -hi! link repeat statement -hi! link conditional statement -hi! link operator statement -hi! link define include -hi! link macro include +hi Todo guifg=#0000FF guibg=#FFFF00 ctermfg=0 ctermbg=0 cterm=NONE gui=NONE +hi Nontext guifg=#81A1C1 guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE +hi Statusline guifg=NONE guibg=#7abecd ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Statuslinenc guifg=NONE guibg=#a8dbfd ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Visual guifg=NONE guibg=#a8caff ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Title guifg=#225555 guibg=NONE ctermfg=0 ctermbg=NONE cterm=bold gui=bold +hi Matchparen guifg=#d7f1e0 guibg=#a8dbfd ctermfg=0 ctermbg=0 cterm=NONE gui=NONE +hi QfFileName guifg=#0076ff guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE +hi Delimiter guifg=#5f5f00 guibg=NONE ctermfg=0 ctermbg=NONE cterm=NONE gui=NONE +hi Comment guifg=#5f5f5f guibg=NONE ctermfg=0 ctermbg=NONE cterm=italic gui=italic +hi Diffadd guifg=NONE guibg=#a5ffa5 ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Diffdelete guifg=NONE guibg=#ffa5a5 ctermfg=NONE ctermbg=0 cterm=NONE gui=NONE +hi Diffchange guifg=#2c2625 guibg=#c0beff ctermfg=0 ctermbg=0 cterm=NONE gui=NONE +hi Difftext guifg=NONE guibg=#a0aeff ctermfg=NONE ctermbg=0 cterm=bold gui=bold hi! link precondit include -hi! link debug delimiter -hi! link special delimiter -hi! link specialchar delimiter -hi! link specialcomment delimiter hi! link tag delimiter -hi! link cursorlinenr delimiter -hi! link number delimiter -hi! link label structure -hi! link storageclass structure -hi! link typedef structure -hi! link character constant -hi! link signcolumn linenr +hi! link spellocal string +hi! link conditional statement +hi! link markdowncode type hi! link netrwdir function hi! link netrwexe title -hi! link netrwMarkFile incsearch -hi! link spellbad todo -hi! link spellocal string -hi! link spellrare string +hi! link tabline tablinefill +hi! link mkdlink type +hi! link signcolumn linenr hi! link spellcap string +hi! link spellrare string +hi! link netrwMarkFile incsearch hi! link markdownUrl string -hi! link markdowncode type -hi! link mkdlink type -hi! link vimwikilink type +hi! link spellbad todo +hi! link number delimiter +hi! link define include +hi! link typedef structure +hi! link storageclass structure +hi! link specialcomment delimiter hi! link pmenu statuslinenc +hi! link macro include hi! link pmenusel statusline +hi! link character constant +hi! link repeat statement +hi! link cursorlinenr delimiter +hi! link debug delimiter +hi! link special delimiter +hi! link label structure +hi! link operator statement +hi! link vimwikilink type +hi! link specialchar delimiter diff --git a/vim/colors/jokull.vimcolor b/vim/colors/jokull.vimcolor @@ -1,63 +0,0 @@ -" This script uses the colorgen script -" to create a colorscheme from something a bit more readable. -" Format is 'group fg_hex, bg_hex. attrs' - -palette: - text #2c2625, - bg #e4e4e4, - darkblue #005493, - lightblue #a8dbfd, - gray #d0d0d0, - lightgreen #d7f1e0, - offwhite #e5e5e5, - justblue #0000FF, - justyellow #FFFF00. - -background light -Normal text, bg -Cursorline NONE, gray -String #009051. italic -Identifier #112d4e -Function #0096ff. bold -Statement #0050a0 -Include #2696bf. bold -Type darkblue -Search NONE, lightgreen -Incsearch NONE, #b7d1b0. bold -Folded #236dff, gray -Tablinefill NONE, gray -Tablinesel NONE, offwhite -Wildmenu darkblue, offwhite. bold -Linenr #9b9b4c, NONE -Preproc NONE -Vertsplit NONE -Todo justblue, justyellow -Nontext #81A1C1 -Statusline NONE, #7abecd -Statuslinenc NONE, lightblue -Visual NONE, #a8caff -Title #225555. bold -Matchparen lightgreen, lightblue -QfFileName #0076ff -Delimiter #5f5f00 -Comment #5f5f5f. italic -link tabline tablinefill -link repeat,conditional,operator statement -link define,macro,precondit include -link debug,special,specialchar,specialcomment,tag,cursorlinenr,number delimiter -link label,storageclass,typedef structure -link character constant -link signcolumn linenr -link netrwdir function -link netrwexe title -link netrwMarkFile incsearch -link spellbad todo -link spellocal,spellrare,spellcap,markdownUrl string -link markdowncode,mkdlink,vimwikilink type -link pmenu statuslinenc -link pmenusel statusline - -Diffadd NONE, #a5ffa5 -Diffdelete NONE, #ffa5a5 -Diffchange text, #c0beff -Difftext NONE, #a0aeff. bold diff --git a/vim/colors/junipero.schemer b/vim/colors/junipero.schemer @@ -0,0 +1,80 @@ +" Set the palette +palette: + text #969696, + bg #11121A, + black #000000, + lightblue #2de3e6, + whitepink #bebebe, + whiteyellow #f0e0b2, + offwhite #f0e2e2. + +" This scheme will have a dark background +background dark + +" Group fg_color, bg_color attribute(s) +Normal text, bg +Cursorline NONE, #222222 +Structure #0490e8, NONE. bold +Constant #5c78f0, NONE. NONE +String lightblue, NONE. italic +Float #4580b4, NONE. NONE +Boolean #fca8ad, NONE. NONE +Identifier #5094c4, NONE. NONE +Function #f9c60e, bg. bold +Number #339aff, NONE. NONE +Conditional #d0688d, bg. NONE +Operator #e8cdc0, bg. NONE +Exception #d0a8ad, bg. bold +Statement #ff6c11, NONE. NONE +Repeat #e06070, bg. NONE +Keyword whitepink, bg. bold +PreProc #ae15eb, NONE. NONE +Include #ba75cf, NONE. NONE +Type #ff3863, NONE. bold +Delimiter #aaaaca, NONE. NONE +Comment #349d58, bg. italic +NonText #382920, bg. NONE +Ignore #666666, NONE. NONE +SpecialKey #90dcb0, NONE. NONE +Underlined #bac5ba, NONE. NONE +Error NONE, #b03452. NONE +Todo #ffd500, #5c0d43. NONE +MatchParen #001122, #7b5a55. NONE +Cursor #0000aa, #cad5c0. NONE +Visual #102030, #80a0f0. NONE +VisualNOS #201a30, #a3a5FF. NONE +LineNr #2069a9, #101124. NONE +Search lightblue, #6b5469. NONE +IncSearch #babeaa, #3a4520. NONE +WildMenu #000000, #804000. NONE +VertSplit #223355, #22253c. NONE +TabLineSel #6079c9, #363649. NONE +Title #fff7fa, NONE. NONE +PmenuSel whiteyellow, #4a85ba. NONE +PmenuThumb NONE, #000000. NONE +PmenuSbar NONE, #0000ff. NONE +Pmenu #bdbdbd, #915623. NONE +Folded whitepink, #171235. NONE +FoldColumn #dbcaa5, #0a0a18. NONE +Directory #bbd0df, NONE. NONE +DiffDelete #300845, #200845. NONE +DiffText #f5f5f5, #423f00. NONE +DiffAdd #e0e3e3, #003802. NONE +DiffChange #fcfcfc, #2e032e. NONE +ModeMsg #00AACC, NONE. NONE +Question #AABBCC, #130445. NONE +MoreMsg #2e8b57, NONE. NONE +ErrorMsg offwhite, #ff4545. NONE +WarningMsg #fa8072, NONE. NONE +StatusLine #4079a9, #101130. bold + +link Label,StorageClass,Typedef Structure +link ConId,Character,VimwikiLink Constant +link Define,Macro,PreCondit Include +link Debug,Special,SpecialChar,SpecialComment,Tag Delimiter +link StatusLineNC,TabLine,TabLineFill,SignColumn,netrwDir LineNr +link NetrwExe Title +link SpellBad Todo +link SpelLocal,SpellRare,SpellCap String +link MkdLink Type +link adaBegin,adaEnd Function diff --git a/vim/colors/junipero.vim b/vim/colors/junipero.vim @@ -1,3 +1,4 @@ +set background=dark if version > 580 highlight clear if exists("syntax_on") @@ -5,7 +6,6 @@ if version > 580 endif endif let g:colors_name = "junipero" -set background=dark hi Normal guifg=#969696 guibg=#11121A ctermfg=246 ctermbg=0 cterm=NONE gui=NONE hi Cursorline guifg=NONE guibg=#222222 ctermfg=NONE ctermbg=234 cterm=NONE gui=NONE hi Structure guifg=#0490e8 guibg=NONE ctermfg=32 ctermbg=NONE cterm=bold gui=bold @@ -14,20 +14,20 @@ hi String guifg=#2de3e6 guibg=NONE ctermfg=6 ctermbg=NONE cterm=italic gui=itali hi Float guifg=#4580b4 guibg=NONE ctermfg=67 ctermbg=NONE cterm=NONE gui=NONE hi Boolean guifg=#fca8ad guibg=NONE ctermfg=217 ctermbg=NONE cterm=NONE gui=NONE hi Identifier guifg=#5094c4 guibg=NONE ctermfg=68 ctermbg=NONE cterm=NONE gui=NONE -hi Function guifg=#f9c60e guibg=#11121a ctermfg=220 ctermbg=0 cterm=bold gui=bold -hi Number guifg=#136aed guibg=NONE ctermfg=27 ctermbg=NONE cterm=NONE gui=NONE -hi Conditional guifg=#d0688d guibg=#11121a ctermfg=168 ctermbg=0 cterm=NONE gui=NONE -hi Operator guifg=#e8cdc0 guibg=#11121a ctermfg=187 ctermbg=0 cterm=NONE gui=NONE -hi Exception guifg=#d0a8ad guibg=#11121a ctermfg=181 ctermbg=0 cterm=bold gui=bold +hi Function guifg=#f9c60e guibg=#11121A ctermfg=220 ctermbg=0 cterm=bold gui=bold +hi Number guifg=#339aff guibg=NONE ctermfg=12 ctermbg=NONE cterm=NONE gui=NONE +hi Conditional guifg=#d0688d guibg=#11121A ctermfg=168 ctermbg=0 cterm=NONE gui=NONE +hi Operator guifg=#e8cdc0 guibg=#11121A ctermfg=187 ctermbg=0 cterm=NONE gui=NONE +hi Exception guifg=#d0a8ad guibg=#11121A ctermfg=181 ctermbg=0 cterm=bold gui=bold hi Statement guifg=#ff6c11 guibg=NONE ctermfg=202 ctermbg=NONE cterm=NONE gui=NONE -hi Repeat guifg=#e06070 guibg=#11121a ctermfg=167 ctermbg=0 cterm=NONE gui=NONE -hi Keyword guifg=#bebebe guibg=#11121a ctermfg=250 ctermbg=0 cterm=bold gui=bold +hi Repeat guifg=#e06070 guibg=#11121A ctermfg=167 ctermbg=0 cterm=NONE gui=NONE +hi Keyword guifg=#bebebe guibg=#11121A ctermfg=250 ctermbg=0 cterm=bold gui=bold hi PreProc guifg=#ae15eb guibg=NONE ctermfg=5 ctermbg=NONE cterm=NONE gui=NONE hi Include guifg=#ba75cf guibg=NONE ctermfg=140 ctermbg=NONE cterm=NONE gui=NONE hi Type guifg=#ff3863 guibg=NONE ctermfg=203 ctermbg=NONE cterm=bold gui=bold hi Delimiter guifg=#aaaaca guibg=NONE ctermfg=146 ctermbg=NONE cterm=NONE gui=NONE -hi Comment guifg=#349d58 guibg=#11121a ctermfg=71 ctermbg=0 cterm=italic gui=italic -hi NonText guifg=#382920 guibg=#11121a ctermfg=1 ctermbg=0 cterm=NONE gui=NONE +hi Comment guifg=#349d58 guibg=#11121A ctermfg=71 ctermbg=0 cterm=italic gui=italic +hi NonText guifg=#382920 guibg=#11121A ctermfg=1 ctermbg=0 cterm=NONE gui=NONE hi Ignore guifg=#666666 guibg=NONE ctermfg=241 ctermbg=NONE cterm=NONE gui=NONE hi SpecialKey guifg=#90dcb0 guibg=NONE ctermfg=115 ctermbg=NONE cterm=NONE gui=NONE hi Underlined guifg=#bac5ba guibg=NONE ctermfg=151 ctermbg=NONE cterm=NONE gui=NONE @@ -61,30 +61,30 @@ hi MoreMsg guifg=#2e8b57 guibg=NONE ctermfg=29 ctermbg=NONE cterm=NONE gui=NONE hi ErrorMsg guifg=#f0e2e2 guibg=#ff4545 ctermfg=224 ctermbg=203 cterm=NONE gui=NONE hi WarningMsg guifg=#fa8072 guibg=NONE ctermfg=209 ctermbg=NONE cterm=NONE gui=NONE hi StatusLine guifg=#4079a9 guibg=#101130 ctermfg=67 ctermbg=17 cterm=bold gui=bold -hi! link Label Structure -hi! link StorageClass Structure +hi! link PreCondit Include +hi! link Tag Delimiter +hi! link Define Include +hi! link MkdLink Type hi! link Typedef Structure -hi! link ConId Constant -hi! link Character Constant +hi! link SpelLocal String hi! link VimwikiLink Constant -hi! link Define Include +hi! link SignColumn LineNr hi! link Macro Include -hi! link PreCondit Include +hi! link TabLine LineNr +hi! link Character Constant hi! link Debug Delimiter +hi! link SpellCap String hi! link Special Delimiter -hi! link SpecialChar Delimiter -hi! link SpecialComment Delimiter -hi! link Tag Delimiter -hi! link StatusLineNC LineNr -hi! link TabLine LineNr hi! link TabLineFill LineNr -hi! link SignColumn LineNr -hi! link netrwDir LineNr -hi! link NetrwExe Title -hi! link SpellBad Todo -hi! link SpelLocal String hi! link SpellRare String -hi! link SpellCap String -hi! link MkdLink Type +hi! link Label Structure +hi! link StatusLineNC LineNr hi! link adaBegin Function +hi! link StorageClass Structure +hi! link SpecialComment Delimiter +hi! link NetrwExe Title hi! link adaEnd Function +hi! link ConId Constant +hi! link SpellBad Todo +hi! link netrwDir LineNr +hi! link SpecialChar Delimiter diff --git a/vim/colors/junipero.vimcolor b/vim/colors/junipero.vimcolor @@ -1,67 +0,0 @@ -background dark -Normal #969696, #11121A -Cursorline NONE, #222222 -Structure #0490e8, NONE. bold -Constant #5c78f0, NONE. NONE -String #2de3e6, NONE. italic -Float #4580b4, NONE. NONE -Boolean #fca8ad, NONE. NONE -Identifier #5094c4, NONE. NONE -Function #f9c60e, #11121a. bold -Number #136aed, NONE. NONE -Conditional #d0688d, #11121a. NONE -Operator #e8cdc0, #11121a. NONE -Exception #d0a8ad, #11121a. bold -Statement #ff6c11, NONE. NONE -Repeat #e06070, #11121a. NONE -Keyword #bebebe, #11121a. bold -PreProc #ae15eb, NONE. NONE -Include #ba75cf, NONE. NONE -Type #ff3863, NONE. bold -Delimiter #aaaaca, NONE. NONE -Comment #349d58, #11121a. italic -NonText #382920, #11121a. NONE -Ignore #666666, NONE. NONE -SpecialKey #90dcb0, NONE. NONE -Underlined #bac5ba, NONE. NONE -Error NONE, #b03452. NONE -Todo #ffd500, #5c0d43. NONE -MatchParen #001122, #7b5a55. NONE -Cursor #0000aa, #cad5c0. NONE -Visual #102030, #80a0f0. NONE -VisualNOS #201a30, #a3a5FF. NONE -LineNr #2069a9, #101124. NONE -Search #2de3e6, #6b5469. NONE -IncSearch #babeaa, #3a4520. NONE -WildMenu #000000, #804000. NONE -VertSplit #223355, #22253c. NONE -TabLineSel #6079c9, #363649. NONE -Title #fff7fa, NONE. NONE -PmenuSel #f0e0b2, #4a85ba. NONE -PmenuThumb NONE, #000000. NONE -PmenuSbar NONE, #0000ff. NONE -Pmenu #bdbdbd, #915623. NONE -Folded #bebebe, #171235. NONE -FoldColumn #dbcaa5, #0a0a18. NONE -Directory #bbd0df, NONE. NONE -DiffDelete #300845, #200845. NONE -DiffText #f5f5f5, #423f00. NONE -DiffAdd #e0e3e3, #003802. NONE -DiffChange #fcfcfc, #2e032e. NONE -ModeMsg #00AACC, NONE. NONE -Question #AABBCC, #130445. NONE -MoreMsg #2e8b57, NONE. NONE -ErrorMsg #f0e2e2, #ff4545. NONE -WarningMsg #fa8072, NONE. NONE -StatusLine #4079a9, #101130. bold - -link Label,StorageClass,Typedef Structure -link ConId,Character,VimwikiLink Constant -link Define,Macro,PreCondit Include -link Debug,Special,SpecialChar,SpecialComment,Tag Delimiter -link StatusLineNC,TabLine,TabLineFill,SignColumn,netrwDir LineNr -link NetrwExe Title -link SpellBad Todo -link SpelLocal,SpellRare,SpellCap String -link MkdLink Type -link adaBegin,adaEnd Function diff --git a/vim/compiler/vimcolor.vim b/vim/compiler/vimcolor.vim @@ -1,8 +0,0 @@ -if exists("current_compiler") - finish -endif -let current_compiler = "vimcolor" -if exists(":CompilerSet") != 2 " older Vim always used :setlocal - command -nargs=* CompilerSet setlocal <args> -endif -CompilerSet makeprg=colgen.rb\ % diff --git a/vim/ftdetect/vimcolor.vim b/vim/ftdetect/vimcolor.vim @@ -1 +0,0 @@ -autocmd BufRead,BufNewFile *.vimcolor set filetype=vimcolor diff --git a/vim/plugin/relative_file_complete.vim b/vim/plugin/relative_file_complete.vim @@ -1 +0,0 @@ -command! CompleteRelative :call relative_file_complete#SaveAndRestoreOnComplete() diff --git a/vim/plugin/vimcolor.vim b/vim/plugin/vimcolor.vim @@ -1,13 +0,0 @@ -function! s:edit_colors() - execute "split ~/.vim/colors/".g:colors_name.".vimcolor" -endfunction - -function! s:synstack() - if !exists("*synstack") - return - endif - echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">" -endfunction - -nnoremap <Plug>VimcolorEdit :call <SID>edit_colors()<CR> -nnoremap <Plug>VimcolorSynstack :call <SID>synstack()<CR> diff --git a/vim/syntax/vimcolor.vim b/vim/syntax/vimcolor.vim @@ -1,48 +0,0 @@ -" Quit when a (custom) syntax file was already loaded -if exists("b:current_syntax") - finish -endif - -let s:cpo_save = &cpo -set cpo&vim - -" Clear the syntax -syntax clear - -" Define highlighting groups -syntax keyword vimcolorKeyword background light dark -syntax keyword vimcolorNone NONE -syntax keyword vimcolorAttrs italic bold -syntax match vimcolorGroup "^[A-Z][^ ]*" -syntax match vimcolorName "[ ,]\zs[^# ][^ ]*" -syntax match vimcolorColor "#[0-9a-fA-F]\+" -syntax match vimcolorDelims "[,.]" containedin=vimcolorLinkSource -syntax match vimcolorLinkLine "^link .*$" contains=vimcolorLink,vimcolorLinkSource,vimcolorLinkDest -syntax keyword vimcolorLink contained link -syntax match vimcolorLinkSource "\(link \)\@<=[a-zA-Z,]\+" contained -syntax match vimcolorLinkDest "[a-zA-Z]\+$" contained -syntax region vimcolorComment start=/^ *"/ end="$" -syntax region vimcolorPalette start="^palette:" end="\." contains=vimcolorPaletteKeyword,vimcolorPaletteColorName,vimcolorPaletteColorVal,vimcolorComment -syntax match vimcolorPaletteColorName "^ *\zs[^ ]\+" contained -syntax match vimcolorPaletteColorVal "#[a-fA-F0-9]\+" contained -syntax keyword vimcolorPaletteKeyword palette contained - -" Perform the actual highlighting -hi def link vimcolorKeyword Include -hi def link vimcolorGroup Statement -hi def link vimcolorLinkSource Statement -hi def link vimcolorColor Constant -hi def link vimcolorNone Include -hi def link vimcolorDelims Delimiter -hi def link vimcolorAttrs String -hi def link vimcolorLink Operator -hi def link vimcolorLinkDest Identifier -hi def link vimcolorComment Comment -hi def link vimcolorPaletteColorName Number -hi def link vimcolorPaletteColorVal Constant -hi def link vimcolorPaletteKeyword Include -hi def link vimcolorName Number - -let b:current_syntax = "vimcolor" -let &cpo = s:cpo_save -unlet s:cpo_save diff --git a/vim/vimrc b/vim/vimrc @@ -80,6 +80,7 @@ Plug 'tpope/vim-abolish' " An improved grep Plug 'rking/ag.vim' + " Highlight hex colors Plug 'chrisbra/colorizer' @@ -127,6 +128,15 @@ Plug 'dhruvasagar/vim-table-mode' " Ada syntax, indent, completion Plug 'thindil/Ada-Bundle' + +" Vimscript testing +Plug 'tpope/vim-scriptease' + +" Schemer - colorscheme creator +Plug 'thezeroalpha/vim-schemer' + +" Relative file complete +Plug 'thezeroalpha/vim-relatively-complete' call plug#end() " }}} " Config {{{ @@ -376,6 +386,15 @@ inoremap <C-l> <Esc>:call unicoder#start(1)<CR> " colorizer {{{ let g:colorizer_colornames = 0 " }}} +" Schemer {{{ +" List color group +nmap <C-P> <Plug>SchemerSynstack +nmap <C-E><C-L> <Plug>SchemerEdit +" }}} +" Relatively complete {{{ +" Replace default file completion with 'smart' relative complete +imap <C-x><C-f> <Plug>CompleteRelative +" }}} " }}} " }}} " General {{{ @@ -555,6 +574,9 @@ syntax on " Enable fenced code highlighting in markdown (tpope's plugin, ships with vim) let g:markdown_fenced_languages = ['html', 'python', 'ruby', 'bash=sh', 'map'] +" Enable markdown folding +let g:markdown_folding = 1 + " Folding on indentation set foldmethod=indent @@ -723,7 +745,6 @@ nnoremap <C-E><C-G> :DropToFoldedVimrc<CR>zXgg/General {{<CR>:noh<CR>za nnoremap <C-E><C-M> :DropToFoldedVimrc<CR>zXgg/Mappings {{<CR>:noh<CR>za nnoremap <C-E><C-P><C-I> :DropToFoldedVimrc<CR>zXgg/Plugins {{<CR>:noh<CR>za/Installation {{<CR>:noh<CR>za nnoremap <C-E><C-P><C-C> :DropToFoldedVimrc<CR>zXgg/Plugins {{<CR>:noh<CR>za/Config {{<CR>:noh<CR>za -nmap <C-E><C-L> <Plug>VimcolorEdit nnoremap <C-E><C-U> :UltiSnipsEdit<CR> " Yank to clipboard @@ -770,13 +791,10 @@ nnoremap L :bnext<CR> nnoremap <leader>H :previous<CR> nnoremap <leader>L :next<CR> -" List color group -nmap <C-P> <Plug>VimcolorSynstack " Correct the last spelling error inoremap <expr> <C-x>s &spell ? "<c-g>u<Esc>[s1z=`]a<c-g>u" : "" -inoremap <C-x><C-f> <c-o>:CompleteRelative<CR><C-x><C-f> " Make-ing (use Dispatch if enabled) nnoremap <leader>m? :set makeprg<CR> nnoremap <expr> <leader>mm g:loaded_dispatch ? ":Make<CR>" : ":silent make<CR>\|:redraw!<CR>\|:cwindow<CR>"