diff options
author | Thanos Apollo <[email protected]> | 2023-06-03 13:28:17 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-06-03 13:28:17 +0300 |
commit | 68502a4590d20b37c1869337a54b85cf68f2d849 (patch) | |
tree | 99901b5db1badb6329de03f664b4cc48862a82a1 /emacs.org | |
parent | e2594565e6afb2be24315543b7aac2e62aeca388 (diff) |
emacs: remove all use-package
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 153 |
1 files changed, 53 insertions, 100 deletions
@@ -181,39 +181,30 @@ Fonts and basic appearance settings for each device #+end_src ** Ivy #+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) - (setq ivy-use-selectable-prompt t)) + (require 'ivy) + ;; keybindings + (global-set-key (kbd "C-s") 'swiper) + (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-alt-done) + (ivy-rich-mode 1) - (all-the-icons-ivy-rich-mode 1) + (all-the-icons-ivy-rich-mode 1) + + (setq ivy-use-selectable-prompt t) #+end_src ** Helpful #+begin_src emacs-lisp -(use-package helpful - :custom - (counsel-describe-function-function #'helpful-callable) - (counsel-describe-variable-function #'helpful-variable) - :bind - ([remap describe-function] . counsel-describe-function) - ([remap describe-command] . helpful-command) - ([remap describe-variable] . counsel-describe-variable) - ([remap describe-key] . helpful-key)) + (require 'helpful) + (global-set-key (kbd "C-h f") #'helpful-callable) + (global-set-key (kbd "C-h v") #'helpful-variable) + (global-set-key (kbd "C-h k") #'helpful-key) + (global-set-key (kbd "C-h x") #'helpful-command) + + (global-set-key (kbd "C-c C-d") #'helpful-at-point) + (global-set-key (kbd "C-h F") #'helpful-function) + + (setq counsel-describe-function-function #'helpful-callable) + (setq counsel-describe-variable-function #'helpful-variable) #+end_src * Dired ** Functions @@ -593,13 +584,10 @@ Hook with ~dired-mode~ #+end_src ** Settings #+begin_src emacs-lisp -(setq markdown-header-scaling t) - - -(use-package markdown-mode - :ensure t - :mode (".md" . gfm-mode) - :init (setq markdown-command "multimarkdown")) + (require 'markdown-mode) + (setq markdown-header-scaling t) + (add-to-list 'auto-mode-alist '("\\.md\\" . gfm-mode)) + (setq markdown-command "multimarkdown") #+end_src * Programming ** Essentials @@ -607,31 +595,20 @@ Hook with ~dired-mode~ (electric-pair-mode 1) (global-flycheck-mode) - (use-package company - :after lsp-mode - :hook (lsp-mode . company-mode) - :bind (:map company-active-map - ("<tab>" . company-complete-selection)) - (:map lsp-mode-map - ("<tab>" . company-indent-or-complete-common)) - :custom - (company-minimum-prefix-length 1) - (company-idle-delay 0.0)) - - (use-package dap-mode - :custom - (lsp-enable-dap-auto-configure nil) - :config - (dap-ui-mode 1)) - - (use-package company-box - :hook (company-mode . company-box-mode)) + (require 'company) + (add-hook 'after-init-hook 'global-company-mode) + (define-key company-active-map (kbd "TAB") 'company-indent-or-complete-common) + (company--idle-delay 0.0) + + (require 'company-box) + (add-hook 'company-mode 'company-box-mode) + + (require 'dap-mode) + (dap-ui-mode) #+end_src *** Magit #+begin_src emacs-lisp -(use-package magit - :custom - (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)) + (require 'magit) #+end_src ** Emacs lisp #+begin_src emacs-lisp @@ -651,57 +628,33 @@ Hook with ~dired-mode~ #+end_src ** LSP #+begin_src emacs-lisp -(defun thanos/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 . thanos/lsp-mode-setup) - :init - (setq lsp-keymap-prefix "C-c l") ;; Or 'C-l', 's-l' - :config + (defun thanos/lsp-mode-setup () + (setq lsp-headerline-breadcrumb-segments '(path-up-to-project file symbols)) + (lsp-headerline-breadcrumb-mode)) + + (require 'lsp-mode) + (add-hook 'lsp-mode #'thanos/lsp-mode-setup) + (setq lsp-keymap-prefix "C-c l") (lsp-enable-which-key-integration t) - (setq lsp-pyls-server-command "~/.local/bin/pylsp")) -(use-package lsp-ui - :hook (lsp-mode . lsp-ui-mode) - :custom - (lsp-ui-doc-position 'bottom)) + (require 'lsp-ui) + (add-hook 'lsp-mode 'lsp-ui-mode) + (setq lsp-ui-doc-position 'bottom) #+end_src ** Python #+begin_src emacs-lisp - (use-package python-mode - :ensure t - :mode ".py" - :hook (python-mode . lsp-deferred) - :custom - (dap-python-debugger 'debugpy) - :config - (require 'dap-python)) - - (use-package pyvenv - :config - (pyvenv-mode 1)) + ;; set pylsp with lsp-mode + (setq lsp-pyls-server-command "~/.local/bin/pylsp") + + (require 'python-mode) + (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) + (add-hook 'python-mode 'lsp-deferred) + (require 'dap-python-debugger) #+end_src ** JSON #+begin_src emacs-lisp -(use-package json-mode - :mode ".json" - :hook (json-mode . lsp-deferred)) -#+end_src -** Javascript -#+begin_src emacs-lisp -(use-package rjsx-mode - :mode ".js" - :hook (rjsx-mode . lsp-deferred) - :config - (defadvice js-jsx-indent-line (after js-jsx-indent-line-after-hack activate) - "Workaround sgml-mode and follow airbnb component style." - (save-excursion - (beginning-of-line) - (if (looking-at-p "^ +\/?> *$") - (delete-char sgml-basic-offset))))) + (require 'json-mode) + (add-to-list 'auto-mode-alist '("\\.json'" . json-mode)) #+end_src * Elfeed ** Feeds |