summaryrefslogtreecommitdiff
path: root/config.org
diff options
context:
space:
mode:
authoryuzu-eva <stevenhu@web.de>2023-10-31 22:42:06 +0100
committeryuzu-eva <stevenhu@web.de>2023-10-31 22:42:06 +0100
commit4caf038cace0169c31f3e6d57c0732a42802541b (patch)
tree25df8383418f04b49b203d7985f6b3272caec79a /config.org
parentc4205af3b173ddcb4a8e4462a9aff609b397e715 (diff)
feature: un-/comment region via C-c u / C-c c
Diffstat (limited to 'config.org')
-rw-r--r--config.org96
1 files changed, 52 insertions, 44 deletions
diff --git a/config.org b/config.org
index 25f9ed7..0e28c0c 100644
--- a/config.org
+++ b/config.org
@@ -12,7 +12,7 @@ yuzu-emacs is my personal configuration for emacs.
It is a very basic configuration, which is heavily inspired by [[https://github.com/snackon/Witchmacs][Witchmacs]], the
main difference is that this configuration uses standard emacs keybindings, no
evil mode at all. Mainly used for programming in C and writing documents in
-org-mode.
+org-mode. Dashboard is just a picture of Cirno, because why not.
* Terminal
@@ -436,8 +436,7 @@ Inserts a newline above or below, like O and o in vim
(interactive)
(beginning-of-line)
(newline-and-indent)
- (previous-line)
- (indent-relative))
+ (previous-line))
(global-set-key (kbd "M-O") 'newline-above)
(defun newline-below ()
@@ -458,22 +457,6 @@ Configure a custom starting buffer
(use-package dashboard
:ensure t
:defer nil
- :preface
- (defun update-config ()
- (interactive)
- (let ((dir (expand-file-name user-emacs-directory)))
- (if (file-exists-p dir)
- (progn
- (message "yuzu-emacs is updating!")
- (cd dir)
- (shell-command "git pull")
- (message "Update finished. See changes in *Message* buffer and then restart."))
- (message "\"%s\" doesn't exist"))))
-
- (defun create-scratch-buffer ()
- (interactive)
- (switch-to-buffer (get-buffer-create "*scratch*"))
- (lisp-interaction-mode))
:config
(dashboard-setup-startup-hook)
(setq dashboard-items '((recents . 5)))
@@ -484,31 +467,7 @@ Configure a custom starting buffer
(setq dashboard-set-init-info t)
(setq dashboard-init-info (format "%d packages loaded in %s"
(length package-activated-list) (emacs-init-time)))
- (setq dashboard-set-footer nil)
- (setq dashboard-set-navigator t)
- (setq dashboard-navigator-buttons
- `(;; line1
- ((,nil
- "yuzu-emacs on github"
- "Open yuzu-emacs' github page on your browser"
- (lambda (&rest _) (browse-url "https://github.com/yuzu-eva/yuzu-emacs")))
- (nil
- "Update yuzu-emacs"
- "Get the latest yuzu-emacs update. See github commits for changes"
- (lambda (&rest _) (update-config)))
- (nil
- "Open scratch buffer"
- "Switch to the scratch buffer"
- (lambda (&rest _) (create-scratch-buffer)))
- ) ;;line 2
- ((,nil
- "Open config.org"
- "Open configuration file"
- (lambda (&rest _) (find-file "~/.emacs.d/config.org")))
- (nil
- "Open init.el"
- "Open the init file"
- (lambda (&rest _) (find-file "~/.emacs.d/init.el")))))))
+ (setq dashboard-set-footer nil))
#+End_src
** Initialize =diminish=
@@ -665,6 +624,49 @@ Autocompletion backend for C and C++
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))
#+end_src
+** Initialize =lsp-mode=
+
+Lsp-mode for autocompletion
+
+#+begin_src emacs-lisp
+ (use-package lsp-mode
+ :ensure t
+ :defer t
+ :commands lsp
+ :hook
+ (lsp-mode . (lambda ()
+ (let ((lsp-keymap-prefix "C-c l"))
+ (lsp-enable-which-key-integration))))
+ (sh-mode . lsp)
+ (lua-mode . lsp)
+ :config
+ (define-key lsp-mode-map (kbd "C-c l") lsp-command-map))
+#+end_src
+
+** Initialize =lua-mode=
+
+#+begin_src emacs-lisp
+ (use-package lua-mode
+ :ensure t
+ :config
+ (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
+ (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
+ (add-to-list 'interpreter-mode-alist '("lua" . lua-mode)))
+#+end_src
+
+# ** Configuring =tree-sitter=
+
+# Install tree sitter grammar packages
+
+# #+begin_src emacs-lisp
+# (setq treesit-language-source-alist
+# '((c "https://github.com/tree-sitter/tree-sitter-c")
+# (cpp "https://github.com/tree-sitter/tree-sitter-cpp")))
+# ;;; comment this out after installing packages
+# ;;; otherwise it'll clone the repos everytime the config is loaded
+# ;;(mapc #'treesit-install-language-grammar (mapcar #'car treesit-language-source-alist))
+# #+end_src
+
* Custom keybinds
Some keybinds to make life easier
@@ -701,3 +703,9 @@ Some keybinds to make life easier
(global-set-key (kbd "C-0") 'xah-forward-right-bracket)
#+end_src
+** Comment / uncomment selected region
+
+#+begin_src emacs-lisp
+ (global-set-key (kbd "C-c c") 'comment-region)
+ (global-set-key (kbd "C-c u") 'uncomment-region)
+#+end_src