Skip to content

Instantly share code, notes, and snippets.

@kuuote
Last active January 27, 2025 15:36
Show Gist options
  • Save kuuote/45eb477611a960fecf561602b3769dd1 to your computer and use it in GitHub Desktop.
Save kuuote/45eb477611a960fecf561602b3769dd1 to your computer and use it in GitHub Desktop.
nix run https://gist.github.com/kuuote/45eb477611a960fecf561602b3769dd1/archive/eef9b05768805f27b90b94768d196330bb537ed4.zip で実行できます。C-x tでチュートリアルが走ります。
{
pkgs ? import <nixpkgs> { },
}:
let
emacs = pkgs.emacsPackages.withPackages (epkgs: [ epkgs.ddskk ]);
init-directory = pkgs.linkFarm ".emacs.d" {
"init.el" = ./init.el;
"skk.el" = pkgs.substituteAll {
src = ./skk.el;
skk_tut = builtins.fetchurl {
url = "https://raw.githubusercontent.com/skk-dev/ddskk/f81ed803e617ccd8175d4bf57a3062bc5ffe1945/etc/SKK.tut";
sha256 = "0h3y8svhc0xvdvspf8jy1b4clainm4zs9jfmdbcci3z23mn9406a";
};
};
};
in
pkgs.writeShellScriptBin "emacs" ''
${pkgs.lib.getExe emacs} --init-directory ${init-directory} "$@"
''
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1737885589,
"narHash": "sha256-Zf0hSrtzaM1DEz8//+Xs51k/wdSajticVrATqDrfQjg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "852ff1d9e153d8875a83602e03fdef8a63f0ecf8",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
{
description = "べんり";
outputs =
{ self, nixpkgs }:
let
forAllSystems =
fn:
nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
fn pkgs
);
in
{
packages = forAllSystems (pkgs: {
default = import ./. { inherit pkgs; };
});
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
}
;; 見た目
(load-theme 'modus-vivendi t)
(set-language-environment "Japanese")
(setq inhibit-startup-screen t)
;; これいじるための設定
(electric-pair-mode)
(fido-vertical-mode)
;;; SKKの設定
;; Nix(というよりMelpa)経由だとskk-setup.elが無いので https://github.com/skk-dev/ddskk/blob/f81ed803e617ccd8175d4bf57a3062bc5ffe1945/skk-setup.el.in よりコピペ
(global-set-key "\C-x\C-j" 'skk-mode)
(global-set-key "\C-xj" 'skk-auto-fill-mode)
(global-set-key "\C-xt" 'skk-tutorial)
(defun skk-isearch-setup-maybe ()
(require 'skk-vars)
(when (or (eq skk-isearch-mode-enable 'always)
(and (boundp 'skk-mode)
skk-mode
skk-isearch-mode-enable))
(skk-isearch-mode-setup)))
(defun skk-isearch-cleanup-maybe ()
(require 'skk-vars)
(when (and (featurep 'skk-isearch)
skk-isearch-mode-enable)
(skk-isearch-mode-cleanup)))
(add-hook 'isearch-mode-hook #'skk-isearch-setup-maybe)
(add-hook 'isearch-mode-end-hook #'skk-isearch-cleanup-maybe)
;; こちらで指定したskk.elを読むための設定
(setq skk-init-file (concat user-emacs-directory "skk"))
;; 「;」の前置で変換ポイントを切る
(setq skk-sticky-key ";")
(setq skk-tut-file "@skk_tut@")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment