mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
feat: Reworking nvim configuration
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"saghen/blink.cmp",
|
"saghen/blink.cmp",
|
||||||
enabeld = false,
|
enabled = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"rafamadriz/friendly-snippets",
|
"rafamadriz/friendly-snippets",
|
||||||
--"L3MON4D3/LuaSnip",
|
--"L3MON4D3/LuaSnip",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
'numToStr/Comment.nvim',
|
'numToStr/Comment.nvim',
|
||||||
|
event = { 'BufReadPre', 'BufNewFile' },
|
||||||
opts = {
|
opts = {
|
||||||
-- add any options here
|
-- add any options here
|
||||||
},
|
},
|
||||||
event = { 'BufReadPre', 'BufNewFile' },
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
"j-hui/fidget.nvim",
|
"j-hui/fidget.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
opts = {
|
||||||
local fidget = require("fidget")
|
|
||||||
fidget.setup({
|
|
||||||
notification = {
|
notification = {
|
||||||
window = {
|
window = {
|
||||||
normal_hl = "String", -- Base highlight group in the notification window
|
normal_hl = "String", -- Base highlight group in the notification window
|
||||||
@@ -18,6 +16,5 @@ return {
|
|||||||
relative = "editor", -- What the notification window position is relative to
|
relative = "editor", -- What the notification window position is relative to
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,19 @@
|
|||||||
return {
|
return {
|
||||||
"mhartington/formatter.nvim",
|
"mhartington/formatter.nvim",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>f",
|
||||||
|
":Format",
|
||||||
|
desc = "[F]ormat",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>F",
|
||||||
|
":FormatWrite",
|
||||||
|
desc = "[F]ormat write",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
local util = require("formatter.util")
|
local util = require("formatter.util")
|
||||||
require("formatter").setup({
|
require("formatter").setup({
|
||||||
filetype = {
|
filetype = {
|
||||||
@@ -50,13 +62,6 @@ return {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Keymaps
|
|
||||||
local wk = require("which-key")
|
|
||||||
wk.add({
|
|
||||||
{ "<space>f", ":Format", desc = "[F]ormat" },
|
|
||||||
{ "<space>F", ":FormateWrite", desc = "[F]ormat write" },
|
|
||||||
}, { mode = "n", silent = true })
|
|
||||||
|
|
||||||
local augroup = vim.api.nvim_create_augroup
|
local augroup = vim.api.nvim_create_augroup
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,10 @@
|
|||||||
-- The language servers to setup.
|
|
||||||
local lsp_servers = {
|
|
||||||
"bashls",
|
|
||||||
"clangd",
|
|
||||||
"dockerls",
|
|
||||||
"gopls",
|
|
||||||
"jsonls",
|
|
||||||
"lua_ls",
|
|
||||||
"marksman",
|
|
||||||
"sourcekit",
|
|
||||||
"yamlls",
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- "hrsh7th/cmp-nvim-lsp",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
"saghen/blink.cmp",
|
--"saghen/blink.cmp",
|
||||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"williamboman/mason-lspconfig.nvim",
|
"williamboman/mason-lspconfig.nvim",
|
||||||
@@ -33,14 +21,25 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
opts = {
|
ensure_installed = {
|
||||||
ensure_installed = lsp_servers,
|
"bashls",
|
||||||
|
"clangd",
|
||||||
|
"dockerls",
|
||||||
|
"gopls",
|
||||||
|
"jinja_lsp",
|
||||||
|
"jqls",
|
||||||
|
"jsonls",
|
||||||
|
"ltex",
|
||||||
|
"lua_ls",
|
||||||
|
"marksman",
|
||||||
|
"yamlls",
|
||||||
},
|
},
|
||||||
|
automatic_installation = true,
|
||||||
})
|
})
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
--local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||||
--local capabilities = cmp_nvim_lsp.default_capabilities()
|
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||||
local capabilities = require("blink.cmp").get_lsp_capabilities()
|
--local capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||||
local opts = { noremap = true, silent = true }
|
local opts = { noremap = true, silent = true }
|
||||||
local on_attach = function(_, bufnr)
|
local on_attach = function(_, bufnr)
|
||||||
opts.buffer = bufnr
|
opts.buffer = bufnr
|
||||||
@@ -79,6 +78,19 @@ return {
|
|||||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- The language servers to setup.
|
||||||
|
local lsp_servers = {
|
||||||
|
"bashls",
|
||||||
|
"clangd",
|
||||||
|
"dockerls",
|
||||||
|
"gopls",
|
||||||
|
"jsonls",
|
||||||
|
"lua_ls",
|
||||||
|
"marksman",
|
||||||
|
"sourcekit",
|
||||||
|
"yamlls",
|
||||||
|
}
|
||||||
|
|
||||||
for _, lsp in ipairs(lsp_servers) do
|
for _, lsp in ipairs(lsp_servers) do
|
||||||
lspconfig[lsp].setup({
|
lspconfig[lsp].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
@@ -102,4 +114,5 @@ return {
|
|||||||
-- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
|
-- For some reason I was having trouble getting this to work inside the on-attach, so it's here.
|
||||||
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
|
vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e-[N]ame" })
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
return {
|
local function xcodebuild_device()
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
config = function()
|
|
||||||
local lualine = require("lualine")
|
|
||||||
|
|
||||||
local function xcodebuild_device()
|
|
||||||
if vim.g.xcodebuild_platform == "macOS" then
|
if vim.g.xcodebuild_platform == "macOS" then
|
||||||
return " macOS"
|
return " macOS"
|
||||||
end
|
end
|
||||||
@@ -14,9 +8,12 @@ return {
|
|||||||
end
|
end
|
||||||
|
|
||||||
return " " .. vim.g.xcodebuild_device_name
|
return " " .. vim.g.xcodebuild_device_name
|
||||||
end
|
end
|
||||||
|
|
||||||
lualine.setup({
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
globalstatus = true,
|
globalstatus = true,
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
@@ -67,151 +64,6 @@ return {
|
|||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
extensions = { "nvim-dap-ui", "quickfix", "trouble", "nvim-tree", "lazy", "mason" },
|
extensions = { "nvim-dap-ui", "quickfix", "trouble", "nvim-tree", "lazy", "mason" },
|
||||||
})
|
|
||||||
end,
|
},
|
||||||
}
|
}
|
||||||
-- return {
|
|
||||||
-- "nvim-lualine/lualine.nvim",
|
|
||||||
-- config = function()
|
|
||||||
-- local colors = {
|
|
||||||
-- red = '#ca1243',
|
|
||||||
-- grey = '#a0a1a7',
|
|
||||||
-- black = '#383a42',
|
|
||||||
-- white = '#f3f3f3',
|
|
||||||
-- light_green = '#83a598',
|
|
||||||
-- orange = '#fe8019',
|
|
||||||
-- green = '#8ec07c',
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- local empty = require('lualine.component'):extend()
|
|
||||||
-- function empty:draw(default_highlight)
|
|
||||||
-- self.status = ''
|
|
||||||
-- self.applied_separator = ''
|
|
||||||
-- self:apply_highlights(default_highlight)
|
|
||||||
-- self:apply_section_separators()
|
|
||||||
-- return self.status
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- -- Put proper separators and gaps between components in sections
|
|
||||||
-- local function process_sections(sections)
|
|
||||||
-- for name, section in pairs(sections) do
|
|
||||||
-- local left = name:sub(9, 10) < 'x'
|
|
||||||
-- for pos = 1, name ~= 'lualine_z' and #section or #section - 1 do
|
|
||||||
-- table.insert(section, pos * 2, { empty, color = { fg = colors.white, bg = colors.white } })
|
|
||||||
-- end
|
|
||||||
-- for id, comp in ipairs(section) do
|
|
||||||
-- if type(comp) ~= 'table' then
|
|
||||||
-- comp = { comp }
|
|
||||||
-- section[id] = comp
|
|
||||||
-- end
|
|
||||||
-- comp.separator = left and { right = '' } or { left = '' }
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- return sections
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- local function search_result()
|
|
||||||
-- if vim.v.hlsearch == 0 then
|
|
||||||
-- return ''
|
|
||||||
-- end
|
|
||||||
-- local last_search = vim.fn.getreg '/'
|
|
||||||
-- if not last_search or last_search == '' then
|
|
||||||
-- return ''
|
|
||||||
-- end
|
|
||||||
-- local searchcount = vim.fn.searchcount { maxcount = 9999 }
|
|
||||||
-- return last_search .. '(' .. searchcount.current .. '/' .. searchcount.total .. ')'
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- local function modified()
|
|
||||||
-- if vim.bo.modified then
|
|
||||||
-- return '+'
|
|
||||||
-- elseif vim.bo.modifiable == false or vim.bo.readonly == true then
|
|
||||||
-- return '-'
|
|
||||||
-- end
|
|
||||||
-- return ''
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- local function xcodebuild_device()
|
|
||||||
-- if vim.g.xcodebuild_platform == "macOS" then
|
|
||||||
-- return " macOS"
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- local deviceIcon = ""
|
|
||||||
-- if vim.g.xcodebuild_platform:match("watch") then
|
|
||||||
-- deviceIcon = ""
|
|
||||||
-- elseif vim.g.xcodebuild_platform:match("tv") then
|
|
||||||
-- deviceIcon = " "
|
|
||||||
-- elseif vim.g.xcodebuild_platform:match("vision") then
|
|
||||||
-- deviceIcon = " "
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- if vim.g.xcodebuild_os then
|
|
||||||
-- return deviceIcon .. " " .. vim.g.xcodebuild_device_name .. " (" .. vim.g.xcodebuild_os .. ")"
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
-- return deviceIcon .. " " .. vim.g.xcodebuild_device_name
|
|
||||||
-- end
|
|
||||||
--
|
|
||||||
--
|
|
||||||
-- require('lualine').setup {
|
|
||||||
-- options = {
|
|
||||||
-- theme = 'auto',
|
|
||||||
-- component_separators = '',
|
|
||||||
-- section_separators = { left = '', right = '' },
|
|
||||||
-- },
|
|
||||||
-- sections = process_sections {
|
|
||||||
-- lualine_a = { 'mode' },
|
|
||||||
-- lualine_b = {
|
|
||||||
-- 'branch',
|
|
||||||
-- 'diff',
|
|
||||||
-- {
|
|
||||||
-- 'diagnostics',
|
|
||||||
-- source = { 'nvim' },
|
|
||||||
-- sections = { 'error' },
|
|
||||||
-- diagnostics_color = { error = { bg = colors.red, fg = colors.white } },
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- 'diagnostics',
|
|
||||||
-- source = { 'nvim' },
|
|
||||||
-- sections = { 'warn' },
|
|
||||||
-- diagnostics_color = { warn = { bg = colors.orange, fg = colors.white } },
|
|
||||||
-- },
|
|
||||||
-- { 'filename', file_status = false, path = 1 },
|
|
||||||
-- { modified, color = { bg = colors.red } },
|
|
||||||
-- {
|
|
||||||
-- '%w',
|
|
||||||
-- cond = function()
|
|
||||||
-- return vim.wo.previewwindow
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- '%r',
|
|
||||||
-- cond = function()
|
|
||||||
-- return vim.bo.readonly
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- '%q',
|
|
||||||
-- cond = function()
|
|
||||||
-- return vim.bo.buftype == 'quickfix'
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- lualine_c = {},
|
|
||||||
-- lualine_x = {
|
|
||||||
-- { "' ' .. vim.g.xcodebuild_last_status", color = { fg = "Gray" } },
|
|
||||||
-- { "' ' .. vim.g.xcodebuild_test_plan", color = { fg = "#a6e3a1", bg = "#161622" } },
|
|
||||||
-- { xcodebuild_device, color = { fg = "#f9e2af", bg = "#161622" } },
|
|
||||||
-- },
|
|
||||||
-- lualine_y = { search_result, 'filetype' },
|
|
||||||
-- lualine_z = { '%l:%c', '%p%%/%L' },
|
|
||||||
-- },
|
|
||||||
-- inactive_sections = {
|
|
||||||
-- lualine_c = { '%f %y %m' },
|
|
||||||
-- lualine_x = {},
|
|
||||||
-- },
|
|
||||||
-- tabline = {},
|
|
||||||
-- extensions = {"nvim-tree"}
|
|
||||||
-- }
|
|
||||||
-- end
|
|
||||||
-- }
|
|
||||||
|
|||||||
@@ -2,44 +2,45 @@ return {
|
|||||||
"L3MON4D3/LuaSnip",
|
"L3MON4D3/LuaSnip",
|
||||||
version = "v2.*",
|
version = "v2.*",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
config = function()
|
opts = {
|
||||||
local ls = require("luasnip")
|
|
||||||
local types = require("luasnip.util.types")
|
|
||||||
ls.setup({
|
|
||||||
history = true,
|
history = true,
|
||||||
enable_autosnippets = false,
|
enable_autosnippets = false,
|
||||||
updatevents = "TextChanged,TextChangedI",
|
updatevents = "TextChanged,TextChangedI",
|
||||||
extra_opts = {
|
extra_opts = {
|
||||||
[types.choiceNode] = {
|
[require("luasnip.utl.types").choiceNode] = {
|
||||||
active = {
|
active = {
|
||||||
virt_text = { { "choiceNode", "Comment" } },
|
virt_text = { { "choiceNode", "Comment" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
keys = {
|
||||||
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
|
{
|
||||||
|
"<C-k>",
|
||||||
-- Keymaps
|
mode = { "i", "s" },
|
||||||
local opts = { silent = true }
|
function()
|
||||||
|
local ls = require("luasnip")
|
||||||
-- Use <Ctrl>k to expand snippets.
|
|
||||||
-- This will expand the current item or jump to the next item within the snippet.
|
|
||||||
vim.keymap.set({ "i", "s" }, "<C-k>", function()
|
|
||||||
if ls.expand_or_jumpable() then
|
if ls.expand_or_jumpable() then
|
||||||
ls.expand_or_jump()
|
ls.expand_or_jump()
|
||||||
end
|
end
|
||||||
end, opts)
|
end,
|
||||||
|
},
|
||||||
-- Use <Ctrl>j to jump backwards in a snippet.
|
{
|
||||||
-- This always moves to the previous item within a snippet.
|
"<C-j>",
|
||||||
vim.keymap.set({ "i", "s" }, "<C-j>", function()
|
mode = { "i", "s" },
|
||||||
|
function()
|
||||||
|
local ls = require("luasnip")
|
||||||
if ls.jumpable(-1) then
|
if ls.jumpable(-1) then
|
||||||
ls.jump(-1)
|
ls.jump(-1)
|
||||||
end
|
end
|
||||||
end, opts)
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function(_, opts)
|
||||||
|
local ls = require("luasnip")
|
||||||
|
ls.setup(opts)
|
||||||
|
|
||||||
-- Reload snippets.
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
vim.keymap.set("n", "<leader><leader>s", "<CMD>source ~/.config/m-housh/lua/user/plugin/luasnip.lua<CR>")
|
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.fn.stdpath("config") .. "/snippets" })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
return {
|
return {
|
||||||
"folke/noice.nvim",
|
"folke/noice.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
-- config.lsp.signature.enabled = false
|
dependencies = {
|
||||||
|
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
-- OPTIONAL:
|
||||||
|
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||||
|
-- If not available, we use `mini` as the fallback
|
||||||
|
"rcarriga/nvim-notify",
|
||||||
|
},
|
||||||
opts = {
|
opts = {
|
||||||
lsp = {
|
lsp = {
|
||||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
@@ -26,22 +33,14 @@ return {
|
|||||||
filter = { event = "msg_showmode" },
|
filter = { event = "msg_showmode" },
|
||||||
},
|
},
|
||||||
{ -- Hide the written messages.
|
{ -- Hide the written messages.
|
||||||
view = 'notify',
|
view = "notify",
|
||||||
filter = {
|
filter = {
|
||||||
event = "msg_show",
|
event = "msg_show",
|
||||||
kind = "",
|
kind = "",
|
||||||
find = "written"
|
find = "written",
|
||||||
},
|
},
|
||||||
opts = { skip = true }
|
opts = { skip = true },
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
dependencies = {
|
|
||||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
-- OPTIONAL:
|
|
||||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
|
||||||
-- If not available, we use `mini` as the fallback
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,34 +35,4 @@ return {
|
|||||||
desc = "Open directory in float.",
|
desc = "Open directory in float.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- config = function()
|
|
||||||
-- require("oil").setup({
|
|
||||||
-- columns = { "icon" },
|
|
||||||
-- keymaps = {
|
|
||||||
-- ["<C-h>"] = false,
|
|
||||||
-- ["<M-h>"] = "actions.select_split",
|
|
||||||
-- ["<C-v>"] = {
|
|
||||||
-- "actions.select",
|
|
||||||
-- opts = { vertical = true },
|
|
||||||
-- desc = "Open the entry in a vertical split",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- view_options = {
|
|
||||||
-- is_hidden_file = function(name, _) -- second arg is bufnr, but not currently used.
|
|
||||||
-- -- Don't show .DS_Store in output.
|
|
||||||
-- local is_ds_store = name ~= ".DS_Store"
|
|
||||||
-- return not is_ds_store
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- -- Show the parent directory in current window.
|
|
||||||
-- vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory." })
|
|
||||||
--
|
|
||||||
-- -- Open parent directory in floating window.
|
|
||||||
-- vim.keymap.set("n", "<space>-", require("oil").toggle_float)
|
|
||||||
--
|
|
||||||
-- -- Old habits die hard, map what used to toggle neo-tree to just open a float.
|
|
||||||
-- vim.keymap.set("n", "<C-n>", require("oil").toggle_float)
|
|
||||||
-- end,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,26 +4,42 @@ return {
|
|||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"folke/trouble.nvim",
|
"folke/trouble.nvim",
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {
|
||||||
config = function()
|
|
||||||
local todos = require("todo-comments")
|
|
||||||
|
|
||||||
todos.setup({
|
|
||||||
keywords = {
|
keywords = {
|
||||||
-- Adds the important keyword, I primarily use this in markdown
|
-- Adds the important keyword, I primarily use this in markdown
|
||||||
-- documents to be able to jump and color appropriately.
|
-- documents to be able to jump and color appropriately.
|
||||||
FIX = { alt = { "IMPORTANT" } },
|
FIX = { alt = { "IMPORTANT" } },
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
|
keys = {
|
||||||
vim.keymap.set("n", "<leader>tq", "<CMD>Trouble todo toggle<CR>", { desc = "[T]odo [Q]uick fix list." })
|
{
|
||||||
vim.keymap.set("n", "<leader><leader>t", "<CMD>TodoTelescope<CR>", { desc = "[T]odo telescope list." })
|
"<leader>tq",
|
||||||
vim.keymap.set("n", "<leader>tl", "<CMD>TodoLocList<CR>", { desc = "[T]odo [L]ocation list." })
|
"<CMD>Trouble todo toggle<CR>",
|
||||||
vim.keymap.set("n", "]t", function()
|
desc = "Todo quick fix list.",
|
||||||
todos.jump_next()
|
},
|
||||||
end, { desc = "Next [T]odo" })
|
{
|
||||||
vim.keymap.set("n", "[t", function()
|
"<leader><leader>t",
|
||||||
todos.jump_prev()
|
"<CMD>TodoTelescope<CR>",
|
||||||
end, { desc = "Previous [T]odo" })
|
desc = "Todo telescope list.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>tl",
|
||||||
|
"<CMD>TodoLocList<CR>",
|
||||||
|
desc = "Todo location list.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"]t",
|
||||||
|
function()
|
||||||
|
require("todo-comments").jump_next()
|
||||||
end,
|
end,
|
||||||
|
desc = "Next todo.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"[t",
|
||||||
|
function()
|
||||||
|
require("todo-comments").jump_prev()
|
||||||
|
end,
|
||||||
|
desc = "Previous todo.",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ return {
|
|||||||
},
|
},
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
event = { "BufReadPre", "BufNewFile" },
|
event = { "BufReadPre", "BufNewFile" },
|
||||||
config = function()
|
opts = {
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
"bash",
|
||||||
"cmake",
|
"cmake",
|
||||||
@@ -73,6 +72,5 @@ return {
|
|||||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
||||||
max_file_lines = 2000, -- Do not enable for files with more than specified lines
|
max_file_lines = 2000, -- Do not enable for files with more than specified lines
|
||||||
},
|
},
|
||||||
})
|
},
|
||||||
end,
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
return {
|
return {
|
||||||
"folke/which-key.nvim",
|
"folke/which-key.nvim",
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
init = function()
|
opts = {
|
||||||
vim.o.timeout = true
|
preset = "helix",
|
||||||
vim.o.timeoutlen = 300
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>?",
|
||||||
|
function()
|
||||||
|
require("which-key").show({ global = false })
|
||||||
end,
|
end,
|
||||||
}
|
desc = "Buffer Local Keymaps (which-key)",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user