chad up my nvim
This commit is contained in:
parent
a613894008
commit
d7ebb8313d
1
_backup/nvim/init.lua
Normal file
1
_backup/nvim/init.lua
Normal file
@ -0,0 +1 @@
|
||||
require("crthaze")
|
@ -2,6 +2,7 @@ require("crthaze.set")
|
||||
require("crthaze.remap")
|
||||
require("crthaze.lazy_init")
|
||||
require("crthaze.langs")
|
||||
require("crthaze.diagnostics")
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
6
home/any/neovim/.config/nvim/.stylua.toml
Normal file
6
home/any/neovim/.config/nvim/.stylua.toml
Normal file
@ -0,0 +1,6 @@
|
||||
column_width = 120
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "None"
|
@ -1 +1,37 @@
|
||||
require("crthaze")
|
||||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||
vim.g.mapleader = " "
|
||||
|
||||
-- bootstrap lazy and all plugins
|
||||
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
local repo = "https://github.com/folke/lazy.nvim.git"
|
||||
vim.fn.system { "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath }
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local lazy_config = require "configs.lazy"
|
||||
|
||||
-- load plugins
|
||||
require("lazy").setup({
|
||||
{
|
||||
"NvChad/NvChad",
|
||||
lazy = false,
|
||||
branch = "v2.5",
|
||||
import = "nvchad.plugins",
|
||||
},
|
||||
|
||||
{ import = "plugins" },
|
||||
}, lazy_config)
|
||||
|
||||
-- load theme
|
||||
dofile(vim.g.base46_cache .. "defaults")
|
||||
dofile(vim.g.base46_cache .. "statusline")
|
||||
|
||||
require "options"
|
||||
require "nvchad.autocmds"
|
||||
|
||||
vim.schedule(function()
|
||||
require "mappings"
|
||||
end)
|
||||
|
44
home/any/neovim/.config/nvim/lazy-lock.json
Normal file
44
home/any/neovim/.config/nvim/lazy-lock.json
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" },
|
||||
"NvChad": { "branch": "v2.5", "commit": "09dd13e9c6df98fe5609829a7a0fbccea2f515ae" },
|
||||
"base46": { "branch": "v2.5", "commit": "fec9fa583025e69e0c4f902bd61990e8d13d1975" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "f5bd8419f8a29451e20bdb1061a54fe13d5c8de3" },
|
||||
"copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "ee7634ab4f0a6606438fe13e16cbf2065589a5ed" },
|
||||
"gopher.nvim": { "branch": "main", "commit": "f55c15ada8e02398000c04a96ef44d986cd01051" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "e7a4442e055ec953311e77791546238d1eaae507" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "1159bdccd8910a0fd0914b24d6c3d186689023d9" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "56760339a81cd1540d5a72fd9d93010a2677b55d" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"menu": { "branch": "main", "commit": "ee85b2e394fde354bd24e35ff7a688d10c9212fa" },
|
||||
"minty": { "branch": "main", "commit": "157e91c04cce2f01643519338d6b854275a77547" },
|
||||
"none-ls.nvim": { "branch": "main", "commit": "dcc8cd4efdcb29275681a3c95786a816330dbca6" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
|
||||
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" },
|
||||
"nvim-dap-python": { "branch": "master", "commit": "03fe9592409236b9121c03b66a682dfca15a5cac" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "84f867753f659bfd9319f75bd5eb273a315f2da5" },
|
||||
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "2a268f631da85e83b7a95291be589bcddfc785d8" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "df20c049694474021cffb2cc8687c809adc1cbba" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"tagbar": { "branch": "master", "commit": "d55d454bd3d5b027ebf0e8c75b8f88e4eddad8d8" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "df534c3042572fb958586facd02841e10186707c" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
|
||||
"ui": { "branch": "v3.0", "commit": "81f5ff0fb2ce60cc3b2cfc9df928751c2ac4f7e9" },
|
||||
"undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" },
|
||||
"venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" },
|
||||
"vim-rooter": { "branch": "master", "commit": "51402fb77c4d6ae94994e37dc7ca13bec8f4afcc" },
|
||||
"vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" },
|
||||
"volt": { "branch": "main", "commit": "229b4f1bc865c866227dd0e2ecda11ab6ec2c8cc" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
||||
}
|
53
home/any/neovim/.config/nvim/lua/chadrc.lua
Normal file
53
home/any/neovim/.config/nvim/lua/chadrc.lua
Normal file
@ -0,0 +1,53 @@
|
||||
-- This file needs to have same structure as nvconfig.lua
|
||||
-- https://github.com/NvChad/ui/blob/v3.0/lua/nvconfig.lua
|
||||
-- Please read that file to know all available options :(
|
||||
|
||||
---@class ChadrcConfig
|
||||
local M = {}
|
||||
|
||||
M.base46 = {
|
||||
theme = "gruvbox",
|
||||
|
||||
hl_override = {
|
||||
LineNr = { fg = "#FBB829" },
|
||||
String = { fg = "#EF2F27" },
|
||||
Keyword = { fg = "#2C78BF" },
|
||||
Type = { fg = "#FF5F00" },
|
||||
Comment = { fg = "#519F50" },
|
||||
["@comment"] = { fg = "#519F50" },
|
||||
-- Normal = { bg = "none" },
|
||||
-- NormalFloat = { bg = "none" },
|
||||
},
|
||||
transparency = true,
|
||||
}
|
||||
|
||||
M.ui = {
|
||||
statusline = {
|
||||
separator_style = "arrow"
|
||||
}
|
||||
}
|
||||
|
||||
M.mason = {
|
||||
pkgs = {
|
||||
"delve",
|
||||
"debugpy",
|
||||
"black",
|
||||
"mypy",
|
||||
"ruff",
|
||||
}
|
||||
}
|
||||
|
||||
M.term = {
|
||||
winopts = { number = false, relativenumber = false },
|
||||
sizes = { sp = 0.3, vsp = 0.2, ["bo sp"] = 0.3, ["bo vsp"] = 0.2 },
|
||||
float = {
|
||||
relative = "editor",
|
||||
row = 0.05,
|
||||
col = 0.1,
|
||||
width = 0.8,
|
||||
height = 0.8,
|
||||
border = "single",
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
15
home/any/neovim/.config/nvim/lua/configs/conform.lua
Normal file
15
home/any/neovim/.config/nvim/lua/configs/conform.lua
Normal file
@ -0,0 +1,15 @@
|
||||
local options = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
-- css = { "prettier" },
|
||||
-- html = { "prettier" },
|
||||
},
|
||||
|
||||
-- format_on_save = {
|
||||
-- -- These options will be passed to conform.format()
|
||||
-- timeout_ms = 500,
|
||||
-- lsp_fallback = true,
|
||||
-- },
|
||||
}
|
||||
|
||||
return options
|
47
home/any/neovim/.config/nvim/lua/configs/lazy.lua
Normal file
47
home/any/neovim/.config/nvim/lua/configs/lazy.lua
Normal file
@ -0,0 +1,47 @@
|
||||
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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
181
home/any/neovim/.config/nvim/lua/configs/lspconfig.lua
Normal file
181
home/any/neovim/.config/nvim/lua/configs/lspconfig.lua
Normal file
@ -0,0 +1,181 @@
|
||||
-- load defaults i.e lua_lsp
|
||||
-- require("nvchad.configs.lspconfig").defaults()
|
||||
dofile(vim.g.base46_cache .. "lsp")
|
||||
|
||||
local x = vim.diagnostic.severity
|
||||
|
||||
vim.diagnostic.config {
|
||||
-- virtual_text = { prefix = "" },
|
||||
virtual_text = false,
|
||||
signs = { text = { [x.ERROR] = "", [x.WARN] = "", [x.INFO] = "", [x.HINT] = "" } },
|
||||
underline = true,
|
||||
float = { border = "single" },
|
||||
}
|
||||
|
||||
-- Default border style
|
||||
local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = "rounded"
|
||||
return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
|
||||
|
||||
-- Function to check if a floating dialog exists and if not
|
||||
-- then check for diagnostics under the cursor
|
||||
function OpenDiagnosticIfNoFloat()
|
||||
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||
if vim.api.nvim_win_get_config(winid).zindex then
|
||||
return
|
||||
end
|
||||
end
|
||||
-- THIS IS FOR BUILTIN LSP
|
||||
vim.diagnostic.open_float(0, {
|
||||
scope = "cursor",
|
||||
focusable = false,
|
||||
close_events = {
|
||||
"CursorMoved",
|
||||
"CursorMovedI",
|
||||
"BufHidden",
|
||||
"InsertCharPre",
|
||||
"WinLeave",
|
||||
},
|
||||
})
|
||||
end
|
||||
-- Show diagnostics under the cursor when holding position
|
||||
vim.api.nvim_create_augroup("lsp_diagnostics_hold", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold" }, {
|
||||
pattern = "*",
|
||||
command = "lua OpenDiagnosticIfNoFloat()",
|
||||
group = "lsp_diagnostics_hold",
|
||||
})
|
||||
|
||||
-- Setup LSPs
|
||||
-------------
|
||||
|
||||
local lspconfig = require "lspconfig"
|
||||
local util = require "lspconfig/util"
|
||||
|
||||
local servers = {
|
||||
html = {},
|
||||
cssls = {},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = { version = "Lua 5.1" },
|
||||
diagnostics = {
|
||||
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
rust_analyzer = {},
|
||||
gopls = {
|
||||
cmd = {"gopls"},
|
||||
filetypes = { "go", "gomod", "gowork", "gotmpl" },
|
||||
root_dir = util.root_pattern("go.mod", "git"),
|
||||
settings = {
|
||||
completeUnimported = true,
|
||||
usPlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
}
|
||||
}
|
||||
},
|
||||
cobol_ls = {},
|
||||
fortls = {},
|
||||
helm_ls = {
|
||||
settings = {
|
||||
['helm-ls'] = {
|
||||
yamlls = {
|
||||
enabled = false,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
htmx = {},
|
||||
-- pylsp = {
|
||||
-- settings = {
|
||||
-- pylsp = {
|
||||
-- plugins = {
|
||||
-- autopep8 = { enabled = false },
|
||||
-- mccabe = { enabled = false },
|
||||
-- pycodestyle = { enabled = false },
|
||||
-- pyflakes = { enabled = false },
|
||||
-- rope = { enabled = false },
|
||||
-- black = {
|
||||
-- enabled = true,
|
||||
-- },
|
||||
-- flake8 = {
|
||||
-- enabled = true,
|
||||
-- maxComplexity = 15,
|
||||
-- },
|
||||
-- jedi_completion = {
|
||||
-- fuzzy = true,
|
||||
-- },
|
||||
-- pydocstyle = {
|
||||
-- enabled = true,
|
||||
-- convention = "google",
|
||||
-- },
|
||||
-- pylint = {
|
||||
-- enabled = true,
|
||||
-- executable = "pylint",
|
||||
-- args = {
|
||||
-- "--disable=line-too-long,import-error,too-many-arguments,too-many-locals,too-many-branches,too-many-lines,too-many-return-statements,fixme,too-few-public-methods,too-many-instance-attributes,too-many-statements,too-many-public-methods",
|
||||
-- },
|
||||
-- },
|
||||
-- pylsp_isort = {
|
||||
-- enabled = true,
|
||||
-- },
|
||||
-- pylsp_mypy = {
|
||||
-- enabled = true,
|
||||
-- },
|
||||
-- yapf = {
|
||||
-- enabled = true,
|
||||
-- },
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
-- },
|
||||
pyright = {
|
||||
filetypes = {"python"},
|
||||
},
|
||||
solargraph = {},
|
||||
gitlab_ci_ls = {},
|
||||
zls = {
|
||||
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
|
||||
settings = {
|
||||
zls = {
|
||||
enable_inlay_hints = true,
|
||||
enable_snippets = true,
|
||||
warn_style = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
local nvlsp = require "nvchad.configs.lspconfig"
|
||||
|
||||
|
||||
for name, opts in pairs(servers) do
|
||||
opts.on_init = nvlsp.on_init
|
||||
opts.on_attach = nvlsp.on_attach
|
||||
opts.capabilities = nvlsp.capabilities
|
||||
|
||||
lspconfig[name].setup(opts)
|
||||
end
|
||||
|
||||
-- -- lsps with default config
|
||||
-- for _, lsp in ipairs(servers) do
|
||||
-- lspconfig[lsp].setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
||||
-- end
|
||||
|
||||
-- configuring single server, example: typescript
|
||||
-- lspconfig.ts_ls.setup {
|
||||
-- on_attach = nvlsp.on_attach,
|
||||
-- on_init = nvlsp.on_init,
|
||||
-- capabilities = nvlsp.capabilities,
|
||||
-- }
|
66
home/any/neovim/.config/nvim/lua/mappings.lua
Normal file
66
home/any/neovim/.config/nvim/lua/mappings.lua
Normal file
@ -0,0 +1,66 @@
|
||||
require "nvchad.mappings"
|
||||
|
||||
-- add yours here
|
||||
|
||||
local map = vim.keymap.set
|
||||
|
||||
map("n", ";", ":", { desc = "CMD enter command mode" })
|
||||
map("i", "jk", "<ESC>")
|
||||
|
||||
-- map({ "n", "i", "v" }, "<C-s>", "<cmd> w <cr>")
|
||||
map("n", "<leader>pv", vim.cmd.Ex)
|
||||
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
map("n", "J", "mzJ`z")
|
||||
-- vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
-- vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
map("n", "n", "nzzzv")
|
||||
map("n", "N", "Nzzzv")
|
||||
map("n", "<leader>zig", "<cmd>LspRestart<cr>")
|
||||
|
||||
-- greatest remap ever
|
||||
map("x", "<leader>p", [["_dP]])
|
||||
|
||||
-- next greatest remap ever : asbjornHaland
|
||||
map({"n", "v"}, "<leader>y", [["+y]])
|
||||
map("n", "<leader>Y", [["+Y]])
|
||||
|
||||
map({"n", "v"}, "<leader>d", [["_d]])
|
||||
|
||||
-- This is going to get me cancelled
|
||||
-- vim.keymap.set("i", "<C-c>", "<Esc>")
|
||||
|
||||
map("n", "Q", "<nop>")
|
||||
-- vim.keymap.set("n", "<C-f>", "<cmd>silent !tmux neww tmux-sessionizer<CR>")
|
||||
map("n", "<leader>f", vim.lsp.buf.format)
|
||||
|
||||
map("n", "<C-k>", "<cmd>cnext<CR>zz")
|
||||
map("n", "<C-j>", "<cmd>cprev<CR>zz")
|
||||
map("n", "<leader>k", "<cmd>lnext<CR>zz")
|
||||
map("n", "<leader>j", "<cmd>lprev<CR>zz")
|
||||
|
||||
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
map("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
|
||||
-- vim.keymap.set(
|
||||
-- "n",
|
||||
-- "<leader>ee",
|
||||
-- "oif err != nil {<CR>}<Esc>Oreturn err<Esc>"
|
||||
-- )
|
||||
|
||||
-- vim.keymap.set("n", "<leader>vpp", "<cmd>e ~/.config/nvim/lua/crthaze/packer.lua<CR>");
|
||||
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
|
||||
|
||||
map("n", "<leader><leader>", function()
|
||||
vim.cmd("so")
|
||||
end)
|
||||
|
||||
map("n", "<leader>nn", function()
|
||||
vim.cmd("set relativenumber!")
|
||||
end)
|
||||
|
||||
map("n", "<leader>t", function()
|
||||
require("nvchad.term").toggle { pos = "float", id = "floatTerm" }
|
||||
end, { desc = "terminal toggle floating term" })
|
41
home/any/neovim/.config/nvim/lua/options.lua
Normal file
41
home/any/neovim/.config/nvim/lua/options.lua
Normal file
@ -0,0 +1,41 @@
|
||||
require "nvchad.options"
|
||||
|
||||
-- add yours here!
|
||||
|
||||
-- local o = vim.o
|
||||
-- o.cursorlineopt ='both' -- to enable cursorline!
|
||||
local o = vim.opt
|
||||
o.nu = true
|
||||
o.relativenumber = true
|
||||
|
||||
o.tabstop = 2
|
||||
o.softtabstop = 2
|
||||
o.shiftwidth = 2
|
||||
o.expandtab = false
|
||||
|
||||
o.smartindent = true
|
||||
|
||||
o.wrap = true
|
||||
|
||||
o.swapfile = false
|
||||
o.backup = false
|
||||
o.undofile = true
|
||||
|
||||
o.hlsearch = false
|
||||
o.incsearch = true
|
||||
|
||||
o.termguicolors = true
|
||||
|
||||
o.scrolloff = 8
|
||||
o.signcolumn = "yes"
|
||||
o.isfname:append("@-@")
|
||||
|
||||
o.updatetime = 50
|
||||
|
||||
o.colorcolumn = "80"
|
||||
|
||||
o.backupdir = os.getenv("HOME") .. "/.var/tmp/nvim/backup/"
|
||||
o.directory = os.getenv("HOME") .. "/.var/tmp/nvim/swap/"
|
||||
o.undodir = os.getenv("HOME") .. "/.var/tmp/nvim/undo/"
|
||||
o.listchars = {tab = '⇥ ', trail = '▓'}
|
||||
o.list = true
|
5
home/any/neovim/.config/nvim/lua/plugins/copilot.lua
Normal file
5
home/any/neovim/.config/nvim/lua/plugins/copilot.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
{
|
||||
"github/copilot.vim",
|
||||
}
|
||||
}
|
20
home/any/neovim/.config/nvim/lua/plugins/gopher.lua
Normal file
20
home/any/neovim/.config/nvim/lua/plugins/gopher.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
{
|
||||
"olexsmir/gopher.nvim",
|
||||
ft = "go",
|
||||
config = function(_, opts)
|
||||
require("gopher").setup(opts)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>gsj", "<cmd>GoTagAdd json<CR>",
|
||||
{ desc = "Add json struct tags" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>gsy", "<cmd>GoTagAdd yaml<CR>",
|
||||
{ desc = "Add yaml struct tags" }
|
||||
)
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd [[silent! GoInstallDeps]]
|
||||
end,
|
||||
}
|
||||
}
|
25
home/any/neovim/.config/nvim/lua/plugins/init.lua
Normal file
25
home/any/neovim/.config/nvim/lua/plugins/init.lua
Normal file
@ -0,0 +1,25 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
-- event = 'BufWritePre', -- uncomment for format on save
|
||||
opts = require "configs.conform",
|
||||
},
|
||||
|
||||
-- These are some examples, uncomment them if you want to see them work!
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require "configs.lspconfig"
|
||||
end,
|
||||
},
|
||||
|
||||
-- {
|
||||
-- "nvim-treesitter/nvim-treesitter",
|
||||
-- opts = {
|
||||
-- ensure_installed = {
|
||||
-- "vim", "lua", "vimdoc",
|
||||
-- "html", "css"
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
}
|
20
home/any/neovim/.config/nvim/lua/plugins/lazygit.lua
Normal file
20
home/any/neovim/.config/nvim/lua/plugins/lazygit.lua
Normal file
@ -0,0 +1,20 @@
|
||||
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" }
|
||||
}
|
||||
}
|
10
home/any/neovim/.config/nvim/lua/plugins/misc.lua
Normal file
10
home/any/neovim/.config/nvim/lua/plugins/misc.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
lazy = false
|
||||
},
|
||||
{
|
||||
"psliwka/vim-smoothie",
|
||||
lazy = false
|
||||
}
|
||||
}
|
42
home/any/neovim/.config/nvim/lua/plugins/null-ls.lua
Normal file
42
home/any/neovim/.config/nvim/lua/plugins/null-ls.lua
Normal file
@ -0,0 +1,42 @@
|
||||
return {
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
ft = "go",
|
||||
opts = function()
|
||||
local null_ls = require("null-ls")
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
local srcs = {}
|
||||
if vim.bo.filetype == "go" then
|
||||
srcs = {
|
||||
null_ls.builtins.formatting.gofmt,
|
||||
null_ls.builtins.formatting.goimports_reviser,
|
||||
null_ls.builtins.formatting.golines,
|
||||
}
|
||||
elseif vim.bo.filetype == "python" then
|
||||
srcs = {
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.diagnostics.mypy,
|
||||
null_ls.builtins.diagnostics.ruff,
|
||||
}
|
||||
end
|
||||
return {
|
||||
sources = srcs,
|
||||
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
|
||||
}
|
||||
end
|
||||
}
|
||||
}
|
84
home/any/neovim/.config/nvim/lua/plugins/nvim-dap.lua
Normal file
84
home/any/neovim/.config/nvim/lua/plugins/nvim-dap.lua
Normal file
@ -0,0 +1,84 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
init = function()
|
||||
vim.keymap.set(
|
||||
"n", "<leader>db", "<cmd>DapToggleBreakpoint<CR>",
|
||||
{ desc = "Add breakpoint at line" }
|
||||
)
|
||||
-- vim.keymap.set(
|
||||
-- "n", "<leader>dus", function()
|
||||
-- local widgets = require('dap.ui.widgets');
|
||||
-- local sidebar = widgets.sidebar(widgets.scopes);
|
||||
-- sidebar.open();
|
||||
-- end,
|
||||
-- { desc = "Open debugging sidebar" }
|
||||
-- )
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-neotest/nvim-nio",
|
||||
},
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"nvim-neotest/nvim-nio",
|
||||
},
|
||||
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
|
||||
},
|
||||
{
|
||||
"leoluz/nvim-dap-go",
|
||||
ft = "go",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("dap-go").setup(opts)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>dgt", function()
|
||||
require('dap-go').debug_test()
|
||||
end,
|
||||
{ desc = "Debug go test" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>dgl", function()
|
||||
require('dap-go').debug_last()
|
||||
end,
|
||||
{ desc = "Debug last go test" }
|
||||
)
|
||||
end
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap-python",
|
||||
ft = "python",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
},
|
||||
config = function(_, _)
|
||||
local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
|
||||
require('dap-python').setup(path)
|
||||
vim.keymap.set(
|
||||
"n", "<leader>dpr", function()
|
||||
require('dap-python').test_method()
|
||||
end,
|
||||
{ desc = "Debug python method" }
|
||||
)
|
||||
end
|
||||
}
|
||||
}
|
59
home/any/neovim/.config/nvim/lua/plugins/nvim-tree.lua
Normal file
59
home/any/neovim/.config/nvim/lua/plugins/nvim-tree.lua
Normal file
@ -0,0 +1,59 @@
|
||||
local HEIGHT_RATIO = 0.8
|
||||
local WIDTH_RATIO = 0.5
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
init = function()
|
||||
-- disable netrw at the very start of your init.lua
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- optionally enable 24-bit colour
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- OR setup with some options
|
||||
require("nvim-tree").setup({
|
||||
sort = {
|
||||
sorter = "case_sensitive",
|
||||
},
|
||||
view = {
|
||||
float = {
|
||||
enable = true,
|
||||
open_win_config = function()
|
||||
local screen_w = vim.opt.columns:get()
|
||||
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
|
||||
local window_w = screen_w * WIDTH_RATIO
|
||||
local window_h = screen_h * HEIGHT_RATIO
|
||||
local window_w_int = math.floor(window_w)
|
||||
local window_h_int = math.floor(window_h)
|
||||
local center_x = (screen_w - window_w) / 2
|
||||
local center_y = ((vim.opt.lines:get() - window_h) / 2)
|
||||
- vim.opt.cmdheight:get()
|
||||
return {
|
||||
border = 'rounded',
|
||||
relative = 'editor',
|
||||
row = center_y,
|
||||
col = center_x,
|
||||
width = window_w_int,
|
||||
height = window_h_int,
|
||||
}
|
||||
end,
|
||||
},
|
||||
width = function()
|
||||
return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
|
||||
end,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = true,
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>")
|
||||
vim.keymap.set("n", "<leader>o", "<cmd>NvimTreeFindFileToggle<CR>")
|
||||
end
|
||||
}
|
||||
}
|
10
home/any/neovim/.config/nvim/lua/plugins/rooter.lua
Normal file
10
home/any/neovim/.config/nvim/lua/plugins/rooter.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
init = function()
|
||||
vim.g.rooter_cd_cmd = "lcd"
|
||||
vim.g.rooter_silent_chdir = 1
|
||||
vim.g.rooter_resolve_links = 1
|
||||
end
|
||||
}
|
||||
}
|
8
home/any/neovim/.config/nvim/lua/plugins/tagbar.lua
Normal file
8
home/any/neovim/.config/nvim/lua/plugins/tagbar.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"majutsushi/tagbar",
|
||||
init = function()
|
||||
vim.keymap.set("n", "<leader>b", "<cmd>TagbarToggle<CR>")
|
||||
end
|
||||
}
|
||||
}
|
22
home/any/neovim/.config/nvim/lua/plugins/treesitter.lua
Normal file
22
home/any/neovim/.config/nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,22 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"css",
|
||||
"bash",
|
||||
"vimdoc",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"c",
|
||||
"lua",
|
||||
"rust",
|
||||
"python",
|
||||
"go",
|
||||
"zig",
|
||||
"fortran",
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
9
home/any/neovim/.config/nvim/lua/plugins/undotree.lua
Normal file
9
home/any/neovim/.config/nvim/lua/plugins/undotree.lua
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
return {
|
||||
"mbbill/undotree",
|
||||
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end
|
||||
}
|
||||
|
18
home/any/neovim/.config/nvim/lua/plugins/venv-selector.lua
Normal file
18
home/any/neovim/.config/nvim/lua/plugins/venv-selector.lua
Normal file
@ -0,0 +1,18 @@
|
||||
return {
|
||||
{
|
||||
"linux-cultist/venv-selector.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap-python", --optional
|
||||
{ "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } },
|
||||
},
|
||||
ft = "python",
|
||||
branch = "regexp", -- This is the regexp branch, use this for the new version
|
||||
config = function()
|
||||
require("venv-selector").setup()
|
||||
end,
|
||||
keys = {
|
||||
{ ",v", "<cmd>VenvSelect<cr>" },
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Reference in New Issue
Block a user