Re: xterm16 vim schema

2008-07-16 Пенетрантность Roman Cheplyaka
* Andrey Nikitin [EMAIL PROTECTED] [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 = '#00 #af #00af00 #afaf00 #af #af00af #00afaf 
 #9a9a9a #5f5f5f #d7 #00d700 #d7d700 #d7 #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.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



xterm16 vim schema

2008-07-11 Пенетрантность Andrey Nikitin
Привет.

Приглянулась мне тема vim с названием xterm16
А именно её вариант: 
  - monitor: LCD, 
  - colormap: softlight,
  - brightness: low или default
http://www.stanford.edu/%7Egi1242/per/opensource/xterm16/c-source.html

Бесхитростная установка в gvim-е прошла быстро и точно,
прописыванием в ~/.vimrc нижеследующего кода:

 Switch syntax highlighting on, when the terminal has colors
 Also switch on highlighting the last used search pattern.
if t_Co  2 || has(gui_running)
   let xterm16_brightness = 'default'  Change if needed
   let xterm16_colormap = 'softlight'Change if needed
   colorscheme xterm16
   syntax on
   set hlsearch
endif

Поработав в xterm16 несколько дней, решил установить её и во всех других
местах, в которых обитаю в рабочее время, а именно:
   - vim,
   - konsole.

Будучи чайником в vim, но уже не желающим работать в других редакторах,
задаю вопросы по vim, на которые не смог ответить сам.

1) По консольному vim.
C модифицированным .vimrc(см.выше) vim отрывается в цветовой схеме xterm16,
но не устанавливаются xterm16_brightness и xterm16_colormap.
Почему или как изменить?

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 = '#00 #af #00af00 #afaf00 #af #af00af #00afaf 
#9a9a9a #5f5f5f #d7 #00d700 #d7d700 #d7 #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-е - как?,
преварительно поменяв переменную palette - как? или можно использовать
  let palette = xterm16_palette
в уже настроенной цветовой схеме.

Vim-гуру, направьте в нужное русло.


-- 
С Уважением,
   Андрей Никитин


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]