initial commit
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
config = function ()
|
||||
local alpha = require'alpha'
|
||||
--local colours = require 'material.colors'
|
||||
vim.api.nvim_set_hl(0, "alphaheader", {fg = "#3661cf" })
|
||||
--vim.api.nvim_set_hl(0, "alphafooter", {fg = colours.main.darkpurple })
|
||||
local dashboard = require'alpha.themes.dashboard'
|
||||
dashboard.section.header.val = {
|
||||
[[ ░░░░░░░░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░░▒▓▒░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░░░▒██▓░░░░░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░░▓████▓░░░░░░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░░▒██████▓░░░░░░░░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░▓████████▒░░░░░░░░░░░░░░░░░ ]],
|
||||
[[░░░░░░░░░░░░░░▒███████████▓░░░░░░░░░░░░░░░░░]],
|
||||
[[░░░░░░░░░░░░░▓██████████████▒░░░░░░░░░░░░░░░]],
|
||||
[[░░░░░░░░░░░░▓████████████████▓░░░░░░░░░░░░░░]],
|
||||
[[░░░░░░░░░░░▓███████████████▓▓██▒░░░░░░░░░░░░]],
|
||||
[[░░░░░░░░░░▒████████████████▓░▒██▒░░░░░░░░░░░]],
|
||||
[[░░░░░░░░░░▒███████████████▓▒░░▓█▓░░░░░░░░░░░]],
|
||||
[[ ░░░░░░░░░▒███████████████▓░░░▓█▓▒░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░▓████████████████████▓░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░▒▓██████████████████▓░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░▓████████████████▒░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░▒▓██████████▓▒░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░▒▒░░░░░░░░░░░░ ]],
|
||||
[[ ░░░░░░░░░░░░░░░░░░ ]],
|
||||
}
|
||||
dashboard.section.header.opts.hl = "alphaheader"
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button( "e", " new file" , ":ene <bar> startinsert <cr>"),
|
||||
dashboard.button("f", " search file in cwd", ":FzfLua files<cr>"),
|
||||
dashboard.button("-", " explore cwd", ":Oil --float<cr>"),
|
||||
dashboard.button("l", " Lazy settings", ":Lazy<cr>"),
|
||||
dashboard.button("g", " GIT", ":LazyGit<cr>"),
|
||||
dashboard.button( "q", " quit nvim" , ":qa<cr>"),
|
||||
}
|
||||
local handle = io.popen('fortune')
|
||||
local fortune = handle:read("*a")
|
||||
handle:close()
|
||||
dashboard.section.footer.val = {
|
||||
[["we define the boundaries of reality;]],
|
||||
[[they don't define us."]],
|
||||
[[ -Teferi]]
|
||||
}
|
||||
dashboard.section.footer.opts.hl = "alphafooter"
|
||||
dashboard.config.opts.noautocmd = true
|
||||
|
||||
vim.cmd[[autocmd user alphaready echo 'ready']]
|
||||
|
||||
alpha.setup(dashboard.config)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
{'romgrk/barbar.nvim',
|
||||
dependencies = {
|
||||
'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status
|
||||
'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons
|
||||
},
|
||||
init = function() vim.g.barbar_auto_setup = false end,
|
||||
opts = {
|
||||
-- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default:
|
||||
-- animation = true,
|
||||
-- insert_at_start = true,
|
||||
-- …etc.
|
||||
},
|
||||
version = '^1.0.0', -- optional: only update when a new 1.x version is released
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return{
|
||||
"APZelos/blamer.nvim",
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
-- Autocommand to re-apply UI highlights after colorscheme changes
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
-- If using nvim-cmp, you can re-source the menu highlights
|
||||
if pcall(require, 'blink-cmp') then
|
||||
-- Optional: run a custom highlights function or just re-setup your completion colors
|
||||
end
|
||||
|
||||
-- Refresh LSP diagnostic highlights and signs
|
||||
if vim.lsp.diagnostic and type(vim.lsp.diagnostic._define_default_signs_and_highlights) == 'function' then
|
||||
vim.lsp.diagnostic._define_default_signs_and_highlights()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'super-tab' },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = false } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
local ignore = require('ignoreConfig.codeCompanionModel');
|
||||
--[[
|
||||
-- ignore file should be formatted as:
|
||||
|
||||
local opts = {
|
||||
model = "claude_code",
|
||||
}
|
||||
return opts
|
||||
|
||||
-- but change model to desired model, ex. ollama
|
||||
--]]
|
||||
|
||||
return {
|
||||
"olimorris/codecompanion.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"hrsh7th/nvim-cmp", -- Optional: for autocompletion inside chat
|
||||
{ "MeanderingProgrammer/render-markdown.nvim", ft = { "markdown", "codecompanion" } }, -- Optional: pretty markdown render
|
||||
},
|
||||
config = function()
|
||||
require("codecompanion").setup({
|
||||
-- Define strategies (Chat vs. Inline code generation/refactor)
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = ignore.model,
|
||||
},
|
||||
inline = {
|
||||
adapter = ignore.model,
|
||||
},
|
||||
},
|
||||
-- Configure the actual connections (adapters)
|
||||
adapters = {
|
||||
claude_code = function()
|
||||
return require("codecompanion.adapters").extend("claude_code", {
|
||||
env = {
|
||||
-- Looks for your export ANTHROPIC_API_KEY="your-key" in your .bashrc/.zshrc
|
||||
command = "/usr/local/bin/claude-code-acp",
|
||||
},
|
||||
})
|
||||
end,
|
||||
ollama = function()
|
||||
return require("codecompanion.adapters").extend("ollama", {
|
||||
schema = {
|
||||
model = {
|
||||
default = "jean:latest", -- Your downloaded local model
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
interactions = {
|
||||
cli = {
|
||||
agent = "claude_code",
|
||||
agents = {
|
||||
claude_code = {
|
||||
cmd = "claude",
|
||||
args = {},
|
||||
description = "Claude Code CLI",
|
||||
provider = "terminal",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Quick Keymaps
|
||||
vim.keymap.set({ "n", "v" }, "<leader>ac", "<cmd>CodeCompanionChat Toggle<cr>", { desc = "Toggle AI Chat" })
|
||||
vim.keymap.set({ "n", "v" }, "<leader>ai", "<cmd>CodeCompanionActions<cr>", { desc = "AI Actions Menu" })
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
--[[
|
||||
return {
|
||||
'marko-cerovac/material.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local material = require "material"
|
||||
--local colours = require "material.colors"
|
||||
local ignores = require('ignoreConfig.colourConfig')
|
||||
vim.g.material_style = "darker"
|
||||
--vim.g.material_style = "palenight"
|
||||
material.setup({
|
||||
lualine_style = "default", -- Lualine style ( can be 'stealth' or 'default' )
|
||||
disable = ignores[1],
|
||||
custom_highlights = {
|
||||
Comment = { fg = "#b7b0bf" },
|
||||
LineNr = { fg = "#b7b0bf" },
|
||||
-- AlphaHeader = { fg = "#3661cf" },
|
||||
-- AlphaFooter = { fg = colours.main.red},
|
||||
},
|
||||
})
|
||||
vim.cmd('colorscheme material')
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
--material styles:
|
||||
--daker
|
||||
--lighter
|
||||
--oceanic
|
||||
--palenight
|
||||
--deep ocean
|
||||
--]]
|
||||
|
||||
--[[
|
||||
-- DRACULA
|
||||
return {
|
||||
-- add dracula
|
||||
"Mofiqul/dracula.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
vim.cmd('colorscheme dracula')
|
||||
end,
|
||||
}
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
--[[
|
||||
return {
|
||||
"rebelot/kanagawa.nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local ignores = require('ignoreConfig.colourConfig')
|
||||
require('kanagawa').setup({
|
||||
theme = "lotus",
|
||||
compile = true,
|
||||
commentStyle = { italic = true },
|
||||
transparent = ignores.transparent,
|
||||
colors = {
|
||||
--palette = {
|
||||
-- -- change all usages of these colors
|
||||
-- --fujiGray = "#FFFFFF",
|
||||
--},
|
||||
theme = {
|
||||
all = {
|
||||
syn = {
|
||||
--comment = "#FF00FF",
|
||||
comment = "#CDD3D4",
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.cmd("colorscheme kanagawa-dragon")
|
||||
-- colourschemes:
|
||||
-- wave (default)
|
||||
-- dragon (dark)
|
||||
-- lotus (MY EEEEYES!)
|
||||
end,
|
||||
--uncomment this and 'compile=true' in setup if compiling to bytecode
|
||||
build = function()
|
||||
vim.cmd("KanagawaCompile")
|
||||
end,
|
||||
}
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--EVERFOREST
|
||||
return{
|
||||
"neanias/everforest-nvim",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local everforest = require("everforest");
|
||||
local ignore = require('ignoreConfig.colourConfig');
|
||||
everforest.setup({
|
||||
background = "hard",
|
||||
transparent_background_level = ignore.transparent,
|
||||
italics = true,
|
||||
|
||||
});
|
||||
everforest.load();
|
||||
vim.cmd("colorscheme everforest");
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
return {
|
||||
'stevearc/conform.nvim',
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
json = { "jq" }, -- Or use "prettierd" / "prettier" / "fixjson"
|
||||
},
|
||||
-- Optional: Automatically format when you save the file
|
||||
--format_on_save = {
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_format = "fallback",
|
||||
--},
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"banjo/contextfiles.nvim",
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return{
|
||||
'stevearc/dressing.nvim',
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
-- or if using mini.icons/mini.nvim
|
||||
-- dependencies = { "echasnovski/mini.icons" },
|
||||
opts = {
|
||||
files = {
|
||||
no_ignore = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
---@module "ibl"
|
||||
---@type ibl.config
|
||||
opts = { },
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
-- nvim v0.8.0
|
||||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
lazy = true,
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
-- setting the keybinding for LazyGit with 'keys' is recommended in
|
||||
-- order to load the plugin when the command is run for the first time
|
||||
keys = {
|
||||
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
-- LSP Plugins
|
||||
return { -- Main LSP Configuration
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
-- Automatically install LSPs and related tools to stdpath for Neovim
|
||||
-- Mason must be loaded before its dependents so we need to set it up here.
|
||||
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
|
||||
{ 'mason-org/mason.nvim', opts = {} },
|
||||
{
|
||||
'mason-org/mason-lspconfig.nvim',
|
||||
opts = {
|
||||
automatic_enable = {
|
||||
exclude = { 'jdtls' }
|
||||
}
|
||||
}
|
||||
},
|
||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||
|
||||
-- Useful status updates for LSP.
|
||||
{ 'j-hui/fidget.nvim', opts = {} },
|
||||
|
||||
-- Allows extra capabilities provided by blink.cmp
|
||||
},
|
||||
config = function()
|
||||
-- Brief aside: **What is LSP?**
|
||||
--
|
||||
-- LSP is an initialism you've probably heard, but might not understand what it is.
|
||||
--
|
||||
-- LSP stands for Language Server Protocol. It's a protocol that helps editors
|
||||
-- and language tooling communicate in a standardized fashion.
|
||||
--
|
||||
-- In general, you have a "server" which is some tool built to understand a particular
|
||||
-- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
|
||||
-- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
|
||||
-- processes that communicate with some "client" - in this case, Neovim!
|
||||
--
|
||||
-- LSP provides Neovim with features like:
|
||||
-- - Go to definition
|
||||
-- - Find references
|
||||
-- - Autocompletion
|
||||
-- - Symbol Search
|
||||
-- - and more!
|
||||
--
|
||||
-- Thus, Language Servers are external tools that must be installed separately from
|
||||
-- Neovim. This is where `mason` and related plugins come into play.
|
||||
--
|
||||
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
||||
-- and elegantly composed help section, `:help lsp-vs-treesitter`
|
||||
|
||||
-- This function gets run when an LSP attaches to a particular buffer.
|
||||
-- That is to say, every time a new file is opened that is associated with
|
||||
-- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
|
||||
-- function will be executed to configure the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
-- NOTE: Remember that Lua is a real programming language, and as such it is possible
|
||||
-- to define small helper and utility functions so you don't have to repeat yourself.
|
||||
--
|
||||
-- In this case, we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
local map = function(keys, func, desc, mode)
|
||||
mode = mode or 'n'
|
||||
vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
|
||||
-- <C-w>d = view diagnostic message under cursor
|
||||
|
||||
-- Rename the variable under your cursor.
|
||||
-- Most Language Servers support renaming across files, etc.
|
||||
map('gn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
|
||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||
-- or a suggestion from your LSP for this to activate.
|
||||
map('ga', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||
|
||||
-- Find references for the word under your cursor.
|
||||
map('gr', require('fzf-lua').lsp_references, '[G]oto [R]eferences')
|
||||
|
||||
-- Jump to the implementation of the word under your cursor.
|
||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||
map('gi', require('fzf-lua').lsp_implementations, '[G]oto [I]mplementation')
|
||||
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||
-- To jump back, press <C-t>.
|
||||
map('gd', require('fzf-lua').lsp_definitions, '[G]oto [D]efinition')
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- For example, in C this would take you to the header.
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
-- Symbols are things like variables, functions, types, etc.
|
||||
map('gO', require('fzf-lua').lsp_document_symbols, 'Open Document Symbols')
|
||||
|
||||
-- Fuzzy find all the symbols in your current workspace.
|
||||
-- Similar to document symbols, except searches over your entire project.
|
||||
map('gW', require('fzf-lua').lsp_live_workspace_symbols, 'Open Workspace Symbols')
|
||||
|
||||
-- Jump to the type of the word under your cursor.
|
||||
-- Useful when you're not sure what type a variable is and you want to see
|
||||
-- the definition of its *type*, not where it was *defined*.
|
||||
map('gt', require('fzf-lua').lsp_typedefs, '[G]oto [T]ype Definition')
|
||||
|
||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||
---@param client vim.lsp.Client
|
||||
---@param method vim.lsp.protocol.Method
|
||||
---@param bufnr? integer some lsp support methods only in specific files
|
||||
---@return boolean
|
||||
local function client_supports_method(client, method, bufnr)
|
||||
if vim.fn.has 'nvim-0.11' == 1 then
|
||||
return client:supports_method(method, bufnr)
|
||||
else
|
||||
return client.supports_method(method, { bufnr = bufnr })
|
||||
end
|
||||
end
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
-- See `:help CursorHold` for information about when this is executed
|
||||
--
|
||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf) then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'LspDetach' }, {
|
||||
group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf }
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- The following code creates a keymap to toggle inlay hints in your
|
||||
-- code, if the language server you are using supports them
|
||||
--
|
||||
-- This may be unwanted, since they displace some of your code
|
||||
if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
|
||||
map('<leader>th', function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
|
||||
end, '[T]oggle Inlay [H]ints')
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Diagnostic Config
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config {
|
||||
severity_sort = true,
|
||||
float = { border = 'rounded', source = 'if_many' },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = ' ',
|
||||
[vim.diagnostic.severity.WARN] = ' ',
|
||||
[vim.diagnostic.severity.INFO] = ' ',
|
||||
[vim.diagnostic.severity.HINT] = ' ',
|
||||
},
|
||||
},
|
||||
virtual_text = {
|
||||
source = 'if_many',
|
||||
spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- LSP servers and clients are able to communicate to each other what features they support.
|
||||
-- By default, Neovim doesn't support everything that is in the LSP specification.
|
||||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||
|
||||
|
||||
local orig_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities(orig_capabilities)
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following tables. Available keys are:
|
||||
-- - cmd (table): Override the default command used to start the server
|
||||
-- - filetypes (table): Override the default list of associated filetypes for the server
|
||||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
||||
-- - settings (table): Override the default settings passed when initializing the server.
|
||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||
local servers = require('config.lspServers')
|
||||
|
||||
-- Ensure the servers and tools above are installed
|
||||
--
|
||||
-- To check the current status of installed tools and/or manually install
|
||||
-- other tools, you can run
|
||||
-- :Mason
|
||||
--
|
||||
-- You can press `g?` for help in this menu.
|
||||
--
|
||||
-- `mason` had to be setup earlier: to configure its options see the
|
||||
-- `dependencies` table for `nvim-lspconfig` above.
|
||||
--
|
||||
-- You can add other tools here that you want Mason to install
|
||||
-- for you, so that they are available from within Neovim.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
'stylua', -- Used to format Lua code
|
||||
})
|
||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||
|
||||
require('mason-lspconfig').setup {
|
||||
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
||||
automatic_installation = false,
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||
require('lspconfig')[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
opts = {
|
||||
--theme = "solarized_light", --https://github.com/nvim-lualine/lualine.nvim/blob/master/THEMES.md
|
||||
},
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
-- lazy.nvim
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- add any options here
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
return{
|
||||
{
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
opts = {
|
||||
'*';
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch = "main",
|
||||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.config',
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
'c',
|
||||
'cpp',
|
||||
'lua',
|
||||
'vim',
|
||||
'vimdoc',
|
||||
'markdown',
|
||||
'markdown_inline',
|
||||
'query',
|
||||
'c_sharp',
|
||||
'yaml',
|
||||
},
|
||||
auto_install = true,
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
case_insensitive = true,
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
natural_order = true,
|
||||
sort = {
|
||||
{ "name", "asc" },
|
||||
},
|
||||
}
|
||||
},
|
||||
dependencies = {{ "echasnovski/mini.icons", opts = {} }},
|
||||
lazy = false,
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
"tpope/vim-sleuth"
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
"linux-cultist/venv-selector.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
{ "nvim-telescope/telescope.nvim", branch = "master", dependencies = { "nvim-lua/plenary.nvim" } },
|
||||
},
|
||||
ft = "python", --load when python file opens
|
||||
lazy = false,
|
||||
branch = "main", -- This is the regexp branch, use this for the new version
|
||||
keys = {
|
||||
{ "<Leader>vs", "<cmd>VenvSelect<cr>" },
|
||||
},
|
||||
---@type venv-selector.Config
|
||||
opts = {
|
||||
-- Your settings go here
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user