关于 fedora20 vi 的配色设置 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
nocturnal
V2EX    Linux

关于 fedora20 vi 的配色设置

  •  
  •   nocturnal 2015-03-08 19:23:17 +08:00 3118 次点击
    这是一个创建于 3889 天前的主题,其中的信息可能已经有所发展或是发生改变。

    请问fedora 20 vi 默认配色在哪里看的 能否导出

    5 条回复    2015-03-15 23:15:40 +08:00
    joyeblue
        1
    joyeblue  
       2015-03-08 20:58:23 +08:00
    现行*nix发行版上的vi一般是软链接到vim上,这个可以通过type vi看下。

    如果是软链接到vim上,执行vim,
    然后:echo $VIM
    这个会输出vim的RUNTIMEPATH,然后cd 到这个目录,
    配色会在RUNTIMEPATH/vimfiles/colors 目录下。
    joyeblue
        2
    joyeblue  
       2015-03-08 21:01:24 +08:00
    查看当前配色的方式为:
    :echo g:colors_name
    nocturnal
        3
    nocturnal  
    OP
       2015-03-08 23:09:13 +08:00
    @joyeblue
    [victini@localhost ~]$ cd /usr/share/vim/
    [victini@localhost vim]$ ll
    总用量 8
    drwxr-xr-x. 16 root root 4096 12月 6 16:57 vim74
    drwxr-xr-x. 17 root root 4096 12月 6 16:57 vimfiles
    [victini@localhost vim]$ cd vimfiles/
    [victini@localhost vimfiles]$ cd colors/
    [victini@localhost colors]$ ll
    总用量 0

    :echo g:colors_name
    default
    但是default文件的配色貌似是调用系统的配色的
    这是default文件 没有具体的配置信息诶
    " Vim color file
    2 " Maintainer:>--Bram Moolenaar <[email protected]>
    3 " Last Change:>-2001 Jul 23
    4
    5 " This is the default color scheme. It doesn't define the Normal
    6 " highlighting, it uses whatever the colors used to be.
    7
    8 " Set 'background' back to the default. The value can't always be estimated
    9 " and is then guessed.
    10 hi clear Normal
    11 set bg&
    12
    13 " Remove all existing highlighting and set the defaults.
    14 hi clear
    15
    16 " Load the syntax highlighting defaults, if it's enabled.
    17 if exists("syntax_on")
    18 syntax reset
    19 endif
    20
    21 let colors_name = "default"
    joyeblue
        4
    joyeblue  
       2015-03-08 23:39:59 +08:00
    @nocturnal 那这就只得去源代码中找答案了。

    分析的源代码版本为7.2
    在src/syntax.c:6199中,以下就是默认的colorscheme

    /*
    * The default highlight groups. These are compiled-in for fast startup and
    * they still work when the runtime files can't be found.
    * When making changes here, also change runtime/colors/default.vim!
    * The #ifdefs are needed to reduce the amount of static data. Helps to make
    * the 16 bit DOS (museum) version compile.
    */
    #ifdef FEAT_GUI
    # define CENT(a, b) b
    #else
    # define CENT(a, b) a
    #endif
    static char *(highlight_init_both[]) =
    {
    CENT("ErrorMsg term=standout ctermbg=DarkRed ctermfg=White",
    "ErrorMsgterm=standout ctermbg=DarkRed ctermfg=White guibg=Red guifg=White"),
    #ifdef FEAT_SEARCH_EXTRA
    CENT("IncSearch term=reverse cterm=reverse",
    "IncSearch term=reverse cterm=reverse gui=reverse"),
    #endif
    CENT("ModeMsg term=bold cterm=bold",
    "ModeMsg term=bold cterm=bold gui=bold"),
    CENT("NonText term=bold ctermfg=Blue",
    "NonText term=bold ctermfg=Blue gui=bold guifg=Blue"),
    CENT("StatusLine term=reverse,bold cterm=reverse,bold",
    "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold"),
    CENT("StatusLineNC term=reverse cterm=reverse",
    "StatusLineNC term=reverse cterm=reverse gui=reverse"),
    #ifdef FEAT_VERTSPLIT
    CENT("VertSplit term=reverse cterm=reverse",
    "VertSplit term=reverse cterm=reverse gui=reverse"),
    #endif
    #ifdef FEAT_CLIPBOARD
    CENT("VisualNOS term=underline,bold cterm=underline,bold",
    "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold"),
    #endif
    #ifdef FEAT_DIFF
    CENT("DiffText term=reverse cterm=bold ctermbg=Red",
    "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red"),
    #endif
    #ifdef FEAT_INS_EXPAND
    CENT("PmenuThumb cterm=reverse",
    "PmenuThumb cterm=reverse gui=reverse"),
    CENT("PmenuSbar ctermbg=Grey",
    "PmenuSbar ctermbg=Grey guibg=Grey"),
    #endif
    #ifdef FEAT_WINDOWS
    CENT("TabLineSel term=bold cterm=bold",
    "TabLineSel term=bold cterm=bold gui=bold"),
    CENT("TabLineFill term=reverse cterm=reverse",
    "TabLineFill term=reverse cterm=reverse gui=reverse"),
    #endif
    #ifdef FEAT_GUI
    "Cursor guibg=fg guifg=bg",
    "lCursor guibg=fg guifg=bg", /* should be different, but what? */
    #endif
    NULL
    };

    PS:要学会去从源代码中去查找答案,因为源代码里面包含你所需要的一切信息!
    nocturnal
        5
    nocturnal  
    OP
       2015-03-15 23:15:40 +08:00
    @joyeblue - -! 不好意思,上个星期事情太多,没啥时间看,不过上星期在公司电脑和自己家电脑终端看代码,发现同一个测试机,在不同终端的代码颜色显示是不一样的,所以在终端的help看到这个:
    Color schemes
    If you do not like the default Terminal theme, you may want to change the colors that are used for the text and background. You can use colors from your theme, select one of the presets or use a custom scheme.
    暂时只发现自己自定义颜色的方法,没有发现导出配置的方法,好麻烦,还不如照着配色自己改一个。。。。。此贴终结
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2960 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 24ms UTC 13:11 PVG 21:11 LAX 06:11 JFK 09:11
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86