Compare commits

...

2 Commits

Author SHA1 Message Date
Adam Bellinson
01480f98b5 do/end block treesitter, avante
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
2025-06-18 19:18:11 -04:00
Adam Bellinson
37eb7073a1 nil-ls => none-ls and stuff
Some checks failed
Close stale issues and PRs / stale (push) Has been cancelled
2025-04-07 18:41:26 -04:00
7 changed files with 199 additions and 37 deletions

View File

@@ -5,8 +5,8 @@ local M = {}
local highlights = require "custom.highlights"
M.ui = {
theme = "everblush",
theme_toggle = { "everblush", "one_light" },
theme = "chadracula",
theme_toggle = { "chadracula", "one_light" },
hl_override = highlights.override,
hl_add = highlights.add,

View File

@@ -0,0 +1,43 @@
local options = {
adapters = {
ollama = function()
return require("codecompanion.adapters").extend("ollama", {
env = {
url = "http://axiom.bell:11434",
api_key = "ollama",
},
headers = {
["Content-Type"] = "application/json",
["Authorization"] = "Bearer ${api_key}",
},
parameters = {
sync = true,
},
})
end,
},
strategies = {
chat = {
adapter = "ollama",
},
inline = {
adapter = "ollama",
keymaps = {
accept_change = {
modes = { n = "ga" },
description = "Accept the suggested change",
},
reject_change = {
modes = { n = "gr" },
description = "Reject the suggested change",
},
},
},
cmd = {
adapter = "ollama",
}
},
}
return options

View File

@@ -0,0 +1,38 @@
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.stylua,
null_ls.builtins.completion.spell,
-- require("none-ls.diagnostics.eslint"), -- requires none-ls-extras.nvim
},
})
-- local augroup = vim.api.nvim_create_augroup("NoneLsFormatting", {})
--
-- local on_attach = function(client, bufnr)
-- if client.supports_method("textDocument/formatting") then
-- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = augroup,
-- buffer = bufnr,
-- callback = function()
-- vim.lsp.buf.format({ bufnr = bufnr })
-- end,
-- })
-- end
-- end
--
-- local null_ls = require("null-ls")
--
-- null_ls.setup({
-- sources = {
-- null_ls.builtins.formatting.stylua,
-- null_ls.builtins.formatting.prettierd.with({
-- extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" },
-- }),
-- null_ls.builtins.diagnostics.mypy.with({ extra_args = { "--ignore-missing-imports" } }),
-- },
-- on_attach = on_attach,
-- })
--

View File

@@ -1,21 +0,0 @@
local null_ls = require "null-ls"
local b = null_ls.builtins
local sources = {
-- webdev stuff
b.formatting.deno_fmt, -- choosed deno for ts/js files cuz its very fast!
b.formatting.prettier.with { filetypes = { "html", "markdown", "css" } }, -- so prettier works only on these filetypes
-- Lua
b.formatting.stylua,
-- cpp
b.formatting.clang_format,
}
null_ls.setup {
debug = true,
sources = sources,
}

View File

@@ -5,17 +5,18 @@ local plugins = {
-- Override plugin definition options
{
"nvimtools/none-ls.nvim",
lazy = false,
config = function()
require "custom.configs.none-ls"
end,
},
{
"neovim/nvim-lspconfig",
dependencies = {
-- format & linting
{
"jose-elias-alvarez/null-ls.nvim",
config = function()
require "custom.configs.null-ls"
end,
},
},
dependencies = "nvimtools/none-ls.nvim",
config = function()
require "plugins.configs.lspconfig"
require "custom.configs.lspconfig"
@@ -40,9 +41,16 @@ local plugins = {
}),
},
-- {
-- "nvim-treesitter/nvim-treesitter",
-- opts = overrides.treesitter,
-- },
{
"nvim-treesitter/nvim-treesitter",
opts = overrides.treesitter,
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects"
},
},
{
@@ -245,6 +253,87 @@ local plugins = {
end,
},
-- {
-- "olimorris/codecompanion.nvim",
-- lazy = false,
-- dependencies = {
-- "nvim-lua/plenary.nvim",
-- "nvim-treesitter/nvim-treesitter",
-- },
-- opts = function()
-- return require "custom.configs.codecompanion"
-- end,
-- config = function(_, opts)
-- require("codecompanion").setup(opts)
-- end,
-- },
--
{
"yetone/avante.nvim",
event = "VeryLazy",
version = false, -- Never set this value to "*"! Never!
---@module 'avante'
---@type avante.Config
opts = {
-- add any opts here
-- for example
provider = "ollama",
providers = {
ollama = {
endpoint = "http://axiom.bell:11434",
-- model = "devstral:24b",
model = "qwen2.5-coder:32b",
},
},
behavior = {
-- auto_apply_diff_after_generation = true
}
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = "make",
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
--- The below dependencies are optional,
"echasnovski/mini.pick", -- for file_selector provider mini.pick
"nvim-telescope/telescope.nvim", -- for file_selector provider telescope
"hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions
"ibhagwan/fzf-lua", -- for file_selector provider fzf
"stevearc/dressing.nvim", -- for input provider dressing
"folke/snacks.nvim", -- for input provider snacks
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
-- "zbirenbaum/copilot.lua", -- for providers='copilot'
{
-- support for image pasting
"HakonHarnes/img-clip.nvim",
event = "VeryLazy",
opts = {
-- recommended settings
default = {
embed_image_as_base64 = false,
prompt_for_file_name = false,
drag_and_drop = {
insert_mode = true,
},
-- required for Windows users
use_absolute_path = true,
},
},
},
{
-- Make sure to set this up properly if you have lazy=true
'MeanderingProgrammer/render-markdown.nvim',
opts = {
file_types = { "markdown", "Avante" },
},
ft = { "markdown", "Avante" },
},
},
}
-- {
-- "rouge8/neotest-rust",
-- config = function() end,

View File

@@ -16,9 +16,9 @@ M.on_attach = function(client, bufnr)
require("nvchad.signature").setup(client)
end
if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
client.server_capabilities.semanticTokensProvider = nil
end
-- if not utils.load_config().ui.lsp_semantic_tokens and client.supports_method "textDocument/semanticTokens" then
-- client.server_capabilities.semanticTokensProvider = nil
-- end
end
M.capabilities = vim.lsp.protocol.make_client_capabilities()

View File

@@ -1,5 +1,5 @@
local options = {
ensure_installed = { "lua" },
ensure_installed = { "lua", "elixir" },
highlight = {
enable = true,
@@ -7,6 +7,19 @@ local options = {
},
indent = { enable = true },
textobjects = {
select = {
enable = true,
lookahead = true,
keymaps = {
-- custom mappings (example)
["ad"] = "@block.outer", -- around do...end
["id"] = "@block.inner", -- inside do...end
},
},
},
}
return options