diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 7b95820..2519de0 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -47,7 +47,6 @@ "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, - "oil.nvim": { "branch": "master", "commit": "05a80e24f6c920e29ed741d12ede0840e456a3e4" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "pretty-fold.nvim": { "branch": "master", "commit": "a7d8b424abe0eedf50116c460fbe6dfd5783b1d5" }, "smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" }, diff --git a/config/nvim/lua/aleidk/options.lua b/config/nvim/lua/aleidk/options.lua index 7420cb7..2a7805d 100644 --- a/config/nvim/lua/aleidk/options.lua +++ b/config/nvim/lua/aleidk/options.lua @@ -46,7 +46,7 @@ opt.timeoutlen = 300 opt.undofile = true opt.undolevels = 10000 opt.updatetime = 200 -- Save swap file and trigger CursorHold -opt.wildmode = "longest:full,full" -- Command-line completion mode +opt.wildmode = "longest,list:full" -- Command-line completion mode opt.winminwidth = 5 -- Minimum window width opt.wrap = false -- Disable line wrap diff --git a/config/nvim/lua/aleidk/plugins/completion.lua b/config/nvim/lua/aleidk/plugins/completion.lua index f4f8eaa..b372dbe 100644 --- a/config/nvim/lua/aleidk/plugins/completion.lua +++ b/config/nvim/lua/aleidk/plugins/completion.lua @@ -77,23 +77,5 @@ return { } cmp.setup(opts) - - -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline({ "/", "?" }, { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, - }) - - -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). - cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - }) end, } diff --git a/config/nvim/lua/aleidk/plugins/file-browser.lua b/config/nvim/lua/aleidk/plugins/file-browser.lua index 87d3ac8..6c420d0 100644 --- a/config/nvim/lua/aleidk/plugins/file-browser.lua +++ b/config/nvim/lua/aleidk/plugins/file-browser.lua @@ -6,7 +6,10 @@ return { dependencies = { "nvim-tree/nvim-web-devicons", }, - lazy = false, + keys = { + { "e", "NvimTreeToggle", desc = "Open file explorer" }, + }, + cmd = { "NvimTreeToggle", "Tree" }, config = function() local tree = require("nvim-tree") local api = require("nvim-tree.api") @@ -94,47 +97,4 @@ return { -- vim.keymap.set("n", "", ":NvimTreeToggle", { desc = "Toggle file tree", silent = true }) end, }, - { - "stevearc/oil.nvim", - opts = function() - local oil = require("oil") - return { - win_options = { - number = false, - }, - delete_to_trash = true, - trash_command = "trash", - skip_confirm_for_simple_edits = false, - keymaps = { - ["g?"] = "actions.show_help", - [""] = "actions.select", - ["l"] = "actions.select", - [""] = "actions.open_external", - [""] = function() - oil.select({ vertical = true }) - vim.cmd.wincmd({ args = { "p" } }) - oil.close() - vim.cmd.wincmd({ args = { "p" } }) - end, - [""] = "actions.select_split", - [""] = "actions.select_tab", - [""] = "actions.preview", - [""] = "actions.preview_scroll_down", - [""] = "actions.preview_scroll_up", - [""] = "actions.close", - [""] = "actions.refresh", - ["y"] = "actions.copy_entry_path", - ["h"] = "actions.parent", - ["gs"] = "actions.change_sort", - ["gx"] = "actions.open_external", - ["g."] = "actions.toggle_hidden", - }, - } - end, - -- Optional dependencies - dependencies = { "nvim-tree/nvim-web-devicons" }, - keys = { - { "e", "Oil", desc = "Open file explorer" }, - }, - }, } diff --git a/config/nvim/lua/aleidk/plugins/git.lua b/config/nvim/lua/aleidk/plugins/git.lua index cd068d4..d157009 100644 --- a/config/nvim/lua/aleidk/plugins/git.lua +++ b/config/nvim/lua/aleidk/plugins/git.lua @@ -27,7 +27,7 @@ return { map("n", "u", gs.undo_stage_hunk, "Undo Stage Hunk") map("n", "R", gs.reset_buffer, "Reset Buffer") map("n", "p", gs.preview_hunk, "Preview Hunk") - map("n", "l", function() gs.blame_line() end, "Blame Line") + map("n", "l", function() gs.blame_line({full = true}) end, "Blame Line") map("n", "d", gs.diffthis, "Diff This") end, }, @@ -38,9 +38,6 @@ return { { "tpope/vim-fugitive", event = "VeryLazy", - keys = { - { "gG", ":Git", desc = "Fugitive" }, - }, }, { @@ -50,7 +47,7 @@ return { "nvim-lua/plenary.nvim", }, keys = { - { "gL", ":LazyGit", desc = "Lazygit" }, + { "gG", ":LazyGit", desc = "Lazygit" }, }, }, diff --git a/config/nvim/lua/aleidk/plugins/sessions.lua b/config/nvim/lua/aleidk/plugins/sessions.lua index d66be94..0c2907b 100644 --- a/config/nvim/lua/aleidk/plugins/sessions.lua +++ b/config/nvim/lua/aleidk/plugins/sessions.lua @@ -2,9 +2,13 @@ return { -- sessions "rmagatti/auto-session", config = function() + ---@diagnostic disable-next-line: missing-fields require("auto-session").setup({ log_level = "error", auto_session_suppress_dirs = { "~/", "~/Downloads", "/" }, + bypass_session_save_file_types = { + "NeogitStatus", + }, }) end, } diff --git a/config/nvim/lua/aleidk/plugins/telescope.lua b/config/nvim/lua/aleidk/plugins/telescope.lua index 21ba654..8279782 100644 --- a/config/nvim/lua/aleidk/plugins/telescope.lua +++ b/config/nvim/lua/aleidk/plugins/telescope.lua @@ -30,8 +30,8 @@ return { layout_config = { vertical = { height = 0.99, mirror = true, prompt_position = "top" } }, mappings = { i = { - [""] = false, - [""] = false, + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, [""] = actions.move_selection_next, [""] = actions.move_selection_previous, [""] = actions.file_vsplit, @@ -75,8 +75,12 @@ return { -- Help vim.keymap.set("n", "fc", builtin.command_history, { desc = "Find in commands history" }) vim.keymap.set("n", "fC", builtin.commands, { desc = "Find a command" }) - vim.keymap.set("n", "fh", builtin.help_tags, { desc = "[F]ind [H]elp" }) - vim.keymap.set("n", "fk", builtin.keymaps, { desc = "[F]ind [K]eymaps" }) + vim.keymap.set("n", "fh", builtin.help_tags, { desc = "Find Help" }) + vim.keymap.set("n", "fk", builtin.keymaps, { desc = "Find Keymaps" }) + + -- Git + vim.keymap.set("n", "gb", builtin.git_branches, { desc = "Change branch" }) + vim.keymap.set("n", "gL", builtin.git_bcommits, { desc = "Commits of buffer" }) -- Diagnosticos -- Disabled, handle by trouble diff --git a/config/zsh/aliases/git.zsh b/config/zsh/aliases/git.zsh new file mode 100644 index 0000000..b7485b6 --- /dev/null +++ b/config/zsh/aliases/git.zsh @@ -0,0 +1,2 @@ +alias \ + glf='git log -p --'