Compare commits
No commits in common. "e374cc2f6f9a2704c1437cd7d2bb8ac605d1725c" and "1d99fb630f363032fe88f1d013487ba819e093dc" have entirely different histories.
e374cc2f6f
...
1d99fb630f
|
@ -0,0 +1,18 @@
|
||||||
|
# nixos-config
|
||||||
|
My NixOS and home-manager configs.
|
||||||
|
Dotfiles and helper scripts.
|
||||||
|
|
||||||
|
Not all config is here, some I keep in private flake.
|
||||||
|
|
||||||
|
## Hosts
|
||||||
|
materusPC - my main PC
|
||||||
|
|
||||||
|
Old-materusPC - my old PC, barely used
|
||||||
|
|
||||||
|
flamaster - my laptop, used mostly as server for games.
|
||||||
|
|
||||||
|
valkyrie - VPS, my website and pleroma instance
|
||||||
|
|
||||||
|
waffentrager - raspberry pi4, home server
|
||||||
|
|
||||||
|
|
21
README.org
21
README.org
|
@ -1,21 +0,0 @@
|
||||||
#+TITLE: nixos-config
|
|
||||||
#+AUTHOR: materus
|
|
||||||
#+DESCRIPTION: NixOS config and dotfiles
|
|
||||||
#+OPTIONS: \n:t
|
|
||||||
My NixOS and home-manager configs.
|
|
||||||
Dotfiles and helper scripts.
|
|
||||||
|
|
||||||
Part of it is encrypted by git-crypt, mostly just ips and names. Secrets are managed by sops.
|
|
||||||
|
|
||||||
* Hosts
|
|
||||||
[[./configurations/host/materusPC/][materusPC]] - my main PC
|
|
||||||
|
|
||||||
[[./configurations/host/Old-materusPC/][Old-materusPC]] - my old PC, barely used
|
|
||||||
|
|
||||||
[[./configurations/host/flamaster/][flamaster]] - my laptop, used mostly as server for games.
|
|
||||||
|
|
||||||
[[./configurations/host/valkyrie/][valkyrie]] - VPS, my website and pleroma instance
|
|
||||||
|
|
||||||
[[./configurations/host/waffentrager/][waffentrager]] - raspberry pi4, home server
|
|
||||||
|
|
||||||
|
|
|
@ -2,43 +2,28 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{
|
{ config, pkgs, materusCfg, materusArg, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
materusCfg,
|
|
||||||
materusArg,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
unstable = import materusCfg.materusFlake.inputs.nixpkgs {
|
unstable = import materusCfg.materusFlake.inputs.nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; nvidia.acceptLicense = true; }; };
|
||||||
system = "x86_64-linux";
|
|
||||||
config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
nvidia.acceptLicense = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports =
|
||||||
# Include the results of the hardware scan.
|
[
|
||||||
./hardware-configuration.nix
|
# Include the results of the hardware scan.
|
||||||
./network.nix
|
./hardware-configuration.nix
|
||||||
];
|
./network.nix
|
||||||
|
];
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
boot.supportedFilesystems = [ "ntfs" ];
|
||||||
nix.settings.experimental-features = [
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
nix.settings.auto-optimise-store = true;
|
nix.settings.auto-optimise-store = true;
|
||||||
nix.settings.substituters = [
|
nix.settings.substituters = [
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
"https://cache.nixos.org/"
|
"https://cache.nixos.org/"
|
||||||
];
|
];
|
||||||
nix.settings.trusted-public-keys = [
|
nix.settings.trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ];
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
||||||
];
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
|
|
||||||
# Use the systemd-boot EFI boot loader.
|
# Use the systemd-boot EFI boot loader.
|
||||||
boot.loader.grub = {
|
boot.loader.grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -85,11 +70,20 @@ in
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver.enable = true;
|
services.xserver.enable = true;
|
||||||
|
|
||||||
|
|
||||||
hardware.opengl.enable = true;
|
hardware.opengl.enable = true;
|
||||||
hardware.opengl.driSupport32Bit = true;
|
hardware.opengl.driSupport32Bit = true;
|
||||||
|
|
||||||
materus.profile.steam.enable = true;
|
materus.profile.steam.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Configure keymap in X11
|
# Configure keymap in X11
|
||||||
services.xserver.xkb.layout = "pl";
|
services.xserver.xkb.layout = "pl";
|
||||||
# services.xserver.xkbOptions = {
|
# services.xserver.xkbOptions = {
|
||||||
|
@ -120,25 +114,17 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
virtualisation.podman = {
|
virtualisation.podman = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dockerCompat = true;
|
dockerCompat = true;
|
||||||
dockerSocket.enable = true;
|
dockerSocket.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
users.users.materus = {
|
users.users.materus = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
extraGroups = [
|
extraGroups = [ "wheel" "networkmanager" "kvm" "input" "libvirt" "libvirtd" "podman" "audio" "pipewire" ];
|
||||||
"wheel"
|
|
||||||
"networkmanager"
|
|
||||||
"kvm"
|
|
||||||
"input"
|
|
||||||
"libvirt"
|
|
||||||
"libvirtd"
|
|
||||||
"podman"
|
|
||||||
"audio"
|
|
||||||
"pipewire"
|
|
||||||
];
|
|
||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
description = "Mateusz Słodkowicz";
|
description = "Mateusz Słodkowicz";
|
||||||
|
|
||||||
|
@ -154,7 +140,9 @@ in
|
||||||
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
|
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
|
||||||
|
|
||||||
MOZ_USE_XINPUT2 = "1";
|
MOZ_USE_XINPUT2 = "1";
|
||||||
PATH = [ "\${XDG_BIN_HOME}" ];
|
PATH = [
|
||||||
|
"\${XDG_BIN_HOME}"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
environment.shellInit = ''
|
environment.shellInit = ''
|
||||||
if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:root &> /dev/null; fi;
|
if ! [ -z "$DISPLAY" ]; then xhost +si:localuser:root &> /dev/null; fi;
|
||||||
|
@ -163,13 +151,11 @@ in
|
||||||
# List packages installed in system profile. To search, run:
|
# List packages installed in system profile. To search, run:
|
||||||
# $ nix search wget
|
# $ nix search wget
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
i18n.inputMethod.enabled = "fcitx5";
|
i18n.inputMethod.enabled = "fcitx5";
|
||||||
i18n.inputMethod.fcitx5.addons = [
|
i18n.inputMethod.fcitx5.addons = [ pkgs.fcitx5-configtool pkgs.fcitx5-lua pkgs.fcitx5-mozc pkgs.libsForQt5.fcitx5-qt ];
|
||||||
pkgs.fcitx5-configtool
|
|
||||||
pkgs.fcitx5-lua
|
|
||||||
pkgs.fcitx5-mozc
|
|
||||||
pkgs.libsForQt5.fcitx5-qt
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
brave
|
brave
|
||||||
|
@ -186,14 +172,10 @@ in
|
||||||
curl
|
curl
|
||||||
jdk
|
jdk
|
||||||
nss_latest
|
nss_latest
|
||||||
(aspellWithDicts (
|
aspell
|
||||||
ds: with ds; [
|
aspellDicts.pl
|
||||||
en
|
aspellDicts.en
|
||||||
en-computers
|
aspellDicts.en-computers
|
||||||
en-science
|
|
||||||
pl
|
|
||||||
]
|
|
||||||
))
|
|
||||||
distrobox
|
distrobox
|
||||||
p7zip
|
p7zip
|
||||||
unrar
|
unrar
|
||||||
|
@ -215,9 +197,12 @@ in
|
||||||
iptraf-ng
|
iptraf-ng
|
||||||
mprocs
|
mprocs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
nix-du
|
nix-du
|
||||||
git-crypt
|
git-crypt
|
||||||
|
|
||||||
|
|
||||||
wineWowPackages.stagingFull
|
wineWowPackages.stagingFull
|
||||||
winetricks
|
winetricks
|
||||||
protontricks
|
protontricks
|
||||||
|
@ -230,6 +215,9 @@ in
|
||||||
inkscape
|
inkscape
|
||||||
gimp
|
gimp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virt-manager
|
virt-manager
|
||||||
libguestfs
|
libguestfs
|
||||||
|
|
||||||
|
@ -240,6 +228,7 @@ in
|
||||||
|
|
||||||
binutils
|
binutils
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts.fontDir.enable = true;
|
fonts.fontDir.enable = true;
|
||||||
|
@ -255,38 +244,15 @@ in
|
||||||
ubuntu_font_family
|
ubuntu_font_family
|
||||||
wqy_zenhei
|
wqy_zenhei
|
||||||
monocraft
|
monocraft
|
||||||
(nerdfonts.override {
|
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" "Meslo" "ProFont" ]; })
|
||||||
fonts = [
|
|
||||||
"FiraCode"
|
|
||||||
"DroidSansMono"
|
|
||||||
"Meslo"
|
|
||||||
"ProFont"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
fonts.fontconfig.cache32Bit = true;
|
fonts.fontconfig.cache32Bit = true;
|
||||||
fonts.fontconfig.defaultFonts.sansSerif = [
|
fonts.fontconfig.defaultFonts.sansSerif = [ "Noto Sans" "DejaVu Sans" "WenQuanYi Zen Hei" "Noto Color Emoji" ];
|
||||||
"Noto Sans"
|
fonts.fontconfig.defaultFonts.serif = [ "Noto Serif" "DejaVu Serif" "WenQuanYi Zen Hei" "Noto Color Emoji" ];
|
||||||
"DejaVu Sans"
|
fonts.fontconfig.defaultFonts.emoji = [ "Noto Color Emoji" "OpenMoji Color" ];
|
||||||
"WenQuanYi Zen Hei"
|
fonts.fontconfig.defaultFonts.monospace = [ "Hack Nerd Font" "Noto Sans Mono" "WenQuanYi Zen Hei Mono" ];
|
||||||
"Noto Color Emoji"
|
|
||||||
];
|
|
||||||
fonts.fontconfig.defaultFonts.serif = [
|
|
||||||
"Noto Serif"
|
|
||||||
"DejaVu Serif"
|
|
||||||
"WenQuanYi Zen Hei"
|
|
||||||
"Noto Color Emoji"
|
|
||||||
];
|
|
||||||
fonts.fontconfig.defaultFonts.emoji = [
|
|
||||||
"Noto Color Emoji"
|
|
||||||
"OpenMoji Color"
|
|
||||||
];
|
|
||||||
fonts.fontconfig.defaultFonts.monospace = [
|
|
||||||
"Hack Nerd Font"
|
|
||||||
"Noto Sans Mono"
|
|
||||||
"WenQuanYi Zen Hei Mono"
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.enableAllTerminfo = true;
|
environment.enableAllTerminfo = true;
|
||||||
environment.pathsToLink = [ "/share/zsh" ];
|
environment.pathsToLink = [ "/share/zsh" ];
|
||||||
|
@ -307,15 +273,14 @@ in
|
||||||
# programs.mtr.enable = true;
|
# programs.mtr.enable = true;
|
||||||
services.pcscd.enable = true;
|
services.pcscd.enable = true;
|
||||||
|
|
||||||
/*
|
/*systemd.user.services.gpg-agent.serviceConfig.ExecStart = [
|
||||||
systemd.user.services.gpg-agent.serviceConfig.ExecStart = [
|
|
||||||
""
|
""
|
||||||
''
|
''
|
||||||
${pkgs.gnupg}/bin/gpg-agent --supervised \
|
${pkgs.gnupg}/bin/gpg-agent --supervised \
|
||||||
--pinentry-program ${pkgs.kwalletcli}/bin/pinentry-kwallet
|
--pinentry-program ${pkgs.kwalletcli}/bin/pinentry-kwallet
|
||||||
''
|
''
|
||||||
];
|
];*/
|
||||||
*/
|
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -329,6 +294,9 @@ in
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Copy the NixOS configuration file and link it from the resulting system
|
# Copy the NixOS configuration file and link it from the resulting system
|
||||||
# (/run/current-system/configuration.nix). This is useful in case you
|
# (/run/current-system/configuration.nix). This is useful in case you
|
||||||
# accidentally delete configuration.nix.
|
# accidentally delete configuration.nix.
|
||||||
|
@ -343,3 +311,4 @@ in
|
||||||
system.stateVersion = "23.11"; # Did you read the comment?
|
system.stateVersion = "23.11"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
{
|
{ config, pkgs, materusArg, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
materusArg,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
{
|
||||||
|
|
||||||
services.jackett.enable = true;
|
services.jackett.enable = true;
|
||||||
|
@ -12,26 +7,11 @@
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
#(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.samba pkgs.jansson pkgs.tdb pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
|
#(pkgs.lutris.override { extraLibraries = pkgs: with pkgs; [ pkgs.samba pkgs.jansson pkgs.tdb pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
|
||||||
materusArg.pkgs.amdgpu-pro-libs.prefixes
|
materusArg.pkgs.amdgpu-pro-libs.prefixes
|
||||||
(pkgs.bottles.override {
|
(pkgs.bottles.override { extraPkgs = pkgs: [ pkgs.libsForQt5.breeze-qt5 pkgs.kdePackages.breeze-gtk pkgs.nss_latest ]; extraLibraries = pkgs: [ pkgs.samba pkgs.jansson pkgs.tdb pkgs.libunwind pkgs.libusb1 pkgs.gnutls pkgs.gtk3 pkgs.pango ]; })
|
||||||
extraPkgs = pkgs: [
|
|
||||||
pkgs.libsForQt5.breeze-qt5
|
|
||||||
pkgs.kdePackages.breeze-gtk
|
|
||||||
pkgs.nss_latest
|
|
||||||
];
|
|
||||||
extraLibraries = pkgs: [
|
|
||||||
pkgs.samba
|
|
||||||
pkgs.jansson
|
|
||||||
pkgs.tdb
|
|
||||||
pkgs.libunwind
|
|
||||||
pkgs.libusb1
|
|
||||||
pkgs.gnutls
|
|
||||||
pkgs.gtk3
|
|
||||||
pkgs.pango
|
|
||||||
];
|
|
||||||
})
|
|
||||||
glibc
|
glibc
|
||||||
glib
|
glib
|
||||||
gtk3
|
gtk3
|
||||||
|
@ -58,14 +38,10 @@
|
||||||
|
|
||||||
pciutils
|
pciutils
|
||||||
|
|
||||||
(aspellWithDicts (
|
aspell
|
||||||
ds: with ds; [
|
aspellDicts.pl
|
||||||
en
|
aspellDicts.en
|
||||||
en-computers
|
aspellDicts.en-computers
|
||||||
en-science
|
|
||||||
pl
|
|
||||||
]
|
|
||||||
))
|
|
||||||
steamtinkerlaunch
|
steamtinkerlaunch
|
||||||
distrobox
|
distrobox
|
||||||
# WebP support
|
# WebP support
|
||||||
|
@ -102,6 +78,7 @@
|
||||||
|
|
||||||
nix-du
|
nix-du
|
||||||
|
|
||||||
|
|
||||||
kate
|
kate
|
||||||
krusader
|
krusader
|
||||||
|
|
||||||
|
@ -116,16 +93,22 @@
|
||||||
monkeysphere
|
monkeysphere
|
||||||
gparted
|
gparted
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virt-viewer
|
virt-viewer
|
||||||
|
|
||||||
inkscape
|
inkscape
|
||||||
gimp
|
gimp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
git-crypt
|
git-crypt
|
||||||
|
|
||||||
bubblewrap
|
bubblewrap
|
||||||
bindfs
|
bindfs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
binutils
|
binutils
|
||||||
|
|
||||||
materusArg.unstable.qbittorrent
|
materusArg.unstable.qbittorrent
|
||||||
|
|
|
@ -1,76 +1,53 @@
|
||||||
{
|
{ config, pkgs, lib, materusArg, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
materusArg,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with materusArg.pkgs.lib;
|
with materusArg.pkgs.lib;
|
||||||
{
|
{
|
||||||
imports = [ ./fonts.nix ];
|
imports = [
|
||||||
|
./fonts.nix
|
||||||
|
];
|
||||||
|
|
||||||
#Single Packages
|
#Single Packages
|
||||||
options.materus.profile.packages.home-manager =
|
options.materus.profile.packages.home-manager = mkPrivateVar materusArg.cfg.configInputs.home-manager.packages.${pkgs.system}.home-manager;
|
||||||
mkPrivateVar
|
options.materus.profile.packages.firefox = mkPrivateVar (pkgs.firefox.override {
|
||||||
materusArg.cfg.configInputs.home-manager.packages.${pkgs.system}.home-manager;
|
nativeMessagingHosts = [
|
||||||
options.materus.profile.packages.firefox = mkPrivateVar (
|
pkgs.plasma-browser-integration
|
||||||
pkgs.firefox.override { nativeMessagingHosts = [ pkgs.plasma-browser-integration ]; }
|
];
|
||||||
);
|
});
|
||||||
|
|
||||||
#Package Lists
|
#Package Lists
|
||||||
options.materus.profile.packages.list.nixRelated = mkPrivateVar (
|
options.materus.profile.packages.list.nixRelated = mkPrivateVar (with pkgs; [
|
||||||
with pkgs;
|
nix-prefetch
|
||||||
[
|
nix-prefetch-scripts
|
||||||
nix-prefetch
|
nix-prefetch-github
|
||||||
nix-prefetch-scripts
|
nix-prefetch-docker
|
||||||
nix-prefetch-github
|
nixfmt-rfc-style
|
||||||
nix-prefetch-docker
|
nix-top
|
||||||
nixfmt-rfc-style
|
nix-tree
|
||||||
nix-top
|
nix-diff
|
||||||
nix-tree
|
nix-ld
|
||||||
nix-diff
|
nixpkgs-fmt
|
||||||
nix-ld
|
nixpkgs-review
|
||||||
nixpkgs-fmt
|
]);
|
||||||
nixpkgs-review
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
options.materus.profile.packages.list.desktopApps = mkPrivateVar (
|
options.materus.profile.packages.list.desktopApps = mkPrivateVar (with pkgs; [
|
||||||
with pkgs;
|
(discord.override { nss = nss_latest; withOpenASAR = true; withTTS = true; })
|
||||||
[
|
tdesktop
|
||||||
(discord.override {
|
syncplay
|
||||||
nss = nss_latest;
|
ani-cli
|
||||||
withOpenASAR = true;
|
nextcloud-client
|
||||||
withTTS = true;
|
spotify
|
||||||
})
|
thunderbird
|
||||||
tdesktop
|
keepassxc
|
||||||
syncplay
|
(aspellWithDicts (ds: with ds; [ en en-computers en-science pl ]))
|
||||||
ani-cli
|
onlyoffice-bin
|
||||||
nextcloud-client
|
qalculate-qt
|
||||||
spotify
|
]);
|
||||||
thunderbird
|
|
||||||
keepassxc
|
|
||||||
(aspellWithDicts (
|
|
||||||
ds: with ds; [
|
|
||||||
en
|
|
||||||
en-computers
|
|
||||||
en-science
|
|
||||||
pl
|
|
||||||
]
|
|
||||||
))
|
|
||||||
onlyoffice-bin
|
|
||||||
qalculate-qt
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
options.materus.profile.packages.list.terminalApps = mkPrivateVar (
|
options.materus.profile.packages.list.terminalApps = mkPrivateVar (with pkgs; [
|
||||||
with pkgs;
|
neofetch
|
||||||
[
|
ripgrep
|
||||||
neofetch
|
fd
|
||||||
ripgrep
|
micro
|
||||||
fd
|
]);
|
||||||
micro
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -127,13 +127,11 @@ let
|
||||||
visual-replace
|
visual-replace
|
||||||
scroll-restore
|
scroll-restore
|
||||||
highlight-indent-guides
|
highlight-indent-guides
|
||||||
diff-hl
|
|
||||||
# Completions & Minibuffer
|
# Completions & Minibuffer
|
||||||
corfu
|
corfu
|
||||||
corfu-terminal
|
company
|
||||||
kind-icon
|
company-quickhelp
|
||||||
cape
|
cape
|
||||||
|
|
||||||
embark
|
embark
|
||||||
embark-consult
|
embark-consult
|
||||||
orderless
|
orderless
|
||||||
|
|
|
@ -2,13 +2,12 @@
|
||||||
#+AUTHOR: materus
|
#+AUTHOR: materus
|
||||||
#+DESCRIPTION: materus emacs configuration
|
#+DESCRIPTION: materus emacs configuration
|
||||||
#+STARTUP: overview
|
#+STARTUP: overview
|
||||||
#+PROPERTY: EMACS-DIR: "./"
|
#+PROPERTY: header-args :tangle etc/materus/emacs-config.el :comments link
|
||||||
#+PROPERTY: header-args :tangle (concat (org-entry-get nil "EMACS-DIR" t) "etc/materus/emacs-config.el") :comments link
|
|
||||||
#+OPTIONS: \n:t
|
#+OPTIONS: \n:t
|
||||||
#+auto_tangle: t
|
#+auto_tangle: t
|
||||||
|
|
||||||
My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
|
My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
|
||||||
#+html:<img src="https://img.shields.io/badge/Telegram-2CA5E0?style=for-the-badge&logo=telegram&logoColor=white"/>
|
|
||||||
* Table of Contents :noexport:TOC_3:
|
* Table of Contents :noexport:TOC_3:
|
||||||
- [[#init-files][Init Files]]
|
- [[#init-files][Init Files]]
|
||||||
- [[#early-init][Early Init]]
|
- [[#early-init][Early Init]]
|
||||||
|
@ -28,10 +27,8 @@ My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
|
||||||
- [[#misc][Misc]]
|
- [[#misc][Misc]]
|
||||||
- [[#dashboard][Dashboard]]
|
- [[#dashboard][Dashboard]]
|
||||||
- [[#modeline][Modeline]]
|
- [[#modeline][Modeline]]
|
||||||
- [[#diff-hl][Diff-hl]]
|
|
||||||
- [[#org-mode][Org-mode]]
|
- [[#org-mode][Org-mode]]
|
||||||
- [[#completions][Completions]]
|
- [[#completions][Completions]]
|
||||||
- [[#style][Style]]
|
|
||||||
- [[#minibuffer][Minibuffer]]
|
- [[#minibuffer][Minibuffer]]
|
||||||
- [[#code-completion][Code completion]]
|
- [[#code-completion][Code completion]]
|
||||||
- [[#terms][Terms]]
|
- [[#terms][Terms]]
|
||||||
|
@ -64,7 +61,7 @@ My emacs config, tangled file is [[file:etc/materus/emacs-config.el][there]]
|
||||||
* Init Files
|
* Init Files
|
||||||
** Early Init
|
** Early Init
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:header-args: :tangle (concat (org-entry-get nil "EMACS-DIR" t) "early-init.el") :comments link
|
:header-args: :tangle early-init.el :comments link
|
||||||
:END:
|
:END:
|
||||||
Early init file, setting for GC and some paths.
|
Early init file, setting for GC and some paths.
|
||||||
Tangled file is [[./early-init.el][there]]
|
Tangled file is [[./early-init.el][there]]
|
||||||
|
@ -162,7 +159,7 @@ Early frame settings, maybe some could be move to normal init
|
||||||
|
|
||||||
** Init
|
** Init
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:header-args: :tangle (concat (org-entry-get nil "EMACS-DIR" t) "init.el") :comments link
|
:header-args: :tangle init.el :comments link
|
||||||
:END:
|
:END:
|
||||||
Init File, tangled [[./init.el][there]]
|
Init File, tangled [[./init.el][there]]
|
||||||
Checking if using emacs from my nix config, loads config and custom.el
|
Checking if using emacs from my nix config, loads config and custom.el
|
||||||
|
@ -462,17 +459,6 @@ Graphical related settings.
|
||||||
(use-package minions
|
(use-package minions
|
||||||
:hook (after-init . minions-mode))
|
:hook (after-init . minions-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Diff-hl
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package diff-hl
|
|
||||||
:config
|
|
||||||
(setq diff-hl-side 'right)
|
|
||||||
(global-diff-hl-mode 1)
|
|
||||||
(diff-hl-margin-mode 1)
|
|
||||||
(diff-hl-flydiff-mode 1)
|
|
||||||
(global-diff-hl-show-hunk-mouse-mode 1))
|
|
||||||
|
|
||||||
#+end_src
|
|
||||||
** Org-mode
|
** Org-mode
|
||||||
Org mode settings
|
Org mode settings
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -510,20 +496,11 @@ Org mode settings
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Completions
|
** Completions
|
||||||
*** Style
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(use-package orderless
|
|
||||||
:init
|
|
||||||
;; Tune the global completion style settings to your liking!
|
|
||||||
;; This affects the minibuffer and non-lsp completion at point.
|
|
||||||
(setq completion-styles '(basic partial-completion orderless)
|
|
||||||
completion-category-defaults nil
|
|
||||||
completion-category-overrides nil))
|
|
||||||
#+end_src
|
|
||||||
*** Minibuffer
|
*** Minibuffer
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package consult)
|
(use-package consult)
|
||||||
(use-package marginalia)
|
(use-package marginalia)
|
||||||
|
(use-package orderless)
|
||||||
|
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:config
|
:config
|
||||||
|
@ -546,52 +523,10 @@ Org mode settings
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Code completion
|
*** Code completion
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(use-package company
|
||||||
(use-package cape)
|
|
||||||
|
|
||||||
(use-package corfu
|
|
||||||
;; Optional customizations
|
|
||||||
:custom
|
|
||||||
(corfu-cycle nil) ;; Enable cycling for `corfu-next/previous'
|
|
||||||
(corfu-auto t) ;; Enable auto completion
|
|
||||||
(global-corfu-minibuffer nil)
|
|
||||||
;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary
|
|
||||||
;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
|
|
||||||
(corfu-preview-current nil) ;; Disable current candidate preview
|
|
||||||
;; (corfu-preselect 'prompt) ;; Preselect the prompt
|
|
||||||
;; (corfu-on-exact-match nil) ;; Configure handling of exact matches
|
|
||||||
|
|
||||||
;; Enable Corfu only for certain modes. See also `global-corfu-modes'.
|
|
||||||
;; :hook ((prog-mode . corfu-mode)
|
|
||||||
;; (shell-mode . corfu-mode)
|
|
||||||
;; (eshell-mode . corfu-mode))
|
|
||||||
|
|
||||||
;; Recommended: Enable Corfu globally. This is recommended since Dabbrev can
|
|
||||||
;; be used globally (M-/). See also the customization variable
|
|
||||||
;; `global-corfu-modes' to exclude certain modes.
|
|
||||||
:init
|
|
||||||
(global-corfu-mode 1)
|
|
||||||
(corfu-popupinfo-mode 1)
|
|
||||||
(corfu-history-mode 1))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package corfu-terminal
|
|
||||||
:after (corfu)
|
|
||||||
:config
|
|
||||||
(when (or (daemonp) (not (display-graphic-p)))
|
|
||||||
(corfu-terminal-mode)))
|
|
||||||
|
|
||||||
(use-package corfu-mouse
|
|
||||||
:after (corfu)
|
|
||||||
:config
|
:config
|
||||||
(corfu-mouse-mode)
|
(setq global-corfu-minibuffer nil)
|
||||||
(keymap-set corfu--mouse-ignore-map "<mouse-movement>" 'ignore)
|
(global-company-mode 1))
|
||||||
(keymap-set corfu-map "<mouse-movement>" 'ignore))
|
|
||||||
|
|
||||||
(use-package kind-icon
|
|
||||||
:config
|
|
||||||
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Terms
|
** Terms
|
||||||
*** Eat
|
*** Eat
|
||||||
|
@ -603,7 +538,6 @@ Other configs
|
||||||
*** Defaults
|
*** Defaults
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq-default buffer-file-coding-system 'utf-8-unix)
|
(setq-default buffer-file-coding-system 'utf-8-unix)
|
||||||
(setq text-mode-ispell-word-completion nil) ; Disable ispell
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** Elcord
|
*** Elcord
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
@ -676,64 +610,47 @@ Other configs
|
||||||
* Programming
|
* Programming
|
||||||
** LSP
|
** LSP
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode)
|
||||||
:custom
|
|
||||||
(lsp-completion-provider :none) ;; we use Corfu!
|
|
||||||
|
|
||||||
:init
|
|
||||||
(defun materus/orderless-dispatch-flex-first (_pattern index _total)
|
|
||||||
(and (eq index 0) 'orderless-flex))
|
|
||||||
|
|
||||||
(defun materus/lsp-mode-setup-completion ()
|
|
||||||
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
|
|
||||||
'(orderless))
|
|
||||||
;; Optionally configure the first word as flex filtered.
|
|
||||||
(add-hook 'orderless-style-dispatchers #'materus/orderless-dispatch-flex-first nil 'local)
|
|
||||||
;; Optionally configure the cape-capf-buster.
|
|
||||||
(setq-local completion-at-point-functions (list (cape-capf-buster #'lsp-completion-at-point))))
|
|
||||||
|
|
||||||
:hook
|
|
||||||
(lsp-completion-mode . materus/lsp-mode-setup-completion))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package lsp-ui)
|
(use-package lsp-ui)
|
||||||
(use-package dap-mode)
|
(use-package dap-mode)
|
||||||
(use-package dap-lldb)
|
(use-package dap-lldb)
|
||||||
(use-package dap-gdb-lldb)
|
(use-package dap-gdb-lldb)
|
||||||
|
|
||||||
|
|
||||||
(setq read-process-output-max (* 1024 1024 3))
|
(setq read-process-output-max (* 1024 1024 3))
|
||||||
|
|
||||||
(defun lsp-booster--advice-json-parse (old-fn &rest args)
|
(defun lsp-booster--advice-json-parse (old-fn &rest args)
|
||||||
"Try to parse bytecode instead of json."
|
"Try to parse bytecode instead of json."
|
||||||
(or
|
(or
|
||||||
(when (equal (following-char) ?#)
|
(when (equal (following-char) ?#)
|
||||||
(let ((bytecode (read (current-buffer))))
|
(let ((bytecode (read (current-buffer))))
|
||||||
(when (byte-code-function-p bytecode)
|
(when (byte-code-function-p bytecode)
|
||||||
(funcall bytecode))))
|
(funcall bytecode))))
|
||||||
(apply old-fn args)))
|
(apply old-fn args)))
|
||||||
(advice-add (if (progn (require 'json)
|
(advice-add (if (progn (require 'json)
|
||||||
(fboundp 'json-parse-buffer))
|
(fboundp 'json-parse-buffer))
|
||||||
'json-parse-buffer
|
'json-parse-buffer
|
||||||
'json-read)
|
'json-read)
|
||||||
:around
|
:around
|
||||||
#'lsp-booster--advice-json-parse)
|
#'lsp-booster--advice-json-parse)
|
||||||
|
|
||||||
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
|
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
|
||||||
"Prepend emacs-lsp-booster command to lsp CMD."
|
"Prepend emacs-lsp-booster command to lsp CMD."
|
||||||
(let ((orig-result (funcall old-fn cmd test?)))
|
(let ((orig-result (funcall old-fn cmd test?)))
|
||||||
(if (and (not test?) ; for check lsp-server-present?
|
(if (and (not test?) ; for check lsp-server-present?
|
||||||
(not (file-remote-p default-directory)) ; see lsp-resolve-final-command, it would add extra shell wrapper
|
(not (file-remote-p default-directory)) ; see lsp-resolve-final-command, it would add extra shell wrapper
|
||||||
lsp-use-plists
|
lsp-use-plists
|
||||||
(not (functionp 'json-rpc-connection)) ; native json-rpc
|
(not (functionp 'json-rpc-connection)) ; native json-rpc
|
||||||
(executable-find "emacs-lsp-booster"))
|
(executable-find "emacs-lsp-booster"))
|
||||||
(progn
|
(progn
|
||||||
(when-let* ((command-from-exec-path (executable-find (car orig-result)))) ; resolve command from exec-path (in case not found in $PATH)
|
(when-let* ((command-from-exec-path (executable-find (car orig-result)))) ; resolve command from exec-path (in case not found in $PATH)
|
||||||
(setcar orig-result command-from-exec-path))
|
(setcar orig-result command-from-exec-path))
|
||||||
(message "Using emacs-lsp-booster for %s!" orig-result)
|
(message "Using emacs-lsp-booster for %s!" orig-result)
|
||||||
(cons "emacs-lsp-booster" orig-result))
|
(cons "emacs-lsp-booster" orig-result))
|
||||||
orig-result)))
|
orig-result)))
|
||||||
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Nix
|
** Nix
|
||||||
|
@ -837,8 +754,7 @@ Other configs
|
||||||
;; perspective
|
;; perspective
|
||||||
(global-set-key (kbd "C-x C-b") 'persp-list-buffers)
|
(global-set-key (kbd "C-x C-b") 'persp-list-buffers)
|
||||||
(global-set-key (kbd "C-x C-B") 'list-buffers)
|
(global-set-key (kbd "C-x C-B") 'list-buffers)
|
||||||
(global-set-key (kbd "C-x b") 'persp-switch-to-buffer)
|
(global-set-key (kbd "C-x B") 'persp-switch-to-buffer)
|
||||||
(global-set-key (kbd "C-x B") 'consult-buffer)
|
|
||||||
|
|
||||||
;; CUA
|
;; CUA
|
||||||
(keymap-set cua--cua-keys-keymap "C-z" 'undo-tree-undo)
|
(keymap-set cua--cua-keys-keymap "C-z" 'undo-tree-undo)
|
||||||
|
@ -901,6 +817,8 @@ Just for testing some code
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;;; (global-set-key (kbd "C-∇") (kbd "C-H"))
|
;;; (global-set-key (kbd "C-∇") (kbd "C-H"))
|
||||||
;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
|
;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
|
||||||
|
;;; (keymap-set corfu--mouse-ignore-map "<mouse-movement>" 'ignore)
|
||||||
|
;;; (keymap-set corfu-map "<mouse-movement>" 'ignore)
|
||||||
;;; (buffer-text-pixel-size)
|
;;; (buffer-text-pixel-size)
|
||||||
;;; (set-window-vscroll nil 960 t t)
|
;;; (set-window-vscroll nil 960 t t)
|
||||||
|
|
||||||
|
|
|
@ -259,16 +259,6 @@
|
||||||
:hook (after-init . minions-mode))
|
:hook (after-init . minions-mode))
|
||||||
;; Modeline:1 ends here
|
;; Modeline:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Diff-hl][Diff-hl:1]]
|
|
||||||
(use-package diff-hl
|
|
||||||
:config
|
|
||||||
(setq diff-hl-side 'right)
|
|
||||||
(global-diff-hl-mode 1)
|
|
||||||
(diff-hl-margin-mode 1)
|
|
||||||
(diff-hl-flydiff-mode 1)
|
|
||||||
(global-diff-hl-show-hunk-mouse-mode 1))
|
|
||||||
;; Diff-hl:1 ends here
|
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Org-mode][Org-mode:1]]
|
;; [[file:../../emacs-materus-config.org::*Org-mode][Org-mode:1]]
|
||||||
(use-package org
|
(use-package org
|
||||||
:mode (("\\.org$" . org-mode))
|
:mode (("\\.org$" . org-mode))
|
||||||
|
@ -303,19 +293,10 @@
|
||||||
(markdown-mode . toc-org-mode)))
|
(markdown-mode . toc-org-mode)))
|
||||||
;; Org-mode:1 ends here
|
;; Org-mode:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Style][Style:1]]
|
|
||||||
(use-package orderless
|
|
||||||
:init
|
|
||||||
;; Tune the global completion style settings to your liking!
|
|
||||||
;; This affects the minibuffer and non-lsp completion at point.
|
|
||||||
(setq completion-styles '(basic partial-completion orderless)
|
|
||||||
completion-category-defaults nil
|
|
||||||
completion-category-overrides nil))
|
|
||||||
;; Style:1 ends here
|
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Minibuffer][Minibuffer:1]]
|
;; [[file:../../emacs-materus-config.org::*Minibuffer][Minibuffer:1]]
|
||||||
(use-package consult)
|
(use-package consult)
|
||||||
(use-package marginalia)
|
(use-package marginalia)
|
||||||
|
(use-package orderless)
|
||||||
|
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:config
|
:config
|
||||||
|
@ -338,50 +319,10 @@
|
||||||
;; Minibuffer:1 ends here
|
;; Minibuffer:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Code completion][Code completion:1]]
|
;; [[file:../../emacs-materus-config.org::*Code completion][Code completion:1]]
|
||||||
(use-package cape)
|
(use-package company
|
||||||
|
|
||||||
(use-package corfu
|
|
||||||
;; Optional customizations
|
|
||||||
:custom
|
|
||||||
(corfu-cycle nil) ;; Enable cycling for `corfu-next/previous'
|
|
||||||
(corfu-auto t) ;; Enable auto completion
|
|
||||||
(global-corfu-minibuffer nil)
|
|
||||||
;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary
|
|
||||||
;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match
|
|
||||||
(corfu-preview-current nil) ;; Disable current candidate preview
|
|
||||||
;; (corfu-preselect 'prompt) ;; Preselect the prompt
|
|
||||||
;; (corfu-on-exact-match nil) ;; Configure handling of exact matches
|
|
||||||
|
|
||||||
;; Enable Corfu only for certain modes. See also `global-corfu-modes'.
|
|
||||||
;; :hook ((prog-mode . corfu-mode)
|
|
||||||
;; (shell-mode . corfu-mode)
|
|
||||||
;; (eshell-mode . corfu-mode))
|
|
||||||
|
|
||||||
;; Recommended: Enable Corfu globally. This is recommended since Dabbrev can
|
|
||||||
;; be used globally (M-/). See also the customization variable
|
|
||||||
;; `global-corfu-modes' to exclude certain modes.
|
|
||||||
:init
|
|
||||||
(global-corfu-mode 1)
|
|
||||||
(corfu-popupinfo-mode 1)
|
|
||||||
(corfu-history-mode 1))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package corfu-terminal
|
|
||||||
:after (corfu)
|
|
||||||
:config
|
|
||||||
(when (or (daemonp) (not (display-graphic-p)))
|
|
||||||
(corfu-terminal-mode)))
|
|
||||||
|
|
||||||
(use-package corfu-mouse
|
|
||||||
:after (corfu)
|
|
||||||
:config
|
:config
|
||||||
(corfu-mouse-mode)
|
(setq global-corfu-minibuffer nil)
|
||||||
(keymap-set corfu--mouse-ignore-map "<mouse-movement>" 'ignore)
|
(global-company-mode 1))
|
||||||
(keymap-set corfu-map "<mouse-movement>" 'ignore))
|
|
||||||
|
|
||||||
(use-package kind-icon
|
|
||||||
:config
|
|
||||||
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
|
|
||||||
;; Code completion:1 ends here
|
;; Code completion:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Eat][Eat:1]]
|
;; [[file:../../emacs-materus-config.org::*Eat][Eat:1]]
|
||||||
|
@ -390,7 +331,6 @@
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Defaults][Defaults:1]]
|
;; [[file:../../emacs-materus-config.org::*Defaults][Defaults:1]]
|
||||||
(setq-default buffer-file-coding-system 'utf-8-unix)
|
(setq-default buffer-file-coding-system 'utf-8-unix)
|
||||||
(setq text-mode-ispell-word-completion nil) ; Disable ispell
|
|
||||||
;; Defaults:1 ends here
|
;; Defaults:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Elcord][Elcord:1]]
|
;; [[file:../../emacs-materus-config.org::*Elcord][Elcord:1]]
|
||||||
|
@ -461,64 +401,47 @@
|
||||||
;; Perspective:1 ends here
|
;; Perspective:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*LSP][LSP:1]]
|
;; [[file:../../emacs-materus-config.org::*LSP][LSP:1]]
|
||||||
(use-package lsp-mode
|
(use-package lsp-mode)
|
||||||
:custom
|
|
||||||
(lsp-completion-provider :none) ;; we use Corfu!
|
|
||||||
|
|
||||||
:init
|
|
||||||
(defun materus/orderless-dispatch-flex-first (_pattern index _total)
|
|
||||||
(and (eq index 0) 'orderless-flex))
|
|
||||||
|
|
||||||
(defun materus/lsp-mode-setup-completion ()
|
|
||||||
(setf (alist-get 'styles (alist-get 'lsp-capf completion-category-defaults))
|
|
||||||
'(orderless))
|
|
||||||
;; Optionally configure the first word as flex filtered.
|
|
||||||
(add-hook 'orderless-style-dispatchers #'materus/orderless-dispatch-flex-first nil 'local)
|
|
||||||
;; Optionally configure the cape-capf-buster.
|
|
||||||
(setq-local completion-at-point-functions (list (cape-capf-buster #'lsp-completion-at-point))))
|
|
||||||
|
|
||||||
:hook
|
|
||||||
(lsp-completion-mode . materus/lsp-mode-setup-completion))
|
|
||||||
|
|
||||||
|
|
||||||
(use-package lsp-ui)
|
(use-package lsp-ui)
|
||||||
(use-package dap-mode)
|
(use-package dap-mode)
|
||||||
(use-package dap-lldb)
|
(use-package dap-lldb)
|
||||||
(use-package dap-gdb-lldb)
|
(use-package dap-gdb-lldb)
|
||||||
|
|
||||||
|
|
||||||
(setq read-process-output-max (* 1024 1024 3))
|
(setq read-process-output-max (* 1024 1024 3))
|
||||||
|
|
||||||
(defun lsp-booster--advice-json-parse (old-fn &rest args)
|
(defun lsp-booster--advice-json-parse (old-fn &rest args)
|
||||||
"Try to parse bytecode instead of json."
|
"Try to parse bytecode instead of json."
|
||||||
(or
|
(or
|
||||||
(when (equal (following-char) ?#)
|
(when (equal (following-char) ?#)
|
||||||
(let ((bytecode (read (current-buffer))))
|
(let ((bytecode (read (current-buffer))))
|
||||||
(when (byte-code-function-p bytecode)
|
(when (byte-code-function-p bytecode)
|
||||||
(funcall bytecode))))
|
(funcall bytecode))))
|
||||||
(apply old-fn args)))
|
(apply old-fn args)))
|
||||||
(advice-add (if (progn (require 'json)
|
(advice-add (if (progn (require 'json)
|
||||||
(fboundp 'json-parse-buffer))
|
(fboundp 'json-parse-buffer))
|
||||||
'json-parse-buffer
|
'json-parse-buffer
|
||||||
'json-read)
|
'json-read)
|
||||||
:around
|
:around
|
||||||
#'lsp-booster--advice-json-parse)
|
#'lsp-booster--advice-json-parse)
|
||||||
|
|
||||||
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
|
(defun lsp-booster--advice-final-command (old-fn cmd &optional test?)
|
||||||
"Prepend emacs-lsp-booster command to lsp CMD."
|
"Prepend emacs-lsp-booster command to lsp CMD."
|
||||||
(let ((orig-result (funcall old-fn cmd test?)))
|
(let ((orig-result (funcall old-fn cmd test?)))
|
||||||
(if (and (not test?) ; for check lsp-server-present?
|
(if (and (not test?) ; for check lsp-server-present?
|
||||||
(not (file-remote-p default-directory)) ; see lsp-resolve-final-command, it would add extra shell wrapper
|
(not (file-remote-p default-directory)) ; see lsp-resolve-final-command, it would add extra shell wrapper
|
||||||
lsp-use-plists
|
lsp-use-plists
|
||||||
(not (functionp 'json-rpc-connection)) ; native json-rpc
|
(not (functionp 'json-rpc-connection)) ; native json-rpc
|
||||||
(executable-find "emacs-lsp-booster"))
|
(executable-find "emacs-lsp-booster"))
|
||||||
(progn
|
(progn
|
||||||
(when-let* ((command-from-exec-path (executable-find (car orig-result)))) ; resolve command from exec-path (in case not found in $PATH)
|
(when-let* ((command-from-exec-path (executable-find (car orig-result)))) ; resolve command from exec-path (in case not found in $PATH)
|
||||||
(setcar orig-result command-from-exec-path))
|
(setcar orig-result command-from-exec-path))
|
||||||
(message "Using emacs-lsp-booster for %s!" orig-result)
|
(message "Using emacs-lsp-booster for %s!" orig-result)
|
||||||
(cons "emacs-lsp-booster" orig-result))
|
(cons "emacs-lsp-booster" orig-result))
|
||||||
orig-result)))
|
orig-result)))
|
||||||
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
(advice-add 'lsp-resolve-final-command :around #'lsp-booster--advice-final-command)
|
||||||
;; LSP:1 ends here
|
;; LSP:1 ends here
|
||||||
|
|
||||||
;; [[file:../../emacs-materus-config.org::*Nix][Nix:1]]
|
;; [[file:../../emacs-materus-config.org::*Nix][Nix:1]]
|
||||||
|
@ -620,8 +543,7 @@
|
||||||
;; perspective
|
;; perspective
|
||||||
(global-set-key (kbd "C-x C-b") 'persp-list-buffers)
|
(global-set-key (kbd "C-x C-b") 'persp-list-buffers)
|
||||||
(global-set-key (kbd "C-x C-B") 'list-buffers)
|
(global-set-key (kbd "C-x C-B") 'list-buffers)
|
||||||
(global-set-key (kbd "C-x b") 'persp-switch-to-buffer)
|
(global-set-key (kbd "C-x B") 'persp-switch-to-buffer)
|
||||||
(global-set-key (kbd "C-x B") 'consult-buffer)
|
|
||||||
|
|
||||||
;; CUA
|
;; CUA
|
||||||
(keymap-set cua--cua-keys-keymap "C-z" 'undo-tree-undo)
|
(keymap-set cua--cua-keys-keymap "C-z" 'undo-tree-undo)
|
||||||
|
@ -679,6 +601,8 @@
|
||||||
;; [[file:../../emacs-materus-config.org::*Test][Test:1]]
|
;; [[file:../../emacs-materus-config.org::*Test][Test:1]]
|
||||||
;;; (global-set-key (kbd "C-∇") (kbd "C-H"))
|
;;; (global-set-key (kbd "C-∇") (kbd "C-H"))
|
||||||
;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
|
;;; (global-set-key (kbd "H-∇") (lambda () (interactive) (insert-char #x2207)))
|
||||||
|
;;; (keymap-set corfu--mouse-ignore-map "<mouse-movement>" 'ignore)
|
||||||
|
;;; (keymap-set corfu-map "<mouse-movement>" 'ignore)
|
||||||
;;; (buffer-text-pixel-size)
|
;;; (buffer-text-pixel-size)
|
||||||
;;; (set-window-vscroll nil 960 t t)
|
;;; (set-window-vscroll nil 960 t t)
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(require 'corfu)
|
(require 'corfu)
|
||||||
|
(make-gdb-table)
|
||||||
(defgroup corfu-mouse nil
|
(defgroup corfu-mouse nil
|
||||||
"Mouse support for Corfu."
|
"Mouse support for Corfu."
|
||||||
:group 'corfu
|
:group 'corfu
|
||||||
|
@ -77,7 +78,7 @@
|
||||||
|
|
||||||
(defun corfu-mouse--format-candidates (fcands)
|
(defun corfu-mouse--format-candidates (fcands)
|
||||||
"Format candidates.
|
"Format candidates.
|
||||||
FCANDS is the return value of `corfu--format-candidates'."
|
FCANDS is the return value of `corfu--format-candidates'."
|
||||||
(let ((index corfu--scroll)
|
(let ((index corfu--scroll)
|
||||||
(cands (caddr fcands)))
|
(cands (caddr fcands)))
|
||||||
(while cands
|
(while cands
|
||||||
|
|
Loading…
Reference in New Issue