Skip to content

Commit

Permalink
Merge branch 'develop' (v0.13.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Nov 18, 2014
2 parents 70a71dd + bf5075c commit b9aab14
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .spacemacs.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
dotspacemacs-configuration-layers '()
;; If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only)
dotspacemacs-fullscreen-at-startup nil
;; If non nil smooth scrolling (native-scrolling) is enabled. Smooth scrolling
;; overrides the default behavior of Emacs which recenters the point when
;; it reaches the top or bottom of the screen
dotspacemacs-smooth-scrolling t
;; If non nil pressing 'jk' in insert state, ido or helm will activate the
;; evil leader.
dotspacemacs-feature-toggle-leader-on-jk nil
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ for contribution guidelines_
- [Executing Vim, Emacs and shell commands](#executing-vim-emacs-and-shell-commands)
- [Navigating](#navigating)
- [Point/Cursor](#pointcursor)
- [Smooth scrolling](#smooth-scrolling)
- [Experimental insert state feature](#experimental-insert-state-feature)
- [Vim motions with ace-jump mode](#vim-motions-with-ace-jump-mode)
- [Window manipulation](#window-manipulation)
Expand Down Expand Up @@ -831,6 +832,18 @@ Key Binding | Description
`<SPC> j l` | go to the end of line (and set a mark at the previous location in the line)
`<SPC> z z` | lock the cursor at the center of the screen

##### Smooth scrolling

[smooth-scrolling]() prevent the point to jump when it reaches the top or
bottom of the screen. It is enabled by default.

On Windows, you may want to disable it. To disable the smooth scrolling set
the `dotspacemacs-smooth-scrolling` variable in your `~/.spacemacs` to `nil`:

```elisp
(setq-default dotspacemacs-smooth-scrolling t)
```

##### Experimental insert state feature

If `dotspacemacs-feature-toggle-leader-on-jk` is non nil, pressing `jk` while
Expand Down Expand Up @@ -1052,7 +1065,7 @@ Key Binding | Description
Key Binding | Description
--------------|----------------------------------------------------------------
`<SPC> s e` | edit all occurrences of the current symbol
`<SPC> t s` | toggle the auto highlighting
`<SPC> t h` | toggle the auto highlighting

Navigation between the highlighted symbols can be done with the commands:

Expand Down
17 changes: 11 additions & 6 deletions core/contribsys.el
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ Paths must have a trailing slash (ie. `~/.mycontribs/')"
(defvar dotspacemacs-fullscreen-at-startup nil
"If non nil the frame is maximized when Emacs starts up (Emacs 24.4+ only).")

(defvar dotspacemacs-smooth-scrolling t
"If non nil smooth scrolling (native-scrolling) is enabled. Smooth scrolling
overrides the default behavior of Emacs which recenters the point when
it reaches the top or bottom of the screen.")

(defvar dotspacemacs-feature-toggle-leader-on-jk nil
"If non nil pressing 'jk' in insert state, ido or helm will activate the
evil leader.")
Expand Down Expand Up @@ -246,13 +251,13 @@ spacemacs-all-post-extensions "
(setq installed-count 0)
(dolist (pkg not-installed)
(setq installed-count (1+ installed-count))
(spacemacs/replace-last-line-of-buffer
(format "--> installing %s:%s... [%s/%s]"
(ht-get spacemacs-all-packages pkg)
pkg
installed-count
not-installed-count) t)
(when (not (package-installed-p pkg))
(spacemacs/replace-last-line-of-buffer
(format "--> installing %s:%s... [%s/%s]"
(ht-get spacemacs-all-packages pkg)
pkg
installed-count
not-installed-count) t)
(package-install pkg))
(redisplay))
(spacemacs/append-to-buffer "\n")))))
Expand Down
2 changes: 0 additions & 2 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
(contribsys/declare-user-configuration-layers)
;; heavy lifting, load all packages and extensions
(contribsys/load-layers)
;; Temporary fix until automatic orphan packages deletion is ported to
;; Emacs 24.4
(contribsys/delete-orphan-packages)
;; Ultimate configuration decisions are given to the user who can defined
;; them in his/her ~/.spacemacs file
Expand Down
63 changes: 32 additions & 31 deletions spacemacs/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
scss-mode
smartparens
smeargle
smooth-scrolling
string-edit
subword
tagedit
Expand Down Expand Up @@ -282,23 +283,10 @@ determine the state to enable when escaping from the insert state.")
;; persistent search highlight like Vim hisearch
(use-package evil-search-highlight-persist
:init
(global-evil-search-highlight-persist)
;; temporary hack, waiting for the maintainer to merge the fix
(require 'highlight)
(defun evil-search-highlight-persist-remove-all ()
(interactive)
(hlt-unhighlight-region-in-buffers (list (current-buffer))))
(defun evil-search-highlight-persist-mark ()
(let ((hlt-use-overlays-flag t)
(hlt-last-face 'evil-search-highlight-persist-highlight-face))
(hlt-highlight-regexp-region-in-buffers
(car-safe (if isearch-regexp
regexp-search-ring
search-ring))
(list (current-buffer)))))
;; end of temporary hack
(evil-leader/set-key "sc" 'evil-search-highlight-persist-remove-all)
(evil-ex-define-cmd "noh" 'evil-search-highlight-persist-remove-all))
(progn
(global-evil-search-highlight-persist)
(evil-leader/set-key "sc" 'evil-search-highlight-persist-remove-all)
(evil-ex-define-cmd "noh" 'evil-search-highlight-persist-remove-all)))
;; add a lisp state
(use-package evil-jumper
:init
Expand Down Expand Up @@ -683,7 +671,7 @@ determine the state to enable when escaping from the insert state.")
"srd" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-display) nil))
"srf" (lambda () (interactive) (eval '(ahs-change-range 'ahs-range-beginning-of-defun) nil))
"sR" (lambda () (interactive) (eval '(ahs-change-range ahs-default-range) nil))
"ts" 'auto-highlight-symbol-mode))
"th" 'auto-highlight-symbol-mode))
(spacemacs//hide-lighter auto-highlight-symbol-mode)
;; micro-state to easily jump from a highlighted symbol to the others
(dolist (sym '(ahs-forward
Expand Down Expand Up @@ -1451,19 +1439,16 @@ determine the state to enable when escaping from the insert state.")
(define-key ido-completion-map (kbd "<up>") 'ido-prev-match)
(define-key ido-completion-map (kbd "<down>") 'ido-next-match)
(define-key ido-completion-map (kbd "<left>") 'ido-delete-backward-updir)
(define-key ido-completion-map (kbd "<right>") 'ido-exit-minibuffer)))
:config
(progn
;; experimental: press "jk" to trigger evil-leader with ido-mode specific
;; commands
(when dotspacemacs-feature-toggle-leader-on-jk
(evil-leader/set-key-for-mode 'ido-mode
"b" 'ido-invoke-in-horizontal-split
"t" 'ido-invoke-in-new-frame
"v" 'ido-invoke-in-vertical-split
"x" 'ido-invoke-in-other-window)
(key-chord-define ido-file-completion-map (kbd "jk")
(cdr (assoc 'ido-mode evil-leader--mode-maps)))))))
(define-key ido-completion-map (kbd "<right>") 'ido-exit-minibuffer)
(when dotspacemacs-feature-toggle-leader-on-jk
(evil-leader/set-key-for-mode 'ido-mode
"b" 'ido-invoke-in-horizontal-split
"t" 'ido-invoke-in-new-frame
"v" 'ido-invoke-in-vertical-split
"x" 'ido-invoke-in-other-window)
(key-chord-define ido-completion-map (kbd "jk")
(cdr (assoc 'ido-mode evil-leader--mode-maps)))))
)))

(defun spacemacs/init-js2-mode ()
(use-package js2-mode
Expand Down Expand Up @@ -1820,6 +1805,22 @@ determine the state to enable when escaping from the insert state.")
"gcc" 'smeargle-commits
"gct" 'smeargle)))


(defun spacemacs/init-smooth-scrolling ()
;; this is not a conventional package
;; no require are needed for this package everything is auto-loaded
(if dotspacemacs-smooth-scrolling
(setq scroll-margin 5
scroll-conservatively 9999
scroll-step 1)
;; deactivate the defadvice's
(ad-disable-advice 'previous-line 'after 'smooth-scroll-down)
(ad-activate 'previous-line)
(ad-disable-advice 'next-line 'after 'smooth-scroll-up)
(ad-activate 'next-line)
(ad-disable-advice 'isearch-repeat 'after 'isearch-smooth-scroll)
(ad-activate 'isearch-repeat)))

(defun spacemacs/init-string-edit ()
(use-package string-edit
:defer t
Expand Down

0 comments on commit b9aab14

Please sign in to comment.