Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 2.70 KB | None | 0 0
  1. ;;;;; Ido
  2. (require 'ido)
  3.  
  4. ;; Display things vertically in Ido
  5. (make-local-variable 'ido-decorations)
  6. (setf (nth 2 ido-decorations) "\n")
  7.  
  8. (setq ido-everywhere t
  9.       ido-ignore-buffers
  10.       '("\\` " "^\\*ESS\\*" "^\\*Messages\\*" "^\\*Help\\*" "^\\*Buffer"
  11.         "^\\*.*Completions\\*$" "^\\*Ediff" "^\\*tramp" "^\\*cvs-"
  12.         "_region_" " output\\*$" "^TAGS$" "^\*Ido")
  13.       ido-ignore-extensions t
  14.       ido-use-faces nil
  15.       ido-confirm-unique-completion t
  16.       ido-case-fold t
  17.       ido-enable-tramp-completion nil
  18.       ido-enable-flex-matching t
  19.       ido-use-filename-at-point 'guess
  20.       ido-create-new-buffer 'always
  21.       ido-enable-flex-matching t
  22.       ido-enable-tramp-completion t
  23.       ido-enable-last-directory-history t
  24.       ;; Prevent auto-searches unless called explicitly
  25.       ido-auto-merge-work-directories-length -1
  26.       ido-auto-merge-delay-time 99999)
  27.  
  28. (defun vve-ido-auto-merge ()
  29.   "WE called Ido's auto merge when WE want."
  30.   (interactive)
  31.   (ido-initiate-auto-merge (current-buffer)))
  32.  
  33. (define-key ido-file-dir-completion-map (kbd "C-c C-s") #'vve-ido-auto-merge!)
  34.  
  35. (unless (member "\\`.DS_Store$" ido-ignore-files)
  36.   (push "\\`.DS_Store$" ido-ignore-files)
  37.   (push "Icon\\?$" ido-ignore-files))
  38.  
  39. ;; Stop Ido from suggesting when naming new file
  40. (define-key (cdr ido-minor-mode-map-entry) [remap write-file] nil)
  41.  
  42. ;; (defun vve-ido-M-x ()
  43. ;;   "An Ido version of \\[M-x]."
  44. ;;   (interactive)
  45. ;;   (call-interactively
  46. ;;    (intern
  47. ;;      (ido-completing-read
  48. ;;       "M-x "
  49. ;;       (all-completions "" obarray 'commandp)))))
  50.  
  51. ;; (global-set-key (kbd "M-x") #'vve-ido-M-x)
  52.  
  53. (ido-mode 1)
  54.  
  55. ;;;;; Icomplete
  56. (require 'icomplete)
  57.  
  58. (setq icomplete-separator "\n"
  59.       icomplete-show-matches-on-no-input t
  60.       icomplete-hide-common-prefix nil
  61.       icomplete-in-buffer t
  62.       icomplete-prospects-height 5
  63.       read-file-name-completion-ignore-case t
  64.       read-buffer-completion-ignore-case t
  65.       completion-ignore-case t
  66.       completions-format 'vertical
  67.       completion-cycle-threshold t)
  68.  
  69. (if (> emacs-major-version 26)
  70.     (setq completion-styles
  71.           '(basic flex partial-completion substring)
  72.           completion-category-overrides
  73.           '((file (styles basic flex substring))
  74.             (buffer (styles basic flex substring))))
  75.   (setq completion-styles
  76.         '(basic partial-completion substring)
  77.         completion-category-overrides
  78.         '((file (styles basic substring))
  79.           (buffer (styles basic substring)))))
  80.  
  81. (define-key icomplete-minibuffer-map (kbd "<right>") 'icomplete-forward-completions)
  82. (define-key icomplete-minibuffer-map (kbd "<left>") 'icomplete-backward-completions)
  83.  
  84. (icomplete-mode 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement