-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
潘俊杰
committed
Nov 29, 2018
1 parent
5ec0697
commit 5103d74
Showing
70 changed files
with
2,417 additions
and
2,808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,5 @@ site-lisp/package/ | |
/plantuml.jar | ||
/magithub | ||
/.cache | ||
/.youdao | ||
/*.keyfreq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(use-package avy) | ||
|
||
(use-package link-hint | ||
:after avy | ||
:commands link-hint-open-link | ||
:init | ||
(jester/with-leader | ||
"l o" 'link-hint-open-link) | ||
(general-define-key | ||
:states '(motion) | ||
"o" 'link-hint-open-link)) | ||
|
||
(provide 'init-avy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
(setq initial-scratch-message "") | ||
|
||
(jester/with-leader | ||
"b b" 'switch-to-buffer | ||
"b i" 'ibuffer | ||
"b k" 'jester/kill-this-buffer | ||
"b r" 'rename-buffer | ||
"b h" (lambda! (switch-to-buffer (help-buffer))) | ||
"b m" (lambda! (switch-to-buffer (messages-buffer))) | ||
"b s" 'jester/switch-to-scratch-buffer | ||
"<return>" 'jester/alternate-buffer) | ||
|
||
(general-define-key | ||
:keymaps 'ibuffer-mode-map | ||
"j" 'ibuffer-forward-line | ||
"k" 'ibuffer-backward-line) | ||
|
||
;;---------------------------------------------------------------------------- | ||
;; switch *scratch* buffer | ||
;;---------------------------------------------------------------------------- | ||
(defun jester/switch-to-scratch-buffer (&optional arg) | ||
"Switch to the `*scratch*' buffer, creating it first if needed. | ||
if prefix argument ARG is given, switch to it in an other, possibly new window." | ||
(interactive "P") | ||
(let ((exists (get-buffer "*scratch*"))) | ||
(if arg | ||
(switch-to-buffer-other-window (get-buffer-create "*scratch*")) | ||
(switch-to-buffer (get-buffer-create "*scratch*"))) | ||
(when (and (not exists) | ||
(not (eq major-mode dotspacemacs-scratch-mode)) | ||
(fboundp dotspacemacs-scratch-mode)) | ||
(funcall dotspacemacs-scratch-mode)))) | ||
|
||
;;---------------------------------------------------------------------------- | ||
;; switch to last buffer | ||
;;---------------------------------------------------------------------------- | ||
(defun jester/alternate-buffer (&optional window) | ||
"Switch back and forth between current and last buffer in the | ||
current window." | ||
(interactive) | ||
(let ((current-buffer (window-buffer window))) | ||
;; if no window is found in the windows history, `switch-to-buffer' will | ||
;; default to calling `other-buffer'. | ||
(switch-to-buffer | ||
(cl-find-if (lambda (buffer) | ||
(not (eq buffer current-buffer))) | ||
(mapcar #'car (window-prev-buffers window)))))) | ||
|
||
;;---------------------------------------------------------------------------- | ||
;; setup ibuffer. | ||
;;---------------------------------------------------------------------------- | ||
(defun ibuffer-set-up-preferred-filters () | ||
(unless (eq ibuffer-sorting-mode 'filename/process) | ||
(ibuffer-do-sort-by-filename/process))) | ||
|
||
(add-hook 'ibuffer-hook 'ibuffer-set-up-preferred-filters) | ||
|
||
(after-load 'ibuffer | ||
;; Use human readable Size column instead of original one | ||
(define-ibuffer-column size-h | ||
(:name "Size" :inline t) | ||
(cond | ||
((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0))) | ||
((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0))) | ||
(t (format "%8d" (buffer-size)))))) | ||
|
||
;;---------------------------------------------------------------------------- | ||
;; kill this buffer. | ||
;;---------------------------------------------------------------------------- | ||
(defun jester/kill-this-buffer (&optional arg) | ||
"Kill the current buffer. | ||
If the universal prefix argument is used then kill also the window." | ||
(interactive) | ||
(if (window-minibuffer-p) | ||
(abort-recursive-edit) | ||
(kill-buffer))) | ||
|
||
(provide 'init-buffer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
(use-package coffee-mode | ||
:mode "\\.coffee\\'" | ||
:config | ||
;; the syntax table is totally sh*t | ||
(modify-syntax-entry ?* "." coffee-mode-syntax-table) | ||
(modify-syntax-entry ?+ "." coffee-mode-syntax-table) | ||
(modify-syntax-entry ?- "." coffee-mode-syntax-table) | ||
(modify-syntax-entry ?_ "w" coffee-mode-syntax-table) | ||
(jester/with-major-leader 'coffee-mode | ||
"d" 'coffee-mark-defun)) | ||
|
||
(provide 'init-coffeescript) |
Oops, something went wrong.