Compare commits

...

3 commits

Author SHA1 Message Date
Barna Máté 2d4f34fe82 - added lush for real time editing of themes
- fixed neogen keymap
- changed qwen2.5-codder to llama3 sinec qwen crashes out
- updated flake
2024-12-18 14:10:53 +01:00
Barna Máté 09ebce4613 Added activity watch
- added code companion
- added neogen for annotations
- remapped trouble keybinds
- some other stuff idk
2024-12-15 09:31:17 +01:00
Barna Máté 13fda9ebf6 Split the lsp into a new directory and also added linters, stole straight from akari's config 2024-12-12 20:52:04 +01:00
19 changed files with 462 additions and 84 deletions

View file

@ -1,7 +1,7 @@
{ pkgs, ... }: {
colorschemes.oxocarbon.enable = true;
colorscheme = "shades_of_purple";
#colorscheme = "shades_of_purple";
colorscheme = "oxocarbon";
opts = {
number = true;
@ -10,6 +10,28 @@
# Set <Space> as leader
globals.mapleader = " ";
autoCmd = [
# Start aw-watcher-vim on startup
{
command = ":'";
event = [
"VimEnter"
];
}
];
extraPlugins = with pkgs; [
{
plugin = pkgs.vimUtils.buildVimPlugin {
pname = "lush";
version = "1.0.0"; # dummy version
src = pkgs.fetchFromGitHub {
owner = "rktjmp";
repo = "lush.nvim";
rev = "45a79ec4acb5af783a6a29673a999ce37f00497e";
hash = "sha256-meUCXjJ9kHOOpRd4TR2dc7Ai97zOQX35hYFEDZseiSk=";
};
};
}
];
}

View file

@ -0,0 +1,65 @@
{ pkgs, ... }: {
plugins.codecompanion = {
enable = true;
settings = {
adapters = {
ollama = {
__raw = ''
function()
return require('codecompanion.adapters').extend('ollama', {
env = {
url = "http://127.0.0.1:11434",
},
schema = {
model = {
default = 'llama3:8b',
-- default = "llama3.1:8b-instruct-q8_0",
},
num_ctx = {
default = 32768,
},
},
})
end
'';
};
};
opts = {
log_level = "TRACE";
send_code = true;
use_default_actions = true;
use_default_prompts = true;
};
strategies = {
agent = {
adapter = "ollama";
};
chat = {
adapter = "ollama";
};
inline = {
adapter = "ollama";
};
};
};
};
extraPlugins = with pkgs; [
{
# Rainbow parentheses
plugin = pkgs.vimUtils.buildVimPlugin {
pname = "rainbow";
version = "1.0.0"; # dummy version
src = pkgs.fetchFromGitHub {
owner = "luochen1990";
repo = "rainbow";
rev = "76ca1a20aa42edb5c65c19029968aad4625790dc";
hash = "sha256-dBHgAc3dOoeBI/lZzIJgYYTda8ZMvdThixUZebZXRHE=";
};
};
}
];
}

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: {
# Activity watch for vim to keep track of time in files. Fuck wakatime
extraPlugins = with pkgs; [
{
plugin = pkgs.vimUtils.buildVimPlugin {

View file

@ -1,11 +1,16 @@
{ pkgs, ... }: {
imports = [
./ai
./aw
./lang
./lsp
./telescope
./ui
./aw
];
# Persistence
plugins.persistence.enable = true;
}

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
plugins = {
# TODO lint
lsp.servers.csharp_ls.enable = true;
};
}

View file

@ -0,0 +1,34 @@
{ pkgs, lib, ... }:
{
plugins = {
conform-nvim.settings = {
formatters_by_ft.css = [
"prettierd"
"prettier"
];
formatters = {
prettierd.command = "${pkgs.prettierd}/bin/prettierd";
prettier.command = "${pkgs.nodePackages.prettier}/bin/prettier";
};
};
lsp.servers = {
cssls = {
enable = true;
cmd = [
"${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server"
"--stdio"
];
};
tailwindcss = {
enable = true;
cmd = [
(lib.getExe pkgs.tailwindcss-language-server)
"--stdio"
];
};
};
};
}

View file

@ -0,0 +1,18 @@
{ pkgs, ... }: {
# Formatters and language servers for programming languages
imports = [
./css.nix
./docker.nix
./html.nix
./json.nix
./nix.nix
./rust.nix
./ts.nix
./yaml.nix
./csharp.nix
# TODO elixir
# TODO java
];
}

View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
plugins = {
lsp.servers = {
dockerls.enable = true;
docker_compose_language_service.enable = true;
};
lint = {
lintersByFt = {
docker = [ "hadolint" ];
};
linters = {
hadolint = {
cmd = "${pkgs.hadolint}/bin/hadolint";
};
};
};
};
}

View file

@ -0,0 +1,44 @@
{ pkgs, lib, ... }:
{
plugins = {
conform-nvim.settings = {
formatters_by_ft.html = [
"prettierd"
"prettier"
];
formatters = {
prettierd.command = "${pkgs.prettierd}/bin/prettierd";
prettier.command = "${pkgs.nodePackages.prettier}/bin/prettier";
};
};
lsp = {
servers = {
html = {
enable = true;
cmd = [
"${pkgs.vscode-langservers-extracted}/bin/vscode-html-language-server"
"--stdio"
];
};
# TODO fix
# error: The option `plugins.lsp.servers.vuels.package' was accessed but has no value defined. Try setting the option.
#vuels.enable = true; # Vue
};
enabledServers = [
{
name = "emmet_language_server";
extraOptions = {
cmd = [
(lib.getExe pkgs.emmet-language-server)
"--stdio"
];
filetypes = [ "html" ];
};
}
];
};
};
}

View file

@ -0,0 +1,32 @@
{ pkgs, ... }:
{
plugins = {
conform-nvim.settings = {
formatters_by_ft = {
json = [ "jq" ];
};
formatters = {
jq = {
command = "${pkgs.jq}/bin/jq";
};
};
};
lint = {
lintersByFt = {
json = [ "jsonlint" ];
};
linters = {
jsonlint = {
cmd = "${pkgs.nodePackages_latest.jsonlint}/bin/jsonlint";
};
};
};
lsp.servers.jsonls = {
enable = true;
};
};
}

View file

@ -0,0 +1,36 @@
{ pkgs, ... }:
{
plugins = {
nix.enable = true;
hmts.enable = true;
nix-develop.enable = true;
conform-nvim.settings = {
formatters_by_ft = {
nix = [ "nixfmt-rfc-style" ];
};
formatters = {
nixfmt-rfc-style = {
command = "${pkgs.nixfmt-rfc-style}/bin/nixfmt";
};
};
};
lint = {
lintersByFt = {
nix = [ "statix" ];
};
linters = {
statix = {
cmd = "${pkgs.statix}/bin/statix";
};
};
};
};
extraConfigVim = ''
au BufRead,BufNewFile flake.lock setf json
'';
}

View file

@ -0,0 +1,24 @@
{ pkgs, ... }:
{
plugins = {
lsp.servers.rust-analyzer = {
enable = true;
# Flip these in case rust is installed systemvise
installRustc = false;
installCargo = false;
settings.completion.callable.snippets = "add_parentheses";
};
lint = {
lintersByFt = {
rust = [ "cargo" ];
};
linters = {
cargo = {
cmd = "${pkgs.rustfmt}/bin/cargo-fmt";
};
};
};
};
}

View file

@ -0,0 +1,92 @@
{ pkgs, ... }:
{
plugins = {
conform-nvim.settings = {
formatters_by_ft = {
javascript = [ "eslint_d" ];
javascriptreact = [ "eslint_d" ];
typescript = [ "eslint_d" ];
typescriptreact = [ "eslint_d" ];
svelte = [ "eslint_d" ];
};
formatters.eslint_d = {
command = "${pkgs.eslint_d}/bin/eslint_d";
};
};
lsp.servers = {
svelte.enable = true;
eslint = {
enable = true;
filetypes = [
"javascript"
"javascriptreact"
"javascript.jsx"
"typescript"
"typescriptreact"
"typescript.tsx"
"vue"
"html"
"markdown"
"json"
"jsonc"
"yaml"
"toml"
"xml"
"gql"
"graphql"
"svelte"
"css"
"less"
"scss"
"pcss"
"postcss"
];
};
ts_ls = {
enable = true;
filetypes = [
"javascript"
"javascriptreact"
"typescript"
"typescriptreact"
"svelte"
];
settings = {
complete_function_calls = true;
vtsls = {
autoUseWorkspaceTsdk = true;
experimental = {
completion = {
enableServerSideFuzzyMatch = true;
};
};
};
typescript = {
updateImportsOnFileMove.enabled = "always";
suggest = {
completeFunctionCalls = true;
};
inlayHints = {
enumMemberValues.enabled = true;
functionLikeReturnTypes.enabled = true;
parameterNames.enabled = "literals";
parameterTypes.enabled = true;
propertyDeclarationTypes.enabled = true;
variableType.enabled = false;
};
};
};
};
};
ts-autotag.enable = true;
};
}

View file

@ -0,0 +1,15 @@
{
plugins.lsp.servers.yamlls = {
enable = true;
extraOptions = {
capabilities = {
textDocument = {
foldingRange = {
dynamicRegistration = false;
lineFoldingOnly = true;
};
};
};
};
};
}

View file

@ -2,9 +2,11 @@
imports = [
./trouble.nix
./neogen.nix
];
# Autocomplete
# TODO "ghost text" auto complete with code companion
plugins.cmp = {
enable = true;
settings = {
@ -66,37 +68,6 @@
plugins.lsp =
{
enable = true;
servers = {
ts_ls.enable = true; # TS/JS
cssls.enable = true; # CSS
tailwindcss.enable = true; # TailwindCSS
html.enable = true; # HTML
astro.enable = true; # AstroJS
phpactor.enable = true; # PHP
svelte.enable = false; # Svelte
vuels.enable = false; # Vue
pyright.enable = true; # Python
marksman.enable = true; # Markdown
nil_ls.enable = true; # Nix
dockerls.enable = true; # Docker
bashls.enable = true; # Bash
clangd.enable = true; # C/C++
csharp_ls.enable = true; # C#
yamlls.enable = true; # YAML
lua_ls = {
enable = true;
settings.telemetry.enable = false;
};
#Rust
rust-analyzer = {
enable = true;
# Flip these in case rust is installed systemvise
installRustc = false;
installCargo = false;
settings.completion.callable.snippets = "add_parentheses";
};
};
};
plugins.none-ls = {

View file

@ -0,0 +1,8 @@
{ pkgs, ... }: {
plugins.neogen = {
enable = true;
keymaps.generate = "<leader>ag";
};
}

View file

@ -5,46 +5,24 @@
};
keymaps = [
{
mode = "n";
key = "<leader>x";
action = "+diagnostics/quickfix";
}
{
mode = "n";
key = "<leader>xx";
action = "<cmd>TroubleToggle<cr>";
action = "<cmd>Trouble diagnostics<cr>";
options = {
silent = true;
desc = "Document Diagnostics (Trouble)";
};
}
{
mode = "n";
key = "<leader>xX";
action = "<cmd>TroubleToggle workspace_diagnostics<cr>";
options = {
silent = true;
desc = "Workspace Diagnostics (Trouble)";
desc = "Show trouble diagnostics";
};
}
{
mode = "n";
key = "<leader>xt";
action = "<cmd>TroubleToggle todo<cr>";
action = "<cmd>Trouble TODO's<cr>";
options = {
silent = true;
desc = "Todo (Trouble)";
};
}
{
mode = "n";
key = "<leader>xq";
action = "<cmd>TodoQuickFix<cr>";
options = {
silent = true;
desc = "Quickfix List (Trouble)";
desc = "Show TODOs";
};
}
];
}

View file

@ -159,6 +159,10 @@
# Status bar
plugins.lualine = {
enable = true;
settings.sections = {
# TODO display absolute path based on project. for example on this file neo2005/config/plugins/ui/default.nix
# lualine_c = ["{ {'filename', path = 1}, },"];
};
};
# Startup dashboard
plugins.alpha = {

View file

@ -109,11 +109,11 @@
]
},
"locked": {
"lastModified": 1733318908,
"narHash": "sha256-SVQVsbafSM1dJ4fpgyBqLZ+Lft+jcQuMtEL3lQWx2Sk=",
"lastModified": 1734279981,
"narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "6f4e2a2112050951a314d2733a994fbab94864c6",
"rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785",
"type": "github"
},
"original": {
@ -152,11 +152,11 @@
]
},
"locked": {
"lastModified": 1733484277,
"narHash": "sha256-i5ay20XsvpW91N4URET/nOc0VQWOAd4c4vbqYtcH8Rc=",
"lastModified": 1734093295,
"narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d00c6f6d0ad16d598bf7e2956f52c1d9d5de3c3a",
"rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8",
"type": "github"
},
"original": {
@ -216,11 +216,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733581040,
"narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=",
"lastModified": 1734119587,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
"type": "github"
},
"original": {
@ -244,11 +244,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1733392399,
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
"lastModified": 1734119587,
"narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661",
"rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
"type": "github"
},
"original": {
@ -271,11 +271,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1733780592,
"narHash": "sha256-SCEjUwyt6R2+36BS7xQG+rHUrhE8HDpmRwQzKHJkimQ=",
"lastModified": 1734346666,
"narHash": "sha256-en0654KcOVZj0J3LVUzd/sbNkDSUZTWP2fHlnyfaXnc=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "cf7e026c8c86c5548d270e20c04f456939591219",
"rev": "76e9d89d96502a4ee8e1cd74a5b50077cf204134",
"type": "github"
},
"original": {
@ -294,11 +294,11 @@
]
},
"locked": {
"lastModified": 1733411491,
"narHash": "sha256-315rJ7O9cOllPDaFscnJhcMleORHbxon0Kq9LAKJ5p4=",
"lastModified": 1733773348,
"narHash": "sha256-Y47y+LesOCkJaLvj+dI/Oa6FAKj/T9sKVKDXLNsViPw=",
"owner": "NuschtOS",
"repo": "search",
"rev": "68e9fad70d95d08156cf10a030bd39487bed8ffe",
"rev": "3051be7f403bff1d1d380e4612f0c70675b44fc9",
"type": "github"
},
"original": {
@ -337,11 +337,11 @@
]
},
"locked": {
"lastModified": 1733440889,
"narHash": "sha256-qKL3vjO+IXFQ0nTinFDqNq/sbbnnS5bMI1y0xX215fU=",
"lastModified": 1733761991,
"narHash": "sha256-s4DalCDepD22jtKL5Nw6f4LP5UwoMcPzPZgHWjAfqbQ=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "50862ba6a8a0255b87377b9d2d4565e96f29b410",
"rev": "0ce9d149d99bc383d1f2d85f31f6ebd146e46085",
"type": "github"
},
"original": {