diff options
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r-- | .config/emacs/init.el | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 011d660..c77dbe8 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el | |||
@@ -4,7 +4,7 @@ | |||
4 | (message "Emacs loaded in %s with %d garbage collections." | 4 | (message "Emacs loaded in %s with %d garbage collections." |
5 | (format "%.2f seconds" | 5 | (format "%.2f seconds" |
6 | (float-time | 6 | (float-time |
7 | (time-subtract after-init-time before-init-time))) | 7 | (time-subtract after-init-time before-init-time))) |
8 | gcs-done)) | 8 | gcs-done)) |
9 | 9 | ||
10 | (defun jd/startup () | 10 | (defun jd/startup () |
@@ -27,23 +27,23 @@ | |||
27 | (setq user-emacs-directory "~/.cache/emacs") | 27 | (setq user-emacs-directory "~/.cache/emacs") |
28 | 28 | ||
29 | (require 'package) | 29 | (require 'package) |
30 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") | 30 | (setq package-archives '(("melpa" . "https://melpa.org/packages/") |
31 | ("org" . "https://orgmode.org/elpa/") | 31 | ("org" . "https://orgmode.org/elpa/") |
32 | ("gnu-devel" . "https://elpa.gnu.org/devel/") | 32 | ("gnu-devel" . "https://elpa.gnu.org/devel/") |
33 | ("elpa" . "https://elpa.gnu.org/packages/"))) | 33 | ("elpa" . "https://elpa.gnu.org/packages/"))) |
34 | (package-initialize) | 34 | (package-initialize) |
35 | 35 | ||
36 | (unless package-archive-contents | 36 | (unless package-archive-contents |
37 | (package-refresh-contents)) | 37 | (package-refresh-contents)) |
38 | 38 | ||
39 | (unless (package-installed-p 'use-package) | 39 | (unless (package-installed-p 'use-package) |
40 | (package-install 'use-package)) | 40 | (package-install 'use-package)) |
41 | 41 | ||
42 | ;; (setq use-package-always-ensure t) | 42 | (setq use-package-always-ensure t) |
43 | 43 | ||
44 | (add-to-list 'load-path ".config/emacs/jd/") | 44 | (add-to-list 'load-path ".config/emacs/jd/") |
45 | 45 | ||
46 | (require 'use-package) | 46 | (require 'use-package) |
47 | 47 | ||
48 | (use-package general | 48 | (use-package general |
49 | :config | 49 | :config |
@@ -135,7 +135,7 @@ | |||
135 | ("C-k" . ivy-previous-line) | 135 | ("C-k" . ivy-previous-line) |
136 | ("C-j" . ivy-next-line) | 136 | ("C-j" . ivy-next-line) |
137 | :map ivy-switch-buffer-map | 137 | :map ivy-switch-buffer-map |
138 | ("C-k" . ivy-previous-line)) | 138 | ("C-k" . ivy-previous-line)) |
139 | :config | 139 | :config |
140 | (ivy-mode 1)) | 140 | (ivy-mode 1)) |
141 | 141 | ||
@@ -405,10 +405,10 @@ | |||
405 | :after lsp) | 405 | :after lsp) |
406 | 406 | ||
407 | (defun jd/python-mode-setup () | 407 | (defun jd/python-mode-setup () |
408 | (let ((project-venv-path (concat (projectile-project-root) "venv/"))) | 408 | (let ((project-venv-path (concat (projectile-project-root) "venv/"))) |
409 | (when (projectile--directory-p project-venv-path) | 409 | (when (projectile--directory-p project-venv-path) |
410 | (pyvenv-activate project-venv-path) | 410 | (pyvenv-activate project-venv-path) |
411 | (pyvenv-mode)))) | 411 | (pyvenv-mode)))) |
412 | 412 | ||
413 | ;; (use-package python-mode ;;TODO: find alternative | 413 | ;; (use-package python-mode ;;TODO: find alternative |
414 | ;; :hook (python-mode . lsp-deferred) | 414 | ;; :hook (python-mode . lsp-deferred) |
@@ -416,8 +416,8 @@ | |||
416 | ;; :config | 416 | ;; :config |
417 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) | 417 | ;; (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))) |
418 | 418 | ||
419 | (use-package pyvenv | 419 | (use-package pyvenv |
420 | :after python-mode) | 420 | :after python-mode) |
421 | 421 | ||
422 | (use-package typescript-mode | 422 | (use-package typescript-mode |
423 | :mode ("\\.ts\\'") | 423 | :mode ("\\.ts\\'") |
@@ -465,9 +465,9 @@ | |||
465 | :after lsp-mode | 465 | :after lsp-mode |
466 | :hook (lsp-mode . company-mode) | 466 | :hook (lsp-mode . company-mode) |
467 | :bind (:map company-active-map | 467 | :bind (:map company-active-map |
468 | ("<tab>" . company-complete-selection)) | 468 | ("<tab>" . company-complete-selection)) |
469 | (:map lsp-mode-map | 469 | (:map lsp-mode-map |
470 | ("<tab>" . company-indent-or-complete-common)) | 470 | ("<tab>" . company-indent-or-complete-common)) |
471 | :custom | 471 | :custom |
472 | (company-minimum-prefix-length 1) | 472 | (company-minimum-prefix-length 1) |
473 | (company-idle-delay 0.0) | 473 | (company-idle-delay 0.0) |
@@ -551,8 +551,6 @@ | |||
551 | 551 | ||
552 | (use-package dired-ranger) | 552 | (use-package dired-ranger) |
553 | 553 | ||
554 | (use-package dired-single) | ||
555 | |||
556 | (use-package dired | 554 | (use-package dired |
557 | :ensure nil | 555 | :ensure nil |
558 | :commands (dired dired-jump) | 556 | :commands (dired dired-jump) |
@@ -565,7 +563,7 @@ | |||
565 | "h" 'dired-up-directory | 563 | "h" 'dired-up-directory |
566 | "t" 'dired-create-empty-file | 564 | "t" 'dired-create-empty-file |
567 | "T" 'dired-toggle-marks | 565 | "T" 'dired-toggle-marks |
568 | "l" 'dired-single-buffer) | 566 | "l" 'dired-find-file) |
569 | (setq dired-kill-when-opening-new-dired-buffer t) | 567 | (setq dired-kill-when-opening-new-dired-buffer t) |
570 | (evil-define-key 'normal dired-mode-map (kbd "q") 'kill-current-buffer)) | 568 | (evil-define-key 'normal dired-mode-map (kbd "q") 'kill-current-buffer)) |
571 | 569 | ||