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 --- aliases/.aliases/aliases | 3 +- ghostty/.config/ghostty/config | 2 +- git/.gitconfig | 49 +++++++++++++ kitty/.config/kitty/kitty.conf | 7 +- 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 ++++++ tmux/.tmux.conf | 6 ++ 12 files changed, 199 insertions(+), 106 deletions(-) create mode 100644 git/.gitconfig 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 diff --git a/aliases/.aliases/aliases b/aliases/.aliases/aliases index f50171e..7645284 100644 --- a/aliases/.aliases/aliases +++ b/aliases/.aliases/aliases @@ -40,7 +40,7 @@ alias fix-gpg-retrieve="gpg2 --keyserver-options auto-key-retrieve --receive-key alias fix-keyserver="[ -d ~/.gnupg ] || mkdir ~/.gnupg ; cp /etc/pacman.d/gnupg/gpg.conf ~/.gnupg/ ; echo 'done'" # Fix GPG server issues # Git and Version Control -alias gs='git status' # Count installed git packages +alias gs='git status -s' alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # Count installed git packages alias rg="rg --sort path" # Ripgrep with sorted results alias lg="lazygit" # Launch lazygit @@ -103,4 +103,3 @@ alias tosddm="sudo pacman -S sddm --noconfirm --needed ; sudo systemctl enable s # random stuff alias rfc="PAGER='nvim +Man!' rfc" alias ff="fastfetch" - diff --git a/ghostty/.config/ghostty/config b/ghostty/.config/ghostty/config index 486a6e8..ea4a907 100644 --- a/ghostty/.config/ghostty/config +++ b/ghostty/.config/ghostty/config @@ -12,7 +12,7 @@ font-family-italic = Monaspace Radon font-family-bold-italic = Monaspace Radon font-style = bold gtk-titlebar = false -background-opacity = 0.6 +background-opacity = 0.85 confirm-close-surface = false adjust-cell-height = 10% diff --git a/git/.gitconfig b/git/.gitconfig new file mode 100644 index 0000000..4f9d0cf --- /dev/null +++ b/git/.gitconfig @@ -0,0 +1,49 @@ +[core] + pager = delta + +[interactive] + diffFilter = delta --color-only + +[delta] + navigate = true # use n and N to move between diff sections + dark = true # or light = true, or omit for auto-detection + +[alias] + st = status -s + lol = log --oneline --graph --all + +[merge] + conflictstyle = zdiff3 + +[http] + version = HTTP/1.1 + postBuffer = 524288000 + +[user] + email = omar.professional8777@gmail.com + name = omagdy + +[diff] + tool = nvimdiff + +[difftool] + prompt = false + +[column] + ui = auto + +[branch] + sort = -committerdate + +[tag] + sort = version:refname + +[init] + defaultBranch = main + +[diff] + algorithm = histogram + colorMoved = plain + +[push] + autoSetupRemote = true diff --git a/kitty/.config/kitty/kitty.conf b/kitty/.config/kitty/kitty.conf index ac097d7..60cae83 100644 --- a/kitty/.config/kitty/kitty.conf +++ b/kitty/.config/kitty/kitty.conf @@ -939,14 +939,15 @@ inactive_tab_font_style normal #: }}} #: Color scheme {{{ -# foreground #dddddd -# background #000000 +# +background #181d1c +foreground #d4be98 #: The foreground and background colors # background_opacity 0.5 # background_opacity 0.50 -background_opacity 1.00 +background_opacity 0.80 #: The opacity of the background. A number between 0 and 1, where 1 is #: opaque and 0 is fully transparent. This will only work if 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() diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 4f9097c..d58ef3d 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -43,9 +43,15 @@ setw -g aggressive-resize on # don't detach tmux when killing a session set -g detach-on-destroy off +# required by yazi for image preview +set -g allow-passthrough on +set -ga update-environment TERM +set -ga update-environment TERM_PROGRAM + # address vim mode switching delay (http://superuser.com/a/252717/65504) set -s escape-time 0 + set -as terminal-features ",*:RGB" # set -g default-terminal "tmux-256color" set -ag terminal-overrides ",xterm-256color:RGB" -- cgit v1.2.3