diff --git a/config/fg42.user.el b/config/fg42.user.el index cb3d322..49ee07d 100644 --- a/config/fg42.user.el +++ b/config/fg42.user.el @@ -13,7 +13,7 @@ ;; ABILITIES ;; ========= ;; Disable abilities which you don't want. -(disable 'rbenv 'helm 'spell 'linum 'smart-mode-line) +(disable 'rbenv 'helm 'spell 'linum 'smart-mode-line 'desktop-mode 'ido) ;; EXTENSIONS ;; ========== diff --git a/lib/extensions/editor.el b/lib/extensions/editor.el index 9bc2ced..dbe96b6 100644 --- a/lib/extensions/editor.el +++ b/lib/extensions/editor.el @@ -35,7 +35,8 @@ (depends-on 'tramp)) (with-ability ivy - (depends-on 'ivy)) + (depends-on 'ivy) + (depends-on 'counsel)) (with-ability ido (depends-on 'ido) diff --git a/lib/extensions/editor/buffers.el b/lib/extensions/editor/buffers.el index 1dbcc68..13ca909 100644 --- a/lib/extensions/editor/buffers.el +++ b/lib/extensions/editor/buffers.el @@ -11,13 +11,20 @@ Repeated invocations toggle between the two most recently open buffers." (switch-to-buffer (other-buffer (current-buffer) 1))) (defun buffer-match-p (buf) + "If BUF name match the favorite buffer regexp." (string-match-p *favorite-buffer* (buffer-name buf))) +(defun switch-and-bury (buf) + "Switch to given BUF and bury it as well." + (interactive) + (bury-buffer buf) + (switch-to-buffer buf)) + (defun switch-to-buffer-by-regex () "Switch to buffer which the name match the *favorite-buffer* regex." (interactive) (if *favorite-buffer* - (switch-to-buffer + (switch-and-bury (car (remove-if-not #'buffer-match-p (buffer-list)))) (eshell))) diff --git a/lib/extensions/editor/init.el b/lib/extensions/editor/init.el index 05bfe94..4f66ae0 100644 --- a/lib/extensions/editor/init.el +++ b/lib/extensions/editor/init.el @@ -79,12 +79,12 @@ (spaceline-compile "ati" '( - ((ati-modified ati-window-numbering ati-buffer-size lxdrive) :face highlight-face :skip-alternate t) - ((ati-projectile ati-mode-icon ati-buffer-id) :face default-face) - ((ati-process ati-position ati-region-info) :face highlight-face :separator " | ") - ((ati-vc-icon ati-flycheck-status ati-(point)ackage-updates purpose) :separator " · " :face other-face) - ;; ((minor-modes) :face default-face) - ) + ((ati-modified ati-window-numbering ati-buffer-size lxdrive) :face highlight-face :skip-alternate t) + ((ati-projectile ati-mode-icon ati-buffer-id) :face default-face) + ((ati-process ati-position ati-region-info) :face highlight-face :separator " | ") + ((ati-vc-icon ati-flycheck-status ati-(point)ackage-updates purpose) :separator " · " :face other-face) + ;; ((minor-modes) :face default-face) + ) '(((ati-time) :separator " | " :face default-face))) @@ -242,9 +242,16 @@ (ability ivy () "Completion using ivy." (require 'ivy) + (require 'counsel) (ivy-mode 1) - (setq ivy-use-virtual-buffers t) + (setq enable-recursive-minibuffers t) + (global-set-key (kbd "M-x") 'counsel-M-x) + (global-set-key (kbd "C-x C-f") 'counsel-find-file) + (global-set-key (kbd " f") 'counsel-describe-function) + (global-set-key (kbd " v") 'counsel-describe-variable) + (global-set-key (kbd " l") 'counsel-find-library) + (global-set-key (kbd "C-c C-r") 'ivy-resume)) ;; Swiper ---------------------------------------------------