【发布时间】:2013-05-24 07:07:05
【问题描述】:
目前我使用比较简单的sn-p代码来动态改变vim中的缓冲区配色方案代码-detailed here on SO
This proposed solution 看起来更全面 - 我只是不确定如何实现它。
if has('autocmd')
" change colorscheme depending on current buffer
" if desired, you may set a user-default colorscheme before this point,
" otherwise we'll use the Vim default.
" Variables used:
" g:colors_name : current colorscheme at any moment
" b:colors_name (if any): colorscheme to be used for the current buffer
" s:colors_name : default colorscheme, to be used where b:colors_name hasn't been set
if has('user_commands')
" User commands defined:
" ColorScheme <name>
" set the colorscheme for the current buffer
" ColorDefault <name>
" change the default colorscheme
command -nargs=1 -bar ColorScheme
\ colorscheme <args>
\ | let b:colors_name = g:colors_name
command -nargs=1 -bar ColorDefault
\ let s:colors_name = <q-args>
\ | if !exists('b:colors_name')
\ | colors <args>
\ | endif
endif
if !exists('g:colors_name')
let g:colors_name = 'default'
endif
let s:colors_name = g:colors_name
au BufEnter *
\ let s:new_colors = (exists('b:colors_name')?(b:colors_name):(s:colors_name))
\ | if s:new_colors != g:colors_name
\ | exe 'colors' s:new_colors
\ | endif
endif
我需要取消注释上述哪些部分?
我在哪里添加我的默认方案 pyte?
它在哪里发现如果它是一个 fuletype sql 然后制定 SummerFruit256 计划?
还是我最好还是坚持使用简单的两行代码来切换配色方案?
【问题讨论】:
-
我不确定我是否理解根据当前文件类型更改整个程序外观的意义。
-
@romainl - 你不考虑配色方案吗?
-
我只使用一种配色方案。
-
我非常喜欢几个配色方案的想法 - 让我对其中一个感到厌烦:只是个人选择
标签: vim