From ddc61439a01d8f93716b5bcea0f3df7f2457c445 Mon Sep 17 00:00:00 2001 From: omagdy Date: Tue, 5 Aug 2025 07:31:43 +0300 Subject: git: Added gitconfig to dotfiles --- nvim/.config/nvim/lua/config/autocmds.lua | 1 + nvim/.config/nvim/lua/config/keymaps.lua | 15 ++++ nvim/.config/nvim/lua/config/options.lua | 2 - nvim/.config/nvim/lua/plugins/diffview.lua | 4 ++ nvim/.config/nvim/lua/plugins/neo-tree.lua | 98 -------------------------- nvim/.config/nvim/lua/plugins/neo-tree.lua.old | 98 ++++++++++++++++++++++++++ nvim/.config/nvim/lua/plugins/telescope.lua | 20 ++++++ 7 files changed, 138 insertions(+), 100 deletions(-) create mode 100644 nvim/.config/nvim/lua/plugins/diffview.lua delete mode 100644 nvim/.config/nvim/lua/plugins/neo-tree.lua create mode 100644 nvim/.config/nvim/lua/plugins/neo-tree.lua.old (limited to 'nvim') diff --git a/nvim/.config/nvim/lua/config/autocmds.lua b/nvim/.config/nvim/lua/config/autocmds.lua index 8f6bb40..f3d156f 100644 --- a/nvim/.config/nvim/lua/config/autocmds.lua +++ b/nvim/.config/nvim/lua/config/autocmds.lua @@ -22,3 +22,4 @@ -- end -- end, -- }) +-- diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua index e5aa308..76a5f63 100644 --- a/nvim/.config/nvim/lua/config/keymaps.lua +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -72,6 +72,21 @@ vim.cmd([[ cnoreabbrev Qall qall ]]) +-- dap keymaps + +-- Eval var under cursor +vim.keymap.set("n", ";", function() + require("dapui").eval(nil, { enter = true }) +end) + +vim.keymap.set("n", "b", require("dap").toggle_breakpoint) + +vim.keymap.set("n", "", require("dap").continue) +vim.keymap.set("n", "", require("dap").step_over) +vim.keymap.set("n", "", require("dap").step_into) +vim.keymap.set("n", "", require("dap").step_out) +vim.keymap.set("n", "", require("dap").restart) + -- load the session for the current directory vim.keymap.set("n", "ql", function() require("persistence").load() diff --git a/nvim/.config/nvim/lua/config/options.lua b/nvim/.config/nvim/lua/config/options.lua index ef5c5f7..6905561 100644 --- a/nvim/.config/nvim/lua/config/options.lua +++ b/nvim/.config/nvim/lua/config/options.lua @@ -9,8 +9,6 @@ vim.opt.confirm = false vim.o.guifont = "Monaspace Radon:bold,Noto Color Emoji:h10" -- text below applies for VimScript vim.o.undofile = true -vim.o.spell = false - -- Best search settings :) vim.opt.smartcase = true vim.opt.ignorecase = true diff --git a/nvim/.config/nvim/lua/plugins/diffview.lua b/nvim/.config/nvim/lua/plugins/diffview.lua new file mode 100644 index 0000000..b223c0d --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/diffview.lua @@ -0,0 +1,4 @@ +return { + "sindrets/diffview.nvim", + lazy = false, +} diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua b/nvim/.config/nvim/lua/plugins/neo-tree.lua deleted file mode 100644 index 488ca77..0000000 --- a/nvim/.config/nvim/lua/plugins/neo-tree.lua +++ /dev/null @@ -1,98 +0,0 @@ --- return { --- "nvim-neo-tree/neo-tree.nvim", --- dependencies = { --- "nvim-lua/plenary.nvim", --- "nvim-tree/nvim-web-devicons", --- "MunifTanjim/nui.nvim", --- }, --- event = "VeryLazy", --- keys = { --- { "", ":Neotree toggle float", silent = true, desc = "Float File Explorer" }, --- { "e", ":Neotree toggle left", silent = true, desc = "Left File Explorer" }, --- }, --- config = function() --- require("neo-tree").setup({ --- close_if_last_window = true, --- popup_border_style = "single", --- enable_git_status = true, --- enable_modified_markers = true, --- enable_diagnostics = true, --- sort_case_insensitive = true, --- default_component_configs = { --- indent = { --- with_markers = true, --- with_expanders = true, --- }, --- modified = { --- symbol = " ", --- highlight = "NeoTreeModified", --- }, --- icon = { --- folder_closed = "", --- folder_open = "", --- folder_empty = "", --- folder_empty_open = "", --- }, --- git_status = { --- symbols = { --- -- Change type --- added = "", --- deleted = "", --- modified = "", --- renamed = "", --- -- Status type --- untracked = "", --- ignored = "", --- unstaged = "", --- staged = "", --- conflict = "", --- }, --- }, --- }, --- window = { --- position = "float", --- width = 35, --- }, --- filesystem = { --- use_libuv_file_watcher = true, --- filtered_items = { --- hide_dotfiles = false, --- hide_gitignored = false, --- hide_by_name = { --- "node_modules", --- }, --- never_show = { --- ".DS_Store", --- "thumbs.db", --- }, --- }, --- }, --- source_selector = { --- winbar = true, --- sources = { --- { source = "filesystem", display_name = "  Files " }, --- { source = "buffers", display_name = "  Bufs " }, --- { source = "git_status", display_name = "  Git " }, --- }, --- }, --- event_handlers = { --- { --- event = "neo_tree_window_after_open", --- handler = function(args) --- if args.position == "left" or args.position == "right" then --- vim.cmd("wincmd =") --- end --- end, --- }, --- { --- event = "neo_tree_window_after_close", --- handler = function(args) --- if args.position == "left" or args.position == "right" then --- vim.cmd("wincmd =") --- end --- end, --- }, --- }, --- }) --- end, --- } diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua.old b/nvim/.config/nvim/lua/plugins/neo-tree.lua.old new file mode 100644 index 0000000..488ca77 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/neo-tree.lua.old @@ -0,0 +1,98 @@ +-- return { +-- "nvim-neo-tree/neo-tree.nvim", +-- dependencies = { +-- "nvim-lua/plenary.nvim", +-- "nvim-tree/nvim-web-devicons", +-- "MunifTanjim/nui.nvim", +-- }, +-- event = "VeryLazy", +-- keys = { +-- { "", ":Neotree toggle float", silent = true, desc = "Float File Explorer" }, +-- { "e", ":Neotree toggle left", silent = true, desc = "Left File Explorer" }, +-- }, +-- config = function() +-- require("neo-tree").setup({ +-- close_if_last_window = true, +-- popup_border_style = "single", +-- enable_git_status = true, +-- enable_modified_markers = true, +-- enable_diagnostics = true, +-- sort_case_insensitive = true, +-- default_component_configs = { +-- indent = { +-- with_markers = true, +-- with_expanders = true, +-- }, +-- modified = { +-- symbol = " ", +-- highlight = "NeoTreeModified", +-- }, +-- icon = { +-- folder_closed = "", +-- folder_open = "", +-- folder_empty = "", +-- folder_empty_open = "", +-- }, +-- git_status = { +-- symbols = { +-- -- Change type +-- added = "", +-- deleted = "", +-- modified = "", +-- renamed = "", +-- -- Status type +-- untracked = "", +-- ignored = "", +-- unstaged = "", +-- staged = "", +-- conflict = "", +-- }, +-- }, +-- }, +-- window = { +-- position = "float", +-- width = 35, +-- }, +-- filesystem = { +-- use_libuv_file_watcher = true, +-- filtered_items = { +-- hide_dotfiles = false, +-- hide_gitignored = false, +-- hide_by_name = { +-- "node_modules", +-- }, +-- never_show = { +-- ".DS_Store", +-- "thumbs.db", +-- }, +-- }, +-- }, +-- source_selector = { +-- winbar = true, +-- sources = { +-- { source = "filesystem", display_name = "  Files " }, +-- { source = "buffers", display_name = "  Bufs " }, +-- { source = "git_status", display_name = "  Git " }, +-- }, +-- }, +-- event_handlers = { +-- { +-- event = "neo_tree_window_after_open", +-- handler = function(args) +-- if args.position == "left" or args.position == "right" then +-- vim.cmd("wincmd =") +-- end +-- end, +-- }, +-- { +-- event = "neo_tree_window_after_close", +-- handler = function(args) +-- if args.position == "left" or args.position == "right" then +-- vim.cmd("wincmd =") +-- end +-- end, +-- }, +-- }, +-- }) +-- end, +-- } diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index 40817dc..11ddbbc 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -54,6 +54,26 @@ return { end, desc = "Find Keymaps", }, + { + "cd", + function() + local actions = require("telescope.actions") + local action_state = require("telescope.actions.state") + + require("telescope.builtin").git_commits({ + attach_mappings = function(prompt_bufnr, _) + actions.select_default:replace(function() + actions.close(prompt_bufnr) + local entry = action_state.get_selected_entry() + local commit = entry.value + vim.cmd("DiffviewOpen " .. commit .. "..HEAD") + end) + return true + end, + }) + end, + desc = "Diff between current commit and an arbitrary commit", + }, { "fw", function() -- cgit v1.2.3