设置securecrt和vim的颜色

设置securecrt和vim的颜色

设置securecrt 代码高亮显示和vim的颜色

首先要设置一下securecrt的配置。

设置securecrt的颜色: 选项->会话选项->终端->仿真,选择linux,并勾选后面的ANSI颜色

securecrt_color

到连接的服务器下改一下会话环境变量,也可以设置为全局环境变量。

把下面的代码加到 /etc/profile 或者 ~/.bash_profile (根据当前shell的不同而不同)

TERM=xterm-color
export TERM

配置vim的代码高亮显示

把下面的代码加入到 ~/.vimrc 文件的末尾。

set cindent
set smartindent
set hls
set nocompatible
set sw=3
set showmatch
set background=light
colorscheme desert
syntax on
set hlsearch
highlight Search term=reverse ctermbg=4 ctermfg=7
highlight Normal ctermbg=black ctermfg=white
highlight Comment ctermfg=blue

这样就应该能看到高亮显示的代码了,并且ll的时候目录和文件和可执行文件都应该是不同颜色了。

vimrc 代码颜色自定义代码:

" Vim color file  
" Maintainer: buzhidao  
" Last Change:  2012 Feb 10  
" as :color ladesert  
set background=light  

hi clear  

if exists("syntax_on")  
  syntax reset  
endif  

let g:colors_name = "laphp"  

if exists("&t_Co") && &t_Co > 2 && &t_Co <= 8  
    "Not much on the linux (text)console, unless anybody would document.  
    hi Normal          ctermfg=4 ctermbg=7  
    hi Comment         ctermfg=3  
    hi Constant        ctermfg=1  
    hi Special         ctermfg=3  
    hi Identifier      ctermfg=4  
    hi Statement       ctermfg=0  
    hi PreProc         ctermfg=2  
    hi Type            ctermfg=2  
    finish  
endif  

" LIGHT COLOR DEFINE START  
hi Normal          guifg=#008000 guibg=#FFFFFF   
hi Cursor          guifg=#ffffff guibg=#333333  
hi Comment         guifg=#ff8000 guibg=bg  
hi Constant        guifg=#dd0000 guibg=bg  
hi Special         guifg=#0000bb guibg=bg  
hi Identifier      guifg=#0066cc guibg=bg  
hi Statement       guifg=#0000bb guibg=bg gui=NONE term=bold ctermfg=28 cterm=NONE   
hi Function        guifg=#008000 guibg=bg gui=bold  
hi Operator        guifg=#0066cc guibg=bg  
hi PreProc         guifg=#0000bb guibg=bg term=underline ctermfg=34  
hi Type            guifg=#0000bb guibg=bg term=underline ctermfg=34  
hi Underlined      guifg=#80a0ff guibg=bg term=underline cterm=underline ctermfg=9 gui=underline   
hi Ignore          guifg=bg guibg=fg cterm=bold ctermfg=0   
hi Error           guifg=#ffffff guibg=#ff0000 term=reverse cterm=bold ctermfg=15 ctermbg=12   
hi Todo            guifg=#0000ff guibg=#ffff00 term=standout ctermfg=0 ctermbg=14   
hi Pmenu           guibg=#ff00ff guifg=fg ctermbg=13   
hi PmenuSel        guibg=#a9a9a9 guifg=fg ctermbg=8   
hi PmenuSbar       guibg=#bebebe guifg=fg ctermbg=7   
hi PmenuThumb      guifg=fg guibg=bg gui=reverse cterm=reverse   
hi TabLine         guibg=#a9a9a9 guifg=fg gui=underline term=underline cterm=underline ctermfg=15 ctermbg=8   
hi TabLineSel      guifg=fg guibg=bg gui=bold term=bold cterm=bold   
hi TabLineFill     guifg=fg guibg=bg gui=reverse term=reverse cterm=reverse   
hi MatchParen      guifg=#cecb00 guibg=#ffffaf term=reverse ctermfg=3 ctermbg=229   
hi SpecialKey      guifg=#00ffff guibg=bg term=bold ctermfg=9   
hi NonText         guifg=#0000ff guibg=bg gui=bold term=bold ctermfg=9   
hi Directory       guifg=#d700af guibg=bg term=bold ctermfg=11   
hi ErrorMsg        guifg=#ffffff guibg=#ff0000 term=standout cterm=bold ctermfg=15 ctermbg=4   
hi IncSearch       guifg=#708090 guibg=#f0e68c gui=reverse term=reverse cterm=reverse ctermfg=11 ctermbg=10   
hi Search          guifg=#000087 guibg=#ff8000 term=reverse ctermfg=18 ctermbg=122   
hi MoreMsg         guifg=#00875f guibg=bg term=bold ctermfg=29 gui=bold   
hi ModeMsg         guifg=#d7af00 guibg=bg term=bold cterm=bold ctermfg=178 gui=bold   
hi LineNr          guifg=#000000 guibg=bg term=underline ctermfg=186   
hi Question        guifg=#00ffff guibg=bg gui=bold term=standout ctermfg=14   
hi StatusLine      guifg=#333333 guibg=bg gui=bold,reverse term=bold,reverse cterm=bold,reverse ctermfg=18 ctermbg=15   
hi StatusLineNC    guifg=#333333 guibg=bg gui=bold,reverse term=bold,reverse cterm=bold,reverse ctermfg=246 ctermbg=15   
hi VertSplit       guifg=#333333 guibg=bg gui=reverse ctermfg=18 ctermbg=251 term=reverse cterm=reverse   
hi Title           guifg=#d700af guibg=bg gui=bold term=bold ctermfg=163   
hi Visual          guifg=#316ac5 guibg=#ffffff gui=reverse term=reverse cterm=reverse ctermfg=229 ctermbg=22   
hi VisualNOS       guifg=fg guibg=bg gui=bold,underline term=bold,underline cterm=bold,underline   
hi WarningMsg      guifg=#ff0000 guibg=bg term=standout ctermfg=9   
hi WildMenu        guifg=#000000 guibg=#ffff00 guifg=fg term=standout ctermfg=0 ctermbg=11   
hi Folded          guifg=#00ffff guibg=#a8a8a8 term=standout ctermfg=14 ctermbg=248   
hi FoldColumn      guifg=#ffffff guibg=#333333 term=standout ctermfg=14 ctermbg=250   
hi DiffAdd         guibg=#000087 guifg=#e4e4e4 term=bold ctermbg=1 ctermbg=18 ctermfg=254   
hi DiffChange      guibg=#870087 guifg=#87afff term=bold ctermbg=90   
hi DiffDelete      guifg=#0000ff guibg=#008787 gui=bold term=bold cterm=bold ctermfg=21 ctermbg=30 ctermbg=3   
hi DiffText        guibg=#ff0000 guifg=fg gui=bold term=reverse cterm=bold ctermbg=9   
hi SignColumn      guifg=#00ffff guibg=#bcbcbc term=standout ctermfg=14 ctermbg=250   
hi lCursor         guifg=#d7ffd7 guibg=#0000af  
" LIGHT COLOR DEFINE END  

"finish  

" DARK COLOR DEFINE START  
hi Normal          guifg=#909090 guibg=#131313 ctermfg=19 ctermbg=254   
hi Cursor          guifg=#131313 guibg=#909090   
hi Comment         guifg=#e4e4e4 guibg=bg ctermfg=208   
hi Constant        guifg=#dd0000 guibg=bg ctermfg=160   
hi Special         guifg=#00af00 guibg=bg term=bold ctermfg=166   
hi Identifier      guifg=#0066cc guibg=bg term=underline cterm=NONE ctermfg=19   
hi Statement       guifg=#00af00 guibg=bg gui=NONE term=bold ctermfg=28 cterm=NONE   
hi Function        guifg=#ff8000 guibg=bg gui=bold  
hi Operator        guifg=#0066cc guibg=bg  
hi PreProc         guifg=#00af00 guibg=bg term=underline cterm=bold ctermfg=34 gui=bold   
hi Type            guifg=#00af00 guibg=bg term=underline ctermfg=34   
hi Underlined      guifg=#80a0ff guibg=bg term=underline cterm=underline ctermfg=9 gui=underline   
hi Ignore          guifg=bg guibg=fg cterm=bold ctermfg=0   
hi Error           guifg=#ffffff guibg=#ff0000 term=reverse cterm=bold ctermfg=15 ctermbg=12   
hi Todo            guifg=#0000ff guibg=#ffff00 term=standout ctermfg=0 ctermbg=14   
hi Pmenu           guibg=#ff00ff guifg=fg ctermbg=13   
hi PmenuSel        guibg=#a9a9a9 guifg=fg ctermbg=8   
hi PmenuSbar       guibg=#bebebe guifg=fg ctermbg=7   
hi PmenuThumb      guifg=fg guibg=bg gui=reverse cterm=reverse   
hi TabLine         guibg=#a9a9a9 guifg=fg gui=underline term=underline cterm=underline ctermfg=15 ctermbg=8   
hi TabLineSel      guifg=fg guibg=bg gui=bold term=bold cterm=bold   
hi TabLineFill     guifg=fg guibg=bg gui=reverse term=reverse cterm=reverse   
hi MatchParen      guifg=#cecb00 guibg=#ffffaf term=reverse ctermfg=3 ctermbg=229   
hi SpecialKey      guifg=#00ffff guibg=bg term=bold ctermfg=9   
hi NonText         guifg=#0000ff guibg=bg gui=bold term=bold ctermfg=9   
hi Directory       guifg=#d700af guibg=bg term=bold ctermfg=11   
hi ErrorMsg        guifg=#ffffff guibg=#ff0000 term=standout cterm=bold ctermfg=15 ctermbg=4   
hi IncSearch       guifg=#708090 guibg=#f0e68c gui=reverse term=reverse cterm=reverse ctermfg=11 ctermbg=10   
hi Search          guifg=#000087 guibg=#ff8000 term=reverse ctermfg=18 ctermbg=122   
hi MoreMsg         guifg=#00875f guibg=bg term=bold ctermfg=29 gui=bold   
hi ModeMsg         guifg=#d7af00 guibg=bg term=bold cterm=bold ctermfg=178 gui=bold   
hi LineNr          guifg=#909090 guibg=bg term=underline ctermfg=186   
hi Question        guifg=#00ffff guibg=bg gui=bold term=standout ctermfg=14   
hi StatusLine      guifg=#333333 guibg=#909090 gui=bold,reverse term=bold,reverse cterm=bold,reverse ctermfg=18 ctermbg=15   
hi StatusLineNC    guifg=#333333 guibg=#909090 gui=bold,reverse term=bold,reverse cterm=bold,reverse ctermfg=246 ctermbg=15   
hi VertSplit       guifg=#333333 guibg=#909090 gui=reverse ctermfg=18 ctermbg=251 term=reverse cterm=reverse   
hi Title           guifg=#d700af guibg=bg gui=bold term=bold ctermfg=163   
hi Visual          guifg=#cccccc guibg=#000000 gui=reverse term=reverse cterm=reverse ctermfg=229 ctermbg=22   
hi VisualNOS       guifg=fg guibg=bg gui=bold,underline term=bold,underline cterm=bold,underline   
hi WarningMsg      guifg=#ff0000 guibg=bg term=standout ctermfg=9   
hi WildMenu        guifg=#000000 guibg=#ffff00 guifg=fg term=standout ctermfg=0 ctermbg=11   
hi Folded          guifg=#00ffff guibg=#a8a8a8 term=standout ctermfg=14 ctermbg=248   
hi FoldColumn      guifg=#ffffff guibg=#333333 term=standout ctermfg=14 ctermbg=250   
hi DiffAdd         guibg=#000087 guifg=#e4e4e4 term=bold ctermbg=1 ctermbg=18 ctermfg=254   
hi DiffChange      guibg=#870087 guifg=#87afff term=bold ctermbg=90   
hi DiffDelete      guifg=#0000ff guibg=#008787 gui=bold term=bold cterm=bold ctermfg=21 ctermbg=30 ctermbg=3   
hi DiffText        guibg=#ff0000 guifg=fg gui=bold term=reverse cterm=bold ctermbg=9   
hi SignColumn      guifg=#00ffff guibg=#bcbcbc term=standout ctermfg=14 ctermbg=250   
hi lCursor         guifg=#d7ffd7 guibg=#0000af  
" DARK COLOR DEFINE END  

finish

 

下面是本人的vimrc文件内容

syntax on

" UTF-8 setting
set tenc=UTF-8
set fenc=UTF-8
set enc=UTF-8

set autoindent
set smartindent
set number
set nocompatible
set bs=2
set expandtab
set noet sts=0
"set smartindent
set nohlsearch
set incsearch
set nobackup
set ts=4
set sts=4
set sw=4
set backspace=2
set ai
set wrap
set wildmode=longest
"set fdm=marker
set ruler

syntax enable
syntax on

set tags=./tags,/usr/include/tags
map " o{}// }}}kkkYPi// {{{ 
map QS o$sql =& new SqlSelect($db);$sql->reset();$sql->addField("");$sql->addTable("");$sql->addWhere("");$ds = $sql->executeQuery();

map  :e .

"nmap  :tabnew
map  :tabprevious
map  :tabnext

" Function Key
map  K
map  :w
"map  :x 
map  :resize 50
map  zo
map  :set noai
map  :set ai
map  :noh
map  :tabnext
map  :tabprevious
map  :%s///g

hi MatchParen ctermbg=black ctermfg=red cterm=bold
hi Pmenu      ctermbg=4 guibg=blue
hi PmenuSel   ctermfg=0 ctermbg=7

"DoMatchParen

highlight Folded term=standout ctermfg=black ctermbg=darkcyan

 

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>