Add something evil
This commit is contained in:
parent
225b3f0b50
commit
99f8be1b71
|
@ -0,0 +1,90 @@
|
||||||
|
(require 'package)
|
||||||
|
(add-to-list 'package-archives
|
||||||
|
'("melpa" . "http://melpa.milkbox.net/packages/") t)
|
||||||
|
|
||||||
|
;;; from purcell/emacs.d
|
||||||
|
(defun require-package (package &optional min-version no-refresh)
|
||||||
|
"Install given PACKAGE, optionally requiring MIN-VERSION.
|
||||||
|
If NO-REFRESH is non-nil, the available package lists will not be
|
||||||
|
re-downloaded in order to locate PACKAGE."
|
||||||
|
(if (package-installed-p package min-version)
|
||||||
|
t
|
||||||
|
(if (or (assoc package package-archive-contents) no-refresh)
|
||||||
|
(package-install package)
|
||||||
|
(progn
|
||||||
|
(package-refresh-contents)
|
||||||
|
(require-package package min-version t)))))
|
||||||
|
|
||||||
|
(package-initialize)
|
||||||
|
|
||||||
|
(require-package 'evil)
|
||||||
|
|
||||||
|
(setq evil-search-module 'evil-search
|
||||||
|
evil-want-C-u-scroll t
|
||||||
|
evil-want-C-w-in-emacs-state t)
|
||||||
|
|
||||||
|
(require 'evil)
|
||||||
|
(evil-mode t)
|
||||||
|
|
||||||
|
;; Remap org-mode meta keys for convenience
|
||||||
|
(mapcar (lambda (state)
|
||||||
|
(evil-declare-key state org-mode-map
|
||||||
|
(kbd "M-l") 'org-metaright
|
||||||
|
(kbd "M-h") 'org-metaleft
|
||||||
|
(kbd "M-k") 'org-metaup
|
||||||
|
(kbd "M-j") 'org-metadown
|
||||||
|
(kbd "M-L") 'org-shiftmetaright
|
||||||
|
(kbd "M-H") 'org-shiftmetaleft
|
||||||
|
(kbd "M-K") 'org-shiftmetaup
|
||||||
|
(kbd "M-J") 'org-shiftmetadown))
|
||||||
|
'(normal insert))
|
||||||
|
|
||||||
|
(defun my-20-lines-down ()
|
||||||
|
(interactive)
|
||||||
|
(evil-next-line 20))
|
||||||
|
|
||||||
|
(defun my-20-lines-up ()
|
||||||
|
(interactive)
|
||||||
|
(evil-previous-line 20))
|
||||||
|
|
||||||
|
(define-key evil-normal-state-map "H" 'my-20-lines-down)
|
||||||
|
(define-key evil-normal-state-map "T" 'my-20-lines-up)
|
||||||
|
|
||||||
|
(define-key evil-visual-state-map "d" 'evil-backward-char)
|
||||||
|
(define-key evil-visual-state-map "h" 'evil-next-line)
|
||||||
|
(define-key evil-visual-state-map "t" 'evil-previous-line)
|
||||||
|
(define-key evil-visual-state-map "n" 'evil-forward-char)
|
||||||
|
(define-key evil-normal-state-map "j" 'kill-line)
|
||||||
|
|
||||||
|
(define-key evil-normal-state-map "H" 'my-20-lines-down)
|
||||||
|
(define-key evil-normal-state-map "T" 'my-20-lines-up)
|
||||||
|
|
||||||
|
(define-key evil-normal-state-map "d" 'evil-backward-char)
|
||||||
|
(define-key evil-normal-state-map "h" 'evil-next-line)
|
||||||
|
(define-key evil-normal-state-map "t" 'evil-previous-line)
|
||||||
|
(define-key evil-normal-state-map "n" 'evil-forward-char)
|
||||||
|
(define-key evil-normal-state-map "j" 'kill-line)
|
||||||
|
(define-key evil-normal-state-map "l" 'evil-next-match)
|
||||||
|
(define-key evil-normal-state-map "L" 'evil-previous-match)
|
||||||
|
(define-key evil-normal-state-map "-" 'evil-end-of-line)
|
||||||
|
(define-key evil-normal-state-map "_" 'evil-first-non-blank)
|
||||||
|
|
||||||
|
(custom-set-variables
|
||||||
|
;; custom-set-variables was added by Custom.
|
||||||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
;; Your init file should contain only one such instance.
|
||||||
|
;; If there is more than one, they won't work right.
|
||||||
|
'(display-battery-mode t)
|
||||||
|
'(scroll-bar-mode nil)
|
||||||
|
'(tool-bar-mode nil))
|
||||||
|
(custom-set-faces
|
||||||
|
;; custom-set-faces was added by Custom.
|
||||||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
;; Your init file should contain only one such instance.
|
||||||
|
;; If there is more than one, they won't work right.
|
||||||
|
)
|
||||||
|
|
||||||
|
(global-set-key "\C-cl" 'org-store-link)
|
||||||
|
(global-set-key "\C-cc" 'org-capture)
|
||||||
|
(global-set-key "\C-ca" 'org-agenda)
|
||||||
|
(global-set-key "\C-cb" 'org-iswitchb)
|
3
setup.sh
3
setup.sh
|
@ -139,6 +139,9 @@ cat "$DOTFILES"/files/tmux.sh > "$HOME"/bin/tmux.sh
|
||||||
mkdir -p "$HOME"/.irssi
|
mkdir -p "$HOME"/.irssi
|
||||||
<"$DOTFILES"/files/irssiconfig sed -e "s/%PASSWORD%/$IRCPASS/" | sed -e "s/%NICK%/$IRCNICK/" | sed -e "s/%SERVER%/$IRCSERVER/" | sed -e "s/%PORT%/$IRCPORT/" > "$HOME"/.irssi/config
|
<"$DOTFILES"/files/irssiconfig sed -e "s/%PASSWORD%/$IRCPASS/" | sed -e "s/%NICK%/$IRCNICK/" | sed -e "s/%SERVER%/$IRCSERVER/" | sed -e "s/%PORT%/$IRCPORT/" > "$HOME"/.irssi/config
|
||||||
|
|
||||||
|
mkdir -p "$HOME"/.emacs.d
|
||||||
|
cat "$DOTFILES"/files/init.el > "$HOME"/.emacs.d/init.el
|
||||||
|
|
||||||
if [[ ! -L "$HOME"/bin/setup.sh ]]; then
|
if [[ ! -L "$HOME"/bin/setup.sh ]]; then
|
||||||
ln -s "$DOTFILES"/setup.sh "$HOME"/bin
|
ln -s "$DOTFILES"/setup.sh "$HOME"/bin
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue