2016-05-16 02:00:44 +00:00
|
|
|
|
;;; config.el --- Ivy Layer Configuration File for Spacemacs
|
2016-01-13 05:07:04 +00:00
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2016-01-13 05:07:04 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
2018-01-11 03:19:04 +00:00
|
|
|
|
|
2016-05-16 02:00:44 +00:00
|
|
|
|
|
2018-01-11 03:19:04 +00:00
|
|
|
|
;; Layer Variables
|
|
|
|
|
|
|
|
|
|
(defvar ivy-enable-advanced-buffer-information nil
|
|
|
|
|
"If non-nil, enable `ivy-rich' which adds information on buffers.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Private Variables
|
2016-05-16 02:00:44 +00:00
|
|
|
|
|
|
|
|
|
(defvar spacemacs--counsel-commands
|
2017-03-08 13:51:19 +00:00
|
|
|
|
'(;; --line-number forces line numbers (disabled by default on windows)
|
|
|
|
|
;; no --vimgrep because it adds column numbers that wgrep can't handle
|
2017-04-13 03:35:23 +00:00
|
|
|
|
;; see https://github.com/syl20bnr/spacemacs/pull/8065
|
2017-05-06 23:33:09 +00:00
|
|
|
|
("rg" . "rg --smart-case --no-heading --color never --line-number --max-columns 150 %s %S .")
|
2016-10-20 00:29:06 +00:00
|
|
|
|
("ag" . "ag --nocolor --nogroup %s %S .")
|
2016-05-16 02:00:44 +00:00
|
|
|
|
("pt" . "pt -e --nocolor --nogroup %s %S .")
|
|
|
|
|
("ack" . "ack --nocolor --nogroup %s %S .")
|
|
|
|
|
("grep" . "grep -nrP %s %S ."))
|
2017-03-08 13:51:19 +00:00
|
|
|
|
"An alist of search commands and their corresponding commands
|
2016-05-16 02:00:44 +00:00
|
|
|
|
with options to run in the shell.")
|
|
|
|
|
|
|
|
|
|
(defvar spacemacs--counsel-search-max-path-length 30
|
|
|
|
|
"Truncate the current path in counsel search if it is longer
|
|
|
|
|
than this amount.")
|
|
|
|
|
|
|
|
|
|
(defvar spacemacs--counsel-initial-number-cand 100)
|
2016-05-18 00:08:08 +00:00
|
|
|
|
|
|
|
|
|
(defvar spacemacs--ivy-file-actions
|
|
|
|
|
'(("f" find-file-other-frame "other frame")
|
2017-05-31 23:36:41 +00:00
|
|
|
|
("j" find-file-other-window "other window")
|
2016-05-18 00:08:08 +00:00
|
|
|
|
("v" spacemacs/find-file-vsplit "in vertical split")
|
|
|
|
|
("s" spacemacs/find-file-split "in horizontal split")
|
2016-06-01 08:27:34 +00:00
|
|
|
|
("l" find-file-literally "literally")
|
2016-12-22 13:52:25 +00:00
|
|
|
|
("d" spacemacs/delete-file-confirm "delete file")
|
2016-06-01 08:27:34 +00:00
|
|
|
|
("r" spacemacs/rename-file "rename file"))
|
2016-05-18 00:08:08 +00:00
|
|
|
|
"Default ivy actions for files.")
|
|
|
|
|
|
|
|
|
|
(defvar spacemacs--ivy-grep-actions
|
2018-01-07 02:38:13 +00:00
|
|
|
|
(cl-loop for j in spacemacs--ivy-file-actions
|
2016-05-18 00:08:08 +00:00
|
|
|
|
for key = (nth 0 j)
|
|
|
|
|
for func = (nth 1 j)
|
|
|
|
|
for desc = (nth 2 j)
|
|
|
|
|
collect `(,key (lambda (x) (spacemacs//counsel-with-git-grep (quote ,func) x)) ,desc))
|
|
|
|
|
"Default ivy actions to be used with git-grep output.")
|