summaryrefslogtreecommitdiff
path: root/.emacs.d/emacs.org
diff options
context:
space:
mode:
Diffstat (limited to '.emacs.d/emacs.org')
-rw-r--r--.emacs.d/emacs.org176
1 files changed, 94 insertions, 82 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
+