Skip to content

Commit

Permalink
feat(mini): add mini files
Browse files Browse the repository at this point in the history
  • Loading branch information
liubang committed Sep 16, 2024
1 parent 585f326 commit 6ad5421
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/plugins/lsp/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ vim.diagnostic.config({ -- {{{
update_in_insert = false,
underline = false,
float = {
border = "single",
spacing = 4,
border = nil,
focusable = true,
header = " Diagnostics: ",
scope = "line",
source = "always",
source = true,
},
}) -- }}}

Expand All @@ -45,9 +46,9 @@ vim.fn.sign_define(hl .. "Hint", { text = dia_cfg.icons.Hint, texthl = hl .. "Hi
local popup_window = {
stylize_markdown = true,
syntax = "lsp_markdown",
border = "single",
border = nil,
width = 100,
height = 10,
height = 15,
max_height = 20,
max_width = 140,
}
Expand Down
57 changes: 57 additions & 0 deletions lua/plugins/mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,61 @@ return {
},
-- }}}
},
{
"echasnovski/mini.files",
version = "*",
opts = {
content = {
filter = nil,
prefix = nil,
sort = nil,
},
-- Module mappings created only inside explorer.
-- Use `''` (empty string) to not create one.
mappings = {
close = "q",
go_in = "",
go_in_plus = "l",
go_out = "",
go_out_plus = "h",
mark_goto = "'",
mark_set = "m",
reset = "<BS>",
reveal_cwd = "@",
show_help = "g?",
synchronize = "=",
trim_left = "<",
trim_right = ">",
},
-- General options
options = {
permanent_delete = true,
use_as_default_explorer = false,
},
-- Customization of explorer windows
windows = {
max_number = math.huge,
preview = false,
width_focus = 50,
width_nofocus = 15,
width_preview = 25,
},
},
keys = {
{
"<leader>mf",
function()
require("mini.files").open(vim.api.nvim_buf_get_name(0), true)
end,
desc = "Open mini.files (Directory of Current File)",
},
{
"<leader>mF",
function()
require("mini.files").open(vim.uv.cwd(), true)
end,
desc = "Open mini.files (cwd)",
},
},
},
}
45 changes: 45 additions & 0 deletions lua/plugins/noice.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
-- Copyright (c) 2024 The Authors. All rights reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- https://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

-- Authors: liubang ([email protected])

return {
"folke/noice.nvim",
event = "VeryLazy",
enabled = false,
opts = {
cmdline = { enabled = false },
messages = { enabled = false },
popupmenu = { enabled = false },
lsp = {
progress = { enabled = false },
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
signature = { enabled = true },
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
},
dependencies = {
"MunifTanjim/nui.nvim",
},
}

0 comments on commit 6ad5421

Please sign in to comment.