diff --git a/config.el b/config.el index 6a186bf..da16691 100644 --- a/config.el +++ b/config.el @@ -3,7 +3,6 @@ ;; Place your private configuration here! Remember, you do not need to run 'doom ;; sync' after modifying this file! - ;; Some functionality uses this to identify you, e.g. GPG configuration, email ;; clients, file templates and snippets. (setq user-full-name "Levi Olson" @@ -22,10 +21,9 @@ ;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light) ;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) -(setq doom-font (font-spec :family "PragmataPro Liga" :size 20) - doom-variable-pitch-font (font-spec :family "PragmataPro Liga" :size 20) ; inherits `doom-font''s :size - doom-unicode-font (font-spec :family "PragmataPro Liga" :size 12) - doom-big-font (font-spec :family "PragmataPro Liga" :size 30)) +(setq doom-font (font-spec :family "PragmataPro" :size 20 :weight 'regular) + doom-variable-pitch-font (font-spec :family "PragmataPro" :size 20) + doom-unicode-font (font-spec :family "PragmataPro" :size 20)) ;; There are two ways to load a theme. Both assume the theme is installed and ;; available. You can either set `doom-theme' or manually load a theme with the @@ -40,7 +38,6 @@ ;; This determines the style of line numbers in effect. If set to `nil', line ;; numbers are disabled. For relative line numbers, set this to `relative'. (setq display-line-numbers-type t) - (setq projectile-project-search-path "~/Projects") (require 's) @@ -56,6 +53,16 @@ (setq browse-url-chrome-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe") (setq browse-url-chromium-program "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe") ))) +(when (eq system-type 'darwin) + (progn + (setq org-directory "/Users/leviolson/Nextcloud/Org") + (add-to-list 'default-frame-alist '(top . 0)) + (add-to-list 'default-frame-alist '(left . 0)) + (add-to-list 'default-frame-alist '(height . 49)) + (add-to-list 'default-frame-alist '(width . 178)) + (setq browse-url-chrome-program "/Applications/Safari.app") + (setq browse-url-chromium-program "/Applications/Safari.app") + )) ;; Here are some additional functions/macros that could help you configure Doom: @@ -78,12 +85,31 @@ (load! "functions.el") (use-package! functions) -(load! "fancy-banner.el") -(use-package! fancy-banner) - (load! "setup-elfeed.el") (use-package! setup-elfeed) +(after! company + ;; (set-company-backend! 'prog-mode nil) + (set-company-backend! 'typescript-mode '(:separate 'company-tabnine 'company-capf 'company-yasnippet)) + ;; (setq company-backends '(company-tabnine company-capf)) + ) + +(use-package company-tabnine + :after company + :ensure t + :config + ;; Tabnine::config ;; to open the config + ;; Tabnine::config_dir ;; /Users/leviolson/Library/Preferences/TabNine + + ;; Trigger completion immediately. + (setq company-idle-delay 0) + + ;; Number the candidates (use M-1, M-2 etc to select completions). + (setq company-show-numbers t) + + ;; (setq company-backends '(company-tabnine company-capf)) + ) + (use-package! darkroom :commands darkroom-mode :custom @@ -94,11 +120,12 @@ ) (use-package! org + ;; :disabled t :commands org-capture :mode ("\\.org\\'" . org-mode) :bind ( ("C-," . org-cycle-agenda-files) - ("C-c C-d" . org-capture) + ;; ("C-c C-d" . org-capture) :map org-mode-map ("M-n" . leo/org-narrow-next-tree) ("M-p" . leo/org-narrow-prev-tree) @@ -118,14 +145,6 @@ (concat org-directory "/personal.org") (concat org-directory "/archive.org") )) - (set-face-attribute 'org-document-title nil :height 1.5) - (set-face-attribute 'org-level-1 nil :height 1.2) - (set-face-attribute 'org-level-2 nil :height 1.1) - (set-face-attribute 'org-level-3 nil :height 1.0) - (set-face-attribute 'org-level-4 nil :height 1.0) - (set-face-attribute 'org-level-5 nil :height 1.0) - (set-face-attribute 'org-scheduled-today nil :height 2.0) - (set-face-attribute 'org-agenda-date-today nil :height 2.0) (setq org-agenda-include-diary t) (add-to-list 'safe-local-variable-values '(eval leo/deft-insert-boilerplate)) (setq org-refile-targets '((nil :maxlevel . 3) @@ -181,14 +200,10 @@ (match-end 1) ,(concat (list ?\C-i) (list (decode-char 'ucs (cadr regex-char-pair))))))))) - '(("\\(\\[ \\]\\)" #XF096);2B1C - ("\\(\\[-\\]\\)" #XF147);29C7;F458 - ("\\(\\[X\\]\\)" #XF046);2BBD + '(("\\(\\[ \\]\\)" #XF096);2B1C;F096; + ("\\(\\[-\\]\\)" #XF147);29C7;F458;F147; + ("\\(\\[X\\]\\)" #XF046);2BBD;F046; ))) - ;; Replace list hyphen with dot - ;; (font-lock-add-keywords 'org-mode - ;; '(("^ *\\([-]\\) " - ;; (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•")))))) (defun add-checkbox-symbol-keywords () "Add checkbox font to font-lock." (font-lock-add-keywords nil checkbox-fontlock-keywords-alist)) @@ -202,14 +217,21 @@ )) ) -(use-package! org-roam - :after org +(use-package org-roam + :disabled t + :ensure t :hook - (org-mode . org-roam-mode) - :config - (setq org-roam-directory (concat org-directory "/Roam/")) - (setq org-roam-link-title-format "r::%s") - (org-roam-db-build-cache)) + (after-init . org-roam-mode) + :custom + (org-roam-directory (concat org-directory "/Roam/")) + (org-roam-link-title-format "r::%s") + :bind (:map org-roam-mode-map + (("C-c n l" . org-roam) + ("C-c n f" . org-roam-find-file) + ("C-c n g" . org-roam-graph)) + :map org-mode-map + (("C-c n i" . org-roam-insert)) + (("C-c n I" . org-roam-insert-immediate)))) (use-package! deft :after org @@ -223,6 +245,7 @@ deft-recursive-ignore-dir-regexp "\\(?:\\.\\|\\.\\.\\|setup\\)$")) (use-package! org-journal + :disabled t :after org :config (setq org-journal-date-prefix "#+TITLE: " @@ -238,18 +261,11 @@ (org-pandoc-import-backend html) ) -(use-package! lsp-java - :hook ( - (java-mode . lsp-deferred) - (java-mode . lsp-lens-mode) - (java-mode . lsp-ui-mode) - (css-mode . lsp-deferred) - (js-mode . lsp-deferred) - ) +(use-package! lsp-mode :config - (setq lsp-ui-doc-include-signature t - lsp-ui-doc-enable t - lsp-ui-sideline-enable t)) + (setq +lsp-company-backends '(:separate company-tabnine company-yasnippet company-capf)) + (setq lsp-enable-symbol-highlighting nil + lsp-headerline-breadcrumb-enable t)) (use-package! apex-mode :mode "\\.cls\\'" @@ -263,19 +279,29 @@ :config (setq so-long-action 'so-long-minor-mode)) -(use-package! ob-apex - :after org - :load-path "/home/leothelocust/Projects/emacs/apex-babel" - :commands org-babel-execute:apex) +(use-package! dired + :config + (setq dired-listing-switches "-ahgo --group-directories-first")) + +(use-package! dired-x + :disabled t + :custom + (dired-omit-files nil)) -(use-package! emacs-sfdx - :load-path "/home/leothelocust/Projects/emacs/emacs-sfdx" ;; use this load-path when testing locally - :commands (sfdx/transient-action sfdx/next-component-file) - :bind ("C-" . #'sfdx/next-component-file)) +(use-package! lookup + :config + (add-to-list '+lookup-provider-url-alist '("Melpa" "https://melpa.org/#/?q=%s"))) + +;;;;;;;;;;; +;; HOOKS ;; +;;;;;;;;;;; +(add-hook 'text-mode-hook 'leo/remove-dos-eol) ;; Don't show `^M' at the end of lines +(add-hook 'prog-mode-hook 'leo/remove-dos-eol) ;; same, but for prog modes -(use-package! vlocitemacs - :commands (vlo/transient-action)) +;;;;;;;;;;;;;;;;; +;; KEYBINDINGS ;; +;;;;;;;;;;;;;;;;; (map! :map global-map :prefix "C-x" "C-l" nil @@ -283,9 +309,8 @@ "a" #'org-agenda "e" #'elfeed "g" #'magit-status - "s" #'sfdx/transient-action - "v" #'vlo/transient-action )) + (map! :map global-map :prefix "C-c" "a" nil @@ -293,9 +318,8 @@ "a" #'org-agenda "e" #'elfeed "g" #'magit-status - "s" #'sfdx/transient-action - "v" #'vlo/transient-action )) + (map! :map comint-mode-map "q" '(lambda() (interactive) @@ -304,30 +328,57 @@ (leo/kill-this-buffer-unless-scratch) (+workspace/close-window-or-workspace) )))) + +(map! :map xwidget-webkit-mode-map + "C-i" 'xwidget-webkit-insert-string + "C-m" 'xwidget-webkit-insert-string + "C-s" 'isearch-forward + "M-w" 'xwidget-webkit-copy-selection-as-kill + "C-w" 'xwidget-webkit-copy-selection-as-kill + + "o" 'xwidget-webkit-goto-url + "C-l" 'xwidget-webkit-goto-url + + "n" 'xwidget-webkit-scroll-up + "p" 'xwidget-webkit-scroll-down + + "C-y" 'yank + ) + (map! :map global-map "M-t" #'treemacs-select-window "M-q" #'leo/kill-this-buffer-unless-scratch - "M-RET" #'lsp-ui-doc-glance + "M-RET" #'eshell "C-" #'leo/tidy "C-;" #'leo/comment-or-uncomment-region-or-line "C-c C-e" #'leo/edit-config "C-c d" #'leo/duplicate-thing + "C-c g" #'magit-status "M-n" #'leo/jump-to-next-symbol "M-p" #'leo/jump-to-prev-symbol "M-u" #'upcase-dwim "M-c" #'capitalize-dwim "M-l" #'downcase-dwim - "C-c b" #'counsel-switch-buffer + ;; Perspective.el + "C-c C-n" #'persp-next + "C-c C-p" #'persp-prev + "C-c C-r" #'persp-rename + "C-c C-l" #'persp-switch + "C-c C-s" #'persp-switch + "C-c b" #'persp-switch-to-buffer + + ;; "C-c b" #'counsel-switch-buffer "C-s" #'swiper "C-}" #'mc/mark-next-like-this "C-)" #'mc/unmark-next-like-this "C-{" #'mc/mark-previous-like-this "C-(" #'mc/unmark-previous-like-this + "C-@" #'er/expand-region "C-#" #'er/contract-region - "C-c C-r" #'counsel-recoll + ;; "C-c C-r" #'counsel-recoll ) diff --git a/custom.el b/custom.el index 5641aba..e348fed 100644 --- a/custom.el +++ b/custom.el @@ -3,11 +3,8 @@ ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. - '(package-selected-packages '(salesforce-utils org-bullets)) - '(safe-local-variable-values - '((eval leo/deft-insert-boilerplate) - (visual-line-mode . 1) - (whitespace-line-column . 120)))) + '(company-backends '(company-tabnine company-capf)) + '(package-selected-packages '(company-box))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/functions.el b/functions.el index a816bd1..2f08618 100644 --- a/functions.el +++ b/functions.el @@ -171,6 +171,51 @@ ;; (message "Tags not found, format aborted"))) ) +(defun leo/remove-dos-eol () + "Do not show ^M in files containing mixed UNIX and DOS line endings." + (interactive) + (setq buffer-display-table (make-display-table)) + (aset buffer-display-table ?\^M [])) + + +(defun leo/tabnine-toggle () + "Toggle TabNine for this buffer" + (interactive) + (if (member '(company-tabnine) company-backends) + (leo/tabnine-disable nil) + (leo/tabnine-enable nil))) + +(defun leo/tabnine-only-toggle () + "Toggle ONLY TabNine completion for this buffer" + (interactive) + (if (not (member '(company-tabnine) company-backends)) + (leo/tabnine-enable t) + (leo/tabnine-disable t))) + + +(defun leo/tabnine-enable (only) + "turn on TabNine for this buffer using ONLY tabnine or suplimentally adding it" + (if (not only) + (setq-local company-backends (add-to-list 'company-backends '(company-tabnine))) + (progn + (setq-local backends-list 'company-backends) + (setq-local company-backends '(company-tabnine)))) + (message "TabNine enabled! :)") + ) + +(defun leo/tabnine-disable (restore) + "turn off TabNine for this buffer, RESTORE it from saved backends list" + (if (not restore) + (setq-local company-backends (delete '(company-tabnine) company-backends)) + (progn + (setq-local company-backends 'backends-list) + (setq-local backends-list nil)) + ) + + (message "TabNine disabled :(") + ) + + (provide 'functions) ;;; functions.el ends here diff --git a/init.el b/init.el index ef33e53..e4d45d3 100644 --- a/init.el +++ b/init.el @@ -17,33 +17,36 @@ (doom! :input ;;chinese ;;japanese - ;;layout ; auie,ctsrnm is the superior home row + ;;layout ; auie,ctsrnm is the superior home row :completion - company ; 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 + (company +childFrame) ; the ultimate code completion backend + ;; helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + (ivy +fuzzy +prescient +icons) ; a search engine for love and life :ui deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does doom-dashboard ; a nifty splash screen for Emacs - doom-quit ; DOOM quit-message prompts when you quit Emacs - (emoji +unicode +ascii +github) ; 🙂 + ;; doom-quit ; DOOM quit-message prompts when you quit Emacs + ;;(emoji + ;; +unicode + ;; +ascii + ;; +github) ; 🙂 ;;fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW - ;;hydra + ;; hydra ;;indent-guides ; highlighted indent columns - ligatures ; ligatures and symbols to make your code pretty again + (ligatures +iosevka) ; 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 ;;neotree ; a project drawer, like NERDTree for vim ophints ; highlight the region an operation acts on (popup +defaults) ; tame sudden yet inevitable temporary windows - ;;tabs ; a tab bar for Emacs - treemacs ; a project drawer, like neotree but cooler + ;; tabs ; a tab bar for Emacs + (treemacs +lsp) ; a project drawer, like neotree but cooler ;;unicode ; extended unicode support for various languages vc-gutter ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB @@ -66,9 +69,9 @@ ;;word-wrap ; soft wrapping with language-aware indent :emacs - dired ; making dired pretty [functional] + (dired +icons) ; making dired pretty [functional] electric ; smarter, keyword-based electric-indent - ibuffer ; interactive buffer management + (ibuffer +icons) ; interactive buffer management undo ; persistent, smarter undo for your inevitable mistakes vc ; version-control and Emacs, sitting in a tree @@ -76,32 +79,32 @@ eshell ; the elisp shell that works everywhere ;;shell ; simple shell REPL for Emacs ;;term ; basic terminal emulator for Emacs - ;;vterm ; the best terminal emulation in Emacs + vterm ; the best terminal emulation in Emacs :checkers - syntax ; tasing you for every semicolon you forget + (syntax +childframe) ; tasing you for every semicolon you forget spell ; tasing you for misspelling mispelling grammar ; tasing grammar mistake every you make :tools ;;ansible - ;;debugger ; FIXME stepping through code, to help you add bugs + ;; debugger ; FIXME stepping through code, to help you add bugs ;;direnv - docker + (docker +lsp) ;;editorconfig ; let someone else argue about tabs vs spaces ;;ein ; tame Jupyter notebooks with emacs (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation (lsp +peek) - magit ; a git porcelain for Emacs + (magit +forge) ; a git porcelain for Emacs ;;make ; run make tasks from Emacs ;;pass ; password manager for nerds ;;pdf ; pdf enhancements - prodigy ; FIXME managing external services & code builders + ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings taskrunner ; taskrunner for all your projects - ;;terraform ; infrastructure as code + terraform ; infrastructure as code ;;tmux ; an API for interacting with tmux ;;upload ; map local to remote projects via ssh/ftp @@ -128,33 +131,31 @@ ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for - (go +lsp) ; the hipster dialect + ;; (go +lsp) ; the hipster dialect ;;(haskell +dante) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python ;;idris ; a language you can depend on (json +lsp) ; At least it ain't XML - (java +lsp) ; the poster child for carpal tunnel syndrome + ;; (java +lsp) ; the poster child for carpal tunnel syndrome (javascript +lsp) ; 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 ;;lean ;;factor - ledger ; an accounting system in Emacs + ;; ledger ; an accounting system in Emacs ;;lua ; one-based indices? one-based indices markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org - +dragndrop +pretty - +roam - +journal) ; organize your plain life in plain text + +roam) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional - python ; beautiful is better than ugly + ;; python ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 @@ -164,13 +165,13 @@ ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;scheme ; a fully conniving family of lisps - sh ; she sells {ba,z,fi}sh shells on the C xor + (sh +lsp) ; she sells {ba,z,fi}sh shells on the C xor ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - web ; the tubes - yaml ; JSON, but readable + (web +lsp +css +html) ; the tubes + (yaml +lsp) ; JSON, but readable :email ;;(mu4e +gmail) @@ -184,5 +185,5 @@ ;;twitter ; twitter client https://twitter.com/vnought :config - ;;literate + ;;literate ; TODO - change to this later @leothelocust (default +bindings +smartparens)) diff --git a/packages.el b/packages.el index 9766d69..d413764 100644 --- a/packages.el +++ b/packages.el @@ -60,23 +60,6 @@ (package! elfeed) (package! darkroom) -;; $DOOMDIR/packages.el -(package! org-pandoc-import - :recipe (:host github - :repo "tecosaur/org-pandoc-import" - :files ("*.el" "filters" "preprocessors"))) - -(package! apex-mode - :recipe (:host github - :repo "orangatame/apex-mode" - :files ("*.el"))) - -;; (package! emacs-sfdx -;; :recipe (:host github -;; :repo "leothelocust/emacs-sfdx" -;; :files ("*.el"))) - -(package! vlocitemacs - :recipe (:host github - :repo "leothelocust/vlocitemacs" - :files ("*.el"))) +(package! graphql-mode) + +(package! company-tabnine) diff --git a/setup-elfeed.el b/setup-elfeed.el index 5501101..30e3e7f 100644 --- a/setup-elfeed.el +++ b/setup-elfeed.el @@ -45,7 +45,7 @@ :config (defun yt-dl-it (url) "Downloads the URL in an async shell" - (let ((default-directory "/mnt/c/Users/Levi/Videos")) + (let ((default-directory "/Users/leviolson/Videos")) (async-shell-command (format "youtube-dl %s" url)))) (defun elfeed-youtube-dl (&optional use-generic-p)