문제

우분투에서 Zsh의 Bash보다 적은 것보다 비슷한 강조 표시를 어떻게 얻을 수 있습니까?

나는 OS X에서 Ubuntu로 전환했습니다. 내 덜 ZSH에서 예상대로 작동하지 않습니다.

저의 덜 설명서는 다음 코드가 있거나없는 녹색이고 검은 색입니다.

 # 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에서는 작동하지 않습니다.

Ubuntu는 Bash 's Less에서 훌륭한 하이라이트를 가지고 있습니다. 내 설명서에는 코드가없는 Bash에서 색상이 노란색, 녹색 및 검정색으로 표시됩니다. ZSH와 Bash는 모두 동일하게 사용합니다 /usr/bin/less. 이것은 Ubuntu의 Bash에 어딘가에 그것을 구성하는 몇 가지 점 파일이 있음을 시사합니다.

Bash에서 Ubuntu의 덜 하이라이트는 어디에 있습니까?

도움이 되었습니까?

해결책

이것 Archlinux의 Zsh에서 나를 위해 일합니다.

$ 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"

다른 팁

내 기본 쉘입니다 bash 따라서 소금 한 알로 가져 가십시오. 시작합니다 /etc/profile 그리고 그것이 어떻게 bash 특정 파일을 소스하는지보십시오. 해당 논리를 다시 만들어야합니다 zsh. 아마도 zsh-lovers 패키지는 적어도 제목을 도울 수 있습니다 ZSH의 팁, 요령 및 예제 암시 적입니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top