Skip to content

Commit

Permalink
Stable.
Browse files Browse the repository at this point in the history
  • Loading branch information
weidaolee committed Jun 24, 2024
1 parent d537da5 commit a19ba1f
Show file tree
Hide file tree
Showing 17 changed files with 176 additions and 48 deletions.
39 changes: 24 additions & 15 deletions doom.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@
;;layout ; auie,ctsrnm is the superior home row

:completion
(company +childframe) ; the ultimate code completion backend
(company
+childframe) ; the ultimate code completion backend
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
(ivy ; a search engine for love and life
(ivy ; a search engine for love and life
;; +fuzzy
+prescient
+childframe
+icons
;; private ;;
;+helm
)
(vertico +icon) ; the search engine of the future
(vertico ; the search engine of the future
+icon
+childframe)
:ui
deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
Expand All @@ -42,7 +45,7 @@
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
hydra
indent-guides ; highlighted indent columns
ligatures ; ligatures and symbols to make your code pretty again
(ligatures +extra) ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
nav-flash ; blink cursor line after big motions
Expand Down Expand Up @@ -75,8 +78,7 @@
:emacs
(dired ; making dired pretty [functional]
+icons
+ranger
)
+ranger)
electric ; smarter, keyword-based electric-indent
;;ibuffer ; interactive buffer management
(undo +tree) ; persistent, smarter undo for your inevitable mistakes
Expand Down Expand Up @@ -127,8 +129,7 @@
;;beancount ; mind the GAAP
(cc ; C > C++ == 1
+lsp
;;+tree-sitter
)
+tree-sitter)
;;clojure ; java with a lisp
;;common-lisp ; if you've seen one lisp, you've seen them all
;;coq ; proofs-as-programs
Expand All @@ -150,7 +151,7 @@
;;gdscript ; the language you waited for
(go ; the hipster dialect
+lsp
;;+tree-sitter
+tree-sitter
)
;;(graphql +lsp) ; Give queries a REST
;;(haskell +lsp) ; a language that's lazier than I am
Expand All @@ -162,7 +163,11 @@
;;javascript ; all(hope(abandon(ye(who(enter(here))))))
;;julia ; a better, faster MATLAB
;;kotlin ; a better, slicker Java(Script)
;;latex ; writing papers in Emacs has never been so fun
(latex ; writing papers in Emacs has never been so fun
+cdlatex
+fold
+latexmk
+lsp)
;;lean ; for folks with too much to prove
;;ledger ; be audit you can be
;;lua ; one-based indices? one-based indices
Expand All @@ -189,8 +194,7 @@
+lsp
+pyright
+cython
;;+tree-sitter
) ; beautiful is better than ugly
+tree-sitter) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6
Expand All @@ -199,15 +203,14 @@
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
(rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
+lsp
;;+tree-sitter
+tree-sitter
)
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
(sh ; she sells {ba,z,fi}sh shells on the C xor
+lsp
;; +fish
;;+tree-sitter
)
+tree-sitter)
;;sml
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
Expand Down Expand Up @@ -249,6 +252,8 @@
evil
hungry-delete
drag-stuff
selectric-mode
typewriter

:private-emacs
dired
Expand All @@ -259,9 +264,13 @@
go
sh
protobuf
python

:private-tools
;; eaf
docker
conf
debugger
;; gpt
;;treemacs-icons

Expand Down
12 changes: 11 additions & 1 deletion doom.d/key-bindings/evil.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
;;; ../emacs/doomemacs/doom.d/key-bindings/evil.el -*- lexical-binding: t; -*-

;;; copy from :editor evil/config.el
;;
;;; Keybinds

;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
;; zu{q,w} - undo last marking

(map! :v "@" #'+evil:apply-macro
:m [C-i] #'evil-jump-forward

Expand Down Expand Up @@ -101,7 +107,11 @@
(:after elfeed
:map elfeed-search-mode-map
:n "gr" #'elfeed-search-update--force
:n "gR" #'elfeed-search-fetch))
:n "gR" #'elfeed-search-fetch)
(:after eglot
:map eglot-mode-map
:nv "gd" #'+lookup/definition
:nv "gD" #'+lookup/references))

;; custom evil keybinds
:nv "zn" #'+evil:narrow-buffer
Expand Down
10 changes: 6 additions & 4 deletions doom.d/key-bindings/roam.el
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"e" #'doom/forward-to-last-non-comment-or-eol
"E" #'end-of-buffer

"u" #'evil-scroll-line-up
"d" #'evil-scroll-line-down)
"U" #'evil-scroll-line-up
"D" #'evil-scroll-line-down
)

(:when (modulep! :editor evil +everywhere)
:map evil-normal-state-map
Expand All @@ -48,8 +49,9 @@
"C-e" nil
"n" #'evil-ex-search-next
"p" #'evil-ex-search-previous
"N" #'evil-ex-search-next
"P" #'evil-ex-search-previous))
;; "N" #'evil-ex-search-next
;; "P" #'evil-ex-search-previous
))

;; ranger
(map!
Expand Down
2 changes: 1 addition & 1 deletion modules/private-config/emacs/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

;; frame
(toggle-frame-maximized)
(toggle-frame-fullscreen)
;(toggle-frame-fullscreen)
(which-function-mode t)

;; display time, battery
Expand Down
2 changes: 2 additions & 0 deletions modules/private-editor/default/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@
:config
(add-hook! 'java-mode-local-vars-hook (smart-newline-mode 0)) ; +1 -> 0
(add-hook! 'python-mode-local-vars-hook (smart-newline-mode 0)))

(setq! doom-big-font-increment 2)
6 changes: 3 additions & 3 deletions modules/private-lang/cc/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
* Auto Fromat on Save
Add the following code to ~.dir-lcoals.el~:
#+begin_src elisp
((c-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t)))))
((c++-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t)))))
((c-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t))))
(c++-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t)))))

((c-mode . ((c-basic-offset . 4)
(c-offsets-alist . ((access-label . -4)
Expand Down Expand Up @@ -53,7 +53,7 @@ Add the following code to ~.dir-lcoals.el~:
(brace-list-open)))))
#+end_src
* Download clangd
Download [[https://github.com/clangd/clangd/releases][clangd-linux-xx.x.xzip]]
Download [[https://github.com/clangd/clangd/releases][clangd-linux-xx.x.x.zip]]
* Upgrade Clang format version
1. Uninstall ~clang-format~
2. Install ~clang-format-xx~
Expand Down
29 changes: 16 additions & 13 deletions modules/private-lang/cc/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,27 @@

(add-to-list 'auto-mode-alist '(".clang-format\\'" . yaml-mode))

(after! lsp-mode
(setq lsp-clangd-version "17.0.3"))

;;; Clang
(after! lsp-clangd
(setq lsp-clients-clangd-args
'("-j=8"
"--pretty"
'(
;;; clangd compilation flags options ;;;
"--all-scopes-completion"
"--background-index"
"--background-index-priority=normal"
"--clang-tidy"
;; "--clang-tidy-checks=*"
"--completion-style=bundled" ;; "--header-insertion=never"
;; "--header-insertion=implicit"
;; "--header-insertion-decorators=0"
"--all-scopes-completion"
"--log=verbose"
"--print-options"
"--query-driver"
"--background-index-rebuild"
;; "--header-insertion-decorators=1"
;; "--suggest-missing-includes=1"
"--completion-style=bundled"
"--header-insertion=iwyu"
"--header-insertion-decorators"
"--import-insertions"
;;; clangd miscellaneous options ;;;
"-j=12"
"--malloc-trim"
"--pch-storage=memory"
;;; clangd protocol and logging options ;;;
))
(set-lsp-priority! 'clangd 2))

Expand Down
4 changes: 2 additions & 2 deletions modules/private-lang/cc/packages.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;;; -*- no-byte-compile: t; -*-
;;; private-lang/cc/packages.el

;; (package! clang-format)
;; (package! clang-format+)
(package! clang-format)
(package! clang-format+)
4 changes: 2 additions & 2 deletions modules/private-lang/cc/template/.dir-locals.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
((c-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t)))))
((c++-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t)))))
((c-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t))))
(c++-mode . ((eval . (add-hook 'before-save-hook #'clang-format-buffer nil t)))))

;; ((c-mode . ((c-basic-offset . 4)
;; (c-offsets-alist . ((access-label . -4)
Expand Down
39 changes: 37 additions & 2 deletions modules/private-lang/go/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,41 @@
(add-hook 'go-mode-hook #'lsp-deferred)
;; Set up before-save hooks to format buffer and add/delete imports.
;; Make sure you don't have other gofmt/goimports hooks enabled.
(defun lsp-go-install-save-hooks ()
(defun my-go-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t))
(add-hook 'go-mode-hook #'lsp-go-install-save-hooks))
(add-hook 'go-mode-hook #'my-go-save-hooks))

(after! go-mode
(set-ligatures! 'go-mode
:def "func"
:for "for"
:null "nil"
))

(after! lsp-go
(setq lsp-gopls-staticcheck t)

(setq lsp-gopls-complete-unimported t)
(setq lsp-gopls-analyses
'((unusedparams . t)
(unusedwrite . t)
(unusedvariable . t)
(unusedresult . t)
(nilness . t)
(shadow . t)
(infertypeargs . t)
))
(setq lsp-go-inlay-hints-enabled t) ; Ensure inlay hints are enabled
(setq lsp-go-inlay-hints-include-parameter-names t) ; Include parameter names in function calls
(setq lsp-go-inlay-hints-parameter-hints t) ; Enable parameter hints
(setq lsp-go-inlay-hints-type-hints t) ; Enable type hints

;; (lsp-register-custom-settings
;; '(("gopls.inlayHints" ((hints . ((assignVariableTypes . t)
;; (compositeLiteralFields . t)
;; (compositeLiteralTypes . t)
;; (constantValues . t)
;; (functionTypeParameters . t)
;; (parameterNames . t)
;; (rangeVariableTypes . t)))) t)))
)
2 changes: 1 addition & 1 deletion modules/private-lang/org/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</tr>
</table>

* Export Org file to Markdown
* Emacs Org to Markdown
1. [[https://pandoc.org/installing.html][Install Pandoc]]
2. ~M-x org-pandoc-export-to-markdown_mmd~
3. ~M-x markdown-toc-generate-toc~
9 changes: 6 additions & 3 deletions modules/private-lang/protobuf/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

(use-package! protobuf-mode
:mode "\\.proto\\'"
:config
;; Add any specific configurations you want for protobuf-mode here
)
:defer t)

(use-package! company-protobuf
:when (modulep! :completion company)
:after protobuf-mode
:config (set-company-backend! 'protobuf-mode 'company-protobuf))
8 changes: 7 additions & 1 deletion modules/private-lang/protobuf/packages.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
;;; -*- no-byte-compile: t; -*-
;;; private-lang/protobuf/packages.el

(package! protobuf-mode)
(package! protobuf-mode :pin "b9483e03c7cfa854c250ad6415b4d9e6f7a9709e")

(package! company-protobuf
:recipe (:host github
:repo "weidaolee/company-protobuf"
:branch "main")
:pin "676f31c0aa4cc2b4bbf683f66e8be3a82dc60ee1")
6 changes: 6 additions & 0 deletions modules/private-lang/python/README.org
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* Tell flake8 to ignore specific warnings or errors
Open ~.config/flake8~
#+begin_src conf
[flake8]
ignore = E501
#+end_src
17 changes: 17 additions & 0 deletions modules/private-lang/python/config.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
;;; private-lang/python/config.el -*- lexical-binding: t; -*-

;; (add-hook! python-mode
;; (setq-local flycheck-enabled-checkers '(python-pyright python-flake8))
;; (setq-local flycheck-disabled-checkers '(python-pylint python-mypy))

;; ;; Explicitly select Pyright as the checker for Flycheck in Python mode
;; (flycheck-select-checker 'python-pyright)

;; ;; Disable LSP diagnostics for Python mode specifically
;; (setq-local lsp-diagnostics-provider :none))

(after! python
(setq python-prettify-symbols-alist nil))

;; (after! lsp-pyright
;; (setq lsp-pyright-typechecking-mode "off"))
1 change: 1 addition & 0 deletions modules/private-tools/conf/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
(add-to-list 'auto-mode-alist '("\\.cnf\\'" . conf-unix-mode))
(add-to-list 'auto-mode-alist '("\\.conf\\'" . conf-unix-mode))
(add-to-list 'auto-mode-alist '("\\.config\\'" . conf-unix-mode))
(add-to-list 'auto-mode-alist '("\\.ini\\'" . conf-unix-mode))
Loading

0 comments on commit a19ba1f

Please sign in to comment.