Move the activation of global modes to emacs-startup

This commit is contained in:
Sameer Rahmani 2024-04-10 14:48:47 +01:00
parent fce6134cac
commit 04ae06edcb
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
4 changed files with 60 additions and 52 deletions

View File

@ -44,8 +44,8 @@
:config
(setq-default company-backends
'((company-capf :with company-yasnippet) :separate
(company-keywords company-dabbrev company-ispell) :separate
'((company-capf :with company-yasnippet :separate)
(company-keywords company-dabbrev company-ispell :separate)
company-files))
(bind-key [remap completion-at-point] #'company-complete company-mode-map))

View File

@ -36,10 +36,11 @@
(require 'fg42/wm)
(require 'fg42/org)
(require 'fg42/minibuffer)
(require 'fg42/graphics))
(require 'fg42/graphics)
(require 'fg42/modeline))
(require 'server)
(require 'fg42/modeline)
(defvar fg42/font '("Fira Mono" 12)
@ -158,26 +159,26 @@ contextual information."
"This cube controls the different aspect of buffer navigation"
:bind ("C-<tab>" . ace-window))
(when-not-wm
(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! 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))
(use! savehist
"Persist history over Emacs restarts. Vertico sorts by history position."
:init
(savehist-mode))
(use! display-line-numbers
"The builtin replacement of linum. It's is pretty fast."
:config
(global-display-line-numbers-mode 1)))
(use! display-line-numbers
"The builtin replacement of linum. It's is pretty fast."
:config
(global-display-line-numbers-mode 1)))
(use! yasnippet
@ -240,12 +241,9 @@ shipped with Emacs."
(setq tooltip-use-echo-area t)
(setq x-gtk-use-system-tooltips nil)
;; Switch from `dabbrev-expand' to `hippie-expand'
(global-set-key [remap dabbrev-expand] 'hippie-expand)
;; Global configurations
(tool-bar-mode -1)
(tooltip-mode nil)
(menu-bar-mode -1)
(when (display-graphic-p)
@ -253,25 +251,32 @@ shipped with Emacs."
(pixel-scroll-precision-mode)
(scroll-bar-mode -1))
(column-number-mode t)
(show-paren-mode t)
(electric-pair-mode 1)
(global-company-mode)
;; git changes in the fringe
(global-diff-hl-mode)
(noether-global-mode)
;; Rectangular select
(cua-selection-mode t)
;; Yank the region on type
(delete-selection-mode 1)
(defalias 'yes-or-no-p 'y-or-n-p)
;; Hooks ---
(add-hook
'emacs-startup-hook
(lambda ()
;; Switch from `dabbrev-expand' to `hippie-expand'
(global-set-key [remap dabbrev-expand] 'hippie-expand)
(column-number-mode t)
(show-paren-mode t)
(electric-pair-mode 1)
(global-company-mode)
;; git changes in the fringe
(global-diff-hl-mode)
;; Modeline replacement
(noether-global-mode)
;; Rectangular select
(cua-selection-mode t)
;; Yank the region on type
(delete-selection-mode 1)))
;; Deletel extra trailing white spaces on save
(add-hook 'before-save-hook 'delete-trailing-whitespace)

View File

@ -54,9 +54,8 @@
"Smart mode line is a pretty simple yet fantastic alternative
to Emacs modeline."
:if (display-graphic-p)
:after projectile
;;:after projectile
:commands noether-global-mode
:config
(require 'noether-views)

View File

@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
{ lib, stdenv, elispPkgs, srcDir, emacsPackagesFor, ourPackages, direnv
, makeDesktopItem, nix
, makeFontsConf, nix
, nil, # nix lsp server
@ -74,18 +74,19 @@ let
pathsStr = lib.strings.concatStrings (lib.strings.intersperse ":" paths);
mimes = import ./mimes.nix;
fontsConf = makeFontsConf {
fontDirectories = [
vazir-fonts
fira-code
nerdfonts
fira-mono
noto-fonts
];
};
in stdenv.mkDerivation (final: rec {
inherit version;
pname = "fg42";
desktop = makeDesktopItem {
name = "FG42";
desktopName = "FG42";
exec = "${placeholder "out"}/bin/fg42 %F";
comment = "Emacs Editor for advance users";
};
src = srcDir;
outputs = [ "out" ];
@ -98,6 +99,8 @@ in stdenv.mkDerivation (final: rec {
cp -rv ${src}/lisp/ $LISPDIR
cp -rv ${src}/share $out/
cp -rv ${src}/snippets $LISPDIR/snippets
cp "${fontsConf}" $LISPDIR/fonts.conf
export FONTCONFIG_FILE="$LISPDIR/fonts.conf"
cat >> $out/share/applications/FG42.desktop << EOF
[Desktop Entry]
@ -128,6 +131,7 @@ in stdenv.mkDerivation (final: rec {
export FG42_EMACSD=~/.fg42/v4/emacs.d
export FG42_USE_NIX=true;
export PATH=${pathsStr}:$PATH
export FONTCONFIG_FILE="$LISPDIR/fonts.conf"
LIBRARY_PATH="\$(${stdenv.cc}/bin/cc -print-file-name=libgccjit.so):\$LIBRARY_PATH" \
FG42_WM=fales ${emacsBundle}/bin/emacs \
@ -145,6 +149,7 @@ in stdenv.mkDerivation (final: rec {
export FG42_EMACSD=~/.fg42/v4/emacs.d
export FG42_USE_NIX=true;
export PATH=${pathsStr}:\$PATH
export FONTCONFIG_FILE="$LISPDIR/fonts.conf"
# Disable access control for the current user.
${xorg.xhost}/bin/xhost +SI:localuser:\$USER
@ -179,7 +184,6 @@ in stdenv.mkDerivation (final: rec {
${nerdfonts}
${noto-fonts}
${lib.strings.concatLines paths}
${desktop}/share/applications/FG42.desktop
EOF
runHook postBuild