Gaucheのエディタ設定について。yamasushi
エディタの違いを超えて共有できる情報をS式で管理すれば幸せになれるような気がします。yamasushi(2013/04/21 05:08:46 UTC)
;(use srfi-13)
;(use gauche.generator)
;(use gauche.dictionary)
(use util.match)
(use util.trie)
(use komono-dict)
;(use komono-glob)
;(use komono-combinator)
(use pretty-print)
;(use vim.vim-color)
(use vim.vim-color-scheme)
; TODO foreとbackが別の項目になっているものと、いっしょになっているもの
; reverseの処理
; fg,bgの処理
; scite color scheme
(define *scite-color-scheme* (alist->trie
'(("colour.number" "Number")
("colour.keyword" "Keyword")
("colour.string" "String")
("colour.char" "Character")
("colour.operator" "Operator")
("colour.preproc" "PreProc")
("colour.code.comment.box" "Comment")
("colour.code.comment.doc" "Comment")
("colour.code.comment.line" "Comment")
;;空白文字
;("whitespace.fore" "Conceal" )
;カーソルの色
;("caret.fore" "Cursor")
;("caret.line.back" "CursorLine")
;選択領域
;("selection.fore" "Visual")
;("selection.back" "Visual")
;("selection.additional.fore" "Visual")
;("selection.additional.back" "Visual")
;Style 32 is the default style and its features will be inherited by all
; other styles unless overridden.
("style.*.32" "Normal" "~a,$(font.base)")
;Style 33 is used to display line numbers in the margin.
("style.*.33" "LineNr")
;Styles 34 and 35 are used to display matching and non-matching braces respectively.
("style.*.34" "MatchParen")
("style.*.35" "Error")
;Style 36 is used for displaying control characters.
;This is not a full style as the foreground and background colours
;for control characters are determined by their lexical state rather than this style.
("style.*.36" "SpecialChar")
;Style 37 is used for displaying indentation guides. Only the fore and back are used.
;("style.*.37" "CursorColumn")
;Style 38 is used for displaying calltips. Only the font, size, fore and back are used.
("style.*.38" "Tooltip")
; # Lexical states for SCLEX_PROPERTIES
; lex Properties=SCLEX_PROPERTIES SCE_PROPS_
; val SCE_PROPS_DEFAULT=0
("style.props.0" "Normal")
; val SCE_PROPS_COMMENT=1
("style.props.1" "Comment")
; val SCE_PROPS_SECTION=2
("style.props.2" "Identifier")
; val SCE_PROPS_ASSIGNMENT=3
("style.props.3" "Operator")
; val SCE_PROPS_DEFVAL=4
("style.props.4" "Function")
; val SCE_PROPS_KEY=5
("style.props.5" "Keyword")
("error.marker.fore" "ErrorMsg")
("error.marker.back" "ErrorMsg")
("style.error.0" "Normal")
("style.error.1" "WarningMsg")
("style.error.2" "ErrorMsg")
("style.error.3" "ErrorMsg")
; # Lexical states for SCLEX_ERRORLIST
; lex ErrorList=SCLEX_ERRORLIST SCE_ERR_
; val SCE_ERR_DEFAULT=0
("style.errorlist.0" "Normal")
; val SCE_ERR_PYTHON=1
("style.errorlist.1" "ErrorMsg")
; val SCE_ERR_GCC=2
("style.errorlist.2" "ErrorMsg")
; val SCE_ERR_MS=3
("style.errorlist.3" "ErrorMsg")
; val SCE_ERR_CMD=4
;# command or return status
("style.errorlist.4" "Normal")
; val SCE_ERR_BORLAND=5
("style.errorlist.5" "ErrorMsg")
; val SCE_ERR_PERL=6
("style.errorlist.6" "ErrorMsg")
; val SCE_ERR_NET=7
("style.errorlist.7" "ErrorMsg")
; val SCE_ERR_LUA=8
("style.errorlist.8" "ErrorMsg")
; val SCE_ERR_CTAG=9
("style.errorlist.9" "Tag")
; val SCE_ERR_DIFF_CHANGED=10
("style.errorlist.10" "DiffChange")
; val SCE_ERR_DIFF_ADDITION=11
("style.errorlist.11" "DiffAdd")
; val SCE_ERR_DIFF_DELETION=12
("style.errorlist.12" "DiffDelete")
; val SCE_ERR_DIFF_MESSAGE=13
("style.errorlist.13" "DiffText")
; val SCE_ERR_PHP=14
("style.errorlist.14" "ErrorMsg")
; val SCE_ERR_ELF=15
("style.errorlist.15" "ErrorMsg")
; val SCE_ERR_IFC=16
("style.errorlist.16" "ErrorMsg")
; val SCE_ERR_IFORT=17
("style.errorlist.17" "ErrorMsg")
; val SCE_ERR_ABSF=18
("style.errorlist.18" "ErrorMsg")
; val SCE_ERR_TIDY=19
("style.errorlist.19" "ErrorMsg")
; val SCE_ERR_JAVA_STACK=20
("style.errorlist.20" "ErrorMsg")
; val SCE_ERR_VALUE=21
;# Text matched with find in files and message part of GCC errors
("style.errorlist.21" "ErrorMsg")
; val SCE_ERR_GCC_INCLUDED_FROM=22
;# GCC showing include path to following error
("style.errorlist.22" "ErrorMsg")
; # Lexical states for SCLEX_LISP
; lex Lisp=SCLEX_LISP SCE_LISP_
; val SCE_LISP_DEFAULT=0
("style.lisp.0" "Normal")
; val SCE_LISP_COMMENT=1
("style.lisp.1" "Comment")
; val SCE_LISP_NUMBER=2
("style.lisp.2" "Number")
; val SCE_LISP_KEYWORD=3
("style.lisp.3" "Function")
; val SCE_LISP_KEYWORD_KW=4
("style.lisp.4" "Keyword")
; val SCE_LISP_SYMBOL=5
("style.lisp.5" "Special")
; val SCE_LISP_STRING=6
("style.lisp.6" "String")
;("style.lisp.7" . #f)
; val SCE_LISP_STRINGEOL=8
("style.lisp.8" "String")
; val SCE_LISP_IDENTIFIER=9
("style.lisp.9" "Identifier")
; val SCE_LISP_OPERATOR=10
("style.lisp.10" "Operator")
; val SCE_LISP_SPECIAL=11
("style.lisp.11" "Special")
; val SCE_LISP_MULTI_COMMENT=12
("style.lisp.12" "Comment")
) ) )
;($ pretty-print $ trie-common-prefix *scite-color-scheme* "style.lisp" )
;(exit)
($ for-each (^n
;#?=n
;#?=(vim-get-scheme n)
(let [[color-scheme (vim-get-scheme n ) ]
[ofile (rxmatch-case n
[#/^\*(\S+)\*$/ (_ x)
(format #f "~a.vim.properties" x) ]
[#/^.*\/([^\/.]+)\.vim$/ (_ x)
(format #f "~a.vim.properties" x) ])]]
;#?=ofile
(call-with-output-file ofile
(^p (dict-for-each *scite-color-scheme*
(^(k v)
(match v
[(vim-col . fmt)
(match-let1 (fg bg) (vim-get-color color-scheme vim-col )
(if (or (not fg) (not bg))
(format (standard-error-port) "!! n=~a k=~a v=~a fg=~a bg=~a\n" n k v fg bg)
(flush))
(let1 col (rxmatch-case k
[#/^caret\.fore$/ (_) (format #f "~a" bg)]
[#/^selection\.fore$/ (_) (format #f "~a" fg)]
[#/^selection\.back$/ (_) (format #f "~a" bg)]
[#/^selection\.additional\.fore$/ (_) (format #f "~a" fg)]
[#/^selection\.additional\.back$/ (_) (format #f "~a" bg)]
[#/^.*\.fore$/ (_) (format #f "~a" fg)]
[#/^.*\.back$/ (_) (format #f "~a" bg)]
[else (format #f "fore:~a,back:~a" fg bg)] )
(if (pair? fmt)
(format p (string-append "~a=" (car fmt) "\n") k col)
(format p "~a=~a\n" k col) ) ) ) ]
[else (format (standard-error-port) "!! ~a ~a \n" k v) ] ) )
)))))
$ vim-scheme-names)
(exit)
Tags: editor, emacs, vim, rlwrap, scite