feat: noice and lua line config + multigrep search + markdown fix on treesitter
This commit is contained in:
2
init.lua
2
init.lua
@@ -14,7 +14,7 @@ vim.cmd("set textwidth=0")
|
|||||||
vim.cmd("set wrapmargin=0")
|
vim.cmd("set wrapmargin=0")
|
||||||
vim.cmd("set linebreak")
|
vim.cmd("set linebreak")
|
||||||
-- vim.cmd("set colorcolumn=85")
|
-- vim.cmd("set colorcolumn=85")
|
||||||
-- vim.cmd("set conceallevel=0") -- DONT hide characters in MD
|
vim.cmd("set conceallevel=0") -- DONT hide characters in MD
|
||||||
vim.cmd("set tabstop=4")
|
vim.cmd("set tabstop=4")
|
||||||
vim.cmd("set shiftwidth=4")
|
vim.cmd("set shiftwidth=4")
|
||||||
vim.cmd("set noexpandtab") -- expandtab to use spaces instead of tabs
|
vim.cmd("set noexpandtab") -- expandtab to use spaces instead of tabs
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
"nvim-colorizer.lua": { "branch": "master", "commit": "72a05f62c52241bc7441c820eb53946f92b2e6a4" },
|
"nvim-colorizer.lua": { "branch": "master", "commit": "72a05f62c52241bc7441c820eb53946f92b2e6a4" },
|
||||||
"nvim-lint": { "branch": "master", "commit": "3d55c8f67c6ae5c15e1042571e107c7a3d5c5f4e" },
|
"nvim-lint": { "branch": "master", "commit": "3d55c8f67c6ae5c15e1042571e107c7a3d5c5f4e" },
|
||||||
"nvim-scrollbar": { "branch": "main", "commit": "f8e87b96cd6362ef8579be456afee3b38fd7e2a8" },
|
"nvim-scrollbar": { "branch": "main", "commit": "f8e87b96cd6362ef8579be456afee3b38fd7e2a8" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
|
"nvim-treesitter": { "branch": "main", "commit": "8b98b4470eb326f1c7b50dae79f8c963568e5720" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "f3061339b8eaf9fda873600bc425b8d2d8502533" },
|
"nvim-treesitter-context": { "branch": "master", "commit": "f3061339b8eaf9fda873600bc425b8d2d8502533" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "88c1453db4ba7dd24131086fe51fdf74e587d275" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
|
"nvim-web-devicons": { "branch": "master", "commit": "2ae6958df7ced50baac5035cec0c15799eedfbf7" },
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ return {
|
|||||||
-- │ Code parse │
|
-- │ Code parse │
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
branch = "main",
|
||||||
|
build = ":TSUpdate",
|
||||||
opts = function()
|
opts = function()
|
||||||
return require("plugins.opts.treesitter")
|
return require("plugins.opts.treesitter")
|
||||||
end,
|
end,
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
require("nvim-treesitter.config").setup(opts)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ local options = {
|
|||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = { "branch", "diff" },
|
lualine_b = { "branch", "diff" },
|
||||||
lualine_c = { "filename", "diagnostics" },
|
lualine_c = { "filename", "diagnostics" },
|
||||||
lualine_x = { "searchcount", "filetype", "encoding", "fileformat" },
|
lualine_x = { "lsp_status", "searchcount", "filetype", "encoding" },
|
||||||
lualine_y = { "progress" },
|
lualine_y = { "progress" },
|
||||||
lualine_z = { "location" },
|
lualine_z = { "location" },
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,26 +36,29 @@ local config = {
|
|||||||
icon = "",
|
icon = "",
|
||||||
lang = "lua",
|
lang = "lua",
|
||||||
},
|
},
|
||||||
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
|
help = { pattern = "^:%s*he?l?p?%s+", icon = "" },
|
||||||
input = {}, -- Used by input()
|
input = {}, -- Used by input()
|
||||||
-- lua = false, -- to disable a format, set to `false`
|
-- lua = false, -- to disable a format, set to `false`
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
notify = {
|
notify = {
|
||||||
-- Noice can be used as `vim.notify` so you can route any notification like other messages
|
|
||||||
-- Notification messages have their level and other properties set.
|
|
||||||
-- event is always "notify" and kind can be any log level as a string
|
|
||||||
-- The default routes will forward notifications to nvim-notify
|
|
||||||
-- Benefit of using Noice for this is the routing and consistent history view
|
|
||||||
enabled = false,
|
enabled = false,
|
||||||
view = "notify",
|
view = "notify",
|
||||||
},
|
},
|
||||||
lsp = {
|
lsp = {
|
||||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
|
||||||
override = {
|
override = {
|
||||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||||
["vim.lsp.util.stylize_markdown"] = true,
|
["vim.lsp.util.stylize_markdown"] = true,
|
||||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
},
|
||||||
|
-- Bottom right notifications with the lsp executions
|
||||||
|
progress = {
|
||||||
|
enabled = false,
|
||||||
|
--- @type NoiceFormat|string
|
||||||
|
format = "lsp_progress",
|
||||||
|
--- @type NoiceFormat|string
|
||||||
|
format_done = "lsp_progress_done",
|
||||||
|
throttle = 1000 / 30, -- frequency to update lsp progress message
|
||||||
|
view = "mini",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
presets = {
|
presets = {
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ return {
|
|||||||
for _, ext in ipairs(opts.extensions_list) do
|
for _, ext in ipairs(opts.extensions_list) do
|
||||||
telescope.load_extension(ext)
|
telescope.load_extension(ext)
|
||||||
end
|
end
|
||||||
|
require("plugins.utils.telescope").setup()
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ "mbbill/undotree" },
|
{ "mbbill/undotree" },
|
||||||
|
|||||||
55
lua/plugins/utils/telescope.lua
Normal file
55
lua/plugins/utils/telescope.lua
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
local pickers = require("telescope.pickers")
|
||||||
|
local finders = require("telescope.finders")
|
||||||
|
local make_entry = require("telescope.make_entry")
|
||||||
|
local conf = require("telescope.config").values
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local live_multigrep = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
opts.cwd = opts.cwd or vim.uv.cwd()
|
||||||
|
|
||||||
|
local finder = finders.new_async_job({
|
||||||
|
command_generator = function(prompt)
|
||||||
|
if not prompt or prompt == "" then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local pieces = vim.split(prompt, " ")
|
||||||
|
local args = { "rg" }
|
||||||
|
if pieces[1] then
|
||||||
|
table.insert(args, "-e")
|
||||||
|
table.insert(args, pieces[1])
|
||||||
|
end
|
||||||
|
|
||||||
|
if pieces[2] then
|
||||||
|
table.insert(args, "-g")
|
||||||
|
table.insert(args, pieces[2])
|
||||||
|
end
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: deprecated
|
||||||
|
return vim.tbl_flatten({
|
||||||
|
args,
|
||||||
|
{ "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
entry_maker = make_entry.gen_from_vimgrep(opts),
|
||||||
|
cwd = opts.cwd,
|
||||||
|
})
|
||||||
|
|
||||||
|
pickers
|
||||||
|
.new(opts, {
|
||||||
|
debounce = 100,
|
||||||
|
prompt_title = "Multi Grep",
|
||||||
|
finder = finder,
|
||||||
|
previewer = conf.grep_previewer(opts),
|
||||||
|
sorter = require("telescope.sorters").empty(),
|
||||||
|
})
|
||||||
|
:find()
|
||||||
|
end
|
||||||
|
|
||||||
|
M.setup = function()
|
||||||
|
vim.keymap.set("n", "<leader>fW", live_multigrep)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
Reference in New Issue
Block a user