2009-08-10 11 views
9

우분투에서 Zsh의 Less than Bash의 Less와 비슷한 하이라이트를 어떻게 얻을 수 있습니까?우분투의 Zsh에서 less를 얻으려면

저는 OS X에서 우분투로 전환했습니다. My Less는 Zsh에서 예상대로 작동하지 않습니다.

내 Less에있는 매뉴얼은 다음 코드의 유무와 상관없이 녹색과 검은 색입니다.

# comment these out in Ubuntu 
export LESS_TERMCAP_mb=$'\E[01;31m'   # begin blinking 
export LESS_TERMCAP_me=$'\E[0m'  # end mode 

export LESS_TERMCAP_se=$'\E[0m'  # end standout-mode 
export LESS_TERMCAP_so=$'\E[38;5;246m' # begin standout-mode - info box 
export LESS_TERMCAP_ue=$'\E[0m'  # end underline 

export LESS_TERMCAP_us=$'\E[04;33;146m' # begin underline is now yellow 
#        | | | 
#        | |----------------- yellow 
#        |-------------------- underline 

# to have the indication of cursor's location and line numbers, and R 
export LESS="-mNR" 
#    |--------- only ASCII color 

이 코드는 OS X에서 설명서를 읽을 수있게하지만 Zsh의 Ubuntu에서는 작동하지 않습니다.

우분투는 배쉬의 Less에서 뛰어난 하이라이트를 가지고 있습니다. 나의 매뉴얼은 Bash에서 내 코드없이 노란색, 녹색, 검은 색으로되어있다. Zsh와 Bash는 모두 /usr/bin/less에서 Less를 사용합니다. 이것은 Ubuntu의 Bash가 어딘가에 그것을 구성하는 몇몇 도트 파일을 가지고 있다는 것을 말해줍니다.

우분투의 Less in Bash는 어디에서 볼 수 있습니까?

+1

@ Luboš Turek 그래서 마침내 나는 [태그 : less-unix]를 ​​만들었습니다. 그래서 당신이 리눅스를 적게 쓸어 버리려한다면, 이 위치에 추가하는 것을 고려하십시오. – fedorqui

답변

8

This 작품 :

$ mkdir ~/.terminfo/ && cd ~/.terminfo 
Now get the terminfo description: 
$ wget http://nion.modprobe.de/mostlike.txt 
Now compile it using tic (the terminfo entry-description compiler) 
$ tic mostlike.txt 
(you may want to delete the mostlike.txt file after compiling) 

mostlike.txt이

# Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-pcolor 
mostlike|manpages with color looking like most, 
    am, hs, km, mir, msgr, xenl, 
    cols#80, it#8, lines#24, wsl#40, 
    acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, 
    bel=^G, bold=\E[1m\E[31m, clear=\E[H\E[2J, cr=^M, 
    csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, 
    cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, 
    cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, 
    dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, 
    dsl=\E]0;\007, ed=\E[J, el=\E[K, enacs=\E)0, fsl=^G, 
    home=\E[H, ht=^I, hts=\EH, il=\E[%p1%dL, il1=\E[L, ind=^J, 
    is2=\E7\E[r\E[m\E[?7h\E[?1;3;4;6l\E[4l\E8\E>, kbs=^H, 
    kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, 
    kdch1=\E[3~, kf1=\E[11~, kf10=\E[21~, kf11=\E[23~, 
    kf12=\E[24~, kf13=\E[25~, kf14=\E[26~, kf15=\E[28~, 
    kf16=\E[29~, kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, 
    kf2=\E[12~, kf20=\E[34~, kf3=\E[13~, kf4=\E[14~, 
    kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, 
    kfnd=\E[1~, kich1=\E[2~, kmous=\E[M, knp=\E[6~, kpp=\E[5~, 
    kslt=\E[4~, rc=\E8, rev=\E[7m\E[34m, ri=\EM, rmacs=^O, 
    rmcup=\E[2J\E[?47l\E8, rmir=\E[4l, rmkx=\E[?1l\E>, 
    rmso=\E[m, rmul=\E[m, 
    rs2=\E7\E[r\E8\E[m\E[?7h\E[?1;3;4;6l\E[4l\E>, sc=\E7, 
    sgr0=\E[m, smacs=^N, smcup=\E7\E[?47h, smir=\E[4h, 
    smkx=\E[?1h\E=, smso=\E[1;30m\E[47m, smul=\E[32m, 
    tbc=\E[3g, tsl=\E]0;, u6=\E[%i%d;%dR, u7=\E[6n, 
    u8=\E[?1;2c, u9=\E[c, 

입니다 그리고 당신의 마음에 드는 쉘의 rc 파일에 별명을 정의

alias man="TERMINFO=~/.terminfo/ LESS=C TERM=mostlike PAGER=less man" 
+0

답변 해 주셔서 감사합니다! –

+1

질문 주셔서 감사합니다. 저는 이것에 대해 몰랐 습니다만, 저는 항상 비밀리에 그것을 원했습니다. – 0x89

+0

링크 전용 답변이 적절하지 않기 때문에 여기에 링크 내용을 추가했습니다. –

1

내 기본 쉘은 bash이므로 염분을 사용하십시오. /etc/profile으로 시작하여 bash 관련 파일의 소스를 확인하십시오. zsh에 대한 논리를 다시 만들어야합니다. 아마도 zsh-lovers 패키지가 도움이 될 수 있습니다. 적어도 의 제목, 유용한 정보 및 zsh에 대한 예제 이 좋습니다. 아치 리눅스에 zsh을에서 나를 위해

관련 문제