Compare commits
16 Commits
old
...
2a39dd7c15
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a39dd7c15 | ||
|
|
3833828409 | ||
|
|
ed4b90be18 | ||
|
|
fccf2bdbae | ||
|
|
9d65fdc908 | ||
|
|
e563553a57 | ||
|
|
c1a605ef20 | ||
|
|
6e88ad861f | ||
|
|
f24a1029aa | ||
|
|
189ba01b97 | ||
|
|
24c0f370d0 | ||
|
|
36a5a0a2c7 | ||
|
|
2574ea9578 | ||
|
|
85676d4153 | ||
|
|
7afd0cc72f | ||
|
|
7f0f2b93f6 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
lazy-lock.json
|
lazy-lock.json
|
||||||
|
.session
|
||||||
|
|||||||
80
init.lua
80
init.lua
@@ -1,49 +1,75 @@
|
|||||||
|
-- Set mapleader
|
||||||
vim.g.mapleader = "<Space>"
|
vim.g.mapleader = "<Space>"
|
||||||
|
|
||||||
|
-- Lazy
|
||||||
require("config.lazy")
|
require("config.lazy")
|
||||||
|
|
||||||
vim.opt.splitbelow = true
|
-- Line numbers
|
||||||
|
|
||||||
vim.cmd.colorscheme("catppuccin-mocha")
|
|
||||||
|
|
||||||
vim.opt.splitright = true
|
|
||||||
|
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
vim.wo.relativenumber = true
|
vim.wo.relativenumber = true
|
||||||
vim.wo.number = true
|
vim.wo.number = true
|
||||||
vim.api.nvim_set_hl(0, "LineNr", { fg = "#6c7086" }) -- overlay0
|
vim.api.nvim_set_hl(0, "LineNr", { fg = "#6c7086" }) -- overlay0
|
||||||
vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#cba6f7", bold = true }) -- mauve
|
vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#cba6f7", bold = true }) -- mauve
|
||||||
|
|
||||||
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
-- Windows
|
||||||
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
|
vim.opt.splitbelow = true
|
||||||
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
|
vim.opt.splitright = true
|
||||||
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
|
vim.o.winborder = "rounded"
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>w", "<C-w>")
|
|
||||||
vim.keymap.set("n", "<leader>wd", "<cmd>lua Snacks.dashboard()<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>l", "<cmd>bnext<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>h", "<cmd>bprev<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>j", "<cmd>lua MiniFiles.open()<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>f", "<cmd>Pick files<cr>")
|
|
||||||
vim.keymap.set("n", "<leader>g", "<cmd>Pick grep_live<cr>")
|
|
||||||
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<cr><cmd>UndotreeFocus<cr>")
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>k", "<cmd>lua Snacks.lazygit()<CR>")
|
|
||||||
vim.keymap.set("n", "<leader>x", "<cmd>FloatermKill<CR>")
|
|
||||||
|
|
||||||
|
-- Sane keymaps
|
||||||
vim.keymap.set("i", "jj", "<Esc>")
|
vim.keymap.set("i", "jj", "<Esc>")
|
||||||
|
vim.keymap.set("n", "q:", ":", { noremap = true, silent = true })
|
||||||
|
vim.keymap.set("n", "<leader>bd", function() -- delete buffer
|
||||||
|
vim.cmd("bd")
|
||||||
|
vim.cmd("echo 'Buffer deleted'")
|
||||||
|
end, { noremap = true })
|
||||||
|
|
||||||
vim.opt.tabstop = 4
|
-- Sane tab management
|
||||||
vim.opt.softtabstop = 4
|
vim.opt.tabstop = 2
|
||||||
vim.opt.shiftwidth = 4
|
vim.opt.softtabstop = 2
|
||||||
vim.opt.expandtab = true
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
|
||||||
|
-- Undo management
|
||||||
vim.opt.swapfile = false
|
vim.opt.swapfile = false
|
||||||
vim.opt.backup = false
|
vim.opt.backup = false
|
||||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
|
|
||||||
|
-- Better Highlighting
|
||||||
vim.opt.hlsearch = false
|
vim.opt.hlsearch = false
|
||||||
vim.opt.incsearch = true
|
vim.opt.incsearch = true
|
||||||
|
|
||||||
require("leap").set_default_mappings()
|
-- Nowrap
|
||||||
|
vim.opt.wrap = false
|
||||||
|
|
||||||
|
-- Colorcheme
|
||||||
|
vim.cmd.colorscheme("catppuccin-mocha")
|
||||||
|
|
||||||
|
-- Scrolloff
|
||||||
|
vim.opt.scrolloff = math.floor(vim.o.lines / 2) - 3
|
||||||
|
|
||||||
|
-- Force proper keybindings
|
||||||
|
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>')
|
||||||
|
|
||||||
|
-- C-BS for deleting whole word in insert mode
|
||||||
|
vim.keymap.set("i", "<C-BS>", "<C-W>", { noremap = true })
|
||||||
|
|
||||||
|
-- Keybinds for MiniSessions
|
||||||
|
vim.keymap.set("n", "<leader>qs", function() -- quit and save session local
|
||||||
|
MiniSessions.write(".session")
|
||||||
|
vim.cmd("wqa")
|
||||||
|
end, { noremap = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>qw", function() -- quit and save session global
|
||||||
|
MiniSessions.write(vim.cmd("pwd"))
|
||||||
|
vim.cmd("wqa")
|
||||||
|
end, { noremap = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>qd", function() -- quit and delete session
|
||||||
|
MiniSessions.delete(".session")
|
||||||
|
vim.cmd("wqa")
|
||||||
|
end, { noremap = true })
|
||||||
|
|||||||
@@ -26,10 +26,16 @@ require("lazy").setup({
|
|||||||
spec = {
|
spec = {
|
||||||
-- import your plugins
|
-- import your plugins
|
||||||
{ import = "plugins" },
|
{ import = "plugins" },
|
||||||
|
{ import = "plugins.completion" },
|
||||||
|
{ import = "plugins.ui" },
|
||||||
|
{ import = "plugins.functional" },
|
||||||
},
|
},
|
||||||
-- Configure any other settings here. See the documentation for more details.
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
-- colorscheme that will be used when installing plugins.
|
-- colorscheme that will be used when installing plugins.
|
||||||
install = { colorscheme = { "catppuccin-mocha" } },
|
install = { colorscheme = { "catppuccin" } },
|
||||||
|
ui = {
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = true },
|
checker = { enabled = false },
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
return {
|
|
||||||
{ "catppuccin/nvim", name = "catppuccin", priority = 1000, opts = {
|
|
||||||
transparent_background = true,
|
|
||||||
} },
|
|
||||||
}
|
|
||||||
48
lua/plugins/completion/blink.lua
Normal file
48
lua/plugins/completion/blink.lua
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
return {
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
dependencies = {
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
-- Snippet configuration
|
||||||
|
snippets = {
|
||||||
|
preset = "luasnip", -- Tells blink.cmp to use LuaSnip
|
||||||
|
},
|
||||||
|
|
||||||
|
fuzzy = { implementation = "lua" },
|
||||||
|
|
||||||
|
signature = { enabled = true },
|
||||||
|
|
||||||
|
completion = {
|
||||||
|
list = {
|
||||||
|
selection = {
|
||||||
|
preselect = false,
|
||||||
|
auto_insert = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Keymaps
|
||||||
|
keymap = {
|
||||||
|
["<Tab>"] = { "select_next", "snippet_forward", "fallback" },
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
default = {
|
||||||
|
"lazydev",
|
||||||
|
"lsp", -- (Equivalent to cmp-nvim-lsp)
|
||||||
|
"snippets", -- (Handled by the snippets config, replaces cmp_luasnip source)
|
||||||
|
"buffer", -- (Equivalent to cmp-buffer)
|
||||||
|
"path", -- (Equivalent to cmp-path)
|
||||||
|
-- "cmdline", -- Generally configured separately, but often included by default
|
||||||
|
},
|
||||||
|
providers = {
|
||||||
|
lazydev = {
|
||||||
|
name = "LazyDev",
|
||||||
|
module = "lazydev.integrations.blink",
|
||||||
|
-- make lazydev completions top priority (see `:h blink.cmp`)
|
||||||
|
score_offset = 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
14
lua/plugins/completion/conform.lua
Normal file
14
lua/plugins/completion/conform.lua
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
"stevearc/conform.nvim",
|
||||||
|
config = function()
|
||||||
|
require("conform").setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { "stylua" },
|
||||||
|
javascript = { "prettier" },
|
||||||
|
python = { "black" },
|
||||||
|
nix = { "nixfmt" },
|
||||||
|
},
|
||||||
|
format_on_save = true,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
11
lua/plugins/completion/lazydev.lua
Normal file
11
lua/plugins/completion/lazydev.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua", -- only load on lua files
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
-- See the configuration section for more details
|
||||||
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
44
lua/plugins/completion/linter.lua
Normal file
44
lua/plugins/completion/linter.lua
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
return {
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
config = function()
|
||||||
|
local lint = require("lint")
|
||||||
|
|
||||||
|
-- Explicitly define linters for each file type (without ast_grep)
|
||||||
|
lint.linters_by_ft = {
|
||||||
|
python = { "flake8" },
|
||||||
|
javascript = { "eslint" },
|
||||||
|
typescript = { "eslint" },
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Only show diagnostics close to the cursor
|
||||||
|
vim.diagnostic.config({
|
||||||
|
virtual_text = {
|
||||||
|
spacing = 4,
|
||||||
|
-- You can make prefix dynamic based on severity using a function
|
||||||
|
prefix = function(diagnostic)
|
||||||
|
local icons = {
|
||||||
|
[vim.diagnostic.severity.ERROR] = " ",
|
||||||
|
[vim.diagnostic.severity.WARN] = " ",
|
||||||
|
[vim.diagnostic.severity.INFO] = " ",
|
||||||
|
[vim.diagnostic.severity.HINT] = " ",
|
||||||
|
}
|
||||||
|
return icons[diagnostic.severity] or "●"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
signs = false,
|
||||||
|
underline = true,
|
||||||
|
update_in_insert = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- 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,
|
||||||
|
}
|
||||||
38
lua/plugins/completion/lspconfig.lua
Normal file
38
lua/plugins/completion/lspconfig.lua
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
return {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
config = function()
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
-- Tell the server to let Neovim handle snippet expansion
|
||||||
|
completion = {
|
||||||
|
callSnippet = "Replace",
|
||||||
|
},
|
||||||
|
-- Use LuaJIT (which Neovim uses)
|
||||||
|
runtime = {
|
||||||
|
version = "LuaJIT",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.lsp.config("emmet_ls", {
|
||||||
|
-- capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
||||||
|
filetypes = { "html", "css", "javascriptreact", "typescriptreact" },
|
||||||
|
init_options = {
|
||||||
|
html = {
|
||||||
|
options = {
|
||||||
|
["bem.enabled"] = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.lsp.enable({
|
||||||
|
"lua_ls",
|
||||||
|
"ts_ls",
|
||||||
|
"cssls",
|
||||||
|
"nixd",
|
||||||
|
"rust_analyzer",
|
||||||
|
"emmet_ls",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
0
lua/plugins/completion/treesitter.lua
Normal file
0
lua/plugins/completion/treesitter.lua
Normal file
@@ -1,137 +0,0 @@
|
|||||||
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 = { "ts_ls", "lua_ls", "pyright", "rust_analyzer", "eslint" }, -- Add your desired LSPs
|
|
||||||
automatic_installation = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
lspconfig.lua_ls.setup({})
|
|
||||||
--Enable (broadcasting) snippet capability for completion
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
vim.lsp.config("cssls", {
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
lspconfig.pyright.setup({})
|
|
||||||
lspconfig.cssls.setup({})
|
|
||||||
lspconfig.ts_ls.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
lspconfig.rust_analyzer.setup({})
|
|
||||||
lspconfig.emmet_ls.setup({
|
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities(),
|
|
||||||
filetypes = { "html", "css", "javascriptreact", "typescriptreact" }, -- Add more if needed
|
|
||||||
init_options = {
|
|
||||||
html = {
|
|
||||||
options = {
|
|
||||||
["bem.enabled"] = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
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" }, -- This should provide LSP completions like for ESLint
|
|
||||||
-- { 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 = {
|
|
||||||
python = { "flake8" },
|
|
||||||
javascript = { "eslint" },
|
|
||||||
typescript = { "eslint" },
|
|
||||||
}
|
|
||||||
|
|
||||||
-- 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,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
48
lua/plugins/functional/flash.lua
Normal file
48
lua/plugins/functional/flash.lua
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
return {
|
||||||
|
"folke/flash.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
---@type Flash.Config
|
||||||
|
opts = {},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"ss",
|
||||||
|
mode = { "n", "x", "o" },
|
||||||
|
function()
|
||||||
|
require("flash").jump()
|
||||||
|
end,
|
||||||
|
desc = "Flash",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"S",
|
||||||
|
mode = { "n", "x", "o" },
|
||||||
|
function()
|
||||||
|
require("flash").treesitter()
|
||||||
|
end,
|
||||||
|
desc = "Flash Treesitter",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>r",
|
||||||
|
mode = "o",
|
||||||
|
function()
|
||||||
|
require("flash").remote()
|
||||||
|
end,
|
||||||
|
desc = "Remote Flash",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>R",
|
||||||
|
mode = { "o", "x" },
|
||||||
|
function()
|
||||||
|
require("flash").treesitter_search()
|
||||||
|
end,
|
||||||
|
desc = "Treesitter Search",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader><c-s>",
|
||||||
|
mode = { "c" },
|
||||||
|
function()
|
||||||
|
require("flash").toggle()
|
||||||
|
end,
|
||||||
|
desc = "Toggle Flash Search",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
66
lua/plugins/functional/mini.lua
Normal file
66
lua/plugins/functional/mini.lua
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
return {
|
||||||
|
"echasnovski/mini.nvim",
|
||||||
|
version = "",
|
||||||
|
|
||||||
|
config = function()
|
||||||
|
local animate = require("mini.animate")
|
||||||
|
require("mini.pairs").setup() -- Bracket pairs and stuff
|
||||||
|
require("mini.ai").setup() -- Around and In extension for visual mode
|
||||||
|
require("mini.cursorword").setup() -- Underline current word below cursor (makes it easier to c and d)
|
||||||
|
require("mini.indentscope").setup({
|
||||||
|
symbol = "│",
|
||||||
|
draw = {
|
||||||
|
delay = 10,
|
||||||
|
animation = require("mini.indentscope").gen_animation.linear({
|
||||||
|
duration = 15,
|
||||||
|
unit = "step",
|
||||||
|
easing = "out",
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
}) -- Indent lines
|
||||||
|
require("mini.trailspace").setup() -- Shows useless spaces
|
||||||
|
require("mini.sessions").setup({
|
||||||
|
autoread = true,
|
||||||
|
autowrite = true,
|
||||||
|
file = ".session",
|
||||||
|
force = { read = false, write = true, delete = true },
|
||||||
|
})
|
||||||
|
require("mini.notify").setup() -- Better Notifications
|
||||||
|
require("mini.surround").setup() -- Suround selections with characters
|
||||||
|
require("mini.move").setup({
|
||||||
|
mappings = {
|
||||||
|
down = "J",
|
||||||
|
up = "K",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require("mini.icons").setup() -- Icon provider
|
||||||
|
require("mini.animate").setup({
|
||||||
|
cursor = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
scroll = {
|
||||||
|
-- Animate for 200 milliseconds with linear easing
|
||||||
|
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||||
|
-- Animate equally but with at most 120 steps instead of default 60
|
||||||
|
subscroll = animate.gen_subscroll.equal({ max_output_steps = 60 }),
|
||||||
|
},
|
||||||
|
open = {
|
||||||
|
-- Animate for 400 milliseconds with linear easing
|
||||||
|
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||||
|
-- Animate with wiping from nearest edge instead of default static one
|
||||||
|
winconfig = animate.gen_winconfig.wipe({ direction = "from_edge" }),
|
||||||
|
-- Make bigger windows more transparent
|
||||||
|
winblend = animate.gen_winblend.linear({ from = 80, to = 100 }),
|
||||||
|
},
|
||||||
|
close = {
|
||||||
|
-- Animate for 400 milliseconds with linear easing
|
||||||
|
timing = animate.gen_timing.linear({ duration = 100, unit = "total" }),
|
||||||
|
-- Animate with wiping to nearest edge instead of default static one
|
||||||
|
winconfig = animate.gen_winconfig.wipe({ direction = "to_edge" }),
|
||||||
|
-- Make bigger windows more transparent
|
||||||
|
winblend = animate.gen_winblend.linear({ from = 100, to = 80 }),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
4
lua/plugins/functional/telescope-file-browser.lua
Normal file
4
lua/plugins/functional/telescope-file-browser.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||||
|
}
|
||||||
4
lua/plugins/functional/telescope-ui-select.lua
Normal file
4
lua/plugins/functional/telescope-ui-select.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope-ui-select.nvim",
|
||||||
|
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||||
|
}
|
||||||
58
lua/plugins/functional/telescope.lua
Normal file
58
lua/plugins/functional/telescope.lua
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
tag = "0.1.8",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
config = function()
|
||||||
|
require("telescope").setup({
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = { ".git", ".node_modules" },
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
find_files = {
|
||||||
|
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||||
|
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*", "-L" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
file_browser = {
|
||||||
|
theme = "ivy",
|
||||||
|
-- disables netrw and use telescope-file-browser in its place
|
||||||
|
hijack_netrw = true,
|
||||||
|
},
|
||||||
|
["ui-select"] = {
|
||||||
|
require("telescope.themes").get_dropdown({
|
||||||
|
-- even more opts
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
local builtin = require("telescope.builtin")
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>ff", function()
|
||||||
|
builtin.find_files({ hidden = true })
|
||||||
|
end, { desc = "Telescope find files (current file dir)" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<space>fn", function()
|
||||||
|
require("telescope").extensions.file_browser.file_browser()
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<space>fs", function() -- select sessions
|
||||||
|
MiniSessions.select()
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<space>fd", function() -- select sessions
|
||||||
|
MiniSessions.select("delete")
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>fg", function()
|
||||||
|
builtin.live_grep()
|
||||||
|
end, { desc = "Telescope live grep (current file dir)" })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>fb", function()
|
||||||
|
builtin.buffers({ cwd = vim.fn.expand("%:p:h") }) -- buffers don’t need cwd, but harmless
|
||||||
|
end, { desc = "Telescope buffers" })
|
||||||
|
|
||||||
|
require("telescope").load_extension("file_browser")
|
||||||
|
require("telescope").load_extension("ui-select")
|
||||||
|
end,
|
||||||
|
}
|
||||||
7
lua/plugins/functional/undotree.lua
Normal file
7
lua/plugins/functional/undotree.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"mbbill/undotree",
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
vim.keymap.set("n", "<leader>u", "<cmd>UndotreeToggle<cr><cmd>UndotreeFocus<cr>")
|
||||||
|
end,
|
||||||
|
}
|
||||||
1
lua/plugins/init.lua
Normal file
1
lua/plugins/init.lua
Normal file
@@ -0,0 +1 @@
|
|||||||
|
return { undefined }
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
return {
|
|
||||||
"ggandor/leap.nvim",
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
return {
|
|
||||||
"echasnovski/mini.nvim",
|
|
||||||
version = "*", -- or a specific tag
|
|
||||||
config = function()
|
|
||||||
-- Only load the modules you want
|
|
||||||
require("mini.animate").setup({
|
|
||||||
cursor = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("mini.pairs").setup()
|
|
||||||
require("mini.files").setup()
|
|
||||||
require("mini.cursorword").setup({
|
|
||||||
content = {
|
|
||||||
active = true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("mini.notify").setup()
|
|
||||||
require("mini.move").setup({
|
|
||||||
mappings = {
|
|
||||||
down = "J",
|
|
||||||
up = "K",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("mini.surround").setup({
|
|
||||||
mappings = {
|
|
||||||
add = "<leader>sa",
|
|
||||||
delete = "<leader>sd", -- Delete surrounding
|
|
||||||
find = "<leader>sf", -- Find surrounding (to the right)
|
|
||||||
find_left = "<leader>sF", -- Find surrounding (to the left)
|
|
||||||
highlight = "<leader>sh", -- Highlight surrounding
|
|
||||||
replace = "<leader>sr", -- Replace surrounding
|
|
||||||
update_n_lines = "<leader>sn", -- Update `n_lines`
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("mini.ai").setup({
|
|
||||||
mappings = {
|
|
||||||
-- Main textobject prefixes
|
|
||||||
around = "a",
|
|
||||||
inside = "i",
|
|
||||||
|
|
||||||
-- Next/last variants
|
|
||||||
-- NOTE: These override built-in LSP selection mappings on Neovim>=0.12
|
|
||||||
-- Map LSP selection manually to use it (see `:h MiniAi.config`)
|
|
||||||
around_next = "<leader>an",
|
|
||||||
inside_next = "<leader>in",
|
|
||||||
around_last = "<leader>al",
|
|
||||||
inside_last = "<leader>il",
|
|
||||||
|
|
||||||
-- Move cursor to corresponding edge of `a` textobject
|
|
||||||
goto_left = "<leader>g[",
|
|
||||||
goto_right = "<leader>g]",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require("mini.pick").setup({})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
return {
|
|
||||||
"folke/snacks.nvim",
|
|
||||||
priority = 1000,
|
|
||||||
lazy = false,
|
|
||||||
---@type snacks.Config
|
|
||||||
opts = {
|
|
||||||
lazygit = { enabled = true },
|
|
||||||
bigfile = { enabled = true },
|
|
||||||
|
|
||||||
picker = {},
|
|
||||||
dashboard = {
|
|
||||||
enabled = true,
|
|
||||||
width = 100,
|
|
||||||
preset = {
|
|
||||||
keys = {
|
|
||||||
{ icon = " ", key = "f", desc = "Find File", action = ":Pick files" },
|
|
||||||
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
key = "g",
|
|
||||||
desc = "Find Text",
|
|
||||||
action = ":Pick live_grep",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
key = "r",
|
|
||||||
desc = "Recent Files",
|
|
||||||
action = ":lua Snacks.dashboard.pick('oldfiles')",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
key = "c",
|
|
||||||
desc = "Config",
|
|
||||||
action = ":lua Snacks.dashboard.pick('files', {cwd = vim.fn.stdpath('config')})",
|
|
||||||
},
|
|
||||||
{ icon = " ", key = "U", desc = "Restore Session", section = "session" },
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
key = "L",
|
|
||||||
desc = "Lazy",
|
|
||||||
action = ":Lazy",
|
|
||||||
enabled = package.loaded.lazy ~= nil,
|
|
||||||
},
|
|
||||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
|
||||||
},
|
|
||||||
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" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"levouh/tint.nvim",
|
|
||||||
config = function()
|
|
||||||
require("tint").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"akinsho/toggleterm.nvim",
|
|
||||||
version = "*",
|
|
||||||
opts = {--[[ things you want to change go here]]
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("toggleterm").setup({
|
|
||||||
open_mapping = [[<c-\>]],
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
run = ":TSUpdate",
|
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
ensure_installed = { "javascript", "lua", "python", "html", "css", "typescript", "rust" }, -- Add JavaScript here
|
|
||||||
highlight = {
|
|
||||||
enable = true, -- Enable syntax highlighting
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
12
lua/plugins/ui/cattpuccin.lua
Normal file
12
lua/plugins/ui/cattpuccin.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
opts = {
|
||||||
|
transparent_background = true, -- disables setting the background color.
|
||||||
|
float = {
|
||||||
|
transparent = true, -- enable transparent floating windows
|
||||||
|
solid = false, -- use solid styling for floating windows, see |winborder|
|
||||||
|
},
|
||||||
|
show_end_of_buffer = true, -- shows the '~' characters after the end of buffers
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,14 +38,14 @@ return {
|
|||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = { "branch", "diff", "diagnostics" },
|
lualine_b = { "branch", "diff", "diagnostics" },
|
||||||
lualine_c = { "buffers" },
|
lualine_c = { "filename" },
|
||||||
lualine_x = { "encoding", "fileformat", "filetype" },
|
lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
lualine_y = { "lsp_status" },
|
lualine_y = { "lsp_status" },
|
||||||
lualine_z = { "location" },
|
lualine_z = { "location" },
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = { "branch", "diff", "diagnostics" },
|
||||||
lualine_c = { "filename" },
|
lualine_c = { "filename" },
|
||||||
lualine_x = { "location" },
|
lualine_x = { "location" },
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
6
lua/plugins/ui/tint.lua
Normal file
6
lua/plugins/ui/tint.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"levouh/tint.nvim",
|
||||||
|
config = function()
|
||||||
|
require("tint").setup()
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
"mbbill/undotree",
|
|
||||||
lazy = false,
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user