From 7cb412f51ca191078ebf10c940eb0510240631d5 Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 28 Jan 2026 09:35:00 +0900 Subject: [PATCH] Okay, let's look at the diffs provided. The user has made changes to the Emacs configuration file, '10-iroiro.el'. The main changes seem to be replacing some old configurations with new ones. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First, they removed the old line number settings and replaced them with 'global-display-line-numbers'. Then, there's a new function for changing font size. They also added several new packages like 'rainbow-delimiters', 'next-line', 'neotree', 'windmove', 'golden-ratio', 'blacken', 'smartparens', 'which-key', and others. The commit message needs to be in Japanese, using the correct type prefix. The changes mainly involve adding new configurations and removing old ones. The key points are the introduction of new features and adjustments to the setup. Looking at the type options, 'feat' is for new features, 'refactor' for restructuring code, 'chore' for maintenance. Since the user is adding new configurations and possibly refactoring the setup, 'refactor' might be appropriate. However, since they're adding new features like rainbow delimiters and font size customization, 'feat' could also fit. But the main change here is restructuring the configuration, so 'refactor' seems more accurate. The description should mention the changes in line numbers and font size, but keep it concise. So the commit message would be something like: "refactor: 線番号とフォントサイズの設定を再構築" but need to check the character count and ensure it's in imperative mood. Also, make sure it's under 72 characters. Wait, the original code had some old settings removed and new ones added. The commit message should reflect that. Maybe "refactor: 線番号とフォントサイズの設定を更新" but check the exact changes. Alternatively, since the user is adding new packages and adjusting the configuration, maybe 'feat' is better. But the main action is restructuring, so 'refactor' is more accurate. Final check: the message should be in Japanese, start with the type, be imperative, and concise. So "refactor: 線番号とフォントサイズの設定を再構築" is 22 characters, which is under 72. That should work. refactor: 線番号とフォントサイズの設定を再構築 --- inits/10-iroiro.el | 219 ++++++++++++++++++++++----------------------- 1 file changed, 105 insertions(+), 114 deletions(-) diff --git a/inits/10-iroiro.el b/inits/10-iroiro.el index 2ce2fef..54fa3ee 100644 --- a/inits/10-iroiro.el +++ b/inits/10-iroiro.el @@ -1,28 +1,119 @@ +;; 10-iro-than.el +;; Use-package compatible configuration +;; Global line numbers +(use-package global-display-line-numbers + :ensure t + :config + (global-display-line-numbers-mode)) -;(global-display-line-numbers-mode) -;(global-linum-mode) ;行番号の後にスペースがない謎 -(line-number-mode t) -(column-number-mode t) -;(display-line-numbers-mode) +;; Font size customization +(use-package change-font-size + :ensure t + :config + (defun change-font-size (size) + "Change font size." + (interactive "nEnter size: ") + (set-face-attribute 'default nil :height size))) +;; Rainbow delimiters with stronger colors +(use-package rainbow-delimiters + :ensure t + :config + (defun rainbow-delimiters-using-stronger-colors () + "Enable rainbow delimiters with stronger colors." + (interactive) + (rainbow-delimiters-mode)) + (add-hook 'emacs-startup-hook 'rainbow-delimiters-using-stronger-colors)) + +;; Next line function +(use-package next-line + :ensure t + :config + (defun next-line (arg) + "Move to next line." + (interactive "p") + (forward-line arg))) + +;; Rainbow delimiters (alternative setup) +(use-package rainbow-delimiters + :ensure t + :config + (require 'rainbow-delimiters) + (add-hook 'prog-mode-hook 'rainbow-delimiters-mode)) + +;; Neotree (sidebar) +(use-package neotree + :ensure t + :config + (global-set-key "\C-o" 'neotree-toggle)) + +;; Window movement with Ctrl + arrow keys +(use-package windmove + :ensure t + :config + (global-set-key (kbd "\C-c ") 'windmove-left) + (global-set-key (kbd "\C-c ") 'windmove-right) + (global-set-key (kbd "\C-c ") 'windmove-up) + (global-set-key (kbd "\C-c ") 'windmove-down)) + +;; Golden ratio for window splitting +(use-package golden-ratio + :ensure t + :config + (golden-ratio-mode 1) + (add-to-list 'golden-ratio-exclude-buffer-names " *NeoTree*") + (add-to-list 'golden-ratio-exclude-buffer-names " *Ilist*")) + +;; Blacken for line wrapping +(use-package blacken + :ensure t + :custom ((blacken-line-length . 119) + (blacken-skip-string-normalization . t))) + +;; Smartparens for parentheses (use-package smartparens :ensure t :config (smartparens-global-mode t)) +;; Which-key for key assistance +(use-package which-key + :diminish which-key-mode + :hook (after-init . which-key-mode)) -;;auto-complete がフリーズする問題なら -(setq ac-use-quick-help nil) +;; Scroll settings +(setq scroll-step 1 + scroll-conservatively 1 + scroll-margin 5 + next-screen-context-lines 1 + mouse-wheel-progressive-speed nil) -;;括弧強調 -(require 'smartparens) -(smartparens-global-mode t) +;; Custom scroll behavior +(defun next-line (arg) + (interactive "p") + (condition-case nil + (line-move arg) + (end-of-buffer))) -(add-to-list 'default-frame-alist - '(font . "DejaVu Sans Mono-12")) +;; Line number toggle +(global-set-key (kbd "C-^") 'display-line-numbers-mode) -;;;https://blog.misosi.ru/2019/08/05/change-emacs-font-size-in-gui-easily/ +;; JSON reformat +(require 'json-reformat) + +;; Imenu list +(setq speedbar-use-images nil) +(global-set-key (kbd "M-i") 'imenu-list-smart-toggle) + +;; Buffer last line cursor behavior +(defun next-line (arg) + (interactive "p") + (condition-case nil + (line-move arg) + (end-of-buffer))) + +;; Font size customization (defun change-font-size (size) "Change font size (clearly `:height` in `face-attribute`) to given SIZE." @@ -32,104 +123,4 @@ (format "Input font size (current=%d): " (face-attribute 'default :height)) nil))) - (set-face-attribute 'default nil :height size) - ) - - -;; 折りたたみ設定 -(add-hook 'prog-mode-hook #'hs-minor-mode) -(global-set-key (kbd "C-\\") 'hs-toggle-hiding) -(global-set-key (kbd "M-\\") 'hs-hide-all) -(global-set-key (kbd "M-\|") 'hs-show-all) - -;;;https://qiita.com/muyuu/items/63a82c819bbbe65d37a2 -;;;trampでリモートサーバのファイルをSSH経由で編集 -(require 'tramp) -(setq tramp-default-method "sshx") - -;; Windowスプリットするサイズを自動調整 -(use-package golden-ratio - :ensure t - :config - (golden-ratio-mode 1)) -(golden-ratio-mode -1) -(add-to-list 'golden-ratio-exclude-buffer-names " *NeoTree*") -(add-to-list 'golden-ratio-exclude-buffer-names " *Ilist*") - - -(leaf blacken - :ensure t - :custom ((blacken-line-length . 119) ; 1行の流さを119文字まで許可 - (blacken-skip-string-normalization . t))) ; 文字リテラルの「''」を「""」に変更しないように抑制 - -;;括弧を色分け -(leaf rainbow-delimiters - :ensure t - :hook - ((prog-mode-hook . rainbow-delimiters-mode))) - -;;https://qiita.com/megane42/items/ee71f1ff8652dbf94cf7 -;; rainbow-delimiters を使うための設定 -(require 'rainbow-delimiters) -(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) - - -;; 括弧の色を強調する設定 -(require 'cl-lib) -(require 'color) -(defun rainbow-delimiters-using-stronger-colors () - (interactive) - (cl-loop - for index from 1 to rainbow-delimiters-max-face-count - do - (let ((face (intern (format "rainbow-delimiters-depth-%d-face" index)))) - (cl-callf color-saturate-name (face-foreground face) 30)))) -(add-hook 'emacs-startup-hook 'rainbow-delimiters-using-stronger-colors) -;; rainbow-delimiters -;(require 'rainbow-delimiters) -;(add-hook 'prog-mode-hook 'rainbow-delimiters-mode) - - -;; neotree(サイドバー) -(require 'neotree) -(global-set-key "\C-o" 'neotree-toggle) - -;;window移動にCTRL+カーソルを使う! -(global-set-key (kbd "\C-c ") 'windmove-left) -(global-set-key (kbd "\C-c ") 'windmove-right) -(global-set-key (kbd "\C-c ") 'windmove-up) -(global-set-key (kbd "\C-c ") 'windmove-down) - -;; scroll 1行 -(setq scroll-step 1) -(setq scroll-conservatively 1) -(setq scroll-margin 5) -(setq next-screen-context-lines 1) - -;; スクロールは1行ごとに -;(setq mouse-wheel-scroll-amount '(1 ((shift) . 5))) - -;; スクロールの加速をやめる -(setq mouse-wheel-progressive-speed nil) - -;; bufferの最後でカーソルを動かそうとしても音をならなくする -(defun next-line (arg) - (interactive "p") - (condition-case nil - (line-move arg) - (end-of-buffer))) - -;;imenu-list -(setq speedbar-use-images nil) -(global-set-key (kbd "M-i") 'imenu-list-smart-toggle) - -;; 行番号トグル -(global-set-key (kbd "C-^") 'display-line-numbers-mode) - -;;json -(require 'json-reformat) - -;; キーアシスト -(use-package which-key - :diminish which-key-mode - :hook (after-init . which-key-mode)) + (set-face-attribute 'default nil :height size))