[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xterm16 vim schema



* Andrey Nikitin <andrey.d.nikitin@gmail.com> [2008-07-11 10:07:20+0400]
> 2) Для эмулятора терминала konsole есть тема xterm16.schema,
> но она получена с варианта xterm16
>   - monitor: CRT, 
>   - colormap: standard,
>   - brightness: default
> 
> Хотелось бы поменять.
> Вот что приведено в мануале:
>     For konsole, the file *xterm16.schema* contains the colors of this color
>     scheme with 'standard' colormap, default brightness and CRTColors. If you
>     use a different colormap / brightness, get the palette from the variable
>     |xterm16_palette|, and modify the file appropriately. You'll need to
>     convert the palette from to decimal. The following few lines might help: >
> 
> 	" Brightness 134 (high), colormap standard
> 	let palette = '#000000 #af0000 #00af00 #afaf00 #0000af #af00af #00afaf #9a9a9a #5f5f5f #d70000 #00d700 #d7d700 #0000d7 #d700d7 #00d7d7 #d7d7d7'
> 
> 	let i = 0
> 	while i < 16
> 	    echo 'Color' i '0x'.strpart(palette,i*8+1,2)+0 '	'
> 		    \ '0x'.strpart(palette,i*8+3,2)+0 '	'
> 		    \ '0x'.strpart(palette,i*8+5,2)+0
> 	    let i = i + 1
> 	endwhile
> 
>    To change the default colors on Konsole, add the file |xterm16.schema| to
>     ~/.kde/share/apps/konsole. Select the "Xterm 16 Colors" schema from the
>     schema menu.
> 
> Судя по синтаксису, код нужно запустить в самом vim-е - как?,

Сохраняем в файл xxx.vim, делаем :so xxx.vim

> преварительно поменяв переменную palette - как? или можно использовать
>   let palette = xterm16_palette
> в уже настроенной цветовой схеме.

Нет, в той переменной много мусора. Варианта целых три (выберите для
себя самый простой):
1. Сделать :echo xterm16_palette и скопипастить нужные цвета в строку.
2. Написать простой фильтр на чем угодно, который оттуда эти цвета
   выдернет. В принципе, тот же фильтр может и цвета в десятичные числа
   перевести.
3. Подредактировать xterm16.vim, дабы тот не пихал в переменную мусор, а
   только желаемые цвета.

-- 
Roman I. Cheplyaka :: http://ro-che.info/
Those who think that you can't have a lot of fun while getting an education
probably don't know much about either.


Reply to: