move to lazyvim

This commit is contained in:
DeveloperDurp 2024-07-29 05:04:34 -05:00
parent ecb347cc19
commit 9725324dbf
27 changed files with 592 additions and 338 deletions

View 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

View file

@ -0,0 +1,51 @@
-- 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
-- map("n", ";", ":", { desc = "CMD enter command mode" })
-- map("i", "jk", "<ESC>")
-- Tmux
map("", "<C-h>", "<cmd> TmuxNavigateLeft<CR>", { desc = "window left" })
map("", "<C-l>", "<cmd> TmuxNavigateRight<CR>", { desc = "window right" })
map("", "<C-j>", "<cmd> TmuxNavigateDown<CR>", { desc = "window down" })
map("", "<C-k>", "<cmd> TmuxNavigateUp<CR>", { desc = "window up" })
-- Go
map("", "<leader>gsj", "<cmd> GoTagAdd json <CR>", { desc = "Add json struct tags" })
map("", "<leader>gsy", "<cmd> GoTagAdd yaml <CR>", { desc = "Add yaml struct tags" })
map("", "<leader>gse", "<cmd> GoTagAdd env <CR>", { desc = "Add env struct tags" })
-- Dap
map("", "<leader>db", "<cmd> DapToggleBreakpoint <CR>", { desc = "Add breakpoint at line" })
map("", "<leader>dc", "<cmd> DapContinue <CR>", { desc = "Start Debugging" })
map("", "<leader>dt", "<cmd> DapTerminate <CR>", { desc = "Stop Debugging" })
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 sidebar = widgets.sidebar(widgets.scopes)
sidebar.open()
end, { desc = "Open debugging Window" })
-- Movement
map("n", "<C-d>", "<c-d>zz", { noremap = true })
map("n", "<C-u>", "<c-u>zz", { noremap = true })
map("n", "n", "nzzzv", { noremap = true })
map("n", "N", "Nzzzv", { noremap = true })
-- Powershell
map("n", "<leader>E", function()
require("powershell").eval()
end, { noremap = true })
map("n", "<leader>P", function()
require("powershell").toggle_term()
end, { noremap = true })
-- Obsidian
map("", "<leader>of", "<cmd> ObsidianFollowLink <CR>", { desc = "Follow Link" })
map("", "<leader>ol", "<cmd> ObsidianLinks <CR>", { desc = "Show All Links" })

View 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",
},
},
},
})

View file

@ -0,0 +1,61 @@
--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 servers = { "html", "cssls" }
-- lsps with default config
--for _, lsp in ipairs(servers) do
-- lspconfig[lsp].setup {
-- on_attach = on_attach,
-- on_init = on_init,
-- capabilities = capabilities,
-- }
--end
-- typescript
lspconfig.tsserver.setup({
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
})
lspconfig.gopls.setup({
on_attach = on_attach,
capabilities = capabilities,
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,
},
},
},
})
lspconfig.pyright.setup({
on_attach = on_attach,
capabilities = capabilities,
filetypes = { "python" },
})
lspconfig.powershell_es.setup({
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services",
})
lspconfig.bashls.setup({})
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) },
})

View 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