<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Support moving between words in prompt with ctrl+left/right"
   href="https://llvm.org/bugs/show_bug.cgi?id=26165">26165</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Support moving between words in prompt with ctrl+left/right
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>lldb-dev@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ori@avtalion.name
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As mentioned in the following mailing list thread, LLDB should have built-in
support for hotkeys for moving between words, specifically ctrl+left/right.

<a href="http://lists.llvm.org/pipermail/lldb-dev/2016-January/009271.html">http://lists.llvm.org/pipermail/lldb-dev/2016-January/009271.html</a>

This is a very common use-case, particularly useful when editing long lines of
text (such as when typing commands in the Swift REPL, based on LLDB). At the
moment, LLDB spits out ;5C and ;5D which causes even more problems, forcing you
to delete those errant characters.

These are the two bindings I'm suggesting, taken from my ~/.editrc:
 bind "\e[1;5C" em-next-word
 bind "\e[1;5D" ed-prev-word

These specific commands match how both Bash and Emacs handle ctrl+left/right.
Ctrl+right moves the cursor forward, stopping directly after the last letter of
the current word.
Ctrl+left moves the cursor back to the first letter of the closest word.

Vi's behavior is a bit different, always moving forward/back to the start of a
word. For "vi-mode", these seem to fit:
  bind "\e[1;5C" vi-next-word
  bind "\e[1;5D" vi-prev-word

(ed-prev-word and vi-prev-word call different functions in libedit, with
slightly different code, but behavior seems to be identical.)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>