From dfde9448cb158fc4547dbfe95fe089ae978c2363 Mon Sep 17 00:00:00 2001 From: Mars Date: Thu, 15 Aug 2024 00:18:15 -0400 Subject: [PATCH] update --- .gitignore | 1 + _sources/generated.json | 42 +++++++++++++++++++++ _sources/generated.nix | 28 ++++++++++++++ config/default.nix | 8 +++- config/extraPackages/intuitive-tab-line.nix | 7 ++++ config/extraPackages/sideline-eglot.nix | 15 ++------ config/init.org | 39 ++++++++++++++----- flake.nix | 11 ++++-- nvfetcher.toml | 7 ++++ 9 files changed, 132 insertions(+), 26 deletions(-) create mode 100644 _sources/generated.json create mode 100644 _sources/generated.nix create mode 100644 config/extraPackages/intuitive-tab-line.nix diff --git a/.gitignore b/.gitignore index 9b42106..4f29c0e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .direnv/ +.DS_Store diff --git a/_sources/generated.json b/_sources/generated.json new file mode 100644 index 0000000..b38d85d --- /dev/null +++ b/_sources/generated.json @@ -0,0 +1,42 @@ +{ + "intuitive-tab-line": { + "cargoLocks": null, + "date": "2024-07-13", + "extract": null, + "name": "intuitive-tab-line", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "thread314", + "repo": "intuitive-tab-line-mode", + "rev": "7af75e46bbb22927e53df8d3664e1873234416f5", + "sha256": "sha256-GQ0ERmw/7EUrTIVHAxp2ggkr9RdWVJSJ6loVzZjDEy0=", + "type": "github" + }, + "version": "7af75e46bbb22927e53df8d3664e1873234416f5" + }, + "sideline-eglot": { + "cargoLocks": null, + "date": "2024-08-05", + "extract": null, + "name": "sideline-eglot", + "passthru": null, + "pinned": false, + "src": { + "deepClone": false, + "fetchSubmodules": false, + "leaveDotGit": false, + "name": null, + "owner": "emacs-sideline", + "repo": "sideline-eglot", + "rev": "d7fbb9e13edbe5b9b9de464c8dabb8b0014de78e", + "sha256": "sha256-/NCclLf4stF4+C1W+s2Y+LJ0TgqGAxVDa6v7+H+3/vA=", + "type": "github" + }, + "version": "d7fbb9e13edbe5b9b9de464c8dabb8b0014de78e" + } +} \ No newline at end of file diff --git a/_sources/generated.nix b/_sources/generated.nix new file mode 100644 index 0000000..3c5e480 --- /dev/null +++ b/_sources/generated.nix @@ -0,0 +1,28 @@ +# This file was generated by nvfetcher, please do not modify it manually. +{ fetchgit, fetchurl, fetchFromGitHub, dockerTools }: +{ + intuitive-tab-line = { + pname = "intuitive-tab-line"; + version = "7af75e46bbb22927e53df8d3664e1873234416f5"; + src = fetchFromGitHub { + owner = "thread314"; + repo = "intuitive-tab-line-mode"; + rev = "7af75e46bbb22927e53df8d3664e1873234416f5"; + fetchSubmodules = false; + sha256 = "sha256-GQ0ERmw/7EUrTIVHAxp2ggkr9RdWVJSJ6loVzZjDEy0="; + }; + date = "2024-07-13"; + }; + sideline-eglot = { + pname = "sideline-eglot"; + version = "d7fbb9e13edbe5b9b9de464c8dabb8b0014de78e"; + src = fetchFromGitHub { + owner = "emacs-sideline"; + repo = "sideline-eglot"; + rev = "d7fbb9e13edbe5b9b9de464c8dabb8b0014de78e"; + fetchSubmodules = false; + sha256 = "sha256-/NCclLf4stF4+C1W+s2Y+LJ0TgqGAxVDa6v7+H+3/vA="; + }; + date = "2024-08-05"; + }; +} diff --git a/config/default.nix b/config/default.nix index cbebfd1..2c00207 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,5 +1,7 @@ {pkgs, ...}: with pkgs; +let sources = import ../_sources/generated.nix {inherit (pkgs) fetchurl fetchFromGitHub fetchgit dockerTools;}; + in emacsWithPackagesFromUsePackage { config = ./init.org; defaultInitFile = true; @@ -52,8 +54,12 @@ with pkgs; epkgs // { sideline-eglot = callPackage ./extraPackages/sideline-eglot.nix { - inherit (pkgs) fetchFromGitHub; + inherit sources; inherit (epkgs) trivialBuild sideline; }; + intuitive-tab-line = callPackage ./extraPackages/intuitive-tab-line.nix { + inherit sources; + inherit (epkgs) trivialBuild; + }; }; } diff --git a/config/extraPackages/intuitive-tab-line.nix b/config/extraPackages/intuitive-tab-line.nix new file mode 100644 index 0000000..8c9f857 --- /dev/null +++ b/config/extraPackages/intuitive-tab-line.nix @@ -0,0 +1,7 @@ +{ + trivialBuild, + sources, +}: +trivialBuild { + inherit (sources.intuitive-tab-line) pname version src; +} diff --git a/config/extraPackages/sideline-eglot.nix b/config/extraPackages/sideline-eglot.nix index 5a68ce1..1f36081 100644 --- a/config/extraPackages/sideline-eglot.nix +++ b/config/extraPackages/sideline-eglot.nix @@ -1,19 +1,10 @@ { sideline, trivialBuild, - fetchFromGitHub, + sources, }: trivialBuild rec { - pname = "sideline-eglot"; - version = "main-12-08-2024"; - src = fetchFromGitHub { - owner = "emacs-sideline"; - repo = "sideline-eglot"; - rev = "d7fbb9e13edbe5b9b9de464c8dabb8b0014de78e"; - hash = "sha256-/NCclLf4stF4+C1W+s2Y+LJ0TgqGAxVDa6v7+H+3/vA="; - }; - propagatedUserEnvPkgs = [ - sideline - ]; + inherit (sources.sideline-eglot) pname version src; + propagatedUserEnvPkgs = [sideline]; buildInputs = propagatedUserEnvPkgs; } diff --git a/config/init.org b/config/init.org index 8a45da0..7758934 100644 --- a/config/init.org +++ b/config/init.org @@ -13,6 +13,18 @@ (unless (server-running-p) (server-start)) #+end_src +** No Scratch On Open + +#+begin_src emacs-lisp + (setq initial-scratch-message nil) + (setq initial-buffer-choice nil) + (add-hook 'emacs-startup-hook + (lambda () + (when (and (get-buffer "*scratch*") + (not (eq (current-buffer) (get-buffer "*scratch*")))) + (kill-buffer "*scratch*")))) +#+end_src + ** Fix Indents #+begin_src emacs-lisp @@ -255,7 +267,7 @@ #+begin_src emacs-lisp (use-package vterm-toggle :ensure t) - (global-set-key [C-t] 'vterm-toggle) + (global-set-key (kbd "C-t") 'vterm-toggle) #+end_src * Evil Mode and Keybindings @@ -297,6 +309,7 @@ (global-evil-leader-mode) (setq evil-leader/leader "") (evil-leader/set-key "a" #'eglot-code-actions) + (evil-leader/set-key "bd" #'kill-this-buffer) (evil-leader/set-key "e" #'treemacs)) #+end_src @@ -322,16 +335,22 @@ * Tab Management -** Centaur Tabs +** Intuitive Tabline #+begin_src emacs-lisp - (use-package centaur-tabs - :demand t + (use-package intuitive-tab-line + :load-path "git/intuitive-tab-line-mode" + :custom + (tab-line-tabs-function 'intuitive-tab-line-buffers-list) + (tab-line-switch-cycling t) :config - (centaur-tabs-mode t) - (setq centaur-tabs-style "wave") - (setq centaur-tabs-cycle-scope 'tabs) - :bind - ("C-" . centaur-tabs-forward) - ("C-S-" . centaur-tabs-backward)) + (global-tab-line-mode 1) + (recentf-mode 1) + (setq + tab-line-separator " | " ;; delimitation between tabs + )) + + (global-set-key (kbd "C-S-") 'tab-line-switch-to-prev-tab) + (global-set-key (kbd "C-") 'tab-line-switch-to-next-tab) + (global-set-key (kbd "C-S-t") 'recentf-open-most-recent-file) #+end_src diff --git a/flake.nix b/flake.nix index a2b1203..e3f1321 100644 --- a/flake.nix +++ b/flake.nix @@ -21,7 +21,9 @@ config.allowUnfree = true; overlays = [emacs-overlay.overlay]; }; - in rec { + + emacs = import ./config {inherit pkgs;}; + in { formatter = treefmt-nix.lib.mkWrapper pkgs { projectRootFile = "flake.nix"; programs = { @@ -31,11 +33,14 @@ }; }; - packages.default = import ./config {inherit pkgs;}; + packages = { + inherit emacs; + default = emacs; + }; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - packages.default + emacs alejandra nvfetcher stylua diff --git a/nvfetcher.toml b/nvfetcher.toml index e69de29..60b191d 100644 --- a/nvfetcher.toml +++ b/nvfetcher.toml @@ -0,0 +1,7 @@ +[sideline-eglot] +src.git = "https://github.com/emacs-sideline/sideline-eglot" +fetch.github = "emacs-sideline/sideline-eglot" + +[intuitive-tab-line] +src.git = "https://github.com/thread314/intuitive-tab-line-mode" +fetch.github = "thread314/intuitive-tab-line-mode" \ No newline at end of file