From 44a24c4d5829c927c512dd82459e59e70969613c Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sat, 5 Dec 2020 13:58:05 -0300 Subject: Cleaned Doom configs, added Ruby configs --- .doom.d/config.el | 46 ++++++++++++++++++++++++++++++++-------------- .doom.d/custom.el | 13 +++++++++++++ .doom.d/init.el | 12 ++++++------ .doom.d/packages.el | 2 ++ 4 files changed, 53 insertions(+), 20 deletions(-) create mode 100644 .doom.d/custom.el diff --git a/.doom.d/config.el b/.doom.d/config.el index aadc0259..a6725545 100644 --- a/.doom.d/config.el +++ b/.doom.d/config.el @@ -36,7 +36,8 @@ ;; available. You can either set `doom-theme' or manually load a theme with the ;; `load-theme' function. This is the default: -(setq doom-theme 'doom-material) +;; (setq doom-theme 'doom-material) +(setq doom-theme 'doom-oceanic-next) ;; If you use `org' and don't want your org files in the default location below, ;; change `org-directory'. It must be set before org loads! @@ -110,12 +111,6 @@ (interactive) (helm-other-buffer '(helm-httpstatus-source) "*helm httpstatus*")) -;; Multiple cursors mode -(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) -(global-set-key (kbd "C->") 'mc/mark-next-like-this) -(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) -(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) - ;; Removes mouse from code (mouse-avoidance-mode "animate") @@ -141,8 +136,6 @@ (setq-default tab-width 2) (setq js-highlight-level 3) (setq auto-indent-indent-style 'aggressive) -;; (require 'aggressive-indent) -;; (global-aggressive-indent-mode 1) ;; Org Mode (after! org @@ -224,10 +217,12 @@ ))) ;; Enforce ordered tasks (setq org-enforce-todo-dependencies t) - (setq org-enforce-todo-checkbox-dependencies t)) + (setq org-enforce-todo-checkbox-dependencies t) + (require 'org-bullets) + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) ;; Emojify mode -(add-hook 'after-init-hook #'global-emojify-mode) +;; (add-hook 'after-init-hook #'global-emojify-mode) ;; My own menu (map! :leader @@ -247,9 +242,9 @@ '("node" "/home/roger/.vscode-oss/extensions/vscode-eslint-release-2.1.5/server/out/eslintServer.js" "--stdio")) -;; For some reason, eslint disables document hightlight so I'm reenabling it -(add-hook 'lsp-on-idle-hook 'lsp-document-highlight) + +(require 'auto-virtualenv) (after! python :init (setq lsp-pyls-plugins-pylint-enabled t) @@ -257,4 +252,27 @@ (setq lsp-pyls-plugins-pyflakes-enabled nil) (setq lsp-pyls-plugins-pycodestyle-enabled nil) (setq lsp-pyls-configuration-sources "pep8") - (add-hook 'before-save-hook 'lsp-format-buffer)) + (add-hook 'before-save-hook 'lsp-format-buffer) + (add-hook 'python-mode-hook 'auto-virtualenv-set-virtualenv) + (define-key python-mode-map (kbd "") 'python-insert-breakpoint)) + + +(defvar ruby--byebug-breakpoint-string "require 'byebug'; byebug ## DEBUG ##" + "Ruby breakpoint string used by `ruby-insert-breakpoint'") + +(defun ruby-insert-breakpoint () + "Inserts a ruby breakpoint using `byebug'" + (interactive) + (back-to-indentation) + ;; this preserves the correct indentation in case the line above + ;; point is a nested block + (split-line) + (insert ruby--byebug-breakpoint-string)) + + +(after! ruby-mode + :init + (add-hook 'ruby-mode-hook 'add-debug-highlight) + (define-key ruby-mode-map (kbd "") 'ruby-insert-breakpoint)) + +(global-set-key [f4] 'compile) diff --git a/.doom.d/custom.el b/.doom.d/custom.el new file mode 100644 index 00000000..3dea2909 --- /dev/null +++ b/.doom.d/custom.el @@ -0,0 +1,13 @@ +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; 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 '(auto-virtualenv))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; 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. + '(font-lock-comment-face ((t (:slant italic)))) + '(font-lock-keyword-face ((t (:slant italic))))) diff --git a/.doom.d/init.el b/.doom.d/init.el index 30002fbd..bcb1f21e 100644 --- a/.doom.d/init.el +++ b/.doom.d/init.el @@ -63,7 +63,7 @@ ;;parinfer ; turn lisp into python, sort of rotate-text ; cycle region at point between text candidates snippets ; my elves. They type so I don't have to - word-wrap ; soft wrapping with language-aware indent + ;; word-wrap ; soft wrapping with language-aware indent :emacs dired ; making dired pretty [functional] @@ -85,7 +85,7 @@ :tools ;;ansible - ;;debugger ; FIXME stepping through code, to help you add bugs + (debugger +lsp) ; FIXME stepping through code, to help you add bugs ;;direnv docker ;;editorconfig ; let someone else argue about tabs vs spaces @@ -116,7 +116,7 @@ ;;common-lisp ; if you've seen one lisp, you've seen them all ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c - ;;csharp ; unity, .NET, and mono shenanigans + csharp ; unity, .NET, and mono shenanigans data ; config/data formats ;;(dart +flutter) ; paint ui and not much else ;;elixir ; erlang done right @@ -132,7 +132,7 @@ ;;(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 ; At least it ain't XML + json ; At least it ain't XML ;;(java +meghanada) ; the poster child for carpal tunnel syndrome (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB @@ -146,7 +146,7 @@ ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - org ; organize your plain life in plain text + (org +hugo) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional @@ -156,7 +156,7 @@ ;;raku ; the artist formerly known as perl6 ;;rest ; Emacs as a REST client ;;rst ; ReST in peace - ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + (ruby +rails +lsp) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;scheme ; a fully conniving family of lisps diff --git a/.doom.d/packages.el b/.doom.d/packages.el index a9b8dbad..6abc3325 100644 --- a/.doom.d/packages.el +++ b/.doom.d/packages.el @@ -56,3 +56,5 @@ (package! ghub+) (package! lsp-python-ms :disable t) (package! jenkinsfile-mode) +(package! auto-virtualenv) +(package! org-bullets) -- cgit v1.2.3