Skip to content

Commit

Permalink
[emacs] rework doom config
Browse files Browse the repository at this point in the history
  • Loading branch information
joaofnds committed Oct 6, 2019
1 parent 592a88a commit 5b13455
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 103 deletions.
112 changes: 67 additions & 45 deletions dot_config/doom/config.el.tmpl
Original file line number Diff line number Diff line change
@@ -1,68 +1,90 @@
;;; ~/.doom.d/config.el -*- lexical-binding: t; -*-
; -*- mode: emacs-lisp; lexical-binding: t; -*-

(require 'tmux-pane)

(setq
(setq initial-frame-alist '((width . 120) (height . 50))

initial-frame-alist '((width . 100) (height . 50))
;; doom
doom-theme 'doom-solarized-dark
doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t ; if nil, italics is universally disabled
{{- if eq .chezmoi.os "darwin" }}
doom-font (font-spec :family "Dank Mono" :weight 'normal :size 18)
doom-big-font (font-spec :family "Dank Mono" :weight 'normal :size 24)
{{- end }}
{{- if eq .chezmoi.os "linux" }}
doom-font (font-spec :family "Dank Mono" :weight 'normal :size 28)
doom-big-font (font-spec :family "Dank Mono" :weight 'normal :size 34)
{{- end }}

doom-theme 'doom-solarized-dark
doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t ; if nil, italics is universally disabled
;; line numbers
display-line-numbers t
display-line-numbers-type 'relative
display-line-numbers-current-absolute t

{{- if eq .chezmoi.os "darwin" }}
doom-font (font-spec :family "Dank Mono" :size 18)
doom-big-font (font-spec :family "Dank Mono" :size 24)
{{- end }}
{{- if eq .chezmoi.os "linux" }}
doom-font (font-spec :family "Dank Mono" :size 28)
doom-big-font (font-spec :family "Dank Mono" :size 34)
{{- end }}
;; indentation
tab-width 2
indent-tabs-mode nil

display-line-numbers t
display-line-numbers-type 'relative
display-line-numbers-current-absolute t
;; projectile
make-backup-files nil
projectile-project-search-path '("~/code/")
projectile-enable-caching nil

tab-width 2
indent-tabs-mode nil
;; ivy
+ivy-project-search-engines '(ag rg)

make-backup-files nil
projectile-project-search-path '("~/code/")
;; enabled modes
tmux-pane-mode t

+ivy-project-search-engines '(ag rg)
dired-dwim-target t)

tmux-pane-mode t

dired-dwim-target t

org-bullets-bullet-list '("⁖")
org-tags-column -80)

; Enable flashing mode-line on errors
;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)

;; Enable custom neotree theme
(doom-themes-neotree-config)
;;(doom-themes-neotree-config)

;; Corrects (and improves) org-mode's native fontification.
(doom-themes-org-config)

;; Turn on the local ~projectile-rails-mode~ for the buffers which belong to a Rails project (either application or an engine).
;;(projectile-rails-global-mode)

;;(map! :leader
;; :v "e s r" #'emamux:send-region
;; :n "e s c" #'emamux:send-command)

(after! org
(map! :map org-mode-map
:n "M-j" #'org-metadown
:n "M-k" #'org-metaup)
(setq
org-todo-keywords '((sequence "TODO(t)" "PROJ(p!)" "|" "DONE(d!)")
(sequence "[ ](T)" "[-](P)" "[?](M@)" "|" "[X](D!)")
(sequence "NEXT(n)" "WAIT(w@/!)" "HOLD(h@/!)" "|" "ABRT(c@)"))
org-enforce-todo-dependencies t
org-enforce-todo-checkbox-dependencies t
org-log-done 'time
org-log-into-drawer t))
(setq org-todo-keywords '((sequence "TODO(t)" "PROJ(p!)" "|" "DONE(d!)")
(sequence "[ ](T)" "[-](P)" "[?](M@)" "|" "[X](D!)")
(sequence "NEXT(n)" "WAIT(w@/!)" "HOLD(h@/!)" "|" "ABRT(c@)"))
;; custom char for org bullets
org-bullets-bullet-list '("")
;; The column to which tags should be indented in a headline
org-tags-column -80
;; Non-nil means undone TODO entries will block switching the parent to DONE
org-enforce-todo-dependencies t
;; Non-nil means unchecked boxes will block switching the parent to DONE
org-enforce-todo-checkbox-dependencies t
;; Information to record when a task moves to the DONE state.
org-log-done 'time
;; Non-nil means insert state change notes and time stamps into a drawer
org-log-into-drawer t))

(add-hook! '(go-mode-hook js2-mode-hook enh-ruby-mode-hook)
#'(hs-minor-mode lsp-deferred yas-minor-mode))

(add-hook 'emacs-lisp-mode-hook #'hs-minor-mode)
(add-hook 'org-mode-hook #'yas-minor-mode)

(add-to-list 'hs-special-modes-alist
'(ruby-mode "\\(def\\|do\\|class\\|begin\\|ensure\\|if\\|unless\\|{\\)"
"\\(end\\|end\\|end\\|end\\|end\\|end\\|end\\|}\\)"
"#"
(lambda (arg) (ruby-end-of-block))
nil))

(map! :leader
:n "l d" #'lsp-find-definition
:n "l R" #'lsp-find-references
:n "l r" #'lsp-rename
:n "l f" #'lsp-format-region
:n "l F" #'lsp-format-buffer)
95 changes: 47 additions & 48 deletions dot_config/doom/init.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
;;; init.el -*- lexical-binding: t; -*-
; -*- mode: emacs-lisp; lexical-binding: t; -*-

;; Copy this file to ~/.doom.d/init.el or ~/.config/doom/init.el ('doom install'
;; will do this for you). The `doom!' block below controls what modules are
Expand All @@ -8,56 +8,56 @@
;; More information about these modules (and what flags they support) can be
;; found in modules/README.org.

(doom! :input
;;chinese
;;japanese
(doom! :completion
ivy ; a search engine for love and life
company ; the ultimate code completion backend

: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

:ui
;;deft ; notational velocity for Emacs
doom ; what makes DOOM look the way it does
doom-dashboard ; a nifty splash screen for Emacs
modeline ; snazzy, Atom-inspired modeline, plus API
workspaces ; tab emulation, persistence & separate workspaces
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
hydra ; Make bindings that stick around
;; neotree ; a project drawer, like NERDTree for vim
;; unicode ; extended unicode support for various languages

;;deft ; notational velocity for Emacs
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
;;fill-column ; a `fill-column' indicator
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;; hydra
;;indent-guides ; highlighted indent columns
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink the current line after jumping
neotree ; a project drawer, like NERDTree for vim
;;ophints ; highlight the region an operation acts on
;;(popup ; tame sudden yet inevitable temporary windows
;; +all ; catch all popups that start with an asterix
;; +defaults) ; default popup rules
;;pretty-code ; replace bits of code with pretty symbols
;;tabs ; an tab bar for Emacs
;;treemacs ; 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
;;window-select ; visually switch windows
workspaces ; tab emulation, persistence & separate workspaces

:editor
(evil +everywhere); come to the dark side, we have cookies
(evil +everywhere) ; come to the dark side, we have cookies
snippets ; my elves. They type so I don't have to
;; fold ; (nigh) universal code folding

;;file-templates ; auto-snippets for empty files
;;fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
;;lispy ; vim for lisp, for people who dont like vim
;;multiple-cursors ; editing in many places at once
;;objed ; text object editing for the innocent
;;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

:emacs
(dired +ranger) ; making dired pretty [functional]
dired ; making dired pretty [functional]

;;electric ; smarter, keyword-based electric-indent
;;vc ; version-control and Emacs, sitting in a tree

Expand All @@ -68,21 +68,22 @@
;;vterm ; another terminals in Emacs

:tools
magit ; a git porcelain for Emacs
flycheck ; tasing you for every semicolon you forget
lsp
eval ; run code, run (also, repls)
editorconfig ; let someone else argue about tabs vs spaces
docker

;;ansible
;;debugger ; FIXME stepping through code, to help you add bugs
;;direnv
;;docker
;;editorconfig ; let someone else argue about tabs vs spaces
;;ein ; tame Jupyter notebooks with emacs
;;eval ; run code, run (also, repls)
;;flycheck ; tasing you for every semicolon you forget
;;flyspell ; tasing you for misspelling mispelling
;;gist ; interacting with github gists
;;(lookup ; helps you navigate your code and documentation
;; +docsets) ; ...or in Dash docsets locally
;;macos ; MacOS-specific commands
;;lsp
magit ; a git porcelain for Emacs
;;make ; run make tasks from Emacs
;;pass ; password manager for nerds
;;pdf ; pdf enhancements
Expand All @@ -94,61 +95,59 @@
;;wakatime

:lang
;;agda ; types of types of types of types...
;;assembly ; assembly for fun or debugging
(org ; organize your plain life in plain text
+dragndrop ; drag & drop files/images into org buffers
+pandoc) ; export-with-pandoc support
common-lisp ; if you've seen one lisp, you've seen them all
data ; config/data formats
emacs-lisp ; drown in parentheses
go ; the hipster dialect
javascript ; all(hope(abandon(ye(who(enter(here))))))
ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
sh ; she sells {ba,z,fi}sh shells on the C xor
;;cc ; C/C++/Obj-C madness
;;clojure ; java with a lisp
common-lisp ; if you've seen one lisp, you've seen them all
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
;;erlang ; an elegant language for a more civilized age
;;(haskell +intero) ; a language that's lazier than I am
;;latex ; writing papers in Emacs has never been so fun
;;markdown ; writing docs for people to ignore
;;python ; beautiful is better than ugly
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()

;;agda ; types of types of types of types...
;;assembly ; assembly for fun or debugging
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
;;erlang ; an elegant language for a more civilized age
;;elixir ; erlang done right
;;elm ; care for a cup of TEA?
;;emacs-lisp ; drown in parentheses
;;ess ; emacs speaks statistics
;;fsharp ; ML stands for Microsoft's Language
;;go ; the hipster dialect
;;(haskell +intero) ; a language that's lazier than I am
;;hy ; readability of scheme w/ speed of python
;;idris ;
;;(java +meghanada) ; the poster child for carpal tunnel syndrome
;;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
;;lean
;;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 ; organize your plain life in plain text
;; +dragndrop ; drag & drop files/images into org buffers
;; +ipython ; ipython/jupyter support for babel
+pandoc ; export-with-pandoc support
;; +present ; using org-mode for presentations
)
;;perl ; write code no one else can comprehend
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
;;python ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;rest ; Emacs as a REST client
ruby ; 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
;;sh ; she sells {ba,z,fi}sh shells on the C xor
;;solidity ; do you need a blockchain? No.
;;swift ; who asked for emoji variables?
;;terra ; Earth and Moon in alignment for performance.
;;web ; the tubes
;;vala ; GObjective-C
;;web ; the tubes

:email
;;(mu4e +gmail) ; WIP
Expand Down
13 changes: 3 additions & 10 deletions dot_config/doom/packages.el
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
;; -*- no-byte-compile: t; -*-
;;; .doom.d/packages.el
; -*- mode: emacs-lisp; no-byte-compile: t; -*-

;;(package! emamux)
;;(package! emamux-ruby-test)
;; Negivate seamlessly between tmux and emacs
(package! tmux-pane)


(package! projectile)
(package! projectile-rails)

;; Convert english words between singular and plural.
;; Needed by projectile-rails
(package! inflections)
(package! inflections) ; Needed by projectile-rails

0 comments on commit 5b13455

Please sign in to comment.