commit e25c2eba3f77d769a3e1b43826191e01d2facd2d
parent 2be217d439e284ac1ffeb2f60df3c81f1f728f68
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Wed, 7 Aug 2019 18:19:45 +0200
vim: bugfixing the color generating script
Former-commit-id: c1f03e5330cf0fc58569b5e631c35462f18ce140
Diffstat:
5 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
@@ -14,6 +14,7 @@ If you read a script and see some improvements that could be made, let me know.
* `checklinks`: recursively check any website for broken links
* `clonedisk`: clones one disk to another
+* `colgen.rb`: a Ruby script to generate Vim colorschemes from a much simpler syntax file.
* `conf`: the script to manage dotfiles. run `conf` to show available commands.
* `dashedit.rb`: script to allow Dash submissions from the commandline. Largely useless to anyone except me.
* `epr.py`: a [Python-based EPUB reader](https://github.com/wustho/epr)
diff --git a/scripts/colgen.rb b/scripts/colgen.rb
@@ -161,7 +161,7 @@ File.open(ARGV[0], "r").each do |line|
end
-File.open("#{ENV['HOME']}/.vim/colors/#{ARGV[0].sub('.vimcolor', '.vim')}", "w") do |f|
+File.open("#{ENV['HOME']}/.vim/colors/#{ARGV[0].sub(/.*\//, '').sub('.vimcolor', '.vim')}", "w") do |f|
f.puts <<~EOF
if version > 580
highlight clear
@@ -169,7 +169,7 @@ File.open("#{ENV['HOME']}/.vim/colors/#{ARGV[0].sub('.vimcolor', '.vim')}", "w")
syntax reset
endif
endif
- let g:colors_name = "#{ARGV[0].sub('.vimcolor', '')}"
+ let g:colors_name = "#{ARGV[0].sub(/.*\//, '').sub('.vimcolor', '')}"
set background=#{background}
EOF
primary.each do |item|
diff --git a/vim/after/ftplugin/vimcolor.vim b/vim/after/ftplugin/vimcolor.vim
@@ -1,4 +1,4 @@
setlocal makeprg=colgen.rb\ %
-autocmd BufWritePost <buffer> silent make | execute 'colorscheme '.expand('%<')
+autocmd BufWritePost <buffer> silent make | execute 'colorscheme '.expand('%:p:t:r')
vmap CH <Plug>Colorizer
noremap CC :ColorClear<CR>
diff --git a/vim/colors/jokull.vim b/vim/colors/jokull.vim
@@ -49,7 +49,7 @@ hi! link storageclass structure
hi! link typedef structure
hi! link character constant
hi! link signcolumn linenr
-hi! link netrwdir linenr
+hi! link netrwdir function
hi! link netrwexe title
hi! link spellbad todo
hi! link spellocal string
diff --git a/vim/colors/jokull.vimcolor b/vim/colors/jokull.vimcolor
@@ -33,7 +33,8 @@ link define,macro,precondit include
link debug,special,specialchar,specialcomment,tag,cursorlinenr,number delimiter
link label,storageclass,typedef structure
link character constant
-link signcolumn,netrwdir linenr
+link signcolumn linenr
+link netrwdir function
link netrwexe title
link spellbad todo
link spellocal,spellrare,spellcap string