move to lazyvim
This commit is contained in:
parent
ecb347cc19
commit
9725324dbf
27 changed files with 592 additions and 338 deletions
|
|
@ -1,9 +0,0 @@
|
|||
-- This file needs to have same structure as nvconfig.lua
|
||||
-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua
|
||||
|
||||
---@type ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.ui = {theme = 'catppuccin'}
|
||||
|
||||
return M
|
||||
3
.config/nvim/lua/config/autocmds.lua
Normal file
3
.config/nvim/lua/config/autocmds.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
-- Add any additional autocmds here
|
||||
|
|
@ -1,4 +1,7 @@
|
|||
require "nvchad.mappings"
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
--
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
|
|
@ -24,7 +27,7 @@ map("", "<leader>dso", "<cmd> DapStepOver <CR>", { desc = "Step Over" })
|
|||
map("", "<leader>dsi", "<cmd> DapStepInto <CR>", { desc = "Step Into" })
|
||||
map("", "<leader>dst", "<cmd> DapStepOut <CR>", { desc = "Step Out" })
|
||||
map("", "<leader>dus", function()
|
||||
local widgets = require "dap.ui.widgets"
|
||||
local widgets = require("dap.ui.widgets")
|
||||
local sidebar = widgets.sidebar(widgets.scopes)
|
||||
sidebar.open()
|
||||
end, { desc = "Open debugging Window" })
|
||||
53
.config/nvim/lua/config/lazy.lua
Normal file
53
.config/nvim/lua/config/lazy.lua
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
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.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
|
||||
-- import/override with your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight", "habamax" } },
|
||||
checker = {
|
||||
enabled = true, -- check for plugin updates periodically
|
||||
notify = false, -- notify on update
|
||||
}, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
local on_init = require("nvchad.configs.lspconfig").on_init
|
||||
local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
--local on_attach = require("nvchad.configs.lspconfig").on_attach
|
||||
--local on_init = require("nvchad.configs.lspconfig").on_init
|
||||
--local capabilities = require("nvchad.configs.lspconfig").capabilities
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local util = require "lspconfig/util"
|
||||
local util = require("lspconfig/util")
|
||||
--local servers = { "html", "cssls" }
|
||||
|
||||
-- lsps with default config
|
||||
|
|
@ -16,16 +16,16 @@ local util = require "lspconfig/util"
|
|||
--end
|
||||
|
||||
-- typescript
|
||||
lspconfig.tsserver.setup {
|
||||
lspconfig.tsserver.setup({
|
||||
on_attach = on_attach,
|
||||
on_init = on_init,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.gopls.setup {
|
||||
lspconfig.gopls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
cmd = {"gopls"},
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
settings = {
|
||||
|
|
@ -37,12 +37,12 @@ lspconfig.gopls.setup {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.pyright.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = {"python"},
|
||||
filetypes = { "python" },
|
||||
})
|
||||
|
||||
lspconfig.powershell_es.setup({
|
||||
|
|
@ -56,6 +56,6 @@ omnisharp_bin = vim.fn.stdpath("data") .. "/mason/packages/omnisharp/omnisharp"
|
|||
lspconfig.omnisharp.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
filetypes = { "cs"},
|
||||
cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) }
|
||||
filetypes = { "cs" },
|
||||
cmd = { omnisharp_bin, "--languageserver", "--hostPID", tostring(pid) },
|
||||
})
|
||||
3
.config/nvim/lua/config/options.lua
Normal file
3
.config/nvim/lua/config/options.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
css = { "prettier" },
|
||||
html = { "prettier" },
|
||||
},
|
||||
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_fallback = true,
|
||||
},
|
||||
}
|
||||
|
||||
require("conform").setup(options)
|
||||
|
||||
--stylua
|
||||
--lua-language-server
|
||||
--prettier
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
return {
|
||||
defaults = { lazy = true },
|
||||
install = { colorscheme = { "nvchad" } },
|
||||
|
||||
ui = {
|
||||
icons = {
|
||||
ft = "",
|
||||
lazy = " ",
|
||||
loaded = "",
|
||||
not_loaded = "",
|
||||
},
|
||||
},
|
||||
|
||||
performance = {
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"2html_plugin",
|
||||
"tohtml",
|
||||
"getscript",
|
||||
"getscriptPlugin",
|
||||
"gzip",
|
||||
"logipat",
|
||||
"netrw",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
"netrwFileHandlers",
|
||||
"matchit",
|
||||
"tar",
|
||||
"tarPlugin",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"vimball",
|
||||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"tutor",
|
||||
"rplugin",
|
||||
"syntax",
|
||||
"synmenu",
|
||||
"optwin",
|
||||
"compiler",
|
||||
"bugreport",
|
||||
"ftplugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
|
||||
parser_config.powershell_es = {
|
||||
install_info = {
|
||||
url = "/home/user/.local/share/tree-sitter-PowerShell",
|
||||
files = { "src/parser.c" },
|
||||
generate_requires_npm = false,
|
||||
requires_generate_from_grammar = false,
|
||||
},
|
||||
filetype = "ps1",
|
||||
}
|
||||
return parser_config
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
require "nvchad.options"
|
||||
|
||||
vim.opt.guicursor = ""
|
||||
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.api.nvim_set_option("clipboard", "unnamedplus")
|
||||
vim.opt_local.conceallevel = 2
|
||||
24
.config/nvim/lua/plugins/example.lua
Normal file
24
.config/nvim/lua/plugins/example.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, "😄")
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
}
|
||||
|
|
@ -1,164 +0,0 @@
|
|||
local Ollama_url = (os.getenv "OLLAMA_TOKEN") and "https://" .. os.getenv "OLLAMA_TOKEN" .. "@ollama.durp.info"
|
||||
or "https://localhost:11347"
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = "BufWritePre",
|
||||
config = function()
|
||||
require "configs.conform"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"gopls",
|
||||
"rust-analyzer",
|
||||
"pyright",
|
||||
"mypy",
|
||||
"ruff",
|
||||
"black",
|
||||
"debugpy",
|
||||
"powershell-editor-services",
|
||||
"bash-language-server",
|
||||
"eslint-lsp",
|
||||
"js-debug-adapter",
|
||||
"prettier",
|
||||
"typescript-language-server",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"go",
|
||||
"terraform",
|
||||
"c_sharp",
|
||||
"bash",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require("nvchad.configs.lspconfig").defaults()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"tpope/vim-fugitive",
|
||||
},
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
opts = {
|
||||
filters = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"TheLeoP/powershell.nvim",
|
||||
opts = {
|
||||
bundle_path = vim.fn.stdpath "data" .. "/man/packages/powershell-editor-services",
|
||||
},
|
||||
},
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
config = function(_, opts)
|
||||
require("gopher").setup(opts)
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd [[silent! GoInstallDeps]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
"dreamsofcode-io/nvim-dap-go",
|
||||
ft = "go",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("dap-go").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
{
|
||||
"nvim-neotest/nvim-nio",
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
local dap = require "dap"
|
||||
local dapui = require "dapui"
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "m4xshen/hardtime.nvim",
|
||||
-- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
|
||||
-- opts = {},
|
||||
-- lazy = false,
|
||||
-- },
|
||||
{
|
||||
"nomnivore/ollama.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
lazy = false,
|
||||
-- All the user commands added by the plugin
|
||||
cmd = { "Ollama", "OllamaModel", "OllamaServe", "OllamaServeStop" },
|
||||
|
||||
keys = {
|
||||
-- Sample keybind for prompt menu. Note that the <c-u> is important for selections to work properly.
|
||||
{
|
||||
"<leader>oo",
|
||||
":<c-u>lua require('ollama').prompt()<cr>",
|
||||
desc = "ollama prompt",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
|
||||
-- Sample keybind for direct prompting. Note that the <c-u> is important for selections to work properly.
|
||||
{
|
||||
"<leader>oG",
|
||||
":<c-u>lua require('ollama').prompt('Generate_Code')<cr>",
|
||||
desc = "ollama Generate Code",
|
||||
mode = { "n", "v" },
|
||||
},
|
||||
},
|
||||
|
||||
---@type Ollama.Config
|
||||
opts = {
|
||||
model = "llama3.1:latest",
|
||||
url = Ollama_url,
|
||||
},
|
||||
},
|
||||
}
|
||||
12
.config/nvim/lua/plugins/neotree.lua
Normal file
12
.config/nvim/lua/plugins/neotree.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
37
.config/nvim/lua/plugins/nvchad.lua
Normal file
37
.config/nvim/lua/plugins/nvchad.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
return {
|
||||
{
|
||||
"dreamsofcode-io/nvim-dap-go",
|
||||
ft = "go",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("dap-go").setup(opts)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
},
|
||||
{
|
||||
"nvim-neotest/nvim-nio",
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = "mfussenegger/nvim-dap",
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
return {
|
||||
{
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*",
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "vault",
|
||||
path = "~/Documents/obsidian",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
143
.config/nvim/lua/plugins/tmux.lua
Normal file
143
.config/nvim/lua/plugins/tmux.lua
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"gopls",
|
||||
"rust-analyzer",
|
||||
"pyright",
|
||||
"mypy",
|
||||
"ruff",
|
||||
"black",
|
||||
"debugpy",
|
||||
"powershell-editor-services",
|
||||
"bash-language-server",
|
||||
"eslint-lsp",
|
||||
"js-debug-adapter",
|
||||
"prettier",
|
||||
"typescript-language-server",
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
"go",
|
||||
"terraform",
|
||||
"c_sharp",
|
||||
"bash",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "catppuccin-mocha",
|
||||
},
|
||||
},
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
lazy = false,
|
||||
name = "catppuccin",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>fp",
|
||||
function()
|
||||
require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root })
|
||||
end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
servers = {
|
||||
pyright = {
|
||||
filetypes = { "python" },
|
||||
},
|
||||
gopls = {
|
||||
cmd = { "gopls" },
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
--root_dir = util.root_pattern("go.work", "go.mod", ".git"),
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tsserver = {},
|
||||
powershell_es = {
|
||||
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require("gitsigns").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"TheLeoP/powershell.nvim",
|
||||
opts = {
|
||||
bundle_path = vim.fn.stdpath("data") .. "/man/packages/powershell-editor-services",
|
||||
},
|
||||
},
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
config = function(_, opts)
|
||||
require("gopher").setup(opts)
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd([[silent! GoInstallDeps]])
|
||||
end,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue