|
|
@@ -26,6 +26,8 @@ |
|
|
|
;; make directories |
|
|
|
(unless (file-directory-p (expand-file-name user-emacs-directory)) |
|
|
|
(make-directory (expand-file-name user-emacs-directory))) |
|
|
|
(unless (file-directory-p (expand-file-name "info" user-emacs-directory)) |
|
|
|
(make-directory (expand-file-name "info" user-emacs-directory))) |
|
|
|
|
|
|
|
;; Custom file |
|
|
|
(setq custom-file (expand-file-name "custom.el" user-emacs-directory)) |
|
|
@@ -528,10 +530,11 @@ Otherwize hook it." |
|
|
|
(define-key ctl-x-map (kbd "C-x") 'my-exchange-point-and-mark) |
|
|
|
(when (fboundp 'counsel-mark-ring) |
|
|
|
(define-key ctl-x-map "m" 'counsel-mark-ring)) |
|
|
|
(with-eval-after-load 'ivy |
|
|
|
(defvar ivy-sort-functions-alist) |
|
|
|
(add-to-list 'ivy-sort-functions-alist |
|
|
|
'(counsel-mark-ring))) |
|
|
|
;; ? |
|
|
|
;; (with-eval-after-load 'ivy |
|
|
|
;; (defvar ivy-sort-functions-alist) |
|
|
|
;; (add-to-list 'ivy-sort-functions-alist |
|
|
|
;; '(counsel-mark-ring))) |
|
|
|
(run-with-idle-timer 10 t |
|
|
|
(lambda () |
|
|
|
(push-mark) |
|
|
@@ -792,6 +795,10 @@ THEM are function and its args." |
|
|
|
(with-eval-after-load 'minibuffer-line |
|
|
|
(set-face-underline 'minibuffer-line nil) |
|
|
|
) |
|
|
|
(with-eval-after-load 'git-ps1-mode |
|
|
|
(defvar git-ps1-mode-ps1-file-candidates-list) |
|
|
|
(add-to-list 'git-ps1-mode-ps1-file-candidates-list |
|
|
|
"/Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh")) |
|
|
|
(when (fboundp 'minibuffer-line-mode) |
|
|
|
(set-variable 'minibuffer-line-refresh-interval |
|
|
|
25) |
|
|
@@ -991,7 +998,7 @@ THEM are function and its args." |
|
|
|
(defvar whitespace-mode) |
|
|
|
(add-to-list 'whitespace-display-mappings |
|
|
|
;; We need t since last one takes precedence |
|
|
|
`(tab-mark ?\t ,(vconcat "|>\t")) t) |
|
|
|
`(tab-mark ?\t ,(vconcat ">\t")) t) |
|
|
|
;; (add-to-list 'whitespace-display-mappings |
|
|
|
;; `(newline-mark ?\n ,(vconcat "$\n"))) |
|
|
|
(set-variable 'whitespace-style '(face |
|
|
@@ -1246,6 +1253,7 @@ THEM are function and its args." |
|
|
|
:history 'my-cousel-recently-history |
|
|
|
:preselect default-directory |
|
|
|
:action (lambda (x) (find-file x)) |
|
|
|
:sort nil |
|
|
|
:caller 'my-counsel-recently)) |
|
|
|
|
|
|
|
(define-key ctl-x-map (kbd "C-r") 'my-counsel-recently) |
|
|
@@ -1487,14 +1495,7 @@ ORIG-FUNC is the target function, and ARGS is the argument when it is called." |
|
|
|
(set-variable 'remember-notes-initial-major-mode |
|
|
|
'change-log-mode) |
|
|
|
|
|
|
|
(declare-function global-magit-file-mode "magit-files") |
|
|
|
(with-eval-after-load 'magit-files |
|
|
|
;; `global-magit-file-mode' is enabled by default and this mode overwrites |
|
|
|
;; existing keybindings. |
|
|
|
;; Apparently it is a HARMFUL behavior and it is really awful that I have |
|
|
|
;; to disable thie mode here, but do anyway. |
|
|
|
;; See also https://github.com/magit/magit/issues/3517 |
|
|
|
(global-magit-file-mode -1)) |
|
|
|
(set-variable 'magit-define-global-key-bindings nil) |
|
|
|
|
|
|
|
(with-eval-after-load 'magit-section |
|
|
|
(set-face-background 'magit-section-highlight |
|
|
@@ -1837,9 +1838,12 @@ ORIG-FUNC is the target function, and ARGS is the argument when it is called." |
|
|
|
|
|
|
|
(with-eval-after-load 'sql |
|
|
|
(require 'sql-indent nil t)) |
|
|
|
(set-variable 'sqlind-basic-offset 4) |
|
|
|
(add-to-list 'auto-mode-alist |
|
|
|
'("\\.hql\\'" . sql-mode)) |
|
|
|
|
|
|
|
(set-variable 'sqlformat-command 'pgformatter) |
|
|
|
|
|
|
|
(when (fboundp 'git-command) |
|
|
|
(define-key ctl-x-map "g" 'git-command)) |
|
|
|
|
|
|
@@ -2091,6 +2095,13 @@ ORIG-FUNC is the target function, and ARGS is the argument when it is called." |
|
|
|
(add-to-list 'interpreter-mode-alist |
|
|
|
'("node" . js-mode)) |
|
|
|
|
|
|
|
(add-hook 'js-mode-hook |
|
|
|
(lambda () |
|
|
|
;; Stop current line highlighting |
|
|
|
(set-variable 'js-indent-level 2 t) |
|
|
|
)) |
|
|
|
|
|
|
|
|
|
|
|
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) |
|
|
|
|
|
|
|
(with-eval-after-load 'uniquify |
|
|
@@ -2176,7 +2187,7 @@ ORIG-FUNC is the target function, and ARGS is the argument when it is called." |
|
|
|
(add-hook 'go-mode-hook |
|
|
|
(lambda() |
|
|
|
(defvar go-mode-map) |
|
|
|
(add-hook 'before-save-hook' 'gofmt-before-save nil t) |
|
|
|
(add-hook 'before-save-hook 'gofmt-before-save nil t) |
|
|
|
(define-key go-mode-map (kbd "M-.") 'godef-jump))) |
|
|
|
|
|
|
|
(when (fboundp 'k8s-mode) |
|
|
@@ -2568,6 +2579,13 @@ ARG is num to show, or defaults to 7." |
|
|
|
(define-key ctl-x-map "T" 'git-worktree) |
|
|
|
(define-key ctl-x-map "W" 'git-walktree) |
|
|
|
|
|
|
|
(defun mkcdd () |
|
|
|
"Make date directory and open it with dired." |
|
|
|
(interactive) |
|
|
|
(let ((d (format-time-string "%Y%m%d-%H%M%S"))) |
|
|
|
(make-directory d) |
|
|
|
(find-file d))) |
|
|
|
|
|
|
|
(when (fboundp 'browse-url-default-macosx-browser) |
|
|
|
(defalias 'browse-osx 'browse-url-default-macosx-browser)) |
|
|
|
|
|
|
@@ -2718,10 +2736,11 @@ and search from projectile root (if projectile is available)." |
|
|
|
(error "No symbol at point"))) |
|
|
|
(error "My-Rgrep: Command for rgrep not found")))) |
|
|
|
(if (eval-and-compile (require 'projectile nil t)) |
|
|
|
(projectile-with-default-dir (or (projectile-project-root) |
|
|
|
default-directory) |
|
|
|
(compilation-start command-args |
|
|
|
'grep-mode)) |
|
|
|
(with-temp-buffer |
|
|
|
(cd (or (projectile-project-root) |
|
|
|
default-directory)) |
|
|
|
(compilation-start command-args |
|
|
|
'grep-mode)) |
|
|
|
(compilation-start command-args |
|
|
|
'grep-mode)))) |
|
|
|
|
|
|
@@ -2965,6 +2984,7 @@ ARGS are not used." |
|
|
|
url)) |
|
|
|
|
|
|
|
|
|
|
|
(declare-function vterm "vterm") |
|
|
|
;; 前の実行結果を残したまま次のコマンドを実行する方法はあるだろうか |
|
|
|
(defun my-vterm-cmd (command) |
|
|
|
"Start arbitrary command in vterm buffer." |
|
|
@@ -2997,8 +3017,9 @@ ARGS are not used." |
|
|
|
;; (set-variable 'eglot-extend-to-xref t)) |
|
|
|
|
|
|
|
(set-variable 'lsp-python-ms-auto-install-server t) |
|
|
|
(set-variable 'lsp-python-ms-parse-dot-env-enabled t) |
|
|
|
(set-variable 'lsp-python-ms-python-executable-cmd "python3") |
|
|
|
(add-hook 'python-mode-hook #'my-lsp-python-setup) |
|
|
|
;; (add-hook 'python-mode-hook #'my-lsp-python-setup) |
|
|
|
|
|
|
|
(defun my-lsp-python-setup () |
|
|
|
"Setup python ms." |
|
|
@@ -3006,6 +3027,16 @@ ARGS are not used." |
|
|
|
(require 'lsp-python-ms nil t)) |
|
|
|
(lsp))) |
|
|
|
|
|
|
|
(set-variable 'awk-preview-default-program |
|
|
|
"# C-c C-l: Update preview C-c C-c: Commit and exit |
|
|
|
# C-c C-r: Resest to original C-c C-k: Abort |
|
|
|
{ |
|
|
|
# Replace string |
|
|
|
# gsub(BEFORE, AFTER, $0) |
|
|
|
print NR, $0 |
|
|
|
} |
|
|
|
") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(message "Emacs started at %s" |
|
|
|