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 ];
};
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 {
# Gtk causes a flickering issue on WM mode
withGTK3 = false;
@ -49,6 +58,15 @@
emacs = lemacs;
};
run-test-wm = pkgs.writeShellApplication {
name = "run-test-wm";
runtimeInputs = [ fg42 ];
text = ''
DISPLAY=:1 ${fg42}/bin/fg42-wm
'';
};
in {
inherit pkgs;
@ -56,11 +74,11 @@
packages.${system}.default = fg42;
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ fg42 pkgs.fish ];
nativeBuildInputs = [ fg42 pkgs.fish test-x run-test-wm ];
buildInputs = [ fg42 ];
shellHook = ''
fish && exit
'';
# shellHook = ''
# fish && exit
# '';
};
}
);

View File

@ -134,11 +134,6 @@ contextual information."
The `Ilist' buffer is typically shown as a sidebar (Emacs vertically splits the window)."
: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
"Adds support for emojis to `FG42'"
: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"
:bind ("C-<tab>" . ace-window))
;; Minibuffer related stuff
(use! vertico
"Vertico provides a performant and minimalistic vertical completion UI
(use! vertico
"Vertico provides a performant and minimalistic vertical completion UI
based on the default completion system. The focus of Vertico is to provide
a UI which behaves correctly under all circumstances."
:config
(vertico-mode)
(setq vertico-count 10)
(setq vertico-cycle t))
:config
(require 'vertico-multiform)
(require 'vertico-flat)
(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
"This package provides an orderless completion style that divides the
(use! orderless
"This package provides an orderless completion style that divides the
pattern into space-separated components, and matches candidates that
match all of the components in any order."
:init
(setq completion-styles '(orderless basic)
completion-category-defaults nil
completion-category-overrides '((file (styles partial-completion)))))
:init
(setq completion-styles '(orderless basic)
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! savehist
"Persist history over Emacs restarts. Vertico sorts by history position."
:init
(savehist-mode))
(when-not-wm
;; Minibuffer related stuff
(when-not-wm
(use! ctrlf
"Single buffer text search."
:config
(ctrlf-mode +1)))
(use! ctrlf
"Single buffer text search."
:config
(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
"A utility package to collect various Icon Fonts and propertize them within
@ -218,7 +244,7 @@ Emacs."
:if (display-graphic-p))
(use! yasnippet
"ASnippet is a template system for Emacs. "
"A Snippet is a template system for Emacs. "
:config
(let* ((snippet-home
(expand-file-name
@ -228,7 +254,7 @@ Emacs."
(user-snippets (or fg42/snippet-dir local-snippet)))
(setq yas-snippet-dirs `(,user-snippets ,local-snippet ,snippet-home))
(yas-global-mode 1)))
(yas-global-mode 1)))
(use! yasnippet-snippets
"Yasnippet's snippets."

View File

@ -57,8 +57,17 @@
"Enables systemtray on EXWM"
: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
"Emacs X Widnow manager."
@ -125,6 +134,10 @@
(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 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
@ -153,11 +166,7 @@
(,(kbd "M-w") . ,(kbd "C-c"))
(,(kbd "C-y") . ,(kbd "C-v"))
;; search
(,(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)
))
(,(kbd "C-s") . ,(kbd "C-f"))))))
(provide 'fg42/wm)