Skip to content

Commit

Permalink
https://github.com/raxod502/ctrlf/issues/83
Browse files Browse the repository at this point in the history
+company snippet tinkering
  • Loading branch information
rileyrg committed Apr 9, 2021
1 parent 39dbb16 commit 2e36194
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 246 deletions.
203 changes: 101 additions & 102 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,18 +424,12 @@ Raw: [rgr/minibuffer](etc/elisp/rgr-minibuffer.el)
(ctrlf-auto-recenter t nil nil "Customized with use-package ctrlf")
(ctrlf-highlight-current-line t)
(ctrlf-auto-recenter t)
;; (ctrlf-mode-bindings
;; '(("C-s" . ctrlf-forward-fuzzy-regexp)
;; ("C-r" . ctrlf-backward-fuzzy-regexp)
;; ("C-M-s" . ctrlf-forward-literal)
;; ("C-M-r" . ctrlf-backward-literal)
;; ("M-s _" . ctrlf-forward-regexp)
;; ))
(ctrlf-mode-bindings
'(("C-s" . ctrlf-forward-fuzzy-regexp)
("C-r" . ctrlf-backward-fuzzy-regexp)
))
:config
(define-advice
ctrlf-change-search-style
(:after (&rest _))
(with-current-buffer (window-buffer (minibuffer-selected-window))
(setq-local ctrlf-default-search-style ctrlf--style)))
(ctrlf-mode +1))

5. [Selectrum](https://github.com/raxod502/selectrum) provides UI for selection from candidate list
Expand Down Expand Up @@ -584,22 +578,7 @@ Raw:[rgr/completion](etc/elisp/rgr-completion.el)

(setq-default abbrev-mode 1)

2. Snippets with yasnippet

(use-package
yasnippet
:init (yas-global-mode 1)
:config
(use-package
php-auto-yasnippets)
(use-package
el-autoyas)
(use-package
yasnippet-snippets)
(use-package
yasnippet-classic-snippets))

3. Company Mode
2. Company Mode :company:

[company-box](https://github.com/sebastiencs/company-box) provides nice linked help on the highlighted completions when available.

Expand All @@ -611,7 +590,7 @@ Raw:[rgr/completion](etc/elisp/rgr-completion.el)
(add-hook 'after-init-hook 'global-company-mode)
:custom
(company-backends
'((company-capf :with company-dabbrev company-files company-ispell)))
'((company-capf :with company-dabbrev company-yasnippet company-files company-ispell)))
:config
(use-package
company-box
Expand All @@ -621,9 +600,23 @@ Raw:[rgr/completion](etc/elisp/rgr-completion.el)
:after company
:config
(company-prescient-mode +1))
) ;; :bind ("C-<tab>" . company-complete))
:bind ("C-<tab>" . company-complete))

4. Which Key
3. Snippets with yasnippet :snippets:yasnippet:

(use-package
yasnippet
:init (yas-global-mode 1)
:config
(require 'company-yasnippet)
(use-package
el-autoyas)
(use-package
yasnippet-snippets)
(use-package
yasnippet-classic-snippets))

4. Which Key :which:key:

[which-key](https://github.com/justbur/emacs-which-key) shows you what further key options you have if you pause on a multi key command.

Expand Down Expand Up @@ -904,78 +897,79 @@ Raw: [rgr/general-config](etc/elisp/rgr-general-config.el).

1. Centaur Tabs :centaur:

(use-package centaur-tabs
:straight ( :local-repo "~/development/projects/emacs/centaur-tabs/" :fork ( :type git :host github :repo "rileyrg/centaur-tabs"))

:custom
(centaur-tabs-style "bar")
(centaur-tabs-height 32)
(centaur-tabs-set-icons t)
(centaur-tabs-set-modified-marker t)
(centaur-tabs-show-navigation-buttons t)
(centaur-tabs-set-bar 'under)
(x-underline-at-descent-line t)
:config
(centaur-tabs-headline-match)
;; (setq centaur-tabs-gray-out-icons 'buffer)
;; (centaur-tabs-enable-buffer-reordering)
;; (setq centaur-tabs-adjust-buffer-order t)
(centaur-tabs-mode +1)
;; (setq uniquify-separator "/")
;; (setq uniquify-buffer-name-style 'forward)
(defun centaur-tabs-buffer-groups ()
"`centaur-tabs-buffer-groups' control buffers' group rules.

Group centaur-tabs with mode if buffer is derived from `eshell-mode' `emacs-lisp-mode' `dired-mode' `org-mode' `magit-mode'.
All buffer name start with * will group to \"Emacs\".
Other buffer group by `centaur-tabs-get-group-name' with project name."
(list
(cond
;; ((not (eq (file-remote-p (buffer-file-name)) nil))
;; "Remote")
((or (string-equal "*" (substring (buffer-name) 0 1))
(memq major-mode '(magit-process-mode
magit-status-mode
magit-diff-mode
magit-log-mode
magit-file-mode
magit-blob-mode
magit-blame-mode
)))
"Emacs")
((derived-mode-p 'prog-mode)
"Editing")
;; ((derived-mode-p 'dired-mode)
;; "Dired")
((memq major-mode '(helpful-mode
help-mode))
"Help")
((memq major-mode '(org-mode
org-agenda-clockreport-mode
org-src-mode
org-agenda-mode
org-beamer-mode
org-indent-mode
org-bullets-mode
org-cdlatex-mode
org-agenda-log-mode
diary-mode))
"OrgMode")
(t
(centaur-tabs-get-group-name (current-buffer))))))
:hook
(dashboard-mode . centaur-tabs-local-mode)
(term-mode . centaur-tabs-local-mode)
(calendar-mode . centaur-tabs-local-mode)
(org-agenda-mode . centaur-tabs-local-mode)
(helpful-mode . centaur-tabs-local-mode)
:bind
("C-1" . centaur-tabs-backward)
("C-2" . centaur-tabs-forward)
("C-x t s" . centaur-tabs-switch-group)
("C-x t p" . centaur-tabs-group-by-projectile-project)
("C-x t g" . centaur-tabs-group-buffer-groups)
)
(use-package centaur-tabs
:straight ( :local-repo "~/development/projects/emacs/centaur-tabs/" :fork ( :type git :host github :repo "rileyrg/centaur-tabs"))

:custom
(centaur-tabs-style
"bar")
(centaur-tabs-height 32)
(centaur-tabs-set-icons t)
(centaur-tabs-set-modified-marker t)
(centaur-tabs-show-navigation-buttons t)
(centaur-tabs-set-bar 'under)
(x-underline-at-descent-line t)
:config
(centaur-tabs-headline-match)
;; (setq centaur-tabs-gray-out-icons 'buffer)
;; (centaur-tabs-enable-buffer-reordering)
;; (setq centaur-tabs-adjust-buffer-order t)
(centaur-tabs-mode +1)
;; (setq uniquify-separator "/")
;; (setq uniquify-buffer-name-style 'forward)
(defun centaur-tabs-buffer-groups ()
"`centaur-tabs-buffer-groups' control buffers' group rules.

Group centaur-tabs with mode if buffer is derived from `eshell-mode' `emacs-lisp-mode' `dired-mode' `org-mode' `magit-mode'.
All buffer name start with * will group to \"Emacs\".
Other buffer group by `centaur-tabs-get-group-name' with project name."
(list
(cond
;; ((not (eq (file-remote-p (buffer-file-name)) nil))
;; "Remote")
((or (string-equal "*" (substring (buffer-name) 0 1))
(memq major-mode '(magit-process-mode
magit-status-mode
magit-diff-mode
magit-log-mode
magit-file-mode
magit-blob-mode
magit-blame-mode
)))
"Emacs")
((derived-mode-p 'prog-mode)
"Editing")
;; ((derived-mode-p 'dired-mode)
;; "Dired")
((memq major-mode '(helpful-mode
help-mode))
"Help")
((memq major-mode '(org-mode
org-agenda-clockreport-mode
org-src-mode
org-agenda-mode
org-beamer-mode
org-indent-mode
org-bullets-mode
org-cdlatex-mode
org-agenda-log-mode
diary-mode))
"OrgMode")
(t
(centaur-tabs-get-group-name (current-buffer))))))
:hook
(dashboard-mode . centaur-tabs-local-mode)
(term-mode . centaur-tabs-local-mode)
(calendar-mode . centaur-tabs-local-mode)
(org-agenda-mode . centaur-tabs-local-mode)
(helpful-mode . centaur-tabs-local-mode)
:bind
("C-<next>" . centaur-tabs-backward)
("C-<prior>" . centaur-tabs-forward)
("C-x t s" . centaur-tabs-switch-group)
("C-x t p" . centaur-tabs-group-by-projectile-project)
("C-x t g" . centaur-tabs-group-buffer-groups)
)

7. Memory

Expand Down Expand Up @@ -2078,7 +2072,12 @@ Excellent [tree based navigation that works really well with projectile.](https:

(use-package
treemacs
:custom
(treemacs-follow-after-init t)
:config
(treemacs-follow-mode -1)
(treemacs-tag-follow-mode +1)
(treemacs-fringe-indicator-mode)
(treemacs-git-mode 'deferred)
(use-package
treemacs-projectile)
Expand Down
69 changes: 34 additions & 35 deletions emacs-config.org
Original file line number Diff line number Diff line change
Expand Up @@ -562,18 +562,12 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
(ctrlf-auto-recenter t nil nil "Customized with use-package ctrlf")
(ctrlf-highlight-current-line t)
(ctrlf-auto-recenter t)
;; (ctrlf-mode-bindings
;; '(("C-s" . ctrlf-forward-fuzzy-regexp)
;; ("C-r" . ctrlf-backward-fuzzy-regexp)
;; ("C-M-s" . ctrlf-forward-literal)
;; ("C-M-r" . ctrlf-backward-literal)
;; ("M-s _" . ctrlf-forward-regexp)
;; ))
(ctrlf-mode-bindings
'(("C-s" . ctrlf-forward-fuzzy-regexp)
("C-r" . ctrlf-backward-fuzzy-regexp)
))
:config
(define-advice
ctrlf-change-search-style
(:after (&rest _))
(with-current-buffer (window-buffer (minibuffer-selected-window))
(setq-local ctrlf-default-search-style ctrlf--style)))
(ctrlf-mode +1))
#+end_src
**** [[https://github.com/raxod502/selectrum][Selectrum]] provides UI for selection from candidate list
Expand Down Expand Up @@ -748,24 +742,7 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
#+begin_src emacs-lisp
(setq-default abbrev-mode 1)
#+end_src
**** Snippets with yasnippet
:PROPERTIES:
:END:
#+begin_src emacs-lisp
(use-package
yasnippet
:init (yas-global-mode 1)
:config
(use-package
php-auto-yasnippets)
(use-package
el-autoyas)
(use-package
yasnippet-snippets)
(use-package
yasnippet-classic-snippets))
#+end_src
**** Company Mode
**** Company Mode :company:
:PROPERTIES:
:END:
[[https://github.com/sebastiencs/company-box][company-box]] provides nice linked help on the highlighted completions when available.
Expand All @@ -779,7 +756,7 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
(add-hook 'after-init-hook 'global-company-mode)
:custom
(company-backends
'((company-capf :with company-dabbrev company-files company-ispell)))
'((company-capf :with company-dabbrev company-yasnippet company-files company-ispell)))
:config
(use-package
company-box
Expand All @@ -789,9 +766,25 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
:after company
:config
(company-prescient-mode +1))
) ;; :bind ("C-<tab>" . company-complete))
:bind ("C-<tab>" . company-complete))
#+end_src
**** Snippets with yasnippet :snippets:yasnippet:
:PROPERTIES:
:END:
#+begin_src emacs-lisp
(use-package
yasnippet
:init (yas-global-mode 1)
:config
(require 'company-yasnippet)
(use-package
el-autoyas)
(use-package
yasnippet-snippets)
(use-package
yasnippet-classic-snippets))
#+end_src
**** Which Key
**** Which Key :which:key:
:PROPERTIES:
:END:
[[https://github.com/justbur/emacs-which-key][which-key]] shows you what further key options you have if you pause on a multi key command.
Expand Down Expand Up @@ -1103,7 +1096,8 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
:straight ( :local-repo "~/development/projects/emacs/centaur-tabs/" :fork ( :type git :host github :repo "rileyrg/centaur-tabs"))

:custom
(centaur-tabs-style "bar")
(centaur-tabs-style
"bar")
(centaur-tabs-height 32)
(centaur-tabs-set-icons t)
(centaur-tabs-set-modified-marker t)
Expand Down Expand Up @@ -1165,8 +1159,8 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
(org-agenda-mode . centaur-tabs-local-mode)
(helpful-mode . centaur-tabs-local-mode)
:bind
("C-1" . centaur-tabs-backward)
("C-2" . centaur-tabs-forward)
("C-<next>" . centaur-tabs-backward)
("C-<prior>" . centaur-tabs-forward)
("C-x t s" . centaur-tabs-switch-group)
("C-x t p" . centaur-tabs-group-by-projectile-project)
("C-x t g" . centaur-tabs-group-buffer-groups)
Expand Down Expand Up @@ -2506,7 +2500,12 @@ This file generates [[file:init.el::defvar bootstrap-version][init.el]] and othe
#+begin_src emacs-lisp
(use-package
treemacs
:custom
(treemacs-follow-after-init t)
:config
(treemacs-follow-mode -1)
(treemacs-tag-follow-mode +1)
(treemacs-fringe-indicator-mode)
(treemacs-git-mode 'deferred)
(use-package
treemacs-projectile)
Expand Down
13 changes: 1 addition & 12 deletions etc/abbrev.el
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
;;-*-coding: utf-8;-*-
(define-abbrev-table 'emacs-lisp-mode-abbrev-table
'(
("ups" "config
)" nil :count 1)
))

(define-abbrev-table 'global-abbrev-table
'(
("eml" "emacs-lisp" nil :count 6)
))

(define-abbrev-table 'org-mode-abbrev-table
'(
("bs" "#+begin_src " nil :count 2)
("bsb" "#+begin_src bash " nil :count 1)
("bse" "#+begin_src emacs-lisp" nil :count 3)
("eml" "emacs-lisp" nil :count 6)
("es" "#+end_src" nil :count 2)
("mls" "ehll\\nthere\\nend" nil :count 1)
))

Loading

0 comments on commit 2e36194

Please sign in to comment.