initial
This commit is contained in:
20
init.lua
Normal file
20
init.lua
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
require("config.lazy")
|
||||||
|
|
||||||
|
vim.cmd.colorscheme("catppuccin-mocha")
|
||||||
|
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.splitright = true
|
||||||
|
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.wo.relativenumber = true
|
||||||
|
vim.wo.number = true
|
||||||
|
vim.api.nvim_set_hl(0, "LineNr", { fg = "#6c7086" }) -- overlay0
|
||||||
|
vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#cba6f7", bold = true }) -- mauve
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||||
|
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
||||||
|
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
||||||
|
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<C-w>d", "<cmd>lua Snacks.dashboard()<CR>")
|
||||||
|
vim.keymap.set("n", "<C-p>", "<cmd>JABSOpen<CR>")
|
||||||
22
lazy-lock.json
Normal file
22
lazy-lock.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"JABS.nvim": { "branch": "main", "commit": "b6dbd1a3e1b8cef3d6ebfafe96c2230ca341b65f" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"conform.nvim": { "branch": "master", "commit": "6632e7d788a85bf8405ea0c812d343fc308b7b8c" },
|
||||||
|
"fzf-lua": { "branch": "main", "commit": "b62a34f5e4fbf36dd4c6d29920a61451eecd04ed" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||||
|
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||||
|
"nvim-lint": { "branch": "master", "commit": "3615c26c4922ae5f7366f0c1943a0e7cece04325" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "a56f4b9dde5daf3d4c7bb50cf78ab609537f2259" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "c90dee4e930ab9f49fa6d77f289bff335b49e972" },
|
||||||
|
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||||
|
"tint.nvim": { "branch": "master", "commit": "586e87f00c8b0f5e857cefe10839e41f3e8c6d01" }
|
||||||
|
}
|
||||||
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