added: swaync

This commit is contained in:
2025-09-16 18:37:46 +02:00
parent d4c4cd0d0a
commit 49e4f0e7ef
8 changed files with 631 additions and 58 deletions

View File

@@ -54,7 +54,6 @@ require("mason-lspconfig").setup({
"nil_ls",
"rust_analyzer",
"pylsp",
"stylelint-lsp",
},
automatic_installation = true,
})
@@ -77,8 +76,6 @@ cmp.setup({
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "avante_commands" },
{ name = "avante_mentions" },
}, {
{ name = "buffer" },
{ name = "path" },
@@ -151,58 +148,6 @@ vim.keymap.set("n", "<leader>fg", telescope.live_grep, { desc = "Telescope live
vim.keymap.set("n", "<leader>fb", telescope.buffers, { desc = "Telescope buffers" })
vim.keymap.set("n", "<leader>fh", telescope.help_tags, { desc = "Telescope help tags" })
-- Avante.nvim Setup
require("avante").setup({
-- Provider configuration
provider = "ollama",
claude = {
endpoint = "https://api.anthropic.com",
model = "claude-sonnet-4-20250514",
},
-- File selector settings
file_selector = {
provider = "telescope",
},
-- Other settings
instructions_file = "avante.md",
-- Keymaps will be set automatically
mappings = {
ask = "<leader>aa",
edit = "<leader>ae",
refresh = "<leader>ar",
--- @class AvanteConflictMappings
diff = {
ours = "co",
theirs = "ct",
none = "c0",
both = "cb",
next = "]x",
prev = "[x",
},
jump = {
next = "]]",
prev = "[[",
},
},
})
-- Img-clip setup for image pasting
require("img-clip").setup({
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
use_absolute_path = true,
},
})
-- Render-markdown setup
require("render-markdown").setup({
file_types = { "markdown", "Avante" },
})
-- Styling
require("catppuccin").setup({
flavour = "mocha",

View File

@@ -0,0 +1,331 @@
{ pkgs, ... }:
{
programs.nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
# ===================
# Basic Options
# ===================
options = {
number = true;
cursorline = true;
showmode = false;
syntax = "enable";
hlsearch = true;
incsearch = true;
tabstop = 4;
termguicolors = true;
};
globals.mapleader = " ";
keymaps = [
# Clipboard
{
mode = "n";
key = "y";
action = "\"+y";
options.desc = "Yank to clipboard";
}
{
mode = "v";
key = "y";
action = "\"+y";
options.desc = "Yank to clipboard";
}
{
mode = "n";
key = "Y";
action = "\"+Y";
options.desc = "Yank line to clipboard";
}
{
mode = "n";
key = "d";
action = "\"+d";
options.desc = "Delete to clipboard";
}
{
mode = "v";
key = "d";
action = "\"+d";
options.desc = "Delete to clipboard";
}
{
mode = "n";
key = "D";
action = "\"+D";
options.desc = "Delete line to clipboard";
}
{
mode = "n";
key = "p";
action = "\"+p";
options.desc = "Paste from clipboard";
}
{
mode = "v";
key = "p";
action = "\"+p";
options.desc = "Paste from clipboard";
}
];
# ===================
# Plugins
# ===================
plugins = {
# Treesitter
treesitter = {
enable = true;
ensureInstalled = [
"lua"
"nix"
"python"
"javascript"
"rust"
"rasi"
];
};
# Lint
lint.enable = true;
# Mason + LSP
mason.enable = true;
mason-lspconfig = {
enable = true;
ensureInstalled = [
"lua_ls"
"nil_ls"
"rust_analyzer"
"pylsp"
"stylelint_lsp"
];
};
lsp = {
enable = true;
servers = {
lua_ls.settings.Lua = {
runtime.version = "LuaJIT";
diagnostics.globals = [ "vim" ];
telemetry.enable = false;
};
nil_ls.enable = true;
rust_analyzer.enable = true;
pylsp.enable = true;
stylelint_lsp = {
enable = true;
filetypes = [
"css"
"scss"
"rasi"
];
cmd = [
"stylelint-lsp"
"--stdio"
];
};
};
keymaps.lspBuf = {
gd = "definition";
K = "hover";
"<leader>rn" = "rename";
"<leader>ca" = "code_action";
};
};
# Completion
cmp = {
enable = true;
sources = [
{ name = "nvim_lsp"; }
{ name = "luasnip"; }
{ name = "avante_commands"; }
{ name = "avante_mentions"; }
{ name = "buffer"; }
{ name = "path"; }
];
};
luasnip.enable = true;
# Conform
conform-nvim = {
enable = true;
formattersByFt = {
lua = [ "stylua" ];
nix = [ "nixfmt" ];
python = [ "black" ];
rust = [ "rustfmt" ];
rasi = [ "prettierd" ];
};
formatOnSave = {
timeoutMs = 500;
lspFallback = true;
};
};
# Telescope
telescope = {
enable = true;
keymaps = {
"<leader>ff" = "find_files";
"<leader>fg" = "live_grep";
"<leader>fb" = "buffers";
"<leader>fh" = "help_tags";
};
};
# Toggleterm
toggleterm = {
enable = true;
settings = {
size = 20;
direction = "float";
float_opts = {
border = "single";
width = 200;
height = 40;
};
};
};
# Statusline
lualine = {
enable = true;
settings.options = {
theme = "catppuccin";
component_separators = {
left = "|";
right = "|";
};
section_separators = {
left = "";
right = "";
};
};
};
# Dashboard (alpha)
alpha = {
enable = true;
theme = "dashboard";
layout.dashboard = {
section.header.val = [
"⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣯⣿⠿⣟⣷⣯⣛⢿⣿⣿⣾⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿"
"⣿⣿⣿⣿⣿⣿⣿⡿⣵⣿⡿⣴⣽⡟⣳⢿⢽⣽⣕⣽⢿⡿⣿⣟⣿⣿⣿⣿⣿⣿⣿"
"⣿⣿⣿⣷⣿⣿⢟⣫⣿⢟⢟⣾⣾⣿⣿⣞⢳⣻⢞⣎⠿⢞⣊⣿⣞⣿⣿⣿⣿⣿⢽"
"⣿⣿⣿⣿⣿⣏⢯⣿⣏⣏⠔⢇⣿⢢⢆⢀⢆⣧⣼⢻⢰⡧⢻⣝⣏⡸⣧⣾⣿⣿⣿"
"⣿⣿⣿⣿⡟⣻⣿⣿⡾⡿⡼⢸⡝⣝⡳⢢⣧⢳⣳⢷⡇⣗⢺⡺⣿⡧⣿⣿⣿⢿⢿"
"⣿⡿⣿⣼⡼⣿⣿⡗⡧⣧⠁⡝⣧⣳⠅⡾⠈⣎⢮⣧⣿⣿⣗⣷⣻⢷⣏⣼⢏⣺⣿"
"⣿⣿⣿⣻⣿⣿⣿⢧⣿⢹⠉⢷⢿⣧⣲⡏⡀⡈⢆⠳⣿⡿⢿⣿⣱⢿⢫⣷⣝⣿⣿"
"⣿⣿⣿⡯⡟⣿⣿⢽⣡⠟⢿⣮⠁⠙⠛⠈⡴⢿⣿⡷⣬⣽⢽⠧⣷⡏⣿⡇⣧⣽⣿"
"⣿⠟⢻⡧⡇⣿⡇⣇⣆⢄⡜⢃⡀⡀⡀⡀⡀⢎⣁⠁⣸⣗⣸⣿⣧⣼⡿⢹⢿⢾⣿"
"⣿⣷⣾⣿⢻⣿⢧⢻⣽⡀⡀⡀⡀⢄⡀⡀⡀⡀⡀⢀⣷⡸⡟⣿⣶⣻⣧⡛⡱⢝⣿"
"⣿⣿⣿⣿⢸⡿⢚⡜⣿⣇⡀⡀⡀⡀⡀⡀⡀⡀⠚⢁⢣⣜⡿⣿⡇⢼⣿⠨⣸⣿⣿"
"⣿⣄⣿⣗⢾⢻⣧⢿⣾⣿⣦⡀⡀⠑⠚⠉⡀⡀⣤⣿⢨⣿⠗⣻⢣⣿⢹⢈⣽⣿⣿"
"⣿⣿⣿⣿⢎⡄⢿⣞⡇⣿⠹⣿⣶⣀⡀⣀⡴⡩⢸⢏⣿⣿⣶⢻⣾⢏⡞⠡⢽⣇⣾"
"⣿⣿⣿⣮⣼⢬⣦⢿⣳⣌⠧⡉⠈⣇⣛⣁⣈⣼⣿⡸⠫⠛⠐⠛⠕⣙⣻⣬⣼⣿⣿"
"⢟⢿⣿⣿⣿⡢⣃⣪⣭⣡⣤⣶⠟⡿⠿⠿⠿⠛⢁⣿⣿⢩⠉⡀⠈⠓⡝⣿⣿⣿⣿"
"⣾⣿⣿⣿⣿⠞⢔⡣⡴⣾⣿⠓⣤⢧⡼⣉⠠⢤⣿⣿⠇⠃⡀⡀⡀⡀⡸⢿⣾⣿⣿"
"⣿⣿⣿⡿⣺⡸⢗⢠⣇⣿⣿⠊⠃⡀⠉⡀⢠⣿⣿⠟⡸⡀⡀⡀⡀⡀⣃⣬⠽⠿⣿"
"⣿⣿⣿⣿⡇⡏⢸⣿⠟⣽⡇⡀⡀⡀⡀⣴⣟⢭⣾⣿⡇⠎⣠⠒⠉⠈⢀⡀⢨⡋⣿"
"⠛⠛⠛⠋⠃⠓⠚⠛⠘⠛⠃⡀⠊⡀⠛⠛⠛⠂⠛⠛⠓⠁⠚⡀⠂⠒⠒⠐⠒⠋⠛"
];
section.buttons.val = [
{
shortcut = "e";
text = "[+] New file";
command = ":ene <BAR> startinsert <CR>";
}
{
shortcut = "f";
text = "[?] Find file";
command = ":Telescope find_files <CR>";
}
{
shortcut = "r";
text = "[~] Recent files";
command = ":Telescope oldfiles <CR>";
}
{
shortcut = "y";
text = "[Y] Yazi";
command = ":Yazi<CR>";
}
{
shortcut = "m";
text = "[M] Mason";
command = ":Mason<CR>";
}
{
shortcut = "q";
text = "[X] Quit";
command = ":qa<CR>";
}
];
section.footer.val = "Circuits hum in anticipation of your will.";
};
};
# Colorscheme
catppuccin = {
enable = true;
flavour = "mocha";
transparentBackground = true;
integrations = {
treesitter = true;
mason = true;
cmp = true;
telescope = true;
toggleterm = true;
};
};
};
# ===================
# Plugins not in nixvim
# ===================
extraPlugins = with pkgs.vimPlugins; [
yazi-nvim
cheatsheet-nvim
avante-nvim
plenary-nvim
nui-nvim
dressing-nvim
nvim-web-devicons
img-clip-nvim
render-markdown-nvim
(pkgs.vimUtils.buildVimPlugin {
name = "conform-nvim";
src = pkgs.fetchFromGitHub {
owner = "stevearc";
repo = "conform.nvim";
rev = "stable";
sha256 = "sha256-pUF9F5QoDzCZuVRcJEF91M8Qjkh/xosMkf9tRavkmJs=";
};
})
];
};
home.packages = with pkgs; [
nixfmt-rfc-style
stylua
black
nodePackages.prettier
rustfmt
nodejs
prettierd
stylelint-lsp
lua-language-server
nil
rust-analyzer
python3Packages.python-lsp-server
curl
cargo
];
}