summaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/.emacs-config.org
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/.emacs-config.org')
-rw-r--r--emacs/.emacs.d/.emacs-config.org192
1 files changed, 103 insertions, 89 deletions
diff --git a/emacs/.emacs.d/.emacs-config.org b/emacs/.emacs.d/.emacs-config.org
index 817f974..ee30acb 100644
--- a/emacs/.emacs.d/.emacs-config.org
+++ b/emacs/.emacs.d/.emacs-config.org
@@ -103,13 +103,18 @@ Only needed when I need to install a package from Melpa and not GNU Guix
Изначально они отключены, но можно вызвать по клавише F7.
#+BEGIN_SRC emacs-lisp :tangle init.el
(define-key global-map
- (kbd "<f7>") 'global-display-line-numbers-mode)
+ (kbd "<f7>") 'display-line-numbers-mode)
(define-key global-map
(kbd "<f6>") 'whitespace-mode)
#+END_SRC
* Editing
+** Completion styles
+#+begin_src emacs-lisp :tangle init.el
+ (setq completion-styles '(basic partial-completion emacs22 substring))
+#+end_src
+
** Dired
#+BEGIN_SRC emacs-lisp :tangle init.el
;; Show files in KiB
@@ -169,12 +174,14 @@ I use Flymake and Flycheck
** Imenu List
#+begin_src emacs-lisp :tangle init.el
-
- (setq imenu-list-focus-after-activation nil
- imenu-list-auto-resize nil
- imenu-list-mode-line-format '()
- imenu-list-size 0.4)
- (global-set-key (kbd "C-x C-d") #'imenu-list-smart-toggle)
+ (use-package imenu-list
+ :bind
+ ("C-x C-d" . imenu-list-smart-toggle)
+ :config
+ (setq imenu-list-focus-after-activation nil
+ imenu-list-auto-resize nil
+ imenu-list-mode-line-format '()
+ imenu-list-size 0.4))
#+end_src
** Version Control System
@@ -212,13 +219,13 @@ https://www.manueluberti.eu//emacs/2021/11/27/vc/
(use-package avy
:defer t
:bind (("M-s M-s" . avy-goto-char)
- ("M-s s" . avy-goto-char)
- ("M-s g" . avy-goto-line)
- ("M-s l" . avy-goto-char-in-line)
- ("M-s M-l" . avy-goto-char-in-line)
+ ("M-s s" . avy-goto-char)
+ ("M-s g" . avy-goto-line)
+ ("M-s l" . avy-goto-char-in-line)
+ ("M-s M-l" . avy-goto-char-in-line)
- ("M-g g" . avy-goto-line)
- ("M-s M-g" . avy-goto-line)))
+ ("M-g g" . avy-goto-line)
+ ("M-s M-g" . avy-goto-line)))
(use-package link-hint
:defer t
@@ -228,12 +235,17 @@ https://www.manueluberti.eu//emacs/2021/11/27/vc/
(use-package goto-chg
:defer t
:bind (("C-z" . goto-last-change)
- ("M-z" . goto-last-change-reverse)))
+ ("M-z" . goto-last-change-reverse)))
;; Jumps using grep and similar tools
(use-package dumb-jump
:defer t
- :bind (("C-." . dumb-jump-go)))
+ :bind (("M-g o" . dumb-jump-go-other-window)
+ ("M-g j" . dumb-jump-go)
+ ("M-g b" . dumb-jump-back)
+ ("M-g q" . dumb-jump-quick-look)
+ ("M-g x" . dumb-jump-go-prefer-external)
+ ("M-g z" . dumb-jump-go-prefer-external-other-window)))
#+END_SRC
@@ -266,24 +278,32 @@ I use built-in project.el
** Tags
Для прыжков и поиска функций/классов и т.д.
-#+BEGIN_SRC emacs-lisp :tangle nil
- (setq path-to-ctags "~/.guix-profile/bin/ctags")
-
+#+BEGIN_SRC emacs-lisp :tangle init.el
+ (setq path-to-ctags "~/.guix-home/profile/bin/ctags")
+
(defun tags-create (dir-name)
"Create tags file."
(interactive "DDirectory: ")
(shell-command
(format "%s -f TAGS -e -R %s" path-to-ctags
- (directory-file-name dir-name))))
-
+ (directory-file-name dir-name))))
+
(defun tags-create-python (dir-name)
"Create tags with python interpreter"
(interactive "DDirectory: ")
(shell-command
(format "%s -f TAGS -e -R --fields=+l --languages=python --python-kinds=-iv $(python -c \"import os, sys; print(' '.join('{}'.format(d) for d in sys.path if os.path.isdir(d)))\") %s" path-to-ctags
- (directory-file-name dir-name))))
+ (directory-file-name dir-name))))
#+END_SRC
+#+begin_src emacs-lisp :tangle init.el
+ (use-package ggtags
+ :defer t
+ :hook
+ (c-mode . ggtags-mode))
+#+end_src
+
+
** Дебаггер
#+begin_src emacs-lisp :tangle nil
(when (package-loaded? "realgud")
@@ -368,6 +388,10 @@ I use built-in project.el
** Клиент LSP
#+begin_src emacs-lisp :tangle init.el
+ (with-eval-after-load 'eglot
+ (add-to-list 'eglot-server-programs
+ '((php-mode phps-mode php-ts-mode) . ("/home/w96k/projects/phpactor/bin/phpactor" "language-server" "-vvv"))))
+
;; (with-eval-after-load 'eglot
;; (add-to-list 'eglot-server-programs '((php-mode phps-mode) . ("~/projects/phpactor/bin/phpactor" "language-server" "-vvv")))
;; (add-to-list 'eglot-server-programs '((php-mode phps-mode) . ("intelephense" "--stdio")))
@@ -381,10 +405,10 @@ I use built-in project.el
;; Show all of the available eldoc information when we want it. This way Flymake errors
;; don't just get clobbered by docstrings.
(add-hook 'eglot-managed-mode-hook
- (lambda ()
- "Make sure Eldoc will show us all of the feedback at point."
- (setq-local eldoc-documentation-strategy
- #'eldoc-documentation-compose)))
+ (lambda ()
+ "Make sure Eldoc will show us all of the feedback at point."
+ (setq-local eldoc-documentation-strategy
+ #'eldoc-documentation-compose)))
#+end_src
** Линтеры
@@ -556,87 +580,66 @@ Sudo-edit
;; (defun init-php-mode ()
;; (eglot-ensure))
-
- (with-eval-after-load 'php-mode
-
- ;; (add-hook 'php-mode-hook #'init-php-mode)
- )
-
- (when (package-loaded? "php-mode")
- (progn
- (add-hook 'php-mode-hook 'php-enable-symfony2-coding-style)
- (setq lsp-intelephense-php-version "8.1.16")
- (defvar phpactor-executable "~/.bin/phpactor")
- (custom-set-variables '(lsp-phpactor-path "~/usr/local/bin/phpactor"))
-
- (add-hook 'php-mode-hook
- '(lambda ()
- ;; (require 'yasnippet)
- ;; (require 'yasnippet-snippets)
- (set-fill-column 120)
-
- ;; (make-local-variable 'eldoc-documentation-function)
- ;; (setq eldoc-documentation-function
- ;; 'phpactor-hover)
- ;; (yas-minor-mode t)
- (define-key php-mode-map (kbd "C-c h") 'php-quickhelp-at-point)))
+ (use-package php-mode
+ :bind ("C-c h" . 'php-quickhelp-at-point)
+ :config
- (setq php-manual-path
- "~/php/php-manual/"
- php-quickhelp-dir "~/php/php-manual/"
- php-quickhelp--dest "~/.emacs.d/php-manual/php_manual_en.json")
+ (setq php-manual-path
+ "~/projects/php-manual/"
+ php-quickhelp-dir "~/projects/php-manual/"
+ php-quickhelp--dest "~/projects/php-manual/php_manual_en.json"))
- ;; (add-hook 'php-mode-hook
- ;; '(lambda ()
- ;; ;; (auto-complete-mode t)
+ ;; (add-hook 'php-mode-hook
+ ;; '(lambda ()
+ ;; ;; (auto-complete-mode t)
- ;; ;; (require 'ac-php)
- ;; (require 'php-quickhelp)
- ;; (require 'company)
- ;; (company-mode t)
- ;; (require 'company-php)
- ;; (require 'company-quickhelp)
+ ;; ;; (require 'ac-php)
+ ;; (require 'php-quickhelp)
+ ;; (require 'company)
+ ;; (company-mode t)
+ ;; (require 'company-php)
+ ;; (require 'company-quickhelp)
- ;; (require 'yasnippet)
- ;; (require 'yasnippet-snippets)
+ ;; (require 'yasnippet)
+ ;; (require 'yasnippet-snippets)
- ;; (set (make-local-variable 'company-backends)
- ;; '((company-ac-php-backend company-dabbrev-code)
- ;; php-quickhelp-company-php
- ;; company-capf company-files))
+ ;; (set (make-local-variable 'company-backends)
+ ;; '((company-ac-php-backend company-dabbrev-code)
+ ;; php-quickhelp-company-php
+ ;; company-capf company-files))
- ;; (company-quickhelp-mode t)
+ ;; (company-quickhelp-mode t)
- ;; (define-key php-mode-map (kbd "C-M-i") 'company-complete)
- ;; (define-key company-mode-map (kbd "M-TAB") 'company-complete)
+ ;; (define-key php-mode-map (kbd "C-M-i") 'company-complete)
+ ;; (define-key company-mode-map (kbd "M-TAB") 'company-complete)
- ;; ;; (setq ac-sources '(ac-source-php php-quickhelp-company-php))
- ;; ;; (setq eldoc-documentation-function
- ;; ;; 'php-quickhelp-eldoc-func)
+ ;; ;; (setq ac-sources '(ac-source-php php-quickhelp-company-php))
+ ;; ;; (setq eldoc-documentation-function
+ ;; ;; 'php-quickhelp-eldoc-func)
- ;; (yas-minor-mode t)
+ ;; (yas-minor-mode t)
- ;; ;; (define-key php-mode-map (kbd "C-M-i") 'auto-complete)
- ;; ;; (define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
+ ;; ;; (define-key php-mode-map (kbd "C-M-i") 'auto-complete)
+ ;; ;; (define-key ac-mode-map (kbd "M-TAB") 'auto-complete)
- ;; (define-key php-mode-map (kbd "C-c H")
- ;; 'php-local-manual-search)
+ ;; (define-key php-mode-map (kbd "C-c H")
+ ;; 'php-local-manual-search)
- ;; (define-key php-mode-map (kbd "C-c h") 'php-quickhelp-at-point)
- ;; (define-key company-mode-map (kbd "C-c h") 'php-quickhelp-at-point)
+ ;; (define-key php-mode-map (kbd "C-c h") 'php-quickhelp-at-point)
+ ;; (define-key company-mode-map (kbd "C-c h") 'php-quickhelp-at-point)
- ;; ;; (define-key php-mode-map (kbd "C-c t") 'ac-php-show-tip)
+ ;; ;; (define-key php-mode-map (kbd "C-c t") 'ac-php-show-tip)
- ;; ;; Jump to definition (optional)
- ;; (define-key php-mode-map
- ;; (kbd "M-.") 'ac-php-find-symbol-at-point)
+ ;; ;; Jump to definition (optional)
+ ;; (define-key php-mode-map
+ ;; (kbd "M-.") 'ac-php-find-symbol-at-point)
- ;; ;; Return back (optional)
- ;; (define-key php-mode-map
- ;; (kbd "M-,") 'ac-php-location-stack-back)))
- ))
+ ;; ;; Return back (optional)
+ ;; (define-key php-mode-map
+ ;; (kbd "M-,") 'ac-php-location-stack-back)))
+ ))
#+end_src
*** Composer
@@ -728,6 +731,16 @@ The main way to interact with SQL is using org-mode
(sql-port 3306))))
#+end_src
+*** Sql Viewer
+#+begin_src emacs-lisp :tangle init.el
+ (unless (package-installed-p 'pg)
+ (package-vc-install "https://github.com/emarsden/pg-el" nil nil 'pg))
+ (unless (package-installed-p 'pgmacs)
+ (package-vc-install "https://github.com/emarsden/pgmacs"))
+
+ (use-package pgmacs)
+#+end_src
+
** Веб шаблоны
*** Web-mode
@@ -1248,4 +1261,5 @@ The main way to interact with SQL is using org-mode
(add-hook 'dired-mode-hook 'set-normal-font)
(add-hook 'org-mode-hook 'set-normal-font)
+ (add-hook 'Info-mode-hook 'set-normal-font)
#+end_src