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
(leaf doom-nano-modeline | |
:doc "Nice look modeline based on N Λ N O" | |
:url "https://github.com/ronisbr/doom-nano-modeline" | |
:el-get "ronisbr/doom-nano-modeline" | |
:hook (emacs-startup-hook . doom-nano-modeline-mode) | |
:custom-face | |
(region . '((t (:background "#6272a4" :extend t)))) | |
(hl-line . '((t (:background "#3B4252" :extend t)))) | |
(doom-nano-modeline-active-face . '((t (:foreground "#f8f8f2" :background "#44475a" :weight bold)))) | |
(doom-nano-modeline-evil-emacs-state-face . '((t (:foreground "#f4a460" :background "#6272a4" :weight bold)))) |
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
(defun kill-word-at-point () | |
"Kill word at cursor position." | |
(interactive) | |
(let ((char (char-to-string (char-after (point))))) | |
(cond | |
((string= " " char) (delete-horizontal-space)) | |
((string-match "[\t\n -@\[-`{-~],.、。" char) (kill-word 1)) | |
(t (forward-char) (backward-word) (kill-word 1))))) |
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
(defun backward-kill-word-or-region () | |
"If the region is active, `clipboard-kill-region'. | |
If the region is inactive, `backward-kill-word'." | |
(interactive) | |
(if (use-region-p) | |
(clipboard-kill-region (region-beginning) (region-end)) | |
(backward-kill-word 1))) |
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
(defun my:kill-whole-line-or-region () | |
"If the region is active, to kill region. | |
If the region is inactive, to kill whole line." | |
(interactive) | |
(if (use-region-p) | |
(clipboard-kill-region (region-beginning) (region-end)) | |
(kill-whole-line))) |
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
(leaf doom-nano-modeline | |
:el-get "ronisbr/doom-nano-modeline" | |
:config | |
(doom-nano-modeline-mode 1) | |
(global-hide-mode-line-mode 1) | |
:custom-face | |
(hl-line . '((t (:background "#3B4252" :extend t )))) | |
(doom-nano-modeline-active-face . '((t (:inherit mode-line :background "#44475a" :weight bold)))) | |
(doom-nano-modeline-cursor-position-face . '((t (:inherit font-lock-comment-face :background "#44475a")))) | |
(doom-nano-modeline-evil-emacs-state-face . '((t (:inherit (font-lock-builtin-face bold) :background "#6272a4")))) |
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
(leaf doom-modeline | |
:ensure t | |
:hook (after-init-hook . doom-modeline-mode) | |
:custom | |
`((doom-modeline-icon . t) | |
(doom-modeline-major-mode-icon . nil) | |
(doom-modeline-minor-modes . nil)) | |
:config | |
(line-number-mode 0) | |
(column-number-mode 0) |
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
;; Automatically open root permission file with sudo | |
(leaf *sudo-open | |
:doc "https://ameblo.jp/grennarthmurmand1976/entry-12151018656.html" | |
:config | |
(defun file-root-p (filename) | |
"Return t if file FILENAME created by root." | |
(eq 0 (nth 2 (file-attributes filename)))) | |
(defadvice find-file (around my:find-file activate) | |
"Open FILENAME using tramp's sudo method if it's root permission." |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;; Scroll deactive window | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
(leaf cus-scrroll-window-key-bind | |
:bind (("C-<next>" . my:scroll-other-window) | |
("C-<prior>" . my:scroll-other-window-down)) | |
:init | |
(defun my:scroll-other-window () | |
"If there are two windows, `scroll-other-window'." | |
(interactive) |
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
;; Sequential-command | |
(leaf sequential-command | |
:el-get HKey/sequential-command | |
:config | |
(leaf sequential-command-config | |
:hook (emacs-startup-hook . sequential-command-setup-keys))) |
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
;; Customized functions | |
(defun evil-swap-key (map key1 key2) | |
"Swap KEY1 and KEY2 in MAP." | |
(let ((def1 (lookup-key map key1)) | |
(def2 (lookup-key map key2))) | |
(define-key map key1 def2) | |
(define-key map key2 def1))) | |
(evil-swap-key evil-motion-state-map "j" "gj") | |
(evil-swap-key evil-motion-state-map "k" "gk") |