initial
This commit is contained in:
35
lua/config/lazy.lua
Normal file
35
lua/config/lazy.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
-- 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.rtp:prepend(lazypath)
|
||||
|
||||
-- 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 = { "catppuccin-mocha" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
3
lua/plugins/catppuccin.lua
Normal file
3
lua/plugins/catppuccin.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000 }
|
||||
}
|
||||
119
lua/plugins/correction.lua
Normal file
119
lua/plugins/correction.lua
Normal file
@@ -0,0 +1,119 @@
|
||||
return {
|
||||
-- LSP Configuration
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "pyright", "rust_analyzer" }, -- Add your desired LSPs
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({})
|
||||
lspconfig.pyright.setup({})
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Autocompletion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip", -- Completion for snippets
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Confirm selection with Enter
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Linting
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
-- Explicitly define linters for each file type (without ast_grep)
|
||||
lint.linters_by_ft = {
|
||||
lua = { "luacheck" }, -- Use "luacheck" instead of "ast_grep"
|
||||
python = { "flake8" },
|
||||
javascript = { "eslint" },
|
||||
typescript = { "eslint" },
|
||||
}
|
||||
|
||||
-- Check if ast_grep is accidentally registered and remove it
|
||||
lint.linters.ast_grep = nil
|
||||
|
||||
-- Auto-run the linter only for the configured filetypes
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "!*.lua",
|
||||
callback = function()
|
||||
local ft = vim.bo.filetype
|
||||
if lint.linters_by_ft[ft] then
|
||||
lint.try_lint()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- autoformatting
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
config = function()
|
||||
require("conform").setup({
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
javascript = { "prettier" },
|
||||
python = { "black" },
|
||||
},
|
||||
format_on_save = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
10
lua/plugins/fzf-lua.lua
Normal file
10
lua/plugins/fzf-lua.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
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 = {},
|
||||
},
|
||||
}
|
||||
59
lua/plugins/jabs.lua
Normal file
59
lua/plugins/jabs.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
return {
|
||||
{
|
||||
"matbme/JABS.nvim",
|
||||
config = function()
|
||||
require("jabs").setup({
|
||||
-- Options for the main window
|
||||
position = { "center", "top" }, -- position = {'<position_x>', '<position_y>'} | <position_x> left, center, right,
|
||||
-- <position_y> top, center, bottom
|
||||
-- Default {'right', 'bottom'}
|
||||
|
||||
relative = "editor", -- win, editor, cursor. Default win
|
||||
clip_popup_size = false, -- clips the popup size to the win (or editor) size. Default true
|
||||
|
||||
width = 80, -- default 50
|
||||
height = 20, -- default 10
|
||||
border = "single", -- none, single, double, rounded, solid, shadow, (or an array or chars). Default shadow
|
||||
|
||||
offset = { -- window position offset
|
||||
top = 4, -- default 0
|
||||
bottom = 2, -- default 0
|
||||
left = 2, -- default 0
|
||||
right = 2, -- default 0
|
||||
},
|
||||
|
||||
sort_mru = true, -- Sort buffers by most recently used (true or false). Default false
|
||||
split_filename = true, -- Split filename into separate components for name and path. Default false
|
||||
split_filename_path_width = 20, -- If split_filename is true, how wide the column for the path is supposed to be, Default 0 (don't show path)
|
||||
|
||||
-- Options for preview window
|
||||
preview_position = "left", -- top, bottom, left, right. Default top
|
||||
preview = {
|
||||
width = 40, -- default 70
|
||||
height = 60, -- default 30
|
||||
border = "rounded", -- none, single, double, rounded, solid, shadow, (or an array or chars). Default double
|
||||
},
|
||||
|
||||
-- Default highlights (must be a valid :highlight)
|
||||
highlight = {
|
||||
current = "Title", -- default StatusLine
|
||||
hidden = "StatusLineNC", -- default ModeMsg
|
||||
split = "WarningMsg", -- default StatusLine
|
||||
alternate = "StatusLine", -- default WarningMsg
|
||||
},
|
||||
|
||||
-- Default symbols
|
||||
keymap = {
|
||||
close = "<c-d>", -- Close buffer. Default D
|
||||
jump = "<cr>", -- Jump to buffer. Default <cr>
|
||||
h_split = "h", -- Horizontally split buffer. Default s
|
||||
v_split = "v", -- Vertically split buffer. Default v
|
||||
preview = "p", -- Open buffer preview. Default P
|
||||
},
|
||||
|
||||
-- Whether to use nvim-web-devicons next to filenames
|
||||
use_devicons = true, -- true or false. Default true
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
24
lua/plugins/mini.lua
Normal file
24
lua/plugins/mini.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "*", -- or a specific tag
|
||||
config = function()
|
||||
-- Only load the modules you want
|
||||
require("mini.animate").setup()
|
||||
require("mini.pairs").setup()
|
||||
require("mini.statusline").setup()
|
||||
require("mini.cursorword").setup({
|
||||
content = {
|
||||
active = true,
|
||||
}
|
||||
})
|
||||
require("mini.notify").setup()
|
||||
require("mini.surround").setup({
|
||||
mappings = {
|
||||
add = "gsa", -- Add surrounding
|
||||
delete = "gsd", -- Delete surrounding
|
||||
find = "gsf", -- Find surrounding
|
||||
replace = "gsr", -- Replace surrounding
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
29
lua/plugins/snacks.lua
Normal file
29
lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
bigfile = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
width = 100,
|
||||
preset = {
|
||||
header = [[
|
||||
░ ░░░░ ░░░ ░░░ ░░ ░░░░ ░░░ ░░░░ ░░
|
||||
▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒▒ ▒▒▒▒ ▒
|
||||
▓▓ ▓▓ ▓▓▓ ▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓▓ ▓▓▓▓ ▓▓ ▓▓▓▓ ▓▓ ▓▓▓ ▓▓▓▓▓▓▓
|
||||
███ ████ ████ █████ █████ ████ ██ ██ ███ ███ ████ █
|
||||
████ ██████ ███ ██ ███ ████ ██ ████ ███ ██
|
||||
]],
|
||||
},
|
||||
sections = {
|
||||
{ section = "header" },
|
||||
{ icon = " ", title = "Keymaps", section = "keys", indent = 2, padding = 1 },
|
||||
{ icon = " ", title = "Recent Files", section = "recent_files", indent = 2, padding = 1 },
|
||||
{ icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
|
||||
{ section = "startup" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
8
lua/plugins/tint.lua
Normal file
8
lua/plugins/tint.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"levouh/tint.nvim",
|
||||
config = function()
|
||||
require("tint").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user