How to configure emacs to have it complete the path automatically like vim?

前端 未结 3 1089
长情又很酷
长情又很酷 2020-12-21 10:54

I have been a vim user for several years. Now I want to try Emacs for some reasons. I use the path auto-completition functionality(C-c, C-f) a lot in Vim. So I am wondering

3条回答
  •  轮回少年
    2020-12-21 11:41

    Notes of interest:

    ;;  For the real hippie-expand enthusiast: A macro that makes it
    ;;  possible to use many functions like hippie-expand, but with
    ;;  different try-functions-lists.
    ;;  Usage is for example:
    ;;    (fset 'my-complete-file (make-hippie-expand-function
    ;;                             '(try-complete-file-name-partially
    ;;                               try-complete-file-name)))
    ;;    (fset 'my-complete-line (make-hippie-expand-function
    ;;                             '(try-expand-line
    ;;                               try-expand-line-all-buffers)))
    ;;
    ;;;###autoload
    (defmacro make-hippie-expand-function (try-list &optional verbose)
      "Construct a function similar to `hippie-expand'.
    Make it use the expansion functions in TRY-LIST.  An optional second
    argument VERBOSE non-nil makes the function verbose."
    

    You could presumably utilise this to generate a list of possible filename completions.

    edit: Actually, that doesn't get you any further than the other question. I'll keep it here, as it seems a slightly nicer approach.

提交回复
热议问题