diff --git a/init.lua b/init.lua index cdb5c2b..0eca1cf 100644 --- a/init.lua +++ b/init.lua @@ -15,7 +15,7 @@ vim.api.nvim_create_autocmd('User', { local lazygit = Terminal:new({ cmd = "lazygit", dir = "git_dir", - direction = "float", + direction = "tab", float_opts = { border = "none", }, diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index 0ff031e..3db0549 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -88,6 +88,13 @@ vim.api.nvim_create_autocmd("BufReadPost", { end, }) +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { + pattern = ".gitlab*", + callback = function() + vim.bo.filetype = "yaml.gitlab" + end, +}) + vim.cmd [[ augroup change_cursor au! diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua index f67de1e..a705a82 100644 --- a/lua/plugins/oil.lua +++ b/lua/plugins/oil.lua @@ -29,7 +29,17 @@ return { }, keymaps = { ['g?'] = 'actions.show_help', - [''] = 'actions.select', + -- [''] = 'actions.select', + [""] = function() + require("oil").select(nil, function(err) + if not err then + local curdir = require("oil").get_current_dir() + if curdir then + vim.cmd.lcd(curdir) + end + end + end) + end, [''] = 'actions.select_vsplit', [''] = 'actions.select_split', [''] = 'actions.preview', @@ -38,7 +48,11 @@ return { ['q'] = 'actions.close', [''] = 'actions.refresh', ['-'] = 'actions.parent', - ['l'] = 'actions.parent', + -- ['l'] = 'actions.parent', + ["l"] = function() + require("oil.actions").parent.callback() + vim.cmd.lcd(require("oil").get_current_dir()) + end, ['_'] = 'actions.open_cwd', ['`'] = 'actions.cd', ['~'] = 'actions.tcd',