From a43de1e8ffa8e505c57ef0d583e9038125f0eff8 Mon Sep 17 00:00:00 2001 From: Christopher James Hayward Date: Fri, 24 Nov 2023 16:10:18 -0500 Subject: [PATCH] Add relative line numbering --- README.org | 110 +++++++++++------------------------------------------ 1 file changed, 23 insertions(+), 87 deletions(-) diff --git a/README.org b/README.org index 098ae79..5ae0266 100644 --- a/README.org +++ b/README.org @@ -17,8 +17,8 @@ #+HUGO_DRAFT: false #+HTML: -#+HTML: -#+HTML: +#+HTML: +#+HTML: #+NAME: description #+BEGIN_SRC text @@ -591,7 +591,6 @@ nixos = nixpkgs.lib.nixosSystem { <> <> <> - <> <> <> <> @@ -616,7 +615,6 @@ Deploy this configuration with ~nixos-rebuild switch --flake /etc/dotfiles/#nixo modules.x11.enable = true; modules.ssh.enable = true; modules.hugo.enable = true; - modules.godot.enable = true; modules.flakes.enable = true; modules.cachix.enable = true; modules.docker.enable = true; @@ -748,7 +746,7 @@ in { services.picom.enable = true; services.printing.enable = true; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ iosevka-bin fira-code-symbols emacs-all-the-icons-fonts @@ -844,44 +842,6 @@ in { } #+END_SRC -** Godot - -#+NAME: module-godot -#+BEGIN_SRC nix -./modules/godot.nix -#+END_SRC - -[[https://godotengine.org][Godot]] is a cross-platform, free and open-source game engine released under the MIT license. It provides a huge set of common tools, so you can focus on making your game without reinventing the wheel. It's completely free and open-source, no strings attached, no royalties. The game belongs to the creator down to each line of the engine code. - -#+BEGIN_SRC nix :noweb yes :tangle modules/godot.nix -# <> -{ config, options, lib, pkgs, ... }: - -with lib; -with lib.types; -let - cfg = config.modules.godot; - -in { - options.modules.godot = { - enable = mkOption { - type = bool; - default = false; - }; - }; - - config = mkIf cfg.enable { - environment.systemPackages = [ - pkgs.tiled - pkgs.godot - pkgs.godot-server - pkgs.godot-headless - pkgs.gdtoolkit - ]; - }; -} -#+END_SRC - ** Flakes #+NAME: module-flakes @@ -1401,7 +1361,6 @@ let <> <> <> - <> <> <> <> @@ -1488,6 +1447,7 @@ When Emacs is started, it normally tries to load a Lisp program from an ititiali <> <> <> +<> <> <> <> @@ -1495,7 +1455,6 @@ When Emacs is started, it normally tries to load a Lisp program from an ititiali <> <> <> -<> <> <> <> @@ -2023,6 +1982,24 @@ epkgs.hydra "tf" '(hydra-text-scale/body :which-key "Font")) #+END_SRC +*** Line Numbers + +With relative line numbers, each line in a file is numbered relative to the cursor's current position to show the distance to that line. The current line is marked 0, the ones above and below are marked 1, and so on. + +#+NAME: emacs-line-numbers-elisp +#+BEGIN_SRC emacs-lisp +;; Enable relative line numbers. +;; (global-display-line-numbers-mode +1) +(setq display-line-numbers-type 'relative) + +;; Enable line numbering for all programming modes. +(add-hook 'prog-mode-hook 'display-line-numbers-mode) + +;; Add a shortcut to toggle line numbers. +(dotfiles/leader + "tl" '(display-line-numbers-mode :which-key "Line Numbers")) +#+END_SRC + *** Ligatures #+NAME: emacs-ligatures-package @@ -2585,6 +2562,7 @@ pkgs.isync #+NAME: emacs-mu4e-package #+BEGIN_SRC nix +epkgs.mu4e epkgs.mu4e-alert #+END_SRC @@ -2779,48 +2757,6 @@ epkgs.company (global-company-mode +1) #+END_SRC -*** GDScript Mode - -#+NAME: emacs-gdscript-package -#+BEGIN_SRC nix -epkgs.gdscript-mode -#+END_SRC - -https://github.com/godotengine/emacs-gdscript-mode is an Emacs package to get GDScript support and syntax highlighting. Some of its features include: - -+ Syntax highlighting -+ Code folding -+ Debugger support -+ Support for scenes and script files -+ Comment wrapping -+ Indentation -+ Automatic parsing -+ Code formatting - -#+NAME: emacs-gdscript-elisp -#+BEGIN_SRC emacs-lisp -(require 'gdscript-mode) - -;; Silence lsp warnings for gdscript. -(defun lsp--gdscript-ignore-errors (original-function &rest args) - "Ignore the error message resulting from Godot not replying to the `JSONRPC' request." - (if (string-equal major-mode "gdscript-mode") - (let ((json-data (nth 0 args))) - (if (and (string= (gethash "jsonrpc" json-data "") "2.0") - (not (gethash "id" json-data nil)) - (not (gethash "method" json-data nil))) - nil; (message "Method not found") - (apply original-function args))) - (apply original-function args))) - -;; Run the function around `lsp--get-message-type' to suppress warnings. -(advice-add #'lsp--get-message-type :around #'lsp--gdscript-ignore-errors) - -;; Add custom keybinds. -(dotfiles/leader - "lg" '(gdscript-hydra-show :which-key "GDScript")) -#+END_SRC - *** Go Mode #+NAME: emacs-golang-package