diff --git a/.config/fish/functions/cfg.fish b/.config/fish/functions/cfg.fish index d3b0fd7..1ca3004 100644 --- a/.config/fish/functions/cfg.fish +++ b/.config/fish/functions/cfg.fish @@ -1,4 +1,3 @@ -function cfg --wraps='/usr/bin/git --git-dir=$HOME/.cfgstore/ --work-tree=$HOME' --description 'alias cfg=/usr/bin/git --git-dir=$HOME/.cfgstore/ --work-tree=$HOME' - /usr/bin/git --git-dir=$HOME/.cfgstore/ --work-tree=$HOME $argv - +function cfg --wraps='/usr/bin/git --git-dir=$HOME/.cfgstore/ --work-tree=$HOME' --wraps='lg --git-dir=$HOME/.cfgstore/ --work-tree=$HOME' --description 'alias cfg=lg --git-dir=$HOME/.cfgstore/ --work-tree=$HOME' + lg --git-dir=$HOME/.cfgstore/ --work-tree=$HOME $argv end diff --git a/.config/lazygit/config.yml b/.config/lazygit/config.yml index 808ddf7..17c7989 100644 --- a/.config/lazygit/config.yml +++ b/.config/lazygit/config.yml @@ -384,44 +384,44 @@ quitOnTopLevelReturn: false # Config relating to things outside of Lazygit like how files are opened, copying to clipboard, etc os: # Command for editing a file. Should contain "{{filename}}". - edit: "" + # edit: "" # Command for editing a file at a given line number. Should contain # "{{filename}}", and may optionally contain "{{line}}". - editAtLine: "" + # editAtLine: "" # Same as EditAtLine, except that the command needs to wait until the # window is closed. - editAtLineAndWait: "" + # editAtLineAndWait: "" # Whether lazygit suspends until an edit process returns - editInTerminal: false + # editInTerminal: false # For opening a directory in an editor - openDirInEditor: "" + # openDirInEditor: "" # A built-in preset that sets all of the above settings. Supported presets # are defined in the getPreset function in editor_presets.go. - editPreset: "" + # editPreset: "" # Command for opening a file, as if the file is double-clicked. Should # contain "{{filename}}", but doesn't support "{{line}}". - open: "" + # open: "" # Command for opening a link. Should contain "{{link}}". - openLink: "" + # openLink: "" # CopyToClipboardCmd is the command for copying to clipboard. # See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-command-for-copying-to-and-pasting-from-clipboard - copyToClipboardCmd: "" + # copyToClipboardCmd: "" # ReadFromClipboardCmd is the command for reading the clipboard. # See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#custom-command-for-copying-to-and-pasting-from-clipboard - readFromClipboardCmd: "" + # readFromClipboardCmd: "" # A shell startup file containing shell aliases or shell functions. This will be sourced before running any shell commands, so that shell functions are available in the `:` command prompt or even in custom commands. # See https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md#using-aliases-or-functions-in-shell-commands - shellFunctionsFile: "" + # shellFunctionsFile: "" # If true, don't display introductory popups upon opening Lazygit. disableStartupPopups: false diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua index 3cefaaa..68765d5 100644 --- a/.config/nvim/lua/keymaps.lua +++ b/.config/nvim/lua/keymaps.lua @@ -1,52 +1,57 @@ -vim.keymap.set({ "n", "v" }, "", ":w ++p", { desc = "save file" }) -vim.keymap.set({ "i" }, "", ":w ++pa", { desc = "save file" }) -vim.keymap.set("n", ";", ":", { desc = "command with ;" }) -vim.keymap.set("v", ";", ":", { desc = "command with ;" }) -vim.keymap.set("n", "q", ":bd", { desc = "close buffer" }) -vim.keymap.set("n", "Q", ":%bd", { desc = "close all buffers" }) -vim.keymap.set({ "n", "v" }, "d", '"_d', { desc = "delete without cut" }) -vim.keymap.set({ "n", "v" }, "c", '"_c', { desc = "delete without cut" }) -vim.keymap.set({ "v", "n" }, "vv", "", { desc = "vv for visual block" }) -vim.keymap.set("i", "jj", "", { silent = true, desc = "back to normal with jj" }) -vim.keymap.set("v", "p", '"_dP', { desc = "do not overwrite 0 register when pasting over selection" }) +local map = vim.keymap.set + +map({ "n", "v" }, "", ":w ++p", { desc = "save file" }) +map({ "i" }, "", ":w ++pa", { desc = "save file" }) +map("n", ";", ":", { desc = "command with ;" }) +map("v", ";", ":", { desc = "command with ;" }) +map("n", "q", ":bd", { desc = "close buffer" }) +map("n", "Q", ":%bd", { desc = "close all buffers" }) +map({ "n", "v" }, "d", '"_d', { desc = "delete without cut" }) +map({ "n", "v" }, "c", '"_c', { desc = "delete without cut" }) +map({ "v", "n" }, "vv", "", { desc = "vv for visual block" }) +map("i", "jj", "", { silent = true, desc = "back to normal with jj" }) +map("v", "p", '"_dP', { desc = "do not overwrite 0 register when pasting over selection" }) -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to pres , which -- is not what someone will guess without a bit more experience. -- -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping -- or just use to exit terminal mode -vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) +map("t", "", "", { desc = "Exit terminal mode" }) -- TIP: Disable arrow keys in normal mode -vim.keymap.set("n", "", function() +map("n", "", function() vim.notify("Use h to move!!") end) -vim.keymap.set("n", "", function() +map("n", "", function() vim.notify("Use l to move!!") end) -vim.keymap.set("n", "", function() +map("n", "", function() vim.notify("Use k to move!!") end) -vim.keymap.set("n", "", function() +map("n", "", function() vim.notify("Use j to move!!") end) -vim.keymap.set("n", "", "", { silent = true, desc = "go back with mouse" }) -vim.keymap.set("n", "", "", { silent = true, desc = "go forward with mouse" }) +map("n", "", "", { silent = true, desc = "go back with mouse" }) +map("n", "", "", { silent = true, desc = "go forward with mouse" }) + +map("n", "bb", "e #", { desc = "Switch to Other Buffer" }) +map("n", "`", "e #", { desc = "Switch to Other Buffer" }) -- Keybindings to make split navigation easier. -- Use CTRL+ to switch between windows -- -- See `:help wincmd` for a list of all window commands -vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) +map("n", "", "", { desc = "Move focus to the left window" }) +map("n", "", "", { desc = "Move focus to the right window" }) +map("n", "", "", { desc = "Move focus to the lower window" }) +map("n", "", "", { desc = "Move focus to the upper window" }) -vim.keymap.set("n", "", ":bprevious", { desc = "Previous buffer" }) -vim.keymap.set("n", "", ":bnext", { desc = "Next buffer" }) +map("n", "", ":bprevious", { desc = "Previous buffer" }) +map("n", "", ":bnext", { desc = "Next buffer" }) -vim.keymap.set("v", "", function() +map("v", "", function() -- get contents of visual selection -- handle unpack deprecation table.unpack = table.unpack or unpack @@ -75,21 +80,30 @@ local default_diagnostics = function() }) end -vim.keymap.set("n", "dd", function() +map("n", "dd", function() vim.diagnostic.config({ virtual_lines = { current_line = true }, virtual_text = false }) default_diagnostics() end, { desc = "show diagnostics in virtual lines" }) -vim.keymap.set("n", "df", function() +map("n", "df", function() vim.diagnostic.config({ virtual_text = false }) vim.diagnostic.open_float({ scope = "line" }) default_diagnostics() end, { desc = "show diagnostics in floating window" }) -vim.keymap.set("n", "j", ":try | cprev | catch | clast | catch | endtryzz", { desc = "quickfix prev" }) -vim.keymap.set("n", "k", ":try | cnext | catch | cfirst | catch | endtryzz", { desc = "quickfix next" }) -vim.keymap.set("n", "qf", ":Cfilter! ", { desc = "quickfix filter" }) +map("n", "j", ":try | cprev | catch | clast | catch | endtryzz", { desc = "quickfix prev" }) +map("n", "k", ":try | cnext | catch | cfirst | catch | endtryzz", { desc = "quickfix next" }) +map("n", "qf", ":Cfilter! ", { desc = "quickfix filter" }) -vim.keymap.set("n", "K", function() +map("n", "K", function() vim.lsp.buf.hover({ border = "rounded" }) -end, { buffer = bufnr, desc = "vim.lsp.buf.hover()" }) +end, { desc = "vim.lsp.buf.hover()" }) + +-- Move lines +map("n", "", ":execute 'move .-' . (v:count1 + 1)==", { desc = "Move Up" }) +map("n", "", ":execute 'move .+' . v:count1==", { desc = "Move Down" }) +map("v", "", ":execute \"'<,'>move '>+\" . v:count1gv=gv", { desc = "Move Down" }) +map("v", "", ":execute \"'<,'>move '<-\" . (v:count1 + 1)gv=gv", { desc = "Move Up" }) + +map("v", "<", "", ">gv") diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua index 9fd98e5..b84ba49 100644 --- a/.config/nvim/lua/options.lua +++ b/.config/nvim/lua/options.lua @@ -47,8 +47,10 @@ vim.opt.smartcase = true -- but make it case sensitive if an uppercase is entere vim.g.clipboard = "wl-copy" vim.opt.clipboard:append("unnamedplus") --- Save undo history -vim.opt.undofile = true +vim.opt.backup = false -- Don't create backup files +vim.opt.writebackup = false -- Don't create backup before writing +vim.opt.swapfile = false -- Don't create swap files +vim.opt.undofile = true -- Persistent undo -- Off signcolumn on by default vim.opt.signcolumn = "no" diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index 161ef3c..93e02ce 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -3,6 +3,8 @@ vim.pack.add({ "https://github.com/folke/snacks.nvim" }) local Snacks = require("snacks") local exclude = { + -- "**/home/**", + -- "**/media/**", "**/.git/*", "**/.next/*", "**/.cursor/*", @@ -49,7 +51,12 @@ Snacks.setup({ layout = { fullscreen = true }, sources = { select = { layout = { fullscreen = false } }, - files = vim.tbl_deep_extend("force", { layout = { preset = "select", fullscreen = false } }, files), + files = { + ignored = true, + hidden = true, + exclude = exclude, + layout = { preset = "select", fullscreen = false }, + }, grep = files, lsp_symbols = files, explorer = { @@ -116,7 +123,7 @@ local keys = { { "sf", function() - Snacks.picker.files() + Snacks.picker.files({ exclude = exclude }) end, desc = "Find Files", },