From 540fd4eee4216670e070f4b37d0da140ade6b83a Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 13:53:11 +0000 Subject: [PATCH 1/7] Rebase with updaterefs --- .gitconfig.shared | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitconfig.shared b/.gitconfig.shared index d608a57..4d24e85 100644 --- a/.gitconfig.shared +++ b/.gitconfig.shared @@ -11,3 +11,5 @@ default = upstream [init] defaultBranch = main +[rebase] + updateRefs = true \ No newline at end of file From 8898d4f8c6b635cada8c52655bcb39ec085e875e Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 13:55:44 +0000 Subject: [PATCH 2/7] Emacs tweaks --- .emacs.d/custom.el | 4 +-- .emacs.d/init.el | 64 ++++++++++++++++++++++++++++------------------ 2 files changed, 41 insertions(+), 27 deletions(-) diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index 7d1dcca..d26cadd 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -31,7 +31,7 @@ '(flycheck-python-flake8-executable "python3") '(font-lock-global-modes t) '(font-lock-maximum-size nil) - '(font-lock-support-mode 'jit-lock-mode) + '(font-lock-support-mode 'jit-lock-mode t) '(global-auto-revert-mode t) '(global-font-lock-mode t nil (font-lock)) '(ido-enable-flex-matching t) @@ -58,7 +58,7 @@ '(org-odd-levels-only t) '(org-todo-keywords '((sequence "TODO" "|" "DONE" "ABANDONED" "DEFERRED"))) '(package-selected-packages - '(lsp-pyright blacken nyan-mode earthfile-mode compat adaptive-wrap terraform-mode deadgrep protobuf-mode bazel howm python-mode color-theme-sanityinc-solarized monokai-theme rust-mode tide typescript-mode modus-themes tree-sitter flycheck-rust eglot ink-mode prettier-js zig-mode esup gnu-elpa-keyring-update lsp-hack hack-mode filladapt lsp-ui yaml-mode wgrep fsharp-mode company-lsp cquery mustache-mode clang-format projectile dash-functional mocha add-node-modules-path rjsx-mode xref-js2 js2-refactor company omnisharp geiser cider clojure-mode graphviz-dot-mode multi-term xterm-color thrift markdown-mode tuareg merlin ag use-package flycheck dockerfile-mode js2-mode web-mode tss switch-window paredit magit lua-mode go-mode go-autocomplete exec-path-from-shell csharp-mode color-theme-monokai auto-complete auto-complete-nxml flymake flyspell json-mode popup ruby-mode company-jedi elm-mode monky color-theme-sanityinc-tomorrow)) + '(vterm lsp-pyright blacken nyan-mode earthfile-mode compat adaptive-wrap terraform-mode deadgrep protobuf-mode bazel howm python-mode color-theme-sanityinc-solarized monokai-theme rust-mode tide typescript-mode modus-themes tree-sitter flycheck-rust eglot ink-mode prettier-js zig-mode esup gnu-elpa-keyring-update lsp-hack hack-mode filladapt lsp-ui yaml-mode wgrep fsharp-mode company-lsp cquery mustache-mode clang-format projectile dash-functional mocha add-node-modules-path rjsx-mode xref-js2 js2-refactor company omnisharp geiser cider clojure-mode graphviz-dot-mode multi-term xterm-color thrift markdown-mode tuareg merlin ag use-package flycheck dockerfile-mode js2-mode web-mode tss switch-window paredit magit lua-mode go-mode go-autocomplete exec-path-from-shell csharp-mode color-theme-monokai auto-complete auto-complete-nxml flymake flyspell json-mode popup ruby-mode company-jedi elm-mode monky color-theme-sanityinc-tomorrow)) '(reb-re-syntax 'string) '(rmail-mail-new-frame t) '(safe-local-variable-values diff --git a/.emacs.d/init.el b/.emacs.d/init.el index cfbb6a7..0aa76fb 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -323,7 +323,10 @@ ;; ================================================================= (use-package company :ensure t :commands company-mode - :hook (typescript-mode . company-mode)) + :hook + (typescript-mode . company-mode) + (python-mode . company-mode) ;; 2023-08-23 Adding company-mode to compose with eglot + ) ;; ================================================================= ;; Common configuration for LSP-based systems. @@ -334,17 +337,19 @@ (executable-find "clangd")) "Path to the clangd binary.") -(defvar my-pylsp-executable - (executable-find "pylsp") - "The path to the python-lsp-server binary.") - -(defvar my-pyls-executable - (executable-find "pyls") - "The path to the python-language-server binary.") - -(defvar my-pyls-language-server-executable - (executable-find "pyls-langauge-server") - "The path to the pyls-language-server binary (used at FB).") +;; 2023-08-23 Disabling all this nonsense for now; I'm using pyright at +;; work and don't feel like maintaining this stuff. +;; (defvar my-pylsp-executable +;; (executable-find "pylsp") +;; "The path to the python-lsp-server binary.") +;; +;; (defvar my-pyls-executable +;; (executable-find "pyls") +;; "The path to the python-language-server binary.") +;; +;; (defvar my-pyls-language-server-executable +;; (executable-find "pyls-langauge-server") +;; "The path to the pyls-language-server binary (used at FB).") (defun my-disable-flycheck-on-eglot () "Disable flycheck in eglot-managed buffers." @@ -359,26 +364,30 @@ (use-package eglot :ensure :commands (eglot-ensure eglot) :hook - ;; 2023-06-26 Using LSP mode for python these days. - ;; (python-mode . eglot-ensure) + (python-mode . eglot-ensure) (rust-mode . eglot-ensure) (c++-mode . eglot-ensure) (c-mode . eglot-ensure) (go-mode . eglot-ensure) ;; 2022-07-29 Add eglot for go (before-save . eglot-format) ;; 2023-05-25 Format buffers on save :bind + ("C-c r" . eglot-rename) ;; 2022-08-23 Make rename more accessible ("C-c \\" . eglot-code-actions) ;; 2022-07-29 I want to make code actions easier. :config (when my-clangd-executable (add-to-list 'eglot-server-programs `((c++-mode c-mode) . (,my-clangd-executable)))) - (let ((py-executable (or my-pyls-language-server-executable - my-pylsp-executable - my-pyls-executable))) - (when py-executable - (add-to-list 'eglot-server-programs - `(python-mode . (,py-executable))))) + ;; 2023-08-23 Disabling all this nonsense for now; I'm using pyright at + ;; work and don't feel like maintaining this stuff. + ;; + ;; (let ((py-executable (or my-pyright-executable + ;; my-pyls-language-server-executable + ;; my-pylsp-executable + ;; my-pyls-executable))) + ;; (when py-executable + ;; (add-to-list 'eglot-server-programs + ;; `(python-mode . (,py-executable))))) ;; 2022-04-28 Configuration for Deno. (defclass eglot-deno (eglot-lsp-server) () @@ -724,7 +733,10 @@ Or, uh, Objective C, I guess." (blacken-mode))) (use-package python-mode :ensure - :mode "\\.py\\'" + :init + ;; NOTE: Not using :mode here because it implies :defer which... doesn't + ;; work with python-mode because it fights the built-in python mode. + (add-to-list 'auto-mode-alist '("\\.py$" . python-mode)) :config (add-to-list 'interpreter-mode-alist '("python" . python-mode)) (add-hook 'python-mode-hook 'my-python-mode-hook)) @@ -733,10 +745,12 @@ Or, uh, Objective C, I guess." :commands (blacken-mode) :hook (python-mode . blacken-mode)) -(use-package lsp-pyright :ensure - :hook (python-mode . (lambda () - (require 'lsp-pyright) - (lsp)))) ; or lsp-deferred +;; 2023-08-23 Disabling all this nonsense for now; I'm using pyright at +;; work and don't feel like maintaining this stuff. +;; (use-package lsp-pyright :ensure +;; :hook (python-mode . (lambda () +;; (require 'lsp-pyright) +;; (lsp)))) ; or lsp-deferred ;; ================================================================= ;; Bazel Support From 0efe992b4618fc93168cf1d1a8b6cd8cd9580ee2 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 07:00:16 -0700 Subject: [PATCH 3/7] Stop some SSH hangs with vscode --- vscode/settings.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/vscode/settings.json b/vscode/settings.json index 6e3b182..d5572a7 100644 --- a/vscode/settings.json +++ b/vscode/settings.json @@ -88,11 +88,7 @@ "/Users/doty/lacework/services/bazel/rust/clippyallrust.py" ], "remote.SSH.showLoginTerminal": true, - "remote.SSH.remotePlatform": { - "coder.doty-dev": "linux", - "192.168.0.114": "linux", - "coder-vscode--johndoty--doty-dev": "linux" - }, + "remote.SSH.remotePlatform": {"coder.doty-dev":"linux","192.168.0.114":"linux","coder-vscode--johndoty--doty-dev":"linux"}, "java.import.maven.enabled": false, "remote.autoForwardPortsSource": "process", "go.toolsManagement.autoUpdate": true, From 5e7a3d20fc68eaea6d0f5dca330053513250e0d3 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 07:00:31 -0700 Subject: [PATCH 4/7] Small tweaks --- .emacs.d/init.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 0aa76fb..c141d62 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -914,9 +914,10 @@ Or, uh, Objective C, I guess." (eglot-ensure) ;; Not a deno project; just enable tide and the normal - (eldoc-mode) (tide-setup) - (tide-hl-identifier-mode))) + (flycheck-mode +1) + (tide-hl-identifier-mode) + (eldoc-mode +1))) (use-package typescript-mode :ensure t :config @@ -1124,7 +1125,7 @@ Or, uh, Objective C, I guess." (defun my-pico8-hook () "My hook for pico-8 mode." ;; Pico-8 has a small indent. - (setq lua-indent-level 2) + (setq lua-indent-level 1) (set-fill-column 32)) (use-package pico8-mode From bd4694c8c60deadd0201b61a33c8ffe772d08478 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 07:04:56 -0700 Subject: [PATCH 5/7] Global company mode --- .emacs.d/init.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index c141d62..4dbec1d 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -319,13 +319,14 @@ (add-hook 'text-mode-hook 'my-text-mode-hook) ;; ================================================================= -;; Company? +;; Company? Company. ;; ================================================================= (use-package company :ensure t :commands company-mode - :hook - (typescript-mode . company-mode) - (python-mode . company-mode) ;; 2023-08-23 Adding company-mode to compose with eglot + :config + ;; 2023-08-26: Enable comapny mode globally. + (setq company-idle-delay 0.3) + (global-company-mode t) ) ;; ================================================================= From acca433c0dfad2bcf152ddfbd0aa02205aa9bb45 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 07:20:48 -0700 Subject: [PATCH 6/7] Some credential helpers? Maybe? --- .gitconfig | 4 ++-- .gitconfig.shared | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitconfig b/.gitconfig index 9f7b921..b1e23ea 100644 --- a/.gitconfig +++ b/.gitconfig @@ -3,7 +3,7 @@ email = john@d0ty.me [include] - path = .gitconfig.shared + path = .gitconfig.shared [credential "https://github.com"] helper = helper = !/opt/local/bin/gh auth git-credential @@ -15,4 +15,4 @@ [github] user = DeCarabas [safe] - directory = /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core + directory = /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core diff --git a/.gitconfig.shared b/.gitconfig.shared index 4d24e85..cc33735 100644 --- a/.gitconfig.shared +++ b/.gitconfig.shared @@ -12,4 +12,8 @@ [init] defaultBranch = main [rebase] - updateRefs = true \ No newline at end of file + updateRefs = true +[credential "helperselector"] + selected = manager +[credential "https://git.d0ty.me"] + provider = generic From fdbddfc8ebf154455e40ad54199e4801530ae9c5 Mon Sep 17 00:00:00 2001 From: John Doty Date: Sat, 26 Aug 2023 07:21:20 -0700 Subject: [PATCH 7/7] CUSTOM.EL (shakes fist) --- .emacs.d/custom.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.emacs.d/custom.el b/.emacs.d/custom.el index d26cadd..c23a4c6 100644 --- a/.emacs.d/custom.el +++ b/.emacs.d/custom.el @@ -58,7 +58,7 @@ '(org-odd-levels-only t) '(org-todo-keywords '((sequence "TODO" "|" "DONE" "ABANDONED" "DEFERRED"))) '(package-selected-packages - '(vterm lsp-pyright blacken nyan-mode earthfile-mode compat adaptive-wrap terraform-mode deadgrep protobuf-mode bazel howm python-mode color-theme-sanityinc-solarized monokai-theme rust-mode tide typescript-mode modus-themes tree-sitter flycheck-rust eglot ink-mode prettier-js zig-mode esup gnu-elpa-keyring-update lsp-hack hack-mode filladapt lsp-ui yaml-mode wgrep fsharp-mode company-lsp cquery mustache-mode clang-format projectile dash-functional mocha add-node-modules-path rjsx-mode xref-js2 js2-refactor company omnisharp geiser cider clojure-mode graphviz-dot-mode multi-term xterm-color thrift markdown-mode tuareg merlin ag use-package flycheck dockerfile-mode js2-mode web-mode tss switch-window paredit magit lua-mode go-mode go-autocomplete exec-path-from-shell csharp-mode color-theme-monokai auto-complete auto-complete-nxml flymake flyspell json-mode popup ruby-mode company-jedi elm-mode monky color-theme-sanityinc-tomorrow)) + '(omnisharp vterm lsp-pyright blacken nyan-mode earthfile-mode compat adaptive-wrap terraform-mode deadgrep protobuf-mode bazel howm python-mode color-theme-sanityinc-solarized monokai-theme rust-mode tide typescript-mode modus-themes tree-sitter flycheck-rust eglot ink-mode prettier-js zig-mode esup gnu-elpa-keyring-update lsp-hack hack-mode filladapt lsp-ui yaml-mode wgrep fsharp-mode company-lsp cquery mustache-mode clang-format projectile dash-functional mocha add-node-modules-path rjsx-mode xref-js2 js2-refactor company omnisharp geiser cider clojure-mode graphviz-dot-mode multi-term xterm-color thrift markdown-mode tuareg merlin ag use-package flycheck dockerfile-mode js2-mode web-mode tss switch-window paredit magit lua-mode go-mode go-autocomplete exec-path-from-shell csharp-mode color-theme-monokai auto-complete auto-complete-nxml flymake flyspell json-mode popup ruby-mode company-jedi elm-mode monky color-theme-sanityinc-tomorrow)) '(reb-re-syntax 'string) '(rmail-mail-new-frame t) '(safe-local-variable-values @@ -90,7 +90,7 @@ '(truncate-lines t) '(typescript-indent-level 2) '(use-dialog-box nil) - '(warning-suppress-types '(((unlock-file)))) + '(warning-suppress-types '((emacs) ((unlock-file)))) '(web-mode-code-indent-offset 2) '(web-mode-css-indent-offset 2) '(which-func-mode-global t nil (which-func))