Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.95 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.95 KB

ido-complete-space-or-hyphen

Make ido completes like built-in M-x does, useful when use smex or use ido to complete other hyphen separated choices

Get started

  • Get ido-complete-space-or-hyphen

  • Add following lines to your .emacs file:

    (require 'ido-complete-space-or-hyphen)
    ;; Enable ido-mode
    (ido-mode 1)
    ;; Enable this mode
    (ido-complete-space-or-hyphen-mode 1)
    

Then try examples below, or use it with smex.

Example

(ido-completing-read "test: " '("ido-foo-bar" "ido-space" "ido-test"))

| Key Sequence | Result |
|--------------+--------|
| i            | "i"    |
| SPACE        | "ido-" |

(ido-completing-read "test: " '("ido foo-bar" "ido space" "ido test"))

| Key Sequence | Result |
|--------------+--------|
| i            | "i"    |
| SPACE        | "ido " |

(ido-completing-read "test: " '("ido-foo-bar" "ido-space" "idotest"))

| Key Sequence | Result |
|--------------+--------|
| i            | "i"    |
| SPACE        | "ido"  |
| SPACE        | "ido-" |

When HYPHEN can be inserted and SPACE cannot, insert HYPHEN when user enter SPACE.

(ido-completing-read "test: " '("ido-foo-bar" "ido-space" "ido test"))

| Key Sequence | Result                           |
|--------------+----------------------------------+
| i            | "i"                              |
| SPACE        | "ido"                            |
| SPACE        | "ido"  Completion popup is shown |
| SPACE        | "ido "                           |

If both HYPHEN and SPACE can be inserted, SPACE first brings the completion popup window, if user types SPACE again, then SPACE itself is inserted.