2026 nvim config
This commit is contained in:
3
init.lua
Normal file
3
init.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
require("config.lazy")
|
||||||
|
|
||||||
|
vim.g.lazyvim_check_order = false
|
||||||
27
lazy-lock.json
Normal file
27
lazy-lock.json
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"LazyVim": { "branch": "main", "commit": "c64a61734fc9d45470a72603395c02137802bc6f" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "234fc048de931a0e42ebcad675bf6559d75e23df" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||||
|
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "b1d9a914b02ba5660f1e272a03314b31d4576fe2" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "b34fbdffdcb6295c7a25df6ba375452a2e73c32e" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||||
|
"ollama.nvim": { "branch": "main", "commit": "45e58779fecde7ac5b8f62800bbe7180d4b48507" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||||
|
"snacks.nvim": { "branch": "main", "commit": "dec29f55666f8f4545835636077a86b150faf630" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "3a12a853ebf21ec1cce9a92290e3013f8ae75f02" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }
|
||||||
|
}
|
||||||
9
lazyvim.json
Normal file
9
lazyvim.json
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extras": [
|
||||||
|
|
||||||
|
],
|
||||||
|
"news": {
|
||||||
|
"NEWS.md": "11866"
|
||||||
|
},
|
||||||
|
"version": 8
|
||||||
|
}
|
||||||
BIN
lua/.DS_Store
vendored
Normal file
BIN
lua/.DS_Store
vendored
Normal file
Binary file not shown.
47
lua/config/lazy.lua
Normal file
47
lua/config/lazy.lua
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
-- Bootstrap lazy.nvim
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
|
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||||
|
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
vim.api.nvim_echo({
|
||||||
|
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||||
|
{ out, "WarningMsg" },
|
||||||
|
{ "\nPress any key to exit..." },
|
||||||
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.api.nvim_create_autocmd("InsertEnter", { command = "set norelativenumber" })
|
||||||
|
vim.api.nvim_create_autocmd("InsertLeave", { command = "set relativenumber" })
|
||||||
|
|
||||||
|
|
||||||
|
vim.opt.tabstop = 4 -- Number of spaces tabs count for
|
||||||
|
vim.opt.shiftwidth = 4 -- Number of spaces for each indent
|
||||||
|
vim.opt.softtabstop = 4 -- Number of spaces for a tab when editing
|
||||||
|
vim.opt.expandtab = true -- Use spaces instead of actual tab characters
|
||||||
|
|
||||||
|
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
vim.opt.number = true -- show absolute line numbers
|
||||||
|
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||||
|
-- loading lazy.nvim so that mappings are correct.
|
||||||
|
-- This is also a good place to setup other settings (vim.opt)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
vim.g.maplocalleader = "\\"
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- import your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
|
-- colorscheme that will be used when installing plugins.
|
||||||
|
install = { colorscheme = { "habamax" } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
||||||
32
lua/plugins/cmp.lua
Normal file
32
lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
-- lua/plugins/cmp.lua
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
event = "InsertEnter",
|
||||||
|
dependencies = {
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"hrsh7th/cmp-nvim-lsp", -- provides require('cmp_nvim_lsp')
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
cmp.setup({
|
||||||
|
snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "path" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
6
lua/plugins/colors.lua
Normal file
6
lua/plugins/colors.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
{ "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {} },
|
||||||
|
{ "catppuccin/nvim", name = "catppuccin", lazy = true },
|
||||||
|
{ "ellisonleao/gruvbox.nvim", lazy = true },
|
||||||
|
}
|
||||||
|
|
||||||
9
lua/plugins/colorscheme.lua
Normal file
9
lua/plugins/colorscheme.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"LazyVim/LazyVim",
|
||||||
|
opts = {
|
||||||
|
colorscheme = "catppuccin-mocha", -- or "catppuccin-mocha", "gruvbox"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
19
lua/plugins/harpoon.lua
Normal file
19
lua/plugins/harpoon.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-- ~/.config/nvim/lua/plugins/harpoon.lua
|
||||||
|
|
||||||
|
return {
|
||||||
|
"ThePrimeagen/harpoon",
|
||||||
|
branch = "harpoon2", -- Use the latest Harpoon 2 branch for best support
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("harpoon"):setup({})
|
||||||
|
-- Map <leader>h to toggle the Harpoon quick menu
|
||||||
|
vim.keymap.set("n", "<leader>h", function()
|
||||||
|
require("harpoon").ui:toggle_quick_menu(require("harpoon"):list())
|
||||||
|
end, { desc = "Harpoon quick menu" })
|
||||||
|
-- Optionally add a key to add the current file (or directory) to Harpoon
|
||||||
|
vim.keymap.set("n", "<leader>m", function()
|
||||||
|
require("harpoon"):list():add()
|
||||||
|
end, { desc = "Mark file (Harpoon)" })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
14
lua/plugins/lualine-clock.lua
Normal file
14
lua/plugins/lualine-clock.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.sections = opts.sections or {}
|
||||||
|
opts.sections.lualine_x = opts.sections.lualine_x or {}
|
||||||
|
table.insert(opts.sections.lualine_x, {
|
||||||
|
function()
|
||||||
|
return os.date("%H:%M:%S")
|
||||||
|
end,
|
||||||
|
icon = "",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
77
lua/plugins/mason.lua
Normal file
77
lua/plugins/mason.lua
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
build = ":MasonUpdate",
|
||||||
|
cmd = { "Mason", "MasonInstall", "MasonUninstall" },
|
||||||
|
opts = { ui = { border = "rounded" } },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mason-org/mason-lspconfig.nvim",
|
||||||
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
|
dependencies = {
|
||||||
|
"mason-org/mason.nvim",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"pyright", -- Python
|
||||||
|
"ts_ls", -- TypeScript/JavaScript (was tsserver)
|
||||||
|
"lua_ls", -- Lua
|
||||||
|
"intelephense", -- PHP
|
||||||
|
"html", -- HTML
|
||||||
|
"cssls", -- CSS
|
||||||
|
"jsonls", -- JSON
|
||||||
|
"yamlls", -- YAML
|
||||||
|
"bashls", -- Bash
|
||||||
|
"dockerls", -- Docker
|
||||||
|
"gopls", -- Go
|
||||||
|
"rust_analyzer", -- Rust
|
||||||
|
"jdtls", -- Java
|
||||||
|
"clangd", -- C/C++
|
||||||
|
"omnisharp", -- C#
|
||||||
|
"vimls", -- Vim
|
||||||
|
"elixirls", -- Elixir
|
||||||
|
"kotlin_language_server",
|
||||||
|
"sqlls", -- SQL
|
||||||
|
"lemminx", -- XML
|
||||||
|
"marksman", -- Markdown
|
||||||
|
"svelte", -- Svelte
|
||||||
|
"tailwindcss", -- Tailwind CSS
|
||||||
|
"angularls", -- Angular
|
||||||
|
"vuels", -- Vue.js
|
||||||
|
"powershell_es", -- PowerShell
|
||||||
|
"fortls", -- Fortran
|
||||||
|
},
|
||||||
|
automatic_installation = true,
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
require("mason").setup({})
|
||||||
|
require("mason-lspconfig").setup(opts)
|
||||||
|
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
-- Custom setup example for Lua
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
workspace = { checkThirdParty = false },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Generic setup for everything else
|
||||||
|
for _, server in ipairs(opts.ensure_installed or {}) do
|
||||||
|
if server ~= "lua_ls" then
|
||||||
|
vim.lsp.config(server, { capabilities = capabilities })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Enable all listed servers
|
||||||
|
vim.lsp.enable(opts.ensure_installed)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
55
lua/plugins/neo-tree.lua
Normal file
55
lua/plugins/neo-tree.lua
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
return {
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
branch = "v3.x",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
lazy = false,
|
||||||
|
opts = {
|
||||||
|
close_if_last_window = true,
|
||||||
|
popup_border_style = "rounded",
|
||||||
|
enable_git_status = true,
|
||||||
|
|
||||||
|
-- Global window options
|
||||||
|
window = {
|
||||||
|
position = "left",
|
||||||
|
width = 35,
|
||||||
|
mappings = {
|
||||||
|
["o"] = "open",
|
||||||
|
["P"] = "toggle_preview",
|
||||||
|
["s"] = "open_split",
|
||||||
|
["v"] = "open_vsplit",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
filesystem = {
|
||||||
|
follow_current_file = { enabled = true },
|
||||||
|
enable_fs_watch = true, -- v3 style watcher flag
|
||||||
|
|
||||||
|
-- All filtering options belong here
|
||||||
|
filtered_items = {
|
||||||
|
-- Set visible=true if you want hidden items to show but dimmed
|
||||||
|
visible = true,
|
||||||
|
hide_dotfiles = false,
|
||||||
|
hide_gitignored = false,
|
||||||
|
-- Optional: never hide these even if other filters apply
|
||||||
|
always_show = {},
|
||||||
|
-- Optional: keep these hidden regardless of visible=true
|
||||||
|
never_show = { ".git" },
|
||||||
|
-- Optional: add names/patterns to hide by default
|
||||||
|
hide_by_name = {},
|
||||||
|
hide_by_pattern = {},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Optional per-source window mappings section (inherits from root window)
|
||||||
|
-- window = {
|
||||||
|
-- mappings = {
|
||||||
|
-- ["/"] = "fuzzy_finder",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
33
lua/plugins/ollama.lua
Normal file
33
lua/plugins/ollama.lua
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
return {
|
||||||
|
"nomnivore/ollama.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Commands added by the plugin
|
||||||
|
cmd = { "Ollama", "OllamaModel", "OllamaServe", "OllamaServeStop" },
|
||||||
|
|
||||||
|
keys = {
|
||||||
|
-- Keybind for prompt menu (the <c-u> is important for selections)
|
||||||
|
{
|
||||||
|
"<leader>oo",
|
||||||
|
":<c-u>lua require('ollama').prompt()<cr>",
|
||||||
|
desc = "ollama prompt",
|
||||||
|
mode = { "n", "v" },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Direct prompt example
|
||||||
|
{
|
||||||
|
"<leader>oG",
|
||||||
|
":<c-u>lua require('ollama').prompt('Generate_Code')<cr>",
|
||||||
|
desc = "ollama Generate Code",
|
||||||
|
mode = { "n", "v" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
opts = {
|
||||||
|
-- your configuration overrides
|
||||||
|
model = "deepseek-coder-v2:16b",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
9
lua/plugins/snacks.lua
Normal file
9
lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/snacks.nvim",
|
||||||
|
priority = 1000,
|
||||||
|
lazy = false,
|
||||||
|
opts = {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
19
lua/plugins/telescope.lua
Normal file
19
lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-- ~/.config/nvim/lua/plugins/Telescope.lua
|
||||||
|
|
||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
-- Basic Telescope setup
|
||||||
|
require("telescope").setup({})
|
||||||
|
|
||||||
|
-- Keymap: <leader>p to find files from the CWD Neovim was opened in
|
||||||
|
vim.keymap.set("n", "<leader>p",
|
||||||
|
function()
|
||||||
|
require("telescope.builtin").find_files({ cwd = vim.fn.getcwd() })
|
||||||
|
end,
|
||||||
|
{ desc = "Find Files (CWD, Telescope)" }
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
13
lua/plugins/terminal.lua
Normal file
13
lua/plugins/terminal.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
return {
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
version = "*",
|
||||||
|
config = function()
|
||||||
|
require("toggleterm").setup({
|
||||||
|
size = 15,
|
||||||
|
open_mapping = [[<C-\>]], -- toggle terminal with Ctrl + \
|
||||||
|
direction = "horizontal", -- options: 'vertical', 'tab', 'float'
|
||||||
|
shade_terminals = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
14
lua/plugins/treesitter.lua
Normal file
14
lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
branch = "master",
|
||||||
|
lazy = false,
|
||||||
|
build = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup({
|
||||||
|
ensure_installed = { "lua", "python", "javascript", "typescript", "html", "css" },
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user