mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 16:41:43 +05:30
- Nvim Theme changed to github-dark-dimmed - keeps it in sync with the kitty theme
- Reorged multiple nvim settings (using LazyVim as primary now)
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
return {
|
||||
-- TODO: Throws git pull issue when downloading through Lazy
|
||||
-- "askinsho/bufferline.nvim",
|
||||
-- dependencies = "nvim-tree/nvim-web-devicons",
|
||||
-- config = function()
|
||||
-- require("bufferline").setup({
|
||||
-- options = {
|
||||
-- indicator = { style = "underline" },
|
||||
-- }
|
||||
-- })
|
||||
|
||||
-- vim.keymap.set('n', '<tab>', ":BufferLineCycleNext<CR>")
|
||||
-- vim.keymap.set('n', '<S-tab>', ":BufferLineCyclePrev<CR>")
|
||||
-- vim.keymap.set('n', '<leader>bo', ":BufferLineCloseOthers<CR>")
|
||||
-- vim.keymap.set('n', '<leader>bp', ":BufferLinePick<CR>")
|
||||
-- end
|
||||
}
|
||||
81
common/.config/nvim/lua/plugins/coding-completions.lua
Normal file
81
common/.config/nvim/lua/plugins/coding-completions.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
return {
|
||||
|
||||
-- Auto completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function()
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
return {
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-x>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(_, item)
|
||||
local icons = require("lazyvim.config").icons.kinds
|
||||
if icons[item.kind] then
|
||||
item.kind = icons[item.kind] .. item.kind
|
||||
end
|
||||
return item
|
||||
end,
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = {
|
||||
hl_group = "CmpGhostText",
|
||||
},
|
||||
},
|
||||
sorting = defaults.sorting,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Snippets
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- VSCode like Snippets
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
}
|
||||
68
common/.config/nvim/lua/plugins/coding-csharp.lua
Normal file
68
common/.config/nvim/lua/plugins/coding-csharp.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
return {
|
||||
{ "Hoffs/omnisharp-extended-lsp.nvim" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "c_sharp" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.formatting.csharpier)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
cs = { "csharpier" },
|
||||
},
|
||||
formatters = {
|
||||
csharpier = {
|
||||
command = "dotnet-csharpier",
|
||||
args = { "--write-stdout" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
table.insert(opts.ensure_installed, "csharpier")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
omnisharp = {
|
||||
handlers = {
|
||||
["textDocument/definition"] = function(...)
|
||||
return require("omnisharp_extended").handler(...)
|
||||
end,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
require("omnisharp_extended").telescope_lsp_definitions()
|
||||
end,
|
||||
desc = "Goto Definition",
|
||||
},
|
||||
},
|
||||
enable_roslyn_analyzers = true,
|
||||
organize_imports_on_format = true,
|
||||
enable_import_completion = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
config = function ()
|
||||
require("trouble").setup({})
|
||||
end
|
||||
},
|
||||
}
|
||||
1
common/.config/nvim/lua/plugins/coding-docker.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-docker.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
@@ -1,40 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local tree_config = require("nvim-treesitter.configs")
|
||||
tree_config.setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-CR>",
|
||||
node_decremental = "<bs>",
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
config = function()
|
||||
require("ibl").setup({
|
||||
indent = { char = "┆" },
|
||||
})
|
||||
end
|
||||
},
|
||||
-- { "windwp/nvim-autopairs" },
|
||||
-- {
|
||||
-- "akinsho/toggleterm.nvim",
|
||||
-- version = "*",
|
||||
-- config = function ()
|
||||
-- require("toggleterm").setup({})
|
||||
-- end
|
||||
-- },
|
||||
}
|
||||
1
common/.config/nvim/lua/plugins/coding-json.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-json.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
@@ -1,123 +0,0 @@
|
||||
-- TODO: Autocompletion is a hit and miss. Way too complicated at this point
|
||||
-- TODO: Try doing LazyVim.nvim instead
|
||||
|
||||
-- TODO: Use nvim-lint for linting - newer thing
|
||||
|
||||
return {
|
||||
-- LSP Configuration
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
config = function()
|
||||
-- local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- lspconfig.tsserver.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- lspconfig.html.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- lspconfig.lua_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Provides :Mason command which installs Language Servers
|
||||
"williamboman/mason.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Helps to auto install Language Servers by specifying them
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
auto_install = true,
|
||||
},
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({})
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Spawns linters, parses their outputs & reports results via nvim.diagnostic
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile"
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
local linters = require("lint").linters
|
||||
local linterConfig = vim.fn.stdpath("config") .. "linter_configs"
|
||||
|
||||
lint.linters_by_ft = {
|
||||
json = { "jsonlint" },
|
||||
protobuf = { "buf", "codespell" },
|
||||
|
||||
text = { "vale" },
|
||||
markdown = { "vale", "markdownlint" },
|
||||
rst = { "vale" },
|
||||
|
||||
html = { "markuplint", "htmlhint" },
|
||||
|
||||
bash = { "shellcheck", "codespell" },
|
||||
shell = { "shellcheck", "codespell" },
|
||||
lua = { "compiler", "selene", "codespell" },
|
||||
luau = { "compiler", "selene", "codespell" },
|
||||
|
||||
javascript = { "eslint_d", "codespell" },
|
||||
typescript = { "eslint_d", "codespell" },
|
||||
javascriptreact = { "eslint_d", "codespell" },
|
||||
typescriptreact = { "eslint_d", "codespell" },
|
||||
|
||||
python = { "pyre", "codespell" },
|
||||
}
|
||||
|
||||
-- use for codespell for all except css
|
||||
for ft, _ in pairs(lint.linters_by_ft) do
|
||||
if ft ~= "css" then table.insert(lint.linters_by_ft[ft], "codespell") end
|
||||
end
|
||||
|
||||
linters.codespell.args = {
|
||||
"--ignore-words",
|
||||
linterConfig .. "/codespell-ignore.txt",
|
||||
"--builtin=pratik,kumar,tripathy",
|
||||
}
|
||||
|
||||
linters.shellcheck.args = {
|
||||
"--shell=bash", -- force to work with zsh
|
||||
"--format=json",
|
||||
"-",
|
||||
}
|
||||
|
||||
linters.yamllint.args = {
|
||||
"--config-file",
|
||||
linterConfig .. "/yamllint.yaml",
|
||||
"--format=parsable",
|
||||
"-",
|
||||
}
|
||||
|
||||
linters.markdownlint.args = {
|
||||
"--disable=no-trailing-spaces", -- not disabled in config, so it's enabled for formatting
|
||||
"--disable=no-multiple-blanks",
|
||||
"--config=" .. linterConfig .. "/markdownlint.yaml",
|
||||
}
|
||||
|
||||
local lint_group = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_group,
|
||||
callback = function ()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", function ()
|
||||
lint.try_lint()
|
||||
end, { desc = "Lint current file" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
1
common/.config/nvim/lua/plugins/coding-markdown.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-markdown.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"theprimeagen/refactoring.nvim"
|
||||
},
|
||||
}
|
||||
1
common/.config/nvim/lua/plugins/coding-python.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-python.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
1
common/.config/nvim/lua/plugins/coding-rust.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-rust.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
1
common/.config/nvim/lua/plugins/coding-tailwind.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-tailwind.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
1
common/.config/nvim/lua/plugins/coding-typescript.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-typescript.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
1
common/.config/nvim/lua/plugins/coding-yaml.lua
Normal file
1
common/.config/nvim/lua/plugins/coding-yaml.lua
Normal file
@@ -0,0 +1 @@
|
||||
return {}
|
||||
293
common/.config/nvim/lua/plugins/coding.lua
Normal file
293
common/.config/nvim/lua/plugins/coding.lua
Normal file
@@ -0,0 +1,293 @@
|
||||
return {
|
||||
|
||||
-- FIX: Vale (markdown linter) isn't working
|
||||
-- TODO: Configure the linter
|
||||
|
||||
-- Treesitter is a parser generator tool that we can use for syntax highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<C-Space>", desc = "Increment selection" },
|
||||
{ "<C-CR>", desc = "Increment scope selection" },
|
||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||
},
|
||||
---@type TSConfig
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
opts = {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
auto_install = true,
|
||||
-- stylua: ignore
|
||||
ensure_installed = {
|
||||
"lua", "luadoc", "luap", "vim", "vimdoc",
|
||||
"diff","query", "regex", "toml", "yaml",
|
||||
"c", "python", "bash",
|
||||
"markdown", "markdown_inline",
|
||||
"html", "javascript", "jsdoc", "json", "jsonc", "tsx", "typescript",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-CR>",
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
-- stylua: ignore
|
||||
-- Defaults(not mentioned below): Select text objects (similar to ip & ap)
|
||||
-- af: Selects around current function
|
||||
-- if: Selects inside current function
|
||||
-- ac: around current Class
|
||||
-- ic: inside current Class
|
||||
move = {
|
||||
-- Jump to next and previous text objects
|
||||
enable = true,
|
||||
goto_next_start = {
|
||||
["]f"] = { query = "@function.outer", desc = "Goto next inner function start" },
|
||||
["]c"] = { query = "@class.outer", desc = "Goto next inner class start" },
|
||||
},
|
||||
goto_next_end = {
|
||||
["]F"] = { query = "@function.outer", desc = "Goto next outer function end" },
|
||||
["]C"] = { query = "@class.outer", desc = "Goto next outer class end" },
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[f"] = { query = "@function.outer", desc = "Goto goto previous inner function start" },
|
||||
["[c"] = { query = "@class.outer", desc = "Previous inner class start" },
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[F"] = { query = "@function.outer", desc = "Goto goto previous outer function start" },
|
||||
["[C"] = { query = "@class.outer", desc = "Goto previous outer class start" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- LSP configuration
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
-- lazy = false,
|
||||
opts = {
|
||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = true,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = {},
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tsserver = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeImports.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
{
|
||||
"<leader>cR",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.removeUnused.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Remove Unused Imports",
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
format = {},
|
||||
},
|
||||
javascript = {
|
||||
format = {},
|
||||
},
|
||||
completions = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Linting
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
lazy = false,
|
||||
opts = {
|
||||
-- Event to trigger linters
|
||||
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
linters_by_ft = {
|
||||
fish = { "fish" },
|
||||
-- Use the "*" filetype to run linters on all filetypes.
|
||||
-- ['*'] = { 'global linter' },
|
||||
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
||||
-- ['_'] = { 'fallback linter' },
|
||||
},
|
||||
-- LazyVim extension to easily override linter options
|
||||
-- or add custom linters.
|
||||
---@type table<string,table>
|
||||
linters = {
|
||||
-- -- Example of using selene only when a selene.toml file is present
|
||||
-- selene = {
|
||||
-- -- `condition` is another LazyVim extension that allows you to
|
||||
-- -- dynamically enable/disable linters based on the context.
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Mason configuration
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"prettier",
|
||||
"js-debug-adapter",
|
||||
"eslint-lsp",
|
||||
"json-lsp",
|
||||
"typescript-language-server",
|
||||
"codelldb",
|
||||
"rust-analyzer",
|
||||
"yaml-language-server",
|
||||
"black",
|
||||
"csharpier",
|
||||
"omnisharp",
|
||||
"stylua",
|
||||
"lua-language-server",
|
||||
"shfmt",
|
||||
"pyright",
|
||||
"hadolint",
|
||||
"docker-compose-language-service",
|
||||
"dockerfile-language-server",
|
||||
"vale",
|
||||
"vale-ls",
|
||||
"markdownlint",
|
||||
"marksman",
|
||||
"taplo",
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Formatter
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
lazy = false,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.root_dir = opts.root_dir
|
||||
or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.formatting.fish_indent,
|
||||
nls.builtins.diagnostics.fish,
|
||||
nls.builtins.formatting.stylua,
|
||||
nls.builtins.formatting.shfmt,
|
||||
nls.builtins.formatting.eslint_d,
|
||||
nls.builtins.formatting.black,
|
||||
nls.builtins.formatting.prettierd,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Auto pairs
|
||||
{ "echasnovski/mini.pairs" },
|
||||
|
||||
-- Automatically add closing tags for HTML and JSX
|
||||
{ "windwp/nvim-ts-autotag" },
|
||||
|
||||
-- Surround things
|
||||
{ "tpope/vim-surround" },
|
||||
-- Tpope one(above) is more predictable
|
||||
{ "echasnovski/mini.surround", enabled = false },
|
||||
|
||||
-- Comments
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring" },
|
||||
{ "echasnovski/mini.comment" },
|
||||
|
||||
-- Better text-objects
|
||||
{
|
||||
-- Extends a & i with the following:
|
||||
-- a/i <space>: around/inside continuous Whitespace
|
||||
-- a/i ": around/inside double quotes
|
||||
-- a/i ': around/inside single quotes
|
||||
-- a/i `: around/inside backticks
|
||||
-- a/i q: around/inside any 2 quotes of any kind (`, ', ")
|
||||
|
||||
-- a/i (: around/inside braces - does NOT include spaces around
|
||||
-- a/i ): around/inside braces - DOES include spaces around
|
||||
-- a/i ]/[
|
||||
-- a/i }/{
|
||||
-- a/i b: around/inside any 2 braces of any kind (), ], }) - NOT including spaces around
|
||||
|
||||
-- a/i >: around/inside tags - does NOT include spaces
|
||||
-- a/i <: around/inside tags - DOES include spaces
|
||||
-- a/i t: around/inside 2 tags of any kind
|
||||
|
||||
-- a/i _: around/inside 2 Underscores
|
||||
|
||||
-- a/i a: around/inside function arguments
|
||||
-- a/i f: around/inside Function
|
||||
-- a/i c: around/inside class
|
||||
-- a/i o: around/inside any block of code (conditional, loop, etc.)
|
||||
"echasnovski/mini.ai",
|
||||
},
|
||||
|
||||
-- Indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = { scope = { enabled = true } },
|
||||
},
|
||||
|
||||
-- This highlights the current level of indentation and animates the highlighting
|
||||
{ "echasnovski/mini.indentscope" },
|
||||
|
||||
-- Navic does a much better job without taking any screen space
|
||||
{ "nvim-treesitter/nvim-treesitter-context", enabled = false },
|
||||
-- VSCode like breadcrumbs in lualine
|
||||
{ "SmiteshP/nvim-navic" },
|
||||
|
||||
-- Shows symbols in the current window on a vsplit on left
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
},
|
||||
}
|
||||
@@ -1,27 +1,16 @@
|
||||
return {
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
name = "kanagawa",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "kanagawa-wave"
|
||||
end
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "github_dark_dimmed",
|
||||
},
|
||||
},
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
"projekt0n/github-nvim-theme",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("catppuccin").setup({
|
||||
show_end_of_buffer = true,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
},
|
||||
})
|
||||
-- vim.cmd.colorscheme "catppuccin-mocha"
|
||||
end
|
||||
-- vim.cmd("colorscheme github_dark_dimmed")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
549
common/.config/nvim/lua/plugins/editor.lua
Normal file
549
common/.config/nvim/lua/plugins/editor.lua
Normal file
@@ -0,0 +1,549 @@
|
||||
-- Most of the code below is for easy reference to lazyvim shortcuts
|
||||
-- So, I can view and change them easily
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
|
||||
-- icons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
-- Changes the Nvim root to git root
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
|
||||
end,
|
||||
},
|
||||
|
||||
-- File Explorer
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
keys = {
|
||||
{ "<leader>e", ":Neotree filesystem toggle<CR>", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
|
||||
-- Change the rest if required
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer explorer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
enable_git_status = true,
|
||||
filesystem = {
|
||||
bind_to_cwd = true,
|
||||
follow_current_file = {
|
||||
enabled = true, -- Highlight the current buffer
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
use_libuv_file_watcher = true, -- Sync file system changes
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
show_hidden_count = true,
|
||||
hide_dotfile = false,
|
||||
hide_gitignore = false,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 30, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- Default vim keymap for horizontal split
|
||||
["v"] = "open_vsplit", -- Default vim keymap for vertical split
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 2, -- Compact tree display
|
||||
},
|
||||
},
|
||||
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
|
||||
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Search and replace in multiple files
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
keys = {
|
||||
{
|
||||
"<leader>sr",
|
||||
function()
|
||||
require("spectre").open()
|
||||
end,
|
||||
desc = "Replace in files (Spectre)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Fuzzy finder of many things
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- find
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
|
||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
|
||||
-- search
|
||||
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
|
||||
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document diagnostics" },
|
||||
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace diagnostics" },
|
||||
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
{ "<leader>sH", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
|
||||
{ "<leader>sw", Util.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
|
||||
{ "<leader>sw", Util.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
|
||||
{
|
||||
"<leader>uC",
|
||||
Util.telescope("colorscheme", { enable_preview = true }),
|
||||
desc = "Colorscheme with preview",
|
||||
},
|
||||
{
|
||||
"<leader>ss",
|
||||
function()
|
||||
require("telescope.builtin").lsp_document_symbols({
|
||||
symbols = require("lazyvim.config").get_kind_filter(),
|
||||
})
|
||||
end,
|
||||
desc = "Goto Symbol",
|
||||
},
|
||||
{
|
||||
"<leader>sS",
|
||||
function()
|
||||
require("telescope.builtin").lsp_dynamic_workspace_symbols({
|
||||
symbols = require("lazyvim.config").get_kind_filter(),
|
||||
})
|
||||
end,
|
||||
desc = "Goto Symbol (Workspace)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Confusing hence disabled
|
||||
{ "folke/flash.nvim", enabled = false },
|
||||
-- EasyMotion is better
|
||||
{ "easymotion/vim-easymotion" },
|
||||
|
||||
-- Adds and reads "keys" property in each plugins
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["ys"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Display undotree
|
||||
{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end,
|
||||
},
|
||||
|
||||
-- TODO: install gitblame plugin
|
||||
|
||||
-- Highlights text that changed since last commit
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "<leader>gH", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- Automatically highlights other instances of the word under cursor
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
config = function(_, opts)
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
vim.keymap.set("n", key, function()
|
||||
require("illuminate")["goto_" .. dir .. "_reference"](false)
|
||||
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
|
||||
end
|
||||
|
||||
map("]]", "next")
|
||||
map("[[", "prev")
|
||||
|
||||
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function()
|
||||
local buffer = vim.api.nvim_get_current_buf()
|
||||
map("]]", "next", buffer)
|
||||
map("[[", "prev", buffer)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "]]", desc = "Next Reference" },
|
||||
{ "[[", desc = "Prev Reference" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Remove Buffer
|
||||
{
|
||||
"echasnovski/mini.bufremove",
|
||||
keys = {
|
||||
{
|
||||
"<leader>br",
|
||||
function()
|
||||
if vim.bo.modified then
|
||||
vim.cmd.write()
|
||||
end
|
||||
require("mini.bufremove").delete(0)
|
||||
end,
|
||||
desc = "Save and remove Buffer",
|
||||
},
|
||||
-- stylua: ignore
|
||||
{ "<leader>bR", function() require("mini.bufremove").delete(0, true) end, desc = "Force Remove Buffer" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Diagnostics lists
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
"[e",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").previous({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cprev)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = "Previous trouble/quickfix item",
|
||||
},
|
||||
{
|
||||
"]e",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").next({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cnext)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = "Next trouble/quickfix item",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
},
|
||||
},
|
||||
|
||||
-- UI Stuff ------------------------------------------------------------------------
|
||||
|
||||
-- Fancy-looking tabs, which include filetype icons and close buttons.
|
||||
{ "akinsho/bufferline.nvim" },
|
||||
|
||||
-- Fancy Statusline
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = function()
|
||||
local lualine_require = require("lualine_require")
|
||||
lualine_require.require = require
|
||||
|
||||
local icons = require("lazyvim.config").icons
|
||||
|
||||
vim.o.laststatus = vim.g.lualine_laststatus
|
||||
|
||||
return {
|
||||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
|
||||
lualine_c = {
|
||||
Util.lualine.root_dir(),
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ Util.lualine.pretty_path() },
|
||||
},
|
||||
lualine_x = {
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.command.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
||||
color = Util.ui.fg("Statement"),
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.mode.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
||||
color = Util.ui.fg("Constant"),
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return " " .. require("dap").status() end,
|
||||
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||
color = Util.ui.fg("Debug"),
|
||||
},
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = Util.ui.fg("Special"),
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = function()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = { { "progress" }, { "location" } },
|
||||
},
|
||||
extensions = { "neo-tree", "lazy" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Better vim.ui
|
||||
{ "stevearc/dressing.nvim" },
|
||||
|
||||
-- Better `vim.notify()`
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
keys = {
|
||||
{
|
||||
"<leader>un",
|
||||
function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
desc = "Dismiss all Notifications",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
render = "wrapped-compact", -- Smaller popups
|
||||
timeout = 3000,
|
||||
max_height = function()
|
||||
return math.floor(vim.o.lines * 0.25)
|
||||
end,
|
||||
max_width = function()
|
||||
return math.floor(vim.o.columns * 0.5)
|
||||
end,
|
||||
on_open = function(win)
|
||||
vim.api.nvim_win_set_config(win, { zindex = 100 })
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- Completely replaces the UI for messages, cmdline and the popupmenu.
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
opts = {
|
||||
routes = {
|
||||
{
|
||||
-- Show popup message when @recording macros
|
||||
view = "notify",
|
||||
filter = { event = "msg_showmode" },
|
||||
},
|
||||
{
|
||||
-- Direct some messages to bottom - obove lualine
|
||||
view = "mini",
|
||||
filter = {
|
||||
event = "msg_show",
|
||||
any = {
|
||||
{ find = "%d+L, %d+B" },
|
||||
{ find = "; after #%d+" },
|
||||
{ find = "; before #%d+" },
|
||||
|
||||
-- Display delete, yank, jump notifications at bottom
|
||||
{ find = "yanked" },
|
||||
{ find = "fewer lines" },
|
||||
{ find = "more lines" },
|
||||
{ find = "EasyMotion" }, -- This can be completely discarded
|
||||
{ find = "Target key" },
|
||||
{ find = "search hit BOTTOM" },
|
||||
{ find = "lines to indent" },
|
||||
{ find = "lines indented" },
|
||||
},
|
||||
},
|
||||
},
|
||||
-- TODO: Some messages needs to suppressed completely. Figure out how???
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
|
||||
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
|
||||
},
|
||||
},
|
||||
|
||||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim" },
|
||||
|
||||
{ "goolord/alpha-nvim", enabled = false },
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
cmd = "ToggleTerm",
|
||||
build = ":ToggleTerm",
|
||||
keys = {
|
||||
-- NOTE: Do not use <leader> for terminals, there would be issue escaping
|
||||
-- F13 = Shift + F1
|
||||
{ "<F13>", "<cmd>ToggleTerm direction=horizontal<cr>", desc = "Toggle horizontal terminal" },
|
||||
},
|
||||
opts = {
|
||||
open_mapping = [[<F13>]],
|
||||
direction = "horizontal",
|
||||
shade_filetypes = {},
|
||||
hide_numbers = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
start_in_insert = true,
|
||||
close_on_exit = true,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mikesmithgh/kitty-scrollback.nvim",
|
||||
lazy = true,
|
||||
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
|
||||
event = { "User KittyScrollbackLaunch" },
|
||||
version = "^3.0.0",
|
||||
opts = {
|
||||
status_window = {
|
||||
icons = { nvim = "" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("kitty-scrollback").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
15
common/.config/nvim/lua/plugins/formatting.lua
Normal file
15
common/.config/nvim/lua/plugins/formatting.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>cF",
|
||||
function()
|
||||
require("conform").format({ formatters = { "injected" } })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Format Injected Langs",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
26
common/.config/nvim/lua/plugins/linting.lua
Normal file
26
common/.config/nvim/lua/plugins/linting.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
text = { "vale" },
|
||||
json = { "jsonlint" },
|
||||
markdown = { "markdownlint", "vale" },
|
||||
rst = { "vale" },
|
||||
dockerfile = { "hadolint" },
|
||||
go = { "golangcilint" },
|
||||
jq = { "jq" },
|
||||
bash = { "shellcheck" },
|
||||
shell = { "shellcheck" },
|
||||
yaml = { "yamllint" },
|
||||
zsh = { "zsh" },
|
||||
typescript = { "eslint_d" },
|
||||
javascript = { "eslint_d" },
|
||||
-- Use the "*" filetype to run linters on all filetypes.
|
||||
-- ['*'] = { 'global linter' },
|
||||
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
||||
-- ['_'] = { 'fallback linter' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local lazy_status = require("lazy.status")
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
-- theme = "horizon",
|
||||
-- TODO: Following ain't taking effect. Why?
|
||||
sections = {
|
||||
lualine_a = {'mode','filename'},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'diff', 'diagnostics'},
|
||||
lualine_x = { { lazy_status.updates, cond = lazy_status.has_updates } },
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location', 'searchcount'}
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true, -- Highlight the current buffer
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
use_libuv_file_watcher = true, -- Sync file system changes
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
show_hidden_count = true,
|
||||
hide_dotfile = false,
|
||||
hide_gitignore = false,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 25, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- Default vim keymap for horizontal split
|
||||
["v"] = "open_vsplit", -- Default vim keymap for vertical split
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 1, -- Compact tree display
|
||||
padding = 0, -- Compact tree display
|
||||
},
|
||||
},
|
||||
})
|
||||
-- Keymaps for Neotree
|
||||
vim.keymap.set("n", "<Leader>e", ":Neotree filesystem toggle<CR>")
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim", tag = "0.1.5",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
require("telescope").setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- Ctrl + s to open in horizontal split
|
||||
["<C-s>"] = actions.select_horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
-- Keymaps for Telescope
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}' }})<cr>", {})
|
||||
-- TODO: Live grep ain't working
|
||||
-- vim.keymap.set("n", "<Leader>fl", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<Leader>fm", builtin.marks, {})
|
||||
vim.keymap.set("n", "<Leader>fc", builtin.colorscheme, {})
|
||||
vim.keymap.set("n", "<Leader>fr", builtin.registers, {})
|
||||
vim.keymap.set("n", "<Leader>fs", builtin.lsp_document_symbols, {})
|
||||
vim.keymap.set("n", "<Leader>fw", builtin.grep_string, {})
|
||||
vim.keymap.set("n", "<Leader>fg", "<cmd>AdvancedGitSearch<CR>", {})
|
||||
vim.keymap.set("n", "<Leader>ft", builtin.treesitter, {})
|
||||
-- TODO: Find TODO ain't working either
|
||||
vim.keymap.set("n", "<Leader>fd", ":TodoTelescope<CR>", {})
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
||||
},
|
||||
{
|
||||
-- For displaying LSP Code Actions
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown{
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
},
|
||||
{
|
||||
"aaronhallaert/advanced-git-search.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("advanced_git_search")
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup({})
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }
|
||||
)
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" }
|
||||
)
|
||||
end
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end
|
||||
}
|
||||
12
common/.config/nvim/lua/plugins/utilities.lua
Normal file
12
common/.config/nvim/lua/plugins/utilities.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
-- Don't measure startuptime
|
||||
{ "dstein64/vim-startuptime", enabled = false },
|
||||
|
||||
-- Session management.
|
||||
{
|
||||
"folke/persistence.nvim",
|
||||
opts = {
|
||||
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"),
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
config = function()
|
||||
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user