Compare commits

...

2 Commits

Author SHA1 Message Date
Sameer Rahmani 581bc30a50
Add git(magit and friends) 2024-04-05 19:35:22 +01:00
Sameer Rahmani c95461ebdb
Add aspell support 2024-04-05 18:35:26 +01:00
4 changed files with 92 additions and 8 deletions

View File

@ -57,7 +57,6 @@
aggressive-indent
graphviz-dot-mode
terraform-mode
magit-todos
magit
diff-hl
rustic
@ -121,6 +120,8 @@
orderless
eglot
marginalia
nerd-icons
forge
)
(provide 'fg42/deps)

View File

@ -31,6 +31,7 @@
(require 'fg42/langs/python)
(require 'fg42/langs/elisp)
(require 'fg42/langs/nix)
(require 'fg42/git)
(require 'fg42/wm))
(require 'server)
@ -199,17 +200,27 @@ match all of the components in any order."
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
(use! savehist
"Persist history over Emacs restarts. Vertico sorts by history position."
:init
(savehist-mode))
(use! marginalia
"Adds useful info to minibuffers completions."
:commands marginalia-mode
:hook (emacs-startup . marginalia-mode))
(when-not-wm
(use! flyspell
"Spell checking on the fly"
:commands (flyspell-mode flyspell-prog-mode)
:init
(setq-default ispell-program-name "aspell")
(setq-default ispell-extra-args '("--sug-mode=ultra"
"--lang=en_US"
"--camel-case")))
(use! savehist
"Persist history over Emacs restarts. Vertico sorts by history position."
:init
(savehist-mode))
;; Minibuffer related stuff
(use! ctrlf
"Single buffer text search."
@ -226,6 +237,11 @@ match all of the components in any order."
Emacs."
:if (display-graphic-p))
(use! nerd-icons
"A utility package to collect various Icon Fonts and propertize them within
Emacs."
:if (display-graphic-p))
(use! yasnippet
"A Snippet is a template system for Emacs. "
:config
@ -303,6 +319,9 @@ shipped with Emacs."
(electric-pair-mode 1)
(global-company-mode)
;; git changes in the fringe
(global-diff-hl-mode)
;; Rectangular select
(cua-selection-mode t)

61
lisp/fg42/git.el Normal file
View File

@ -0,0 +1,61 @@
;;; FG42 --- The mighty editor for the emacsians -*- lexical-binding: t; -*-
;;
;; Copyright (c) 2010-2024 Sameer Rahmani & Contributors
;;
;; Author: Sameer Rahmani <lxsameer@gnu.org>
;; URL: https://devheroes.codes/FG42/FG42
;; Version: 3.0.0
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
;;; Commentary:
;;; Code:
(eval-when-compile
(require 'fpkg))
(use! diff-hl
"This package highlights changes to the current buffer in respect to the
VC status of the file. For example if you're using `git' in your project
and you've made some changes to the current buffer that are not commited
yet it will highlihgt them for you.
For more info check out `https://github.com/dgutov/diff-hl'."
:commands global-diff-hl-mode
:config
(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
(use! magit
"Git magic in FG42. For more info checkout `magit's documentation."
:bind (("C-x g" . magit-status)
("C-c b" . magit-blame)
("C-c b" . magit-log))
:config
(when (featurep 'diff-hl)
(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)))
(use! forge
"Forge allows you to work with Git forges, such as Github and Gitlab,
from the comfort of Magit and the rest of Emacs.
For more info: `https://magit.vc/manual/forge/'"
:after magit)
(provide 'fg42/git)
;;; git.el ends here

View File

@ -23,7 +23,8 @@ python311, python3Packages,
# This is a set of system tools required for FG42
# to work.
pyright, emacs, ripgrep, git, texinfo, vazir-fonts, fira-code, nerdfonts
, fira-mono, noto-fonts, gcc, ltex-ls, bash, tree-sitter,
, fira-mono, noto-fonts, gcc, ltex-ls, bash, tree-sitter
, aspellWithDicts,
supportWM ? true, xorg, slock,
@ -40,7 +41,9 @@ let
maintainers = import ./maintainers.nix;
runtimeBins = [ ripgrep git ltex-ls tree-sitter direnv nix nil ]
dicts = aspellWithDicts (dicts: with dicts; [ en en-computers en-science ]);
runtimeBins = [ ripgrep git ltex-ls tree-sitter direnv nix nil dicts ]
++ (lib.optional supportPython [
python311
# Python deps