Skip to content

Commit

Permalink
emacs: backup / wip
Browse files Browse the repository at this point in the history
  • Loading branch information
hrls committed Jan 5, 2024
1 parent e75cffd commit c342e88
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 110 deletions.
9 changes: 7 additions & 2 deletions emacs/alh-theme.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
;; https://coolors.co/contrast-checker
;; https://encycolorpedia.com

;; list-colors-display
;; describe-face
;; describe-theme
;; list-faces-display

;; TODO:
;; [ ] - M-x mininuffer-prompt
;; [ ] - eshell
;; [ ] - dim numbers for display-line-number-mode on inactive frames or windows
;; [ ] - Dark background

Expand All @@ -26,11 +28,12 @@
(pal/builtin "#324b80")
(pal/preprocessor "#be3536")

(pal/string "#1313b0")
(pal/string "#1313b0") ; #1313b0 4169e1
(pal/comment "#666666") ; 7011 Iron grey #52595d
(pal/docline "#2b3f98") ; unknown color

(pal/shadow "#666666")
(pal/phantom "#8b7765")

(pal/gh/str-literal "#162f65")
(pal/gh/button-link "#2e68d3") ; also used for some kws
Expand All @@ -43,7 +46,7 @@

(pal/okay "#6495ed")

(pal/red "#ff0000")
(pal/red "#ff3b30") ; system red
(pal/blue "#0000cd")
(pal/amber "#ffbf00")
(pal/black "#040404"))
Expand Down Expand Up @@ -83,6 +86,8 @@
(dired-symlink (:inherit 'font-lock-keyword-face :italic t :bold nil))
(which-key-key-face (:inherit 'font-lock-constant-face :weight 'bold))

(company-preview (:background pal/bg :foreground pal/phantom))

(rust-ampersand-face (:foreground pal/shadow))
))

Expand Down
28 changes: 23 additions & 5 deletions emacs/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;;; GUI
;;; TODO: make window scrollable by touchpad on horizontal axis
(set-default 'cursor-type 'hbar)
;; (set-face-font 'variable-pitch "Helvetica:size=13")
(set-face-font 'variable-pitch "Georgia:size=15") ;; Helvetica Neue:size=15 Verdana:size=14
(tool-bar-mode -1)
(scroll-bar-mode -1)
(fringe-mode '(0 . 13))
Expand All @@ -34,18 +34,28 @@
(setq use-dialog-box nil)
(defalias 'yes-or-no-p 'y-or-n-p)

;; NeXTSTEP
(when (string-equal system-type "darwin")
(setq
ns-use-native-fullscreen nil
ns-alternate-modifier 'meta
ns-right-alternate-modifier 'meta))


;;; Text
(setq-default standard-indent 4
tab-width 4
c-basic-offset 4
sgml-basic-offset 4
css-indent-offset 2
indent-tabs-mode nil
truncate-lines t)

(setq search-highlight t
query-replace-highlight t
kill-whole-line t)

;; (toggle-truncate-lines 1) ;; word wrap off
(toggle-word-wrap) ;; when (toggle-truncate-lines)
(column-number-mode t)
(show-paren-mode t)
(delete-selection-mode t)
Expand All @@ -63,7 +73,7 @@
"Like \\[dired-jump] (dired-jump) but in other window." t)
(define-key global-map "\C-x\C-j" 'dired-jump)
(define-key global-map "\C-x4\C-j" 'dired-jump-other-window)

(define-key dired-mode-map (kbd "<mouse-2>") 'dired-mouse-find-file)

;;; Windows
;;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Windows.html
Expand All @@ -88,7 +98,8 @@
(defun prog-mode-tweaks ()
(setq display-line-numbers-width 3
show-trailing-whitespace t)
(display-line-numbers-mode))
(display-line-numbers-mode)
(toggle-truncate-lines 1))

(add-hook 'prog-mode-hook 'prog-mode-tweaks)

Expand All @@ -115,14 +126,21 @@
(global-set-key (kbd "C-x i") #'ielm) ; TODO: in new selected frame
(global-set-key (kbd "C-x e") #'eshell)

(global-set-key (kbd "s-/") #'comment-or-uncomment-region)
;; Command is new Meta
(global-set-key (kbd "s-/") #'comment-or-uncomment-region) ; comment-dwim
(global-set-key (kbd "s-i") #'xref-find-definitions)
(global-set-key (kbd "s-I") #'xref-find-definitions-other-frame)
;; https://www.emacswiki.org/emacs/NavigatingParentheses
(global-set-key (kbd "C-s-n") #'forward-list)
(global-set-key (kbd "C-s-p") #'backward-list)


(define-key prog-mode-map [s-mouse-1] #'xref-find-definitions-at-mouse)
(define-key prog-mode-map [C-return] #'my/indent-and-return)

(global-unset-key (kbd "C-<wheel-down>"))
(global-unset-key (kbd "C-<wheel-up>"))

;; Free bindings
;; C-t
;; C-j
Expand Down
Loading

0 comments on commit c342e88

Please sign in to comment.