Browse Source

Shortcuts, attempted language server and org refile

* Failed attempt to get org-refile to use ido
* M-w for ibuffer shortcut
* kill-subword function for camelCase fast deletion
* idomenu bind for quickly going to local symbols
* Language server early experimentation
master
macoymadson@gmail.com 3 years ago
parent
commit
c3f62f240f
  1. 2
      Emacs/core-settings.el
  2. 13
      Emacs/keybinds.el
  3. 7
      Emacs/org-customizations.el
  4. 27
      Emacs/tags-and-autocompletion.el

2
Emacs/core-settings.el

@ -116,6 +116,8 @@
(setq ido-enable-flex-matching t)
(setq ido-use-faces nil)
)
(setq ido-everywhere t)
;; Use ido for recentf file selection
;; From https://masteringemacs.org/article/find-files-faster-recent-files-package

13
Emacs/keybinds.el

@ -78,6 +78,9 @@
;; Switch buffers. Was backward-char
(global-set-key (kbd "C-b") 'ido-switch-buffer)
;; Open ibuffer (good for killing many buffers)
(global-set-key (kbd "M-w") 'ibuffer)
;; Switch desktops
(global-set-key (kbd "C-S-b") 'macoy-switch-desktop)
@ -103,6 +106,16 @@
;; Toggle comment lines (same keybind as Sublime). This also works for regions
(global-set-key (kbd "C-/") 'comment-line)
(defun macoy-kill-subword ()
"Temporarily enable subword mode to kill camelCase subword"
(interactive)
(subword-mode 1)
(call-interactively 'kill-word)
(subword-mode 0)
)
(global-set-key (kbd "C-S-<delete>") 'macoy-kill-subword)
;; Simpleclip cut copy paste (not sure if this is essential due to customize-group settings)
;; These are also set in my-keys mode with macoyCopy functions for multiple-cursors support,
;; overriding these defaults

7
Emacs/org-customizations.el

@ -39,6 +39,13 @@
;; Org: indent nested things
(setq org-startup-indented t)
;; Use ido for refile (doesn't work)
;; (setq org-refile-targets '((nil :maxlevel . 6)
;; (org-agenda-files :maxlevel . 6)))
;; (setq org-refile-use-outline-path nil)
(setq org-completion-use-ido t)
(setq org-outline-path-complete-in-steps nil)
;; My org files
(when (string-equal (user-login-name) "macoy")
(setq org-agenda-files (list "~/Dropbox/Org/1_Calendar.org"

27
Emacs/tags-and-autocompletion.el

@ -1,5 +1,6 @@
;; Imenu Ido interface (browse symbols in file)
(load-user-file "idomenu.el")
(global-set-key (kbd "C-]") 'idomenu)
;; Templates/Snippets
(yas-global-mode 1)
@ -149,14 +150,6 @@
(ido-completing-read
"Project file: " (tags-table-files) nil t)))))
;; cquery language server
;; See https://github.com/cquery-project/cquery/wiki
;; Run `lsp` to enable it in a buffer
(when (require 'cquery)
(setq cquery-executable "f:/gitRepos/cquery/build/Release/cquery.exe")
(setq cquery-project-roots '("f:/CJUNCTIONS/src" ))
)
;; Find references via tags-search. This is my find-references replacement
(defun macoy-tags-search ()
"Pick tag with `macoy-ido-find-tag' then run `tags-search' (or search marked)"
@ -191,3 +184,21 @@
(call-interactively 'tags-query-replace)
)
)
;;
;; Language Servers (the nuclear option)
;;
;; cquery language server
;; See https://github.com/cquery-project/cquery/wiki
;; Run `lsp` to enable it in a buffer
(when (require 'cquery)
(setq cquery-executable "f:/gitRepos/cquery/build/Release/cquery.exe")
(setq cquery-project-roots '("f:/CJUNCTIONS/src" ))
)
;; eglot language server alternative
(when (require 'eglot)
(add-to-list 'eglot-server-programs
'((c++ mode c-mode) . (eglot-cquery "f:/gitRepos/cquery/build/Release/cquery.exe")))
)

Loading…
Cancel
Save