Commits

William B  committed 4ef5e96

setup ido mode

  • Participants
  • Parent commits 3ba9265

Comments (0)

Files changed (1)

       (interactive)
       (mapc 'kill-buffer (delq (current-buffer) (buffer-list))))
 
-	  
+      
 ;;
 ;; Required
 ;;
 (require 'htmlize)
 (require 'rainbow-mode)
 (require 'dirtree)
+(require 'ido)
 
 ;;
 ;; Emacs look & feel settings
     (while (and (not (string-match "^*" (buffer-name))) (< i 50))
       (setq i (1+ i)) (previous-buffer) )))
 
-;; Note: change key bindings	  
+;; Note: change key bindings      
 (global-set-key (kbd "<f5>") 'find-file) ; Open file or dir
 (global-set-key (kbd "<f6>") 'kill-this-buffer) ; Close file
 
 
 (setq powerline-arrow-shape 'arrow14)
 (custom-set-faces
-	'(mode-line ((t (:foreground "#f9f9f9" :background "#212121" :box nil))))
-	'(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#383838" :box nil)))))
+    '(mode-line ((t (:foreground "#f9f9f9" :background "#212121" :box nil))))
+    '(mode-line-inactive ((t (:foreground "#f9f9f9" :background "#383838" :box nil)))))
 
 ;;
 ;; Rainbow Mode 
             (set-buffer buffer)
             (when (equal major-mode 'dirtree-mode)
               (setq count (1+ count))
-			  (delete-window (get-buffer-window buffer))
+              (delete-window (get-buffer-window buffer))
               (kill-buffer buffer)))
           (message "Killed %i dirtree buffer(s)." count))))
 
 (setq tree-widget-image-enable nil)
 (global-set-key (kbd "C-x C-d") 'dirtree)
 (global-set-key (kbd "M-q") 'kill-all-dirtree-buffers)
+
+
+;;
+;; Ido
+;;
+
+;; http://www.masteringemacs.org/articles/2010/10/10/introduction-to-ido-mode/
+
+(mapc (lambda (ext)
+        (push ext completion-ignored-extensions))
+      '(
+        ".exe" ".obj" ".class" ".dll" ".pyc" ".bak" ".so" ".swp" ".jar" ".desktop"
+        ".doc" ".xls" ".odt" ".ods" ".ots" ".xlsx"
+        ".zip" ".rar" ".tar.gz" ".tar"
+        ".mp3" ".wav" ".mp4" ".mpeg" ".wmv" ".wma" ".m3u" ".flac" ".mid" ".m4a" "aiff" ".mp2" ".aac" ".ogg" ".mov"
+        ))
+
+(eval-after-load "ido"
+  '(progn
+     (setq ido-ignore-buffers (append
+                               ido-ignore-buffers
+                               '(
+                                 "\\` " "^\*Mess" "^\*Back" ".*Completion" "^\*Ido" "^\*trace"
+                                 "^\*compilation" "^\*GTAGS" "^session\.*" "^\*"
+                                 )))
+     (setq ido-ignore-directories (append
+                                   ido-ignore-directories
+                                   '(
+                                     "\\.git/"
+                                     "\\.svn/"
+                                     "\\.hg/"
+                                     "_region_"
+                                     )))
+     (setq ido-ignore-files (append
+                             ido-ignore-files
+                             '(
+                               "^auto/$"
+                               "_region_"
+                               )))
+    ))
+
+(setq ido-enable-prefix nil                     ; match arbitrary substring
+      ido-enable-flex-matching t                ; fall back to matching sequence of characters
+      ido-case-fold nil                         ; ignore case
+      ido-auto-merge-work-directories-length -1 ; no auto merging work dirs
+      ido-enable-last-directory-history t       ; remember last used dirs
+      ido-create-new-buffer 'always             ; always create new buffer if no match
+      ido-use-filename-at-point nil             ; don't look at text at point as a filename
+      ido-use-url-at-point nil                  ; don't use url at point
+      ido-max-prospects 10                      ; don't overload minibuffer
+      ido-save-directory-list-file (format "%s/%s" user-emacs-directory "autosave/ido.last"))
+
+(setq ido-everywhere t)
+(ido-mode 1)