166 lines
3.8 KiB
EmacsLisp
166 lines
3.8 KiB
EmacsLisp
|
|
|
|
|
|
|
|
;;; relative line numbers
|
|
(setq display-line-numbers 'relative)
|
|
|
|
|
|
;;; set my org directory
|
|
(setq org-directory "~/work/things/org")
|
|
|
|
|
|
;;; set my name and email
|
|
(setq user-full-name "Sebastian Moser"
|
|
user-mail-address "c2vi.dev@gmail.com")
|
|
|
|
|
|
;;; theme
|
|
(setq doom-theme 'doom-one)
|
|
|
|
|
|
;;; C-p to be M-x
|
|
(map! "C-p" #'execute-extended-command)
|
|
;;(map! :leader "a" #'execute-extended-command)
|
|
;;(map! :nv ":" #'execute-extended-command)
|
|
(after! evil
|
|
;;(map! :nv ":" #'execute-extended-command)
|
|
(map! :gnv "C-p" #'execute-extended-command)
|
|
)
|
|
|
|
|
|
|
|
;;; projectile find file - quick switcher
|
|
(after! evil
|
|
(map! :gnv "C-e" #'projectile-find-file)
|
|
)
|
|
(after! 'better-jumper
|
|
(map! :gnv "C-i" #'projectile-find-file)
|
|
)
|
|
(with-eval-after-load 'projectile
|
|
(add-to-list 'projectile-globally-ignored-directories "node_modules")
|
|
(add-to-list 'projectile-globally-ignored-directories ".obsidian")
|
|
(setq projectile-indexing-method 'native)
|
|
)
|
|
|
|
|
|
|
|
;;; obsidian
|
|
(after! obsidian
|
|
(setq obsidian-directory "~/work/things"
|
|
obsidian-inbox-directory "semi-public"
|
|
markdown-enable-wiki-links t
|
|
)
|
|
(global-obsidian-mode t)
|
|
)
|
|
|
|
|
|
|
|
|
|
;;; clipboard
|
|
(after! evil
|
|
(setq interprogram-cut-function nil
|
|
interprogram-paste-function nil)
|
|
)
|
|
(defun my/clipboard-copy (beg end)
|
|
"Copy region to the OS clipboard (bypassing the kill-ring)."
|
|
(interactive "r")
|
|
(let ((text (buffer-substring-no-properties beg end))
|
|
(inhibit-message t))
|
|
(gui-select-text text)
|
|
(deactivate-mark)
|
|
(when (called-interactively-p 'any)
|
|
(message "Copied to clipboard: %d chars" (length text)))))
|
|
|
|
(defun my/clipboard-paste ()
|
|
"Paste from the OS clipboard, replacing the region if active."
|
|
(interactive)
|
|
(let ((text (gui-get-selection 'CLIPBOARD)))
|
|
(unless text
|
|
(user-error "OS clipboard is empty"))
|
|
(when (use-region-p)
|
|
(delete-region (region-beginning) (region-end)))
|
|
(insert-for-yank text)))
|
|
(map! :v "C-c" #'my/clipboard-copy
|
|
:v "C-v" #'my/clipboard-paste
|
|
:i "C-v" #'my/clipboard-paste) ; insert-state paste, terminal-style
|
|
|
|
|
|
|
|
;;; in buffer completions
|
|
(setq tab-always-indent 'complete)
|
|
(after! corfu
|
|
; possible: basic, initials, orderless, partial-completion substring, flex
|
|
(setq completion-styles '(orderless flex partial-completion substring))
|
|
(setq corfu-cycle t
|
|
corfu-preview-current nil
|
|
corfu-min-width 20
|
|
corfu-on-exact-match 'insert
|
|
corfu-quit-no-match t
|
|
corfu-quit-at-boundary t
|
|
corfu-popupinfo-delay '(1.25 . 0.5))
|
|
(corfu-popupinfo-mode 1)
|
|
;; history-based sorting, persisted across restarts
|
|
(corfu-history-mode 1)
|
|
(after! savehist
|
|
(add-to-list 'savehist-additional-variables 'corfu-history)))
|
|
|
|
|
|
|
|
;;; C-i to pick first completion thing
|
|
(after! corfu
|
|
(defun my/corfu-insert-first ()
|
|
"Insert the first candidate immediately."
|
|
(interactive)
|
|
(corfu-next)
|
|
(corfu-insert)
|
|
)
|
|
(map! :map corfu-map
|
|
"<insert-state> C-i" #'my/corfu-insert-first
|
|
)
|
|
)
|
|
|
|
|
|
;;; better eval mappings
|
|
(map! :leader "m e" #'eval-last-sexp)
|
|
(map! :leader "m r" #'eval-print-last-sexp)
|
|
|
|
|
|
|
|
;;;; font/zoom
|
|
(setq doom-font (font-spec
|
|
;:family "Hack Mono"
|
|
:size 22 :weight 'regular))
|
|
|
|
|
|
;;; have authinfo file in my $SECRETS_DIR
|
|
(setq auth-sources '("~/secrets/authinfo"))
|
|
|
|
|
|
|
|
;;; empv
|
|
(after! empv
|
|
(customize-set-variable 'empv-subsonic-username "c2vi")
|
|
(customize-set-variable 'empv-subsonic-url "https://tunes.c2vi.dev")
|
|
(customize-set-variable 'empv-subsonic-password (f-read-text "~/secrets/tunes-password"))
|
|
)
|
|
|
|
|
|
|
|
;;; supersonic
|
|
(after! supersonic
|
|
;;(setq supersonic-host "https://tunes.c2vi.dev")
|
|
)
|
|
|
|
|
|
|
|
;;; scratch
|
|
(defun my/scratch ()
|
|
(lookup-key corfu-map (kbd "C-u"))
|
|
(lookup-key corfu-map (kbd "C-i"))
|
|
(define-key corfu-map (kbd "C-i") 'my/corfu-insert-first)
|
|
|
|
)
|
|
|
|
|