Skip to content

Commit

Permalink
org-todo-keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
JJPandari committed Apr 15, 2022
1 parent 1e365eb commit ee3fd37
Show file tree
Hide file tree
Showing 20 changed files with 76 additions and 18 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "emacs-application-framework"]
path = extensions/emacs-application-framework
url = [email protected]:manateelazycat/emacs-application-framework.git
[submodule "company-anywhere"]
path = extensions/company-anywhere
url = https://github.com/zk-phi/company-anywhere.git
1 change: 1 addition & 0 deletions extensions/company-anywhere
Submodule company-anywhere added at e33229
1 change: 1 addition & 0 deletions init.el
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
(require 'init-dotenv)
(require 'init-shell)
(require 'init-http)
(require 'init-cucumber)

(require 'init-chinese)
(require 'init-keyfreq)
Expand Down
8 changes: 8 additions & 0 deletions modes/init-company.el
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,14 @@ In that case, insert the number."
:custom (company-posframe-quickhelp-delay nil)
:hook (company-mode . company-posframe-mode))


(push (expand-file-name "company-anywhere" jester-submodules-dir) load-path)
(use-package company-anywhere
:ensure nil
:after company
:demand t)


;;----------------------------------------------------------------------------
;; Make tab do both yas expand and company.
;;----------------------------------------------------------------------------
Expand Down
26 changes: 26 additions & 0 deletions modes/init-cucumber.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(defvar cucumber-mode-syntax-table
(let ((table (make-syntax-table)))
(modify-syntax-entry ?\' "\"" table)
(modify-syntax-entry ?\@ "_" table)
table))

(defvar cucumber-mode-font-lock-keywords
(list
(cons (rx (and "@" (+ (or (syntax word) (syntax symbol))))) 'font-lock-function-name-face)
(cons (rx (or "Feature"
"Scenario"
"Given"
"When"
"Then"
"And")) 'font-lock-keyword-face))
"Font lock for cucumber mode.")

(define-derived-mode cucumber-mode prog-mode "🥒"
"Major mode for cucumber .feature files"
:syntax-table cucumber-mode-syntax-table
(setq font-lock-defaults '(cucumber-mode-font-lock-keywords)))

(add-auto-mode 'cucumber-mode "\\.feature\\'")


(provide 'init-cucumber)
1 change: 1 addition & 0 deletions modes/init-editing-utils.el
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ by telling whether the language in current buffer has generic types (which are u
(push (lambda () (eq major-mode 'rust-mode)) jester-buffer-has-generic-or-jsx-p-list)
(push (lambda () (eq major-mode 'typescript-mode)) jester-buffer-has-generic-or-jsx-p-list)
(push (lambda () (eq major-mode 'rjsx-mode)) jester-buffer-has-generic-or-jsx-p-list)
(push (lambda () (and (eq major-mode 'web-mode) (string-equal web-mode-engine "none"))) jester-buffer-has-generic-or-jsx-p-list)
(push (lambda () (and (buffer-file-name)
(member (file-name-extension (buffer-file-name))
'("ts" "tsx"))))
Expand Down
1 change: 0 additions & 1 deletion modes/init-evil.el
Original file line number Diff line number Diff line change
Expand Up @@ -614,5 +614,4 @@
;; TODO "vio" vs "yio": make visual "auto line-wise"?


;; TODO use another key for register 0 ("(" looks good)
(provide 'init-evil)
4 changes: 3 additions & 1 deletion modes/init-git.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
(use-package magit
:init
(setq magit-diff-refine-hunk t
magit-display-buffer-function 'magit-display-buffer-fullframe-status-v1)
magit-display-buffer-function 'magit-display-buffer-fullframe-status-v1
magit-log-margin '(t "周%u %Y-%m-%d %H:%M:%S %z" magit-log-margin-width t 18))
(jester/with-leader
"g s" 'magit-status
"g d" 'magit-diff-buffer-file
Expand Down Expand Up @@ -86,6 +87,7 @@
;; :config
;; (magithub-feature-autoinject t))

;; TODO setup forge
;; (use-package forge
;; :after magit)

Expand Down
10 changes: 6 additions & 4 deletions modes/init-ivy.el
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
"C-d" 'evil-scroll-down
"H-d" 'ivy-occur-delete-candidate
"g g" 'evil-goto-first-line
"g r" 'ivy-occur-revert-buffer)
"g r" 'ivy-occur-revert-buffer
"<return>" 'ivy-occur-press-and-switch
"f" 'ivy-occur-press)
(defun jester/ivy-copy-current-line ()
"Copy current line in ivy."
(interactive)
Expand All @@ -32,11 +34,11 @@
:after ivy
:config
;; --no-sort is much faster
(setq counsel-fzf-cmd "fzf --no-sort -f \"%s\""
(setq counsel-fzf-cmd "fzf --no-sort --exact -f \"%s\""
;; https://github.com/hlissner/doom-emacs/issues/3038
;; counsel-rg-base-command "rg --with-filename --no-heading --line-number --color never --max-filesize 1M --max-columns 233 --max-columns-preview %s || true"
;; counsel-rg-base-command "rg --with-filename --no-heading --line-number --color never --hidden --max-filesize 1M --max-columns 233 --max-columns-preview %s || true"
;; limit file size and line length to be faster. long lines doesn't matter when search but is laggy to display
counsel-rg-base-command '("rg" "--with-filename" "--no-heading" "--line-number" "--color" "never" "--max-filesize" "1M" "--max-columns" "233" "--max-columns-preview" "%s"))
counsel-rg-base-command '("rg" "--with-filename" "--no-heading" "--line-number" "--color" "never" "--hidden" "--max-filesize" "1M" "--max-columns" "233" "--max-columns-preview" "%s"))

(jester/with-leader
"p f" 'jester/open-project-file
Expand Down
3 changes: 2 additions & 1 deletion modes/init-javascript.el
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
(setq imenu-create-index-function (lambda () (jester/merge-imenu 'js2-mode-create-imenu-index))
imenu-generic-expression '((nil "^ *static \\(propTypes\\|defaultProps\\) = {$" 1))
mode-name "JSX"
emmet-expand-jsx-className? t))
emmet-expand-jsx-className? t)
(aggressive-indent-mode -1))
(require 'web-mode)
(custom-set-faces '(rjsx-tag
((t (:inherit web-mode-html-tag-face)))))
Expand Down
2 changes: 2 additions & 0 deletions modes/init-json.el
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(use-package json-mode
:init
(add-hook! 'json-mode-hook (aggressive-indent-mode -1))
:mode "\\(?:\\(?:\\(?:\\.\\(?:b\\(?:\\(?:abel\\|ower\\)rc\\)\\|json\\(?:ld\\)?\\)\\|composer\\.lock\\)\\)\\'\\)"
:config
(jester/with-major-leader 'json-mode-map
Expand Down
8 changes: 7 additions & 1 deletion modes/init-jump.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
:keymaps 'lsp-mode
"g r" 'jester/xref-find-references-at-point)


;; TODO xref-ring
;; (advice-add 'xref-find-definitions :after )


(use-package dumb-jump
:init
Expand All @@ -45,7 +49,9 @@


(use-package citre
:custom (citre-tags-files '("tagz" ".tags" "tags"))
:custom ((citre-enable-imenu-integration nil)
(citre-update-tags-file-when-no-definitions nil)
(citre-tags-files '("tagz" ".tags" "tags")))
:init
(require 'citre-config))
;; TODO try `citre-peek'
Expand Down
1 change: 1 addition & 0 deletions modes/init-minibuffer.el
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"M-d" #'backward-word
"M-b" #'kill-word
"C-w" #'backward-kill-word
"C-f" #'forward-char
"C-d" #'backward-char
"C-b" #'delete-char
"C-v" #'yank
Expand Down
2 changes: 2 additions & 0 deletions modes/init-misc.el
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
(use-package snow
:demand t)

;; (zone-when-idle 300)

;; TODO remember layout when ediff


Expand Down
10 changes: 4 additions & 6 deletions modes/init-org.el
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,12 @@ typical word processor."
;;; To-do settings

(setq org-todo-keywords
(quote ((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!/!)")
(sequence "PROJECT(p)" "|" "DONE(d!/!)" "CANCELLED(c@/!)")
(sequence "WAITING(w@/!)" "DELEGATED(e!)" "HOLD(h)" "|" "CANCELLED(c@/!)")))
org-todo-repeat-to-state "NEXT")
(quote ((sequence "TODO(t)" "|" "DONE(d!)" "THEM(e!)" "DONT(n!)")
(sequence "ASK(a)" "TODO(t)" "|")
(sequence "HOLD(h)" "TODO(t)" "|"))))

(setq org-todo-keyword-faces
(quote (("NEXT" :inherit warning)
("PROJECT" :inherit font-lock-string-face))))
(quote (("ASK" :inherit hl-todo))))



Expand Down
3 changes: 3 additions & 0 deletions modes/init-read.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(use-package sicp)

(provide 'init-read)
3 changes: 2 additions & 1 deletion modes/init-web.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
;; `flycheck-add-next-checker'
(setq flycheck-checker 'javascript-eslint)
(jester/make-default-evil-markers-for-js)
(setq emmet-expand-jsx-className? t)))
(setq-local emmet-expand-jsx-className? t)
(aggressive-indent-mode -1)))

(add-hook 'web-mode-hook 'jester/web-mode-maybe-setup-xml)
(defun jester/web-mode-maybe-setup-xml ()
Expand Down
3 changes: 2 additions & 1 deletion modes/init-windows.el
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ bound to `KEY' in the leader sub-keymap."
(jester/make-eyebrowse-switcher "main" 3 "m")
(jester/make-eyebrowse-switcher "terms" 4 "t")
(jester/make-eyebrowse-switcher "scratch" 6 "s")
(jester/make-eyebrowse-switcher "config" 9 "c"))
(jester/make-eyebrowse-switcher "config" 9 "c")
(jester/make-eyebrowse-switcher "org" 0 "g"))


(defun jester/kill-buffer-and-window ()
Expand Down
2 changes: 1 addition & 1 deletion snippets/js2-mode/useState
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# name: useState
# key: us
# --
const [$2, set${2:$(when (> (length yas-text) 0) (concat (upcase (substring yas-text 0 1)) (substring yas-text 1)))}] = useState($1);
const [$1, set${1:$(when (> (length yas-text) 0) (concat (upcase (substring yas-text 0 1)) (substring yas-text 1)))}] = useState$3($2);
2 changes: 1 addition & 1 deletion snippets/web-mode/useState
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# name: useState
# key: us
# --
const [$2, set${2:$(when (> (length yas-text) 0) (concat (upcase (substring yas-text 0 1)) (substring yas-text 1)))}] = useState($1);
const [$1, set${1:$(when (> (length yas-text) 0) (concat (upcase (substring yas-text 0 1)) (substring yas-text 1)))}] = useState$3($2);

0 comments on commit ee3fd37

Please sign in to comment.