6 Commits

Author SHA1 Message Date
  10sr a134954d93
Update 2 years ago
  10sr 366f3d03ed
Add eglot configs 2 years ago
  10sr a7eb47fb03
Add a idle timer 2 years ago
  10sr c85188644e
Add comment 2 years ago
  10sr 8190de074d
Add config 2 years ago
  10sr 8d3aeedc27
Fix compile warnings 2 years ago
1 changed files with 46 additions and 5 deletions
Split View
  1. +46
    -5
      emacs.el

+ 46
- 5
emacs.el View File

@@ -450,10 +450,15 @@ Otherwize hook it."

;; (global-set-key (kbd "C-s") 'isearch-forward-regexp)
;; (global-set-key (kbd "C-r") 'isearch-backward-regexp)
(if (eval-and-compile (require 'prescient nil t))
(set-variable 'search-default-mode
(lambda (orig lax)
(prescient-fuzzy-regexp orig)))
(if (locate-library "prescient")
(progn
(declare-function prescient-fuzzy-regexp
"prescient")
(autoload 'prescient-fuzzy-regexp
"prescient")
(set-variable 'search-default-mode
(lambda (orig lax)
(prescient-fuzzy-regexp orig))))
(set-variable 'search-default-mode t))
;; (set-variable 'search-whitespace-regexp ".*?")
;; (set-variable 'isearch-regexp-lax-whitespace t)
@@ -1234,7 +1239,7 @@ THEM are function and its args."
(when (and (require 'recently nil t)
(fboundp 'ivy-read))
(defun my-counsel-recently ()
"Consel `recently'."
"Counsel `recently'."
(interactive)
(ivy-read "Recently: " (mapcar 'abbreviate-file-name (recently-list))
:require-match t
@@ -1741,6 +1746,17 @@ ORIG-FUNC is the target function, and ARGS is the argument when it is called."
;; Used in interactive function of pydoc
(with-venv-advice-add 'pydoc-all-modules)))

(defvar my-cousel-pydoc-history nil "History of `my-counsel-pydoc'.")
(defun my-counsel-pydoc ()
"Counsel `pydoc'."
(interactive)
(eval-and-compile (require 'pydoc nil t))
(ivy-read "Recently: " (pydoc-all-modules)
:require-match t
:history 'my-cousel-pydoc-history
:action (lambda (x) (pydoc x))
:caller 'my-counsel-pydoc))

(set-variable 'flycheck-python-mypy-config '("mypy.ini" ".mypy.ini" "setup.cfg"))
(set-variable 'flycheck-flake8rc '("setup.cfg" "tox.ini" ".flake8rc"))

@@ -3111,6 +3127,7 @@ ARGS are not used."
url))


;; 前の実行結果を残したまま次のコマンドを実行する方法はあるだろうか
(defun my-vterm-cmd (command)
"Start arbitrary command in vterm buffer."
(interactive "sCommand: ")
@@ -3125,8 +3142,32 @@ ARGS are not used."
;; (setq vterm-kill-buffer-on-exit nil)
;; ;; (setq vterm-term-environment-variable "screen-256color")


;; これいつ動くの?
;; 自動で project を switch させる方法はある?
(add-hook 'projectile-after-switch-project-hook
(lambda ()
(message "Projecttile switched to: %s"
(projectile-project-root))))
(when (fboundp 'projectile-mode)
(projectile-mode 1))

(with-eval-after-load 'eglot
(when (fboundp 'with-venv-advice-add)
(with-venv-advice-add 'eglot--executable-find))
(set-variable 'eldoc-echo-area-use-multiline-p nil)
(set-variable 'eglot-extend-to-xref t))



(message "Emacs started at %s"
(current-time-string))
(run-with-idle-timer (* 3 60 60) ;; 3 hours
t
(lambda ()
(message "Emacs does nothing for 3 hours: %s"
(current-time-string))))


;; https://emacs-jp.github.io/tips/startup-optimization
;; Restore to original value


Loading…
Cancel
Save