Skip to content

Commit

Permalink
feat(mini.files): replace most nvim-tree usage with mini.files
Browse files Browse the repository at this point in the history
  • Loading branch information
WilliamHsieh committed Oct 30, 2024
1 parent 9dd1ad7 commit c0e948e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" },
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
"mini.files": { "branch": "main", "commit": "6abe854f1410fc6aec69897a78b1db994c32d9c6" },
"mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" },
"neogit": { "branch": "master", "commit": "e0a8674ac6b6048e1e4d364645dc605ac789bc4a" },
"neovim-session-manager": { "branch": "master", "commit": "cbaebd92dce84e9ba63cb07d3199e5a19b204c1a" },
Expand Down
1 change: 0 additions & 1 deletion config/nvim/lua/core/mapping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ end
--}}}

-- <leader>: normal mode{{{
map("n", "<leader>e", "<cmd>NvimTreeToggle<cr>", "Explorer")
map("n", "<leader>w", "<cmd>up<cr>", "Save")
map("n", "<leader>q", "<cmd>q<cr>", "Quit")
map("n", "<leader>y", function() yank() end, "copy to clipboard")
Expand Down
21 changes: 21 additions & 0 deletions config/nvim/lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,25 @@ return {
event = { "BufRead Cargo.toml" },
opts = {},
},

{
"echasnovski/mini.files",
keys = {
{
"<leader>e",
function()
if not MiniFiles.close() then
MiniFiles.open()
end
end,
desc = "File Explorer",
},
},
opts = {
mappings = {
synchronize = "<leader>w",
go_in_plus = "<CR>",
},
},
},
}
12 changes: 6 additions & 6 deletions config/nvim/lua/plugins/session.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ local M = {
}

M.config = function()
vim.api.nvim_create_autocmd("User", {
pattern = "SessionLoadPost",
callback = vim.schedule_wrap(function()
pcall(require("nvim-tree.api").tree.toggle, false, true)
end),
})
-- vim.api.nvim_create_autocmd("User", {
-- pattern = "SessionLoadPost",
-- callback = vim.schedule_wrap(function()
-- pcall(require("nvim-tree.api").tree.toggle, false, true)
-- end),
-- })

require("session_manager").setup {
autoload_mode = require("session_manager.config").AutoloadMode.Disabled,
Expand Down

0 comments on commit c0e948e

Please sign in to comment.