Compare commits

..

No commits in common. "546b54c8a9464edd2e4c421e7fbba7a19229974b" and "bcaa2a1ae1514666b6f9bd7d6137c488313567f4" have entirely different histories.

111
init.el
View File

@ -106,17 +106,17 @@
((eq evil-state 'normal) "<N>") ((eq evil-state 'normal) "<N>")
((eq evil-state 'emacs) "<E>") ((eq evil-state 'emacs) "<E>")
(t " * "))) (t " * ")))
;; (setq-default mode-line-format '("%e " mode-line-modified " " (setq-default mode-line-format '("%e " mode-line-modified " "
;; (:eval (propertize (buffer-name)) 'face 'font-lock-constant-face) (:eval (propertize (buffer-name)) 'face 'font-lock-constant-face)
;; "%6l:%c (%o) " "%6l:%c (%o) "
;; (:eval (:eval
;; (if (and (mode-line-window-selected-p) (bound-and-true-p evil-mode)) (if (and (mode-line-window-selected-p) (bound-and-true-p evil-mode))
;; (my-evil-mode-indicator)) (my-evil-mode-indicator))
;; " ") " ")
;; (:eval (unless (not vc-mode) (concat " | Git:" (substring-no-properties vc-mode 5)))) (:eval (unless (not vc-mode) (concat " | Git:" (substring-no-properties vc-mode 5))))
;; mode-line-format-right-align mode-line-format-right-align
;; (:eval (concat " " (symbol-name major-mode))) (:eval (concat " " (symbol-name major-mode)))
;; " " mode-line-misc-info)) " " mode-line-misc-info))
(use-package emacs (use-package emacs
:init :init
@ -203,18 +203,18 @@
:ensure t :ensure t
:init :init
:custom :custom
(denote-directory "~/NCKlinsoft/DenoteNotes/") (denote-directory "~/Nextcloud/DenoteNotes/")
:hook :hook
(dired-mode . denote-dired-mode) (dired-mode . denote-dired-mode)
:custom-face :custom-face
(denote-faces-link ((t (:slant italic))))) (denote-faces-link ((t (:slant italic)))))
(global-set-key (kbd "C-c n n") 'denote-open-or-create) (global-set-key (kbd "C-c n n") 'denote-open-or-create)
;; (use-package consult-denote (use-package consult-denote
;; :ensure t :ensure t
;; :config :config
;; (define-key global-map (kbd "C-c n f") #'consult-denote-find) (define-key global-map (kbd "C-c n f") #'consult-denote-find)
;; (define-key global-map (kbd "C-c n g") #'consult-denote-grep)) (define-key global-map (kbd "C-c n g") #'consult-denote-grep))
(use-package vertico (use-package vertico
:ensure t :ensure t
@ -316,12 +316,6 @@
:bind :bind
(:map isearch-mode-map (:map isearch-mode-map
("C-f" . my-project-search-from-isearch))) ("C-f" . my-project-search-from-isearch)))
(use-package isearch
:ensure nil
:defer t
:bind
(:map isearch-mode-map
("C-d" . isearch-forward-symbol-at-point)))
;; Selection window (rg, grep, help etc). ----- ;; Selection window (rg, grep, help etc). -----
@ -442,7 +436,6 @@
(setq org-src-preserve-indentation t) (setq org-src-preserve-indentation t)
(setq org-src-tab-acts-natively t) (setq org-src-tab-acts-natively t)
(setq org-hide-emphasis-markers nil) (setq org-hide-emphasis-markers nil)
(setq org-agenda-files (quote ("~/Nextcloud/DenoteNotes/")))
(setq org-edit-src-content-indentation 0)) (setq org-edit-src-content-indentation 0))
@ -535,10 +528,11 @@
(global-set-key (kbd "C-z") 'move-text-down) (global-set-key (kbd "C-z") 'move-text-down)
(global-set-key (kbd "C-q") 'move-text-up) (global-set-key (kbd "C-q") 'move-text-up)
;; (global-set-key (kbd "C-'") 'avy-goto-char) ;; (global-set-key (kbd "C-c t c") 'avy-goto-char)
(keymap-global-set "C-;" 'avy-goto-char) (global-set-key (kbd "C-'") 'avy-goto-char)
(keymap-set org-mode-map "C-;" 'avy-goto-char) ;; (global-set-key (kbd "C-c t w") 'avy-goto-word-0)
(global-set-key (kbd "C-:") 'avy-goto-word-0) (global-set-key (kbd "C-,") 'avy-goto-word-0)
;;; Functions. ----- ;;; Functions. -----
;;RecentFiles ;;RecentFiles
@ -553,45 +547,23 @@
(global-set-key "\C-x\C-r" 'my/recentf-open-files-compl) (global-set-key "\C-x\C-r" 'my/recentf-open-files-compl)
;; Half page up/down ;; Half page up/down
(defun my/half-page-up () (defun my/half-page-up ()
(interactive) (interactive)
(let ((target-line (/ (window-height) 2))) ;; (scroll-down-command )
(condition-case nil (move-to-window-line-top-bottom 0)
(scroll-down (/ (window-height) 2)) (recenter))
(error nil)) (global-set-key (kbd "M-p") 'my/half-page-up)
(sit-for 0)
(move-to-window-line target-line)))
(defun my/half-page-down () (defun my/half-page-down ()
(interactive) (interactive)
(let ((target-line (/ (window-height) 2))) (if (eq (line-number-at-pos) (line-number-at-pos (window-start)))
(condition-case nil ;; If the cursor is at the top of the page, move it to the center
(scroll-up (/ (window-height) 2)) (progn
(error nil)) (let ((middle-line (1+ (/ (window-height) 2))))
(sit-for 0) (move-to-window-line middle-line)))
(move-to-window-line target-line))) ;; (scroll-up scroll-amount)
(move-to-window-line -1 )
;; (defun my/half-page-up () (recenter)))
;; (interactive)
;; ;; (follow-scroll-down)
;; ;; (recenter))
;; (move-to-window-line-top-bottom 0)
;; (recenter))
(global-set-key (kbd "M-p") 'my/half-page-up)
;; (defun my/half-page-down ()
;; (interactive)
;; (if (eq (line-number-at-pos) (line-number-at-pos (window-start)))
;; ;; If the cursor is at the top of the page, move it to the center
;; (progn
;; (let ((middle-line (1+ (/ (window-height) 2))))
;; (move-to-window-line middle-line)))
;; ;; (scroll-up scroll-amount)
;; (move-to-window-line -1 )
;; (recenter)))
(global-set-key (kbd "M-n") 'my/half-page-down) (global-set-key (kbd "M-n") 'my/half-page-down)
;; Split window and follow cursor. ----- ;; Split window and follow cursor. -----
@ -678,21 +650,6 @@
(set-mark-command 1)) (set-mark-command 1))
(global-set-key (kbd "M-`") 'jump-to-mark) (global-set-key (kbd "M-`") 'jump-to-mark)
;; Show/hide `~*/+` symbols in org-mode ------
(defun my/org-toggle-emphasis ()
"Toggle hiding/showing of org emphasize markers."
(interactive)
(if org-hide-emphasis-markers
(set-variable 'org-hide-emphasis-markers nil)
(set-variable 'org-hide-emphasis-markers t))
(save-excursion
(goto-char (point-min))
(org-ctrl-c-ctrl-c)))
;; (org-reload))
(define-key org-mode-map (kbd "C-c e") 'my/org-toggle-emphasis)
;; (defun exchange-point-and-mark-no-activate () ;; (defun exchange-point-and-mark-no-activate ()
;; "Identical to \\[exchange-point-and-mark] but will not activate the region." ;; "Identical to \\[exchange-point-and-mark] but will not activate the region."
;; (interactive) ;; (interactive)