Not selecting what emacs ido is suggesting? [duplicate]

不羁岁月 提交于 2019-11-30 18:41:14

问题


In my current working directory ~/WD there is a abc.txt file. Now I want to make another abc.txt under a sub directory ~/WD/NEW/. As I type C-x C-f and the directory ~/WD/NEW/abc.txt, ido is changing the string into ~/WD/abc.txt, which is not what I want to open. As I try to modify the string back, ido automatically "correct" my input into the wrong string again.

Is there any way to solve this issue?


回答1:


If you're using ido to open a file and you want to "step out" of ido in the middle of completing, you can use C-f. For example:

  1. Ctrl+X Ctrl+F (find-file)

    Find file: ~/{ .emacs.d/ | bin/ | some-file.txt | tmp/ ... }
    
  2. T Enter (narrow options with ido)

    Find file: ~/tmp/{ file1.txt | file2.txt | subdir/ }
    
  3. Ctrl+F ("step out" of ido mode)

    Find file: ~/tmp/
    



回答2:


Another way of avoiding the completion proposed by ido is to validate your entry using C-j instead of RET

Example, in a case where file foobar already exists and you want to create file foo

  1. C-xC-f (find-file)

    Find file: ~/{.emacs.d | ... | foobar} 
    
  2. foo (ido narrows options)

    Find file: ~/foo[foobar]
    
  3. C-j (ido-select-text)

    This creates file foo instead of accepting ido's foobar completion



来源:https://stackoverflow.com/questions/21007014/not-selecting-what-emacs-ido-is-suggesting

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!