Skip to content

Commit

Permalink
No filetree but netrw
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-zan committed Nov 19, 2023
1 parent 683a627 commit ea7eb82
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 49 deletions.
49 changes: 0 additions & 49 deletions lua/custom/plugins/filetree.lua

This file was deleted.

18 changes: 18 additions & 0 deletions lua/reymerk/remap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ vim.keymap.set('t', "<Esc>", "<C-\\><C-n>:FloatermHide<CR>")
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })

-- Open netrw in current file
vim.keymap.set('n', '<leader>op', function ()
local relative_path = vim.fn.expand("%:h")
local startPos, endPos = string.find(relative_path, "/")
if startPos == 1 then
relative_path = "."
end
vim.cmd [[:let @/=expand("%:t")]]
vim.cmd("Explore " .. relative_path)
if startPos > 1 then
while startPos ~= nil do
startPos, endPos = string.find(relative_path, "/", endPos + 1)
vim.cmd("call netrw#Call('NetrwBrowseUpDir', 1)")
end
vim.cmd("call netrw#Call('NetrwBrowseUpDir', 1)")
end
vim.cmd(":normal n<CR>zz")
end, { desc = "[O]pen [P]roject dir"})
2 changes: 2 additions & 0 deletions lua/reymerk/set.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ vim.opt.isfname:append("@-@")
-- To setu the height of the suggestions (to not shoot all over the place)
vim.opt.pumheight = 8;

-- To choose the best Netrw mode
vim.g.netrw_liststyle=3
-- [[ Basic Keymaps ]]

-- Keymaps for better default experience
Expand Down

0 comments on commit ea7eb82

Please sign in to comment.