Nvim config update

This commit is contained in:
Hadi
2025-03-01 02:58:48 +01:00
parent be161771f4
commit b801f55276
11 changed files with 42 additions and 490 deletions

View File

@@ -1,223 +0,0 @@
{ config, ... }:
let
accent = "#${config.lib.stylix.colors.base0D}";
muted = "#${config.lib.stylix.colors.base03}";
foreground = "#${config.lib.stylix.colors.base05}";
configDir = config.var.configDirectory;
in {
programs.nixvim.highlight = {
AlphaHeaderColor.fg = accent;
AlphaTextColor.fg = foreground;
AlphaShortcutColor.fg = muted;
};
programs.nixvim.plugins.alpha = {
enable = true;
layout = [
{
type = "padding";
val = 4;
}
{
type = "text";
opts = {
position = "center";
hl = "AlphaHeaderColor";
};
val = [
" "
" "
" "
" "
" "
" "
" "
" "
" "
];
}
{
type = "padding";
val = 4;
}
{
type = "group";
val = [
{
type = "button";
val = "󰭎 Find file";
on_press.__raw = "function() vim.cmd[[Telescope find_files]] end";
opts = {
keymap = [
"n"
"nf"
":Telescope find_files <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "nf";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " New file";
on_press.__raw = "function() vim.cmd[[ene]] end";
opts = {
keymap = [
"n"
"nn"
":ene <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "nn";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " NixOs Config";
on_press.__raw = "function() vim.cmd[[Neotree ${configDir}]] end";
opts = {
keymap = [
"n"
"nc"
":Neotree ${configDir} <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
shortcut = "nc";
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " Keybindings";
on_press.__raw =
"function() vim.cmd[[e ${configDir}/docs/KEYBINDINGS.md]] end";
opts = {
shortcut = "nk";
keymap = [
"n"
"nk"
":e ${configDir}/docs/KEYBINDINGS-HYPRLAND.md <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = " Recently used";
on_press.__raw = "function() vim.cmd[[Telescope oldfiles]] end";
opts = {
shortcut = "no";
keymap = [
"n"
"no"
":Telescope oldfiles <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = "󰱽 Find text";
on_press.__raw = "function() vim.cmd[[Telescope live_grep]] end";
opts = {
shortcut = "ng";
keymap = [
"n"
"ng"
":Telescope live_grep <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
{
type = "button";
val = "󰩈 Quit Neovim";
on_press.__raw = "function() vim.cmd[[qa]] end";
opts = {
shortcut = "nq";
keymap = [
"n"
"nq"
":qa <CR>"
{
noremap = true;
silent = true;
nowait = true;
}
];
position = "center";
cursor = 3;
width = 50;
align_shortcut = "right";
hl_shortcut = "AlphaShortcutColor";
hl = "AlphaTextColor";
};
}
];
}
];
};
}

View File

@@ -5,22 +5,12 @@
enable = true;
servers = {
bashls.enable = true;
clangd.enable = true;
gopls.enable = true;
eslint.enable = true;
ts_ls.enable = true;
nixd = {
enable = true;
extraOptions = {
expr = "import <nixpkgs> {}";
# fix- encoding: https://github.com/nix-community/nixvim/issues/2390
offset_encoding = "utf-8";
};
};
nixd.enable = true;
tailwindcss.enable = true;
html.enable = true;
svelte.enable = true;
marksman.enable = true;
};
keymaps.lspBuf = {
"gd" = "definition";

View File

@@ -1,30 +0,0 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
settings = {
options.disabled_filetypes.statusline =
[ "dashboard" "alpha" "neo-tree" ];
alwaysDivideMiddle = true;
globalstatus = true;
ignoreFocus = [ "neo-tree" ];
extensions = [ "fzf" ];
componentSeparators = {
left = "|";
right = "|";
};
sectionSeparators = {
left = ""; # 
right = ""; # 
};
sections = {
lualine_a = [ "mode" ];
lualine_b = [ "branch" "diff" "diagnostics" ];
lualine_c = [ "filename" ];
lualine_x = [ "filetype" ];
lualine_y = [ "progress" ];
lualine_z = [ ''" " .. os.date("%R")'' ];
};
};
};
}

View File

@@ -37,59 +37,6 @@ in {
# Plugins
plugins = {
# Paste images from clipboard
clipboard-image = {
enable = true;
settings = { default.img_dir = [ "%:p:h" "img" ]; };
};
# Zen mode
zen-mode = {
enable = true;
settings = {
on_close = ''
function()
end
'';
on_open = ''
function()
end
'';
plugins = {
gitsigns = { enabled = false; };
options = {
enabled = true;
ruler = false;
showcmd = false;
laststatus = "0";
kitty = {
enabled = true;
font = "+4";
};
};
};
window = {
backdrop = 0.95;
height = 1;
options = {
signcolumn = "no";
number = false;
relativenumber = false;
};
width = 0.8;
};
};
};
# Display images in markdown
image = {
enable = true;
integrations.markdown = {
clearInInsertMode = true;
onlyRenderImageAtCursor = true;
};
};
# This one takes care of the markdown titles
headlines = {
enable = true;

View File

@@ -0,0 +1,33 @@
{ config, ... }: {
programs.nixvim = {
plugins.mini = {
enable = true;
mockDevIcons = true;
modules = {
animate = { cursor = { enable = false; }; };
icons = { };
# TODO: Learn how to use this
bracketed = { };
tabline = { };
statusline = { };
starter = { };
pairs = { };
notify = { };
indentscope = { };
git = { };
cursorword = { };
comment = {
mappings = {
comment = "<leader>/";
comment_line = "<leader>/";
comment_visual = "<leader>/";
textobject = "<leader>/";
};
};
starter = { };
};
};
};
}

View File

@@ -2,13 +2,7 @@
home.packages = with pkgs; [ ctags ];
programs.nixvim.plugins = {
web-devicons.enable = true;
noice.enable = true;
gitsigns = {
enable = true;
settings.current_line_blame = false;
};
trouble.enable = true;
bufferline.enable = true;
lazygit.enable = true;
};
}

View File

@@ -1,16 +1,13 @@
{ config, ... }: {
programs.nixvim = {
nixpkgs.config.allowUnfree = true; # For copilot
highlightOverride = {
FloatBorder.fg = "#${config.lib.stylix.colors.base0D}";
};
nixpkgs.config = { allowUnfree = true; };
plugins = {
copilot-vim.enable = true;
flash.enable = true;
tmux-navigator.enable = true;
comment.enable = true;
nvim-autopairs.enable = true;
todo-comments.enable = true;
treesitter = {
enable = true;
nixGrammars = true;