Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir committed Jul 30, 2024
1 parent fd3c2d6 commit d3bec53
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/core/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('core.pack'):boot_strap()
require('core.options')

-- some color i interested
-- backup: #05262e
-- backup: #05262e #79a617
vim.cmd([[
hi EndOfBuffer guifg=#14161b
hi Function guifg=#a6dbff ctermfg=12
Expand Down
15 changes: 15 additions & 0 deletions lua/internal/event.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,18 @@ au('InsertEnter', {
require('internal.pairs').setup({})
end,
})

au('FileType', {
pattern = 'netrw',
callback = function()
local map = function(lhs, rhs, desc)
vim.keymap.set('n', lhs, rhs, { buffer = true, remap = true, desc = desc })
end
vim.wo.stc = ''
map('r', 'R', 'rename file')
map('l', '<CR>', 'open directory or file')
map('.', 'gh', 'toggle dotfiles')
map('H', 'u', 'go back')
map('h', '-^', 'go up')
end,
})
17 changes: 16 additions & 1 deletion lua/keymap/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,19 @@ map.nt('<A-d>', cmd('Lspsaga term_toggle'))

map.nx('ga', cmd('Lspsaga code_action'))

map.n('<leader>n', function() end)
local loaded_netrw = false
map.n('<leader>n', function()
if not loaded_netrw then
vim.g.loaded_netrwPlugin = nil
vim.g.netrw_keepdir = 0
vim.g.netrw_winsize = 30
vim.g.netrw_banner = 0
vim.g.netrw_list_hide = [[\(^\|\s\s\)\zs\.\S\+]]
vim.g.netrw_liststyle = 3
vim.cmd.source(vim.env.VIMRUNTIME .. '/plugin/netrwPlugin.vim')
vim.cmd('Lexplore')
loaded_netrw = true
return
end
vim.cmd('Lexplore')
end)

0 comments on commit d3bec53

Please sign in to comment.