You are not logged in.

#1 2005-07-02 10:36:06

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

tweak vims syntax highlighting

here is a little tutorial for making your own s-h theme for vim,
if you're using gvim you can skip the part about terminals,

for terminal users you must first set your prefered terminal colours in .Xdefaults ,
eg for urxvt:

urxvt*scrollColor: #111111
urxvt*font: xft:Bitstream Vera Sans Mono:pixelsize=13
urxvt*scrollBar_floating: false
urxvt*scrollstyle: urxvt
urxvt*saveLines: 1000
urxvt*foreground: #eeeeee
urxvt*background: #000000

! black
urxvt*color0:  #000000
urxvt*color8:  #444444

! red
urxvt*color1:  #b21818
urxvt*color9:  #ee9090

! green
urxvt*color2:  #18b218
urxvt*color10: #54ee54

! yellow
urxvt*color3:  #968a38
urxvt*color11: #eeee77

! blue
urxvt*color4:  #1818b2
urxvt*color12: #9090ee

! magenta
urxvt*color5:  #963c59
urxvt*color13: #cf9ebe

! cyan
urxvt*color6:  #418179
urxvt*color14: #71bebe

! white
urxvt*color7:  #aaaaaa
urxvt*color15: #eeeeee

then you save this example file as ~/.vim/colors/xerxes.vim

" local syntax file - set colors on a per-machine basis:
hi clear
set background=dark
if exists("syntax_on")
  syntax reset
endif
let g:colors_name = "xerxes"
hi Normal          guifg=white  guibg=black
hi Scrollbar      guifg=darkcyan guibg=cyan
hi Menu          guifg=black guibg=cyan
hi SpecialKey      term=bold  cterm=bold  ctermfg=2  guifg=Blue
hi NonText          term=bold  cterm=bold  ctermfg=darkred  gui=bold    guifg=Blue
hi Directory      term=bold  cterm=bold  ctermfg=brown    guifg=Blue
hi ErrorMsg      term=standout  cterm=bold  ctermfg=grey  ctermbg=blue  guifg=White  guibg=Red
hi Search          term=reverse    ctermfg=white  ctermbg=red    guifg=white  guibg=Red
hi MoreMsg      term=bold  cterm=bold  ctermfg=darkgreen    gui=bold  guifg=SeaGreen
hi ModeMsg      term=bold  cterm=bold  gui=bold  guifg=White    guibg=Blue
hi LineNr          term=underline  cterm=bold  ctermfg=darkcyan    guifg=Yellow
hi Question      term=standout  cterm=bold  ctermfg=darkgreen    gui=bold  guifg=Green
hi StatusLine      term=bold,reverse  cterm=bold ctermfg=4 ctermbg=15 gui=bold guifg=blue guibg=white
hi StatusLineNC   term=reverse    ctermfg=white ctermbg=lightblue guifg=white guibg=blue
hi Title          term=bold  cterm=bold  ctermfg=darkmagenta  gui=bold    guifg=Magenta
hi Visual          term=reverse    cterm=reverse  gui=reverse
hi WarningMsg      term=standout  cterm=bold  ctermfg=red  guifg=Red
hi Cursor          guifg=bg    guibg=Green
hi Comment      term=bold  ctermfg=6  guifg=#80a0ff
hi Constant      term=underline  ctermfg=9  guifg=#ffa0a0
hi Special          term=bold  ctermfg=1  guifg=Orange
hi Identifier              term=underline   ctermfg=14  guifg=#40ffff
hi Statement      term=bold  cterm=bold  ctermfg=11  gui=bold  guifg=#ffff60
hi PreProc          term=underline  ctermfg=5  guifg=#ff80ff
hi Type          term=underline  cterm=bold ctermfg=lightgreen  gui=bold  guifg=#60ff60
hi Error          term=reverse    ctermfg=darkcyan  ctermbg=black  guifg=Red    guibg=Black
hi Todo          term=standout  ctermfg=black  ctermbg=darkcyan  guifg=Blue  guibg=Yellow
hi link IncSearch        Visual
hi link String            Constant
hi link Character        Constant
hi link Number            Constant
hi link Boolean            Constant
hi link Float            Number
hi link Function        Identifier
hi link Conditional        Statement
hi link Repeat            Statement
hi link Label            Statement
hi link Operator        Statement
hi link Keyword            Statement
hi link Exception        Statement
hi link Include            PreProc
hi link Define            PreProc
hi link Macro            PreProc
hi link PreCondit        PreProc
hi link StorageClass    Type
hi link Structure        Type
hi link Typedef            Type
hi link Tag                Special
hi link SpecialChar        Special
hi link Delimiter        Special
hi link SpecialComment    Special
hi link Debug            Special

now you can start tweaking the theme, use the numbers in .Xdefaults  as your prefered colours in the "ctermfg" and "ctermbg" commands,

now you can use the "colorscheme" command in vim to enable it,

colorscheme xerxes

arch + gentoo + initng + python = enlisy

Offline

#2 2005-07-03 00:34:50

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: tweak vims syntax highlighting

awesome! thanks!!

Offline

#3 2005-07-03 01:51:12

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: tweak vims syntax highlighting

Colorscheme for............desert!

urxvt*background: rgb:33/33/33
urxvt*foreground: rgb:FF/FF/FF

urxvt*color0:     rgb:33/33/33
urxvt*color8:     rgb:33/33/33

urxvt*color1:     rgb:ff/a0/a0
urxvt*color9:     rgb:ff/a0/a0

urxvt*color2:     rgb:98/fb/98
urxvt*color10:    rgb:9a/cd/32

urxvt*color3:     rgb:f0/e6/8c
urxvt*color11:    rgb:f0/e6/8c

urxvt*color4:     rgb:87/ce/eb
urxvt*color12:    rgb:87/ce/eb

urxvt*color5:     rgb:ff/a0/a0
urxvt*color13:    rgb:ff/a0/a0

urxvt*color6:     rgb:87/ce/eb
urxvt*color14:    rgb:87/ce/eb

urxvt*color7:     rgb:ff/ff/ff
urxvt*color15:    rgb:ff/ff/ff

and just colorscheme desert in vim and bam!

https://iphitus.no-ip.org/screenshots/030705.png

gvim on right, vim on left.

found here: http://vico.kleinplanet.de/files/dot.Xdefaults

only problem with this setup is that pida doesnt work with it sad

Offline

#4 2005-07-03 11:58:45

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: tweak vims syntax highlighting

hello iphitus,

i've edited the first post and if you use that .Xdefaults the following scheme should give you something close to desert,

" Vim color file
set background=dark
if version > 580
    " no guarantees for version 5.8 and below, but this makes it stop
    " complaining
    hi clear
    if exists("syntax_on")
    syntax reset
    endif
endif
let g:colors_name="desert"

hi Normal    guifg=White guibg=grey20

" highlight groups
hi Cursor    guibg=khaki guifg=slategrey
"hi CursorIM
"hi Directory
"hi DiffAdd
"hi DiffChange
"hi DiffDelete
"hi DiffText
"hi ErrorMsg
hi VertSplit    guibg=#c2bfa5 guifg=grey50 gui=none
hi Folded    guibg=grey30 guifg=gold
hi FoldColumn    guibg=grey30 guifg=tan
hi IncSearch    guifg=slategrey guibg=khaki
"hi LineNr
hi ModeMsg    guifg=goldenrod
hi MoreMsg    guifg=SeaGreen
hi NonText    guifg=LightBlue guibg=grey30
hi Question    guifg=springgreen
hi Search    guibg=peru guifg=wheat
hi SpecialKey    guifg=yellowgreen
hi StatusLine    guibg=#c2bfa5 guifg=black gui=none
hi StatusLineNC    guibg=#c2bfa5 guifg=grey50 gui=none
hi Title    guifg=indianred
hi Visual    gui=none guifg=khaki guibg=olivedrab
"hi VisualNOS
hi WarningMsg    guifg=salmon
"hi WildMenu
"hi Menu
"hi Scrollbar
"hi Tooltip

" syntax highlighting groups
hi Comment    guifg=SkyBlue
hi Constant    guifg=#ffa0a0
hi Identifier            guifg=palegreen
hi Statement    guifg=khaki
hi PreProc            guifg=indianred
hi Type        guifg=darkkhaki
hi Special            guifg=navajowhite
"hi Underlined
hi Ignore            guifg=grey40
"hi Error
hi Todo        guifg=orangered guibg=yellow2

" color terminal definitions
hi SpecialKey    ctermfg=darkgreen
hi NonText            cterm=bold ctermfg=darkblue
hi Directory    ctermfg=darkcyan
hi ErrorMsg    cterm=bold ctermfg=7 ctermbg=1
hi IncSearch    cterm=NONE ctermfg=yellow ctermbg=green
hi Search            cterm=NONE ctermfg=grey ctermbg=blue
hi MoreMsg    ctermfg=darkgreen
hi ModeMsg    cterm=NONE ctermfg=brown
hi LineNr            ctermfg=3
hi Question    ctermfg=green
hi StatusLine    cterm=bold,reverse
hi StatusLineNC cterm=reverse
hi VertSplit            cterm=reverse
hi Title            ctermfg=5
hi Visual            cterm=reverse
hi VisualNOS    cterm=bold,underline
hi WarningMsg    ctermfg=1
hi WildMenu    ctermfg=0 ctermbg=3
hi Folded            ctermfg=darkgrey ctermbg=NONE
hi FoldColumn    ctermfg=darkgrey ctermbg=NONE
hi DiffAdd            ctermbg=4
hi DiffChange    ctermbg=5
hi DiffDelete    cterm=bold ctermfg=4 ctermbg=6
hi DiffText            cterm=bold ctermbg=1
hi Comment    ctermfg=12
hi Constant    ctermfg=9
hi Special            ctermfg=5
hi Identifier      ctermfg=10
hi Statement    cterm=bold ctermfg=11
hi PreProc            ctermfg=1
hi Type        ctermfg=2
hi Underlined    cterm=underline ctermfg=5
hi Ignore            cterm=bold ctermfg=7
hi Ignore            ctermfg=darkgrey
hi Error            cterm=bold ctermfg=7 ctermbg=1

arch + gentoo + initng + python = enlisy

Offline

#5 2005-07-03 12:32:52

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: tweak vims syntax highlighting

xerxes2 wrote:

hello iphitus,

i've edited the first post and if you use that .Xdefaults the following scheme should give you something close to desert,

the xdefaults I posted above, when used with the desert theme file, will give a nearly exact desert setup, as compared in that screenshot...

Offline

#6 2005-07-03 12:45:04

xerxes2
Member
From: Malmoe, Sweden
Registered: 2004-04-23
Posts: 1,249
Website

Re: tweak vims syntax highlighting

you should use a .Xdefaults with the right colours and modify the schemes instead,

my scheme in the first post is a slightly modified desert that looks even better in my eyes,


arch + gentoo + initng + python = enlisy

Offline

Board footer

Powered by FluxBB