Commit da719adf authored by syl20bnr's avatar syl20bnr
Browse files

Add evil-snipe layer variable evil-snipe-enable-alternate-f-and-t-behaviors

parent 07d668b6
......@@ -19,7 +19,29 @@ The package [evil-snipe](https://github.com/hlissner/evil-snipe)
- enables more efficient searches with `f/F/t/T`.
- adds a new, more precise search with `s/S`
### Improved f and t searches
`evil-snipe` changes `s/S` behavior in order to search forward/backwards in the
buffer with two chars.
## Install
### Layer
To use this contribution add it to your `~/.spacemacs`
```elisp
(setq-default dotspacemacs-configuration-layers '(evil-snipe))
```
### Alternate behavior for `f/F` and `t/T`
This alternate behavior is disabled by default, to enable it set the
layer variable `evil-snipe-enable-alternate-f-and-t-behaviors` to `t`:
```elisp
(setq-default dotspacemacs-configuration-layers
'(evil-snipe :variables evil-snipe-enable-alternate-f-and-t-behaviors t ))
```
Instead of repeating searches with `,/;` you can just press `f/t` again to
continue the search (`F/T` to go the opposite direction).
......@@ -40,20 +62,6 @@ If you do not want to replace the regular `f/F/t/T` behavior, just
remove this line from `evil-snipe/packages.el`:
`(evil-snipe-replace-evil)`
### Improved precision search
Now you can press `s/S` to search forward/backwards in the buffer with two chars.
This greatly improves the precision of the search and is much more useful than it
might sound at first.
## Install
To use this contribution add it to your `~/.spacemacs`
```elisp
(setq-default dotspacemacs-configuration-layers '(evil-snipe))
```
## Key bindings
TODO
;;; config.el --- evil-snipe Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
;; Variables
(defvar evil-snipe-enable-alternate-f-and-t-behaviors nil
"if non nil f/F/t/T behaviors are replaced by evil-snipe behavior.")
......@@ -2,24 +2,20 @@
"List of all packages to install and/or initialize. Built-in packages
which require an initialization must be listed explicitly in the list.")
(defvar evil-snipe-excluded-packages '()
"List of packages to exclude.")
(defun evil-snipe/init-evil-snipe ()
(require 'evil-snipe)
(global-evil-snipe-mode t)
;; (evil-snipe-enable-sS)
(evil-snipe-replace-evil)
;; or 'buffer, 'whole-visible or 'whole-buffer
(setq evil-snipe-scope 'whole-buffer)
(setq evil-snipe-repeat-scope 'whole-buffer)
(setq evil-snipe-scope 'whole-buffer
evil-snipe-enable-highlight t
evil-snipe-enable-incremental-highlight t
evil-snipe-enable-half-cursor nil
evil-snipe-show-prompt nil
evil-snipe-smart-case t)
(setq evil-snipe-enable-highlight t)
(setq evil-snipe-enable-incremental-highlight t)
(setq evil-snipe-enable-half-cursor nil)
(setq evil-snipe-show-prompt nil)
(setq evil-snipe-smart-case t)
)
(defvar evil-snipe-excluded-packages '()
"List of packages to exclude.")
(when evil-snipe-enable-alternate-f-and-t-behaviors
(evil-snipe-replace-evil)
(setq evil-snipe-repeat-scope 'whole-buffer)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment