diff options
author | ThanosApollo <[email protected]> | 2022-10-29 09:41:47 +0300 |
---|---|---|
committer | ThanosApollo <[email protected]> | 2022-10-29 09:41:47 +0300 |
commit | dd2d4fac17865d1078a333e35fdd79af26ffdfb9 (patch) | |
tree | f4d72b9c6b7941c66ed4150b3771c495f30f7c09 | |
parent | c6f2ecac931d9a3d0643dc3ae6c830f1b8b533e9 (diff) |
Add pylsp path, update leader-keys
-rw-r--r-- | .emacs.d/emacs.org | 176 | ||||
-rw-r--r-- | .emacs.d/init.el | 43 |
2 files changed, 120 insertions, 99 deletions
diff --git a/.emacs.d/emacs.org b/.emacs.d/emacs.org index faacb83..c11cc42 100644 --- a/.emacs.d/emacs.org +++ b/.emacs.d/emacs.org @@ -2,7 +2,6 @@ #+PROPERTY: header-args:emacs-lisp :tangle ./init.el * Package System Setup #+begin_src emacs-lisp -;;Test 3 (require 'package) (setq package-archives '(("melpa" . "https://melpa.org/packages/") @@ -95,34 +94,35 @@ I use *JetBrains Mono*, *Arial* and *Cantarell* for this configuration, which wi #+end_src ** Ivy and counsel #+begin_src emacs-lisp -(use-package ivy - :diminish - :bind (("C-s" . swiper) - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) - :config - (ivy-mode 1)) + (use-package ivy + :diminish + :bind (("C-s" . swiper) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-switch-buffer-kill) + :map ivy-reverse-i-search-map + ("C-k" . ivy-previous-line) + ("C-d" . ivy-reverse-i-search-kill)) + :config + (ivy-mode 1)) -(use-package ivy-rich - :init - (ivy-rich-mode 1)) + (use-package ivy-rich + :init + (ivy-rich-mode 1)) -(use-package counsel - :bind (("C-M-j" . 'counsel-switch-buffer) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history)) - :config - (counsel-mode 1)) + (use-package counsel + :bind (("C-M-j" . 'counsel-switch-buffer) + :map minibuffer-local-map + ("C-r" . 'counsel-minibuffer-history) + ("C-'" . 'counsel-find-file)) + :config + (counsel-mode 1)) #+end_src ** Helpful Help Commands #+begin_src emacs-lisp @@ -147,50 +147,53 @@ I use *JetBrains Mono*, *Arial* and *Cantarell* for this configuration, which wi ** The Essentials I use [[https://evil.readthedocs.io/en/latest/index.html][evil-mode]] for a vim-like experience, with *general.el* and *evil-collection* for better integration #+begin_src emacs-lisp - ;; Make ESC quit prompts - (global-set-key (kbd "<escape>") 'keyboard-escape-quit) - (use-package general - :config - (general-create-definer apollo/leader-keys - :keymaps '(normal insert visual emacs) - :prefix "SPC" - :global-prefix "C-SPC") - - (apollo/leader-keys - "t" '(:ignore t :which-key "toggles") - "tt" '(counsel-load-theme :which-key "choose theme"))) - - - (use-package evil - :init - (setq evil-want-integration t) - (setq evil-want-keybinding nil) - (setq evil-want-C-u-scroll t) - (setq evil-want-C-i-jump nil) - ;;:hook (evil-mode . apollo/evil-hook) - :config - (evil-mode 1) - (define-key evil-insert-state-map (kbd "C-f") 'evil-normal-state) - - (evil-global-set-key 'motion "j" 'evil-next-visual-line) - (evil-global-set-key 'motion "k" 'evil-previous-visual-line) - - (evil-set-initial-state 'messages-buffer-mode 'normal) - ;; (evil-set-initial-state 'dashboard-mode 'normal) - (evil-define-key 'normal dired-mode-map - (kbd "h") 'dired-up-directory - (kbd "l") 'dired-find-file - (kbd "m") 'dired-mark - (kbd "R") 'dired-do-rename - (kbd "D") 'dired-do-delete) - ) - - (use-package evil-collection - :after evil - :config - (evil-collection-init)) - ;;Ibuffer - (global-set-key (kbd "C-x C-b") 'ibuffer) + ;; Make ESC quit prompts + (global-set-key (kbd "<escape>") 'keyboard-escape-quit) + (use-package general + :config + (general-create-definer apollo/leader-keys + :keymaps '(normal insert visual emacs) + :prefix "SPC" + :global-prefix "C-SPC") + + (apollo/leader-keys + "t" '(:ignore t :which-key "toggles") + "tt" '(counsel-load-theme :which-key "choose theme"))) + + + (use-package evil + :init + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-want-C-u-scroll t) + (setq evil-want-C-i-jump nil) + ;;:hook (evil-mode . apollo/evil-hook) + :config + (evil-mode 1) + (define-key evil-insert-state-map (kbd "C-f") 'evil-normal-state) + + (evil-global-set-key 'motion "j" 'evil-next-visual-line) + (evil-global-set-key 'motion "k" 'evil-previous-visual-line) + + (evil-set-initial-state 'messages-buffer-mode 'normal) + (evil-set-initial-state 'dashboard-mode 'normal) + (evil-define-key 'normal dired-mode-map + (kbd "h") 'dired-up-directory + (kbd "l") 'dired-find-file + (kbd "m") 'dired-mark + (kbd "R") 'dired-do-rename + (kbd "D") 'dired-do-delete) + ) + + (use-package evil-collection + :after evil + :config + (evil-collection-init)) + ;;Ibuffer + (global-set-key (kbd "C-x C-b") 'ibuffer) + ;;Counsel + (global-set-key (kbd "M-;") 'counsel-M-x) + (global-set-key (kbd "C-;") 'counsel-find-file) #+end_src ** apollo/leader-keys *** Magit @@ -199,6 +202,11 @@ I use [[https://evil.readthedocs.io/en/latest/index.html][evil-mode]] for a vim- "g" '(:ignore t :which-key "Git") "gs" '(magit-status :which-key "status")) #+end_src +*** Counsel +#+begin_src emacs-lisp + (apollo/leader-keys + "f" '(counsel-find-file :which-key "Find File")) +#+end_src * Org mode ** Basic configuration #+begin_src emacs-lisp @@ -350,17 +358,18 @@ Add some text *** IDE Features | lsp-mode **** lsp-mode #+begin_src emacs-lisp -(defun apollo/lsp-mode-setup () - (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) - (lsp-headerline-breadcrumb-mode)) - -(use-package lsp-mode - :commands (lsp lsp-deferred) - :hook (lsp-mode . apollo/lsp-mode-setup) - :init - (setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' - :config - (lsp-enable-which-key-integration t)) + (defun apollo/lsp-mode-setup () + (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) + (lsp-headerline-breadcrumb-mode)) + + (use-package lsp-mode + :commands (lsp lsp-deferred) + :hook (lsp-mode . apollo/lsp-mode-setup) + :init + (setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' + :config + (lsp-enable-which-key-integration t) + ) #+end_src **** lsp-ui #+begin_src emacs-lisp @@ -418,6 +427,8 @@ If pyls and pylsp are not on path, do *M-x setenv RET PATH* in emacs, and then s (use-package pyvenv :config (pyvenv-mode 1)) +;;set PATH of pyls +(setq lsp-pyls-server-command "/home/apollo/.local/bin/pylsp") #+end_src *** Company mode #+begin_src emacs-lisp @@ -442,3 +453,4 @@ The best Git interface :custom (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) #+end_src + diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 1bdee80..508c8e6 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -1,4 +1,3 @@ -;;Test 3 (require 'package) (setq package-archives '(("melpa" . "https://melpa.org/packages/") @@ -78,18 +77,18 @@ (use-package ivy :diminish :bind (("C-s" . swiper) - :map ivy-minibuffer-map - ("TAB" . ivy-alt-done) - ("C-l" . ivy-alt-done) - ("C-j" . ivy-next-line) - ("C-k" . ivy-previous-line) - :map ivy-switch-buffer-map - ("C-k" . ivy-previous-line) - ("C-l" . ivy-done) - ("C-d" . ivy-switch-buffer-kill) - :map ivy-reverse-i-search-map - ("C-k" . ivy-previous-line) - ("C-d" . ivy-reverse-i-search-kill)) + :map ivy-minibuffer-map + ("TAB" . ivy-alt-done) + ("C-l" . ivy-alt-done) + ("C-j" . ivy-next-line) + ("C-k" . ivy-previous-line) + :map ivy-switch-buffer-map + ("C-k" . ivy-previous-line) + ("C-l" . ivy-done) + ("C-d" . ivy-switch-buffer-kill) + :map ivy-reverse-i-search-map + ("C-k" . ivy-previous-line) + ("C-d" . ivy-reverse-i-search-kill)) :config (ivy-mode 1)) @@ -99,8 +98,9 @@ (use-package counsel :bind (("C-M-j" . 'counsel-switch-buffer) - :map minibuffer-local-map - ("C-r" . 'counsel-minibuffer-history)) + :map minibuffer-local-map + ("C-r" . 'counsel-minibuffer-history) + ("C-'" . 'counsel-find-file)) :config (counsel-mode 1)) @@ -147,7 +147,7 @@ (evil-global-set-key 'motion "k" 'evil-previous-visual-line) (evil-set-initial-state 'messages-buffer-mode 'normal) - ;; (evil-set-initial-state 'dashboard-mode 'normal) + (evil-set-initial-state 'dashboard-mode 'normal) (evil-define-key 'normal dired-mode-map (kbd "h") 'dired-up-directory (kbd "l") 'dired-find-file @@ -162,11 +162,17 @@ (evil-collection-init)) ;;Ibuffer (global-set-key (kbd "C-x C-b") 'ibuffer) +;;Counsel +(global-set-key (kbd "M-;") 'counsel-M-x) +(global-set-key (kbd "C-;") 'counsel-find-file) (apollo/leader-keys "g" '(:ignore t :which-key "Git") "gs" '(magit-status :which-key "status")) +(apollo/leader-keys +"f" '(counsel-find-file :which-key "Find File")) + (defun apollo/org-mode-setup () (setq evil-auto-indent nil) (apollo/org-theme-dracula)) @@ -303,7 +309,8 @@ :init (setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' :config - (lsp-enable-which-key-integration t)) + (lsp-enable-which-key-integration t) + ) (use-package lsp-ui :hook (lsp-mode . lsp-ui-mode) @@ -351,6 +358,8 @@ (use-package pyvenv :config (pyvenv-mode 1)) +;;set PATH of pyls +(setq lsp-pyls-server-command "/home/apollo/.local/bin/pylsp") (use-package company :after lsp-mode |