How to customize the look of currently selected(highlighted) completion in zsh?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
1












Main question



I would like to add powerline characters at the start and at the end of the selected completion, like this:




  1. Started the completion menu by inserting c and pressing the TAB key.


  2. Moved right in the completion menu by pressing the right arrow key.


  3. Moved down in the completion menu by pressing the down arrow key.

Is there any way to make zsh look/behave like in the pictures?



Note



Added powerline triangle + blank character at the beginning and blank character + powerline triangle at the end should somehow be accounted when columns are created to keep the alignment correct.



Bonus



Add 2 blanks at the beginning of every completion in the list, so that when the completion is selected it doesn't look like the text was moved to the right.

( This issue can be seen by comparing the completion with and without the selection. )




Alternative question



In case that previously explained behavior is impossible to get without changing the zsh source code, is it at least possible to add powerline triangle only at the end of the selected completion?




My unsuccessful attempts



  • I have tried using the lc, rc, and ec variables in the list-colors style but that didn't help:

    1. Completion list was badly aligned and it created all kinds of visual problems.

    2. Symbols were inserted in all elements of the completion list, not just the selected one.


  • I have also tried using the ma variable, but I couldn't properly insert a character at the beginning:

    1. The variable expects only a number that represents a color and it is probably wrapped in some escape sequences, so the output did not look as expected.







share|improve this question























    up vote
    3
    down vote

    favorite
    1












    Main question



    I would like to add powerline characters at the start and at the end of the selected completion, like this:




    1. Started the completion menu by inserting c and pressing the TAB key.


    2. Moved right in the completion menu by pressing the right arrow key.


    3. Moved down in the completion menu by pressing the down arrow key.

    Is there any way to make zsh look/behave like in the pictures?



    Note



    Added powerline triangle + blank character at the beginning and blank character + powerline triangle at the end should somehow be accounted when columns are created to keep the alignment correct.



    Bonus



    Add 2 blanks at the beginning of every completion in the list, so that when the completion is selected it doesn't look like the text was moved to the right.

    ( This issue can be seen by comparing the completion with and without the selection. )




    Alternative question



    In case that previously explained behavior is impossible to get without changing the zsh source code, is it at least possible to add powerline triangle only at the end of the selected completion?




    My unsuccessful attempts



    • I have tried using the lc, rc, and ec variables in the list-colors style but that didn't help:

      1. Completion list was badly aligned and it created all kinds of visual problems.

      2. Symbols were inserted in all elements of the completion list, not just the selected one.


    • I have also tried using the ma variable, but I couldn't properly insert a character at the beginning:

      1. The variable expects only a number that represents a color and it is probably wrapped in some escape sequences, so the output did not look as expected.







    share|improve this question





















      up vote
      3
      down vote

      favorite
      1









      up vote
      3
      down vote

      favorite
      1






      1





      Main question



      I would like to add powerline characters at the start and at the end of the selected completion, like this:




      1. Started the completion menu by inserting c and pressing the TAB key.


      2. Moved right in the completion menu by pressing the right arrow key.


      3. Moved down in the completion menu by pressing the down arrow key.

      Is there any way to make zsh look/behave like in the pictures?



      Note



      Added powerline triangle + blank character at the beginning and blank character + powerline triangle at the end should somehow be accounted when columns are created to keep the alignment correct.



      Bonus



      Add 2 blanks at the beginning of every completion in the list, so that when the completion is selected it doesn't look like the text was moved to the right.

      ( This issue can be seen by comparing the completion with and without the selection. )




      Alternative question



      In case that previously explained behavior is impossible to get without changing the zsh source code, is it at least possible to add powerline triangle only at the end of the selected completion?




      My unsuccessful attempts



      • I have tried using the lc, rc, and ec variables in the list-colors style but that didn't help:

        1. Completion list was badly aligned and it created all kinds of visual problems.

        2. Symbols were inserted in all elements of the completion list, not just the selected one.


      • I have also tried using the ma variable, but I couldn't properly insert a character at the beginning:

        1. The variable expects only a number that represents a color and it is probably wrapped in some escape sequences, so the output did not look as expected.







      share|improve this question











      Main question



      I would like to add powerline characters at the start and at the end of the selected completion, like this:




      1. Started the completion menu by inserting c and pressing the TAB key.


      2. Moved right in the completion menu by pressing the right arrow key.


      3. Moved down in the completion menu by pressing the down arrow key.

      Is there any way to make zsh look/behave like in the pictures?



      Note



      Added powerline triangle + blank character at the beginning and blank character + powerline triangle at the end should somehow be accounted when columns are created to keep the alignment correct.



      Bonus



      Add 2 blanks at the beginning of every completion in the list, so that when the completion is selected it doesn't look like the text was moved to the right.

      ( This issue can be seen by comparing the completion with and without the selection. )




      Alternative question



      In case that previously explained behavior is impossible to get without changing the zsh source code, is it at least possible to add powerline triangle only at the end of the selected completion?




      My unsuccessful attempts



      • I have tried using the lc, rc, and ec variables in the list-colors style but that didn't help:

        1. Completion list was badly aligned and it created all kinds of visual problems.

        2. Symbols were inserted in all elements of the completion list, not just the selected one.


      • I have also tried using the ma variable, but I couldn't properly insert a character at the beginning:

        1. The variable expects only a number that represents a color and it is probably wrapped in some escape sequences, so the output did not look as expected.









      share|improve this question










      share|improve this question




      share|improve this question









      asked May 9 at 19:44









      Iskustvo

      667118




      667118

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442850%2fhow-to-customize-the-look-of-currently-selectedhighlighted-completion-in-zsh%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442850%2fhow-to-customize-the-look-of-currently-selectedhighlighted-completion-in-zsh%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)