Setup the vertico multiform mode

This commit is contained in:
Sameer Rahmani 2024-03-25 20:51:00 +00:00
parent 0c737c827f
commit 3bbd095f75
Signed by: lxsameer
GPG Key ID: 8741FACBF412FFA5
3 changed files with 93 additions and 40 deletions

View File

@ -28,6 +28,15 @@
overlays = [ inputs.emacs-overlay.overlays.package ]; overlays = [ inputs.emacs-overlay.overlays.package ];
}; };
test-x = pkgs.writeShellApplication {
name = "test-x";
runtimeInputs = [ pkgs.xorg.xorgserver ];
text = ''
${pkgs.xorg.xorgserver.out}/bin/Xephyr -br -ac -noreset -screen 800x600 :1
'';
};
lemacs = pkgs.emacs29.override { lemacs = pkgs.emacs29.override {
# Gtk causes a flickering issue on WM mode # Gtk causes a flickering issue on WM mode
withGTK3 = false; withGTK3 = false;
@ -49,6 +58,15 @@
emacs = lemacs; emacs = lemacs;
}; };
run-test-wm = pkgs.writeShellApplication {
name = "run-test-wm";
runtimeInputs = [ fg42 ];
text = ''
DISPLAY=:1 ${fg42}/bin/fg42-wm
'';
};
in { in {
inherit pkgs; inherit pkgs;
@ -56,11 +74,11 @@
packages.${system}.default = fg42; packages.${system}.default = fg42;
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
nativeBuildInputs = [ fg42 pkgs.fish ]; nativeBuildInputs = [ fg42 pkgs.fish test-x run-test-wm ];
buildInputs = [ fg42 ]; buildInputs = [ fg42 ];
shellHook = '' # shellHook = ''
fish && exit # fish && exit
''; # '';
}; };
} }
); );

View File

@ -134,11 +134,6 @@ contextual information."
The `Ilist' buffer is typically shown as a sidebar (Emacs vertically splits the window)." The `Ilist' buffer is typically shown as a sidebar (Emacs vertically splits the window)."
:bind (("C-'" . imenu-list-smart-toggle))) :bind (("C-'" . imenu-list-smart-toggle)))
(use! display-line-numbers
"The builtin replacement of linum. It's is pretty fast."
:config
(global-display-line-numbers-mode 1))
(use! emojify (use! emojify
"Adds support for emojis to `FG42'" "Adds support for emojis to `FG42'"
:hook (emacs-startup . global-emojify-mode)) :hook (emacs-startup . global-emojify-mode))
@ -180,37 +175,68 @@ data. The typical example of this would be Lisp or Scheme source code."
"This cube controls the different aspect of buffer navigation" "This cube controls the different aspect of buffer navigation"
:bind ("C-<tab>" . ace-window)) :bind ("C-<tab>" . ace-window))
;; Minibuffer related stuff
(use! vertico (use! vertico
"Vertico provides a performant and minimalistic vertical completion UI "Vertico provides a performant and minimalistic vertical completion UI
based on the default completion system. The focus of Vertico is to provide based on the default completion system. The focus of Vertico is to provide
a UI which behaves correctly under all circumstances." a UI which behaves correctly under all circumstances."
:config :config
(vertico-mode) (require 'vertico-multiform)
(setq vertico-count 10) (require 'vertico-flat)
(setq vertico-cycle t)) (require 'vertico-grid)
(require 'vertico-buffer)
(require 'vertico-indexed)
(require 'vertico-quick)
(require 'vertico-repeat)
(vertico-mode)
(vertico-multiform-mode)
;; Configure the display per command.
;; Use a buffer with indices for imenu
(setq vertico-multiform-commands
'((imenu buffer indexed)))
;; Configure the display per completion category.
;; Use the grid display for files and a buffer
;; for the consult-grep commands.
(setq vertico-multiform-categories
'((file grid)))
(setq vertico-count 10)
(setq vertico-cycle t)
(when-wm
(setq vertico-multiform-commands
'((t flat)))
(setq vertico-multiform-categories
'((file flat)))))
(use! orderless (use! orderless
"This package provides an orderless completion style that divides the "This package provides an orderless completion style that divides the
pattern into space-separated components, and matches candidates that pattern into space-separated components, and matches candidates that
match all of the components in any order." match all of the components in any order."
:init :init
(setq completion-styles '(orderless basic) (setq completion-styles '(orderless basic)
completion-category-defaults nil completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion))))) completion-category-overrides '((file (styles partial-completion)))))
(use! savehist (use! savehist
"Persist history over Emacs restarts. Vertico sorts by history position." "Persist history over Emacs restarts. Vertico sorts by history position."
:init :init
(savehist-mode)) (savehist-mode))
(when-not-wm
;; Minibuffer related stuff
(when-not-wm (use! ctrlf
(use! ctrlf "Single buffer text search."
"Single buffer text search." :config
:config (ctrlf-mode +1))
(ctrlf-mode +1)))
(use! display-line-numbers
"The builtin replacement of linum. It's is pretty fast."
:config
(global-display-line-numbers-mode 1)))
(use! all-the-icons (use! all-the-icons
"A utility package to collect various Icon Fonts and propertize them within "A utility package to collect various Icon Fonts and propertize them within
@ -218,7 +244,7 @@ Emacs."
:if (display-graphic-p)) :if (display-graphic-p))
(use! yasnippet (use! yasnippet
"ASnippet is a template system for Emacs. " "A Snippet is a template system for Emacs. "
:config :config
(let* ((snippet-home (let* ((snippet-home
(expand-file-name (expand-file-name
@ -228,7 +254,7 @@ Emacs."
(user-snippets (or fg42/snippet-dir local-snippet))) (user-snippets (or fg42/snippet-dir local-snippet)))
(setq yas-snippet-dirs `(,user-snippets ,local-snippet ,snippet-home)) (setq yas-snippet-dirs `(,user-snippets ,local-snippet ,snippet-home))
(yas-global-mode 1))) (yas-global-mode 1)))
(use! yasnippet-snippets (use! yasnippet-snippets
"Yasnippet's snippets." "Yasnippet's snippets."

View File

@ -57,8 +57,17 @@
"Enables systemtray on EXWM" "Enables systemtray on EXWM"
:commands exwm-systemtray-enable) :commands exwm-systemtray-enable)
(use! exwm-config
:commands) ;; (use! mini-frame
;; "Place minibuffer at the top of the current frame on `read-from-minibuffer'."
;; :hook (emacs-startup . mini-frame-mode)
;; :custom
;; (mini-frame-show-parameters
;; '((top . 10)
;; (width . 0.5)
;; (left . 0.5)
;; (height . 15))))
(use! exwm (use! exwm
"Emacs X Widnow manager." "Emacs X Widnow manager."
@ -125,6 +134,10 @@
(push ?\C-c exwm-input-prefix-keys) (push ?\C-c exwm-input-prefix-keys)
;; You can hide the minibuffer and echo area when they're not used, by
;; uncommenting the following line.
;;(setq exwm-workspace-minibuffer-position 'bottom)
;; The following example demonstrates how to use simulation keys to mimic ;; The following example demonstrates how to use simulation keys to mimic
;; the behavior of Emacs. The value of `exwm-input-simulation-keys` is a ;; the behavior of Emacs. The value of `exwm-input-simulation-keys` is a
;; list of cons cells (SRC . DEST), where SRC is the key sequence you press ;; list of cons cells (SRC . DEST), where SRC is the key sequence you press
@ -153,11 +166,7 @@
(,(kbd "M-w") . ,(kbd "C-c")) (,(kbd "M-w") . ,(kbd "C-c"))
(,(kbd "C-y") . ,(kbd "C-v")) (,(kbd "C-y") . ,(kbd "C-v"))
;; search ;; search
(,(kbd "C-s") . ,(kbd "C-f")))) (,(kbd "C-s") . ,(kbd "C-f"))))))
;; You can hide the minibuffer and echo area when they're not used, by
;; uncommenting the following line.
;;(setq exwm-workspace-minibuffer-position 'bottom)
))
(provide 'fg42/wm) (provide 'fg42/wm)