diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index b865afe..ebee295 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,69 +1,64 @@ { - "LazyVim": { "branch": "main", "commit": "9b4675ddde38fdae09978bd7dbdba83ec91f4d80" }, - "LuaSnip": { "branch": "master", "commit": "8f3d3465ba5c7ade0a8adb41eca5736f291a3fa8" }, - "SchemaStore.nvim": { "branch": "main", "commit": "f8b00bba94eab372e0c29605568a7ec323e30620" }, - "bufferline.nvim": { "branch": "main", "commit": "73540cb95f8d95aa1af3ed57713c6720c78af915" }, - "catppuccin": { "branch": "main", "commit": "a1439ad7c584efb3d0ce14ccb835967f030450fe" }, + "LazyVim": { "branch": "main", "commit": "0f6ff53ce336082869314db11e9dfa487cf83292" }, + "SchemaStore.nvim": { "branch": "main", "commit": "9a5992a881583d886bfbb46631a09f736f0fae50" }, + "bufferline.nvim": { "branch": "main", "commit": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe" }, + "catppuccin": { "branch": "main", "commit": "5215ea59df6d0a7e27da9a5cd1165e06d1b04cbe" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "12b3995537f52ba2810a9857e8ca256881febbda" }, - "crates.nvim": { "branch": "main", "commit": "f00e11e8282b94f2a2e938d32712c99f0e0bdeb4" }, - "dashboard-nvim": { "branch": "master", "commit": "1c8b82c5b02bb890862538be2061e37ef801a99b" }, - "diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" }, - "dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" }, - "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "d5f74ce4dfdd82848f3f4eac65fe6e29ac5df4c2" }, + "conform.nvim": { "branch": "master", "commit": "f3b930db4964d60e255c8f9e37b7f2218dfc08cb" }, + "crates.nvim": { "branch": "main", "commit": "d556c00d60c9421c913ee54ff690df2a34f6264e" }, + "dashboard-nvim": { "branch": "master", "commit": "5182c09ac8085dc73b78ad0ea9f5479c9a866fc4" }, + "diffview.nvim": { "branch": "main", "commit": "1ec7b56b959dab18f7030f541c33ae60e18a6f88" }, + "dressing.nvim": { "branch": "master", "commit": "3c38ac861e1b8d4077ff46a779cde17330b29f3a" }, + "flash.nvim": { "branch": "main", "commit": "11a2e667d19d8f48c93c6ed2e2e525ac6b1b79be" }, + "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, "git-worktree": { "branch": "main", "commit": "b6f06312850ec2657921484c1c7c34ff0468f4f2" }, - "gitsigns.nvim": { "branch": "main", "commit": "035da036e68e509ed158414416c827d022d914bd" }, + "gitsigns.nvim": { "branch": "main", "commit": "cdfcd9d39d23c46ae9a040de2c6a8b8bf868746e" }, "gleam.vim": { "branch": "master", "commit": "6739d8b656adb5d2807675b7652afb6e257b2b1c" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "headlines.nvim": { "branch": "master", "commit": "618ef1b2502c565c82254ef7d5b04402194d9ce3" }, - "indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "jinja.vim": { "branch": "master", "commit": "51b8a2a504416c4959127c82eac26f14f3508975" }, - "lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" }, + "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "273fdde8ac5e51f3a223ba70980e52bbc09d9f6f" }, - "mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" }, - "mini.ai": { "branch": "main", "commit": "98e45e6832351354e41e82b32a80ce7537c20746" }, - "mini.animate": { "branch": "main", "commit": "82519630b2760ffc516ebc387bef632f9c07b9f5" }, - "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, - "mini.comment": { "branch": "main", "commit": "f9f1a646fd3d9df7397aa1b9550a875fe8189eb0" }, - "mini.indentscope": { "branch": "main", "commit": "a8274b6ea2d868198d27bd91a31ed5ea3a6a5744" }, - "mini.surround": { "branch": "main", "commit": "a00d69be09e3fe27dfa9e5b0298410d0e148e3e2" }, - "neoconf.nvim": { "branch": "main", "commit": "ba3503e246ea687732e51f7f9878e653e2e2039b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, + "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, + "mini.ai": { "branch": "main", "commit": "7859b6344f5cee567a94f173859d25e20ba1a77e" }, + "mini.animate": { "branch": "main", "commit": "0a35f6db55cfac04a0999abe3465f7b692dc56a7" }, + "mini.hipatterns": { "branch": "main", "commit": "427712c754bfdccd8da7073576cd8e2586c0fe93" }, + "mini.indentscope": { "branch": "main", "commit": "f0d7faa064c892b96997810afcddfadc3f2a15b3" }, + "neoconf.nvim": { "branch": "main", "commit": "4e204e0d423e70293b81ba1655ed17e1f3c97986" }, "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "neogit": { "branch": "master", "commit": "0cae7abc30cb91d661f28257c331fcb5b5198e31" }, - "noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" }, - "nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" }, - "nvim-cmp": { "branch": "main", "commit": "8f3c541407e691af6163e2447f3af1bd6e17f9a3" }, - "nvim-lint": { "branch": "master", "commit": "f098232d70cebe90e27404928c9bc19ca7a5a7b5" }, - "nvim-lspconfig": { "branch": "master", "commit": "ae0651d850f8f9313d4db3f96fe24dbf054edeb4" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-spectre": { "branch": "master", "commit": "026394a8458d62c6b7b305c076ce675420dbaa4c" }, - "nvim-treesitter": { "branch": "master", "commit": "160e5d52c841dc9261c0b2dc6f253bddbcf3d766" }, - "nvim-treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "23b820146956b3b681c19e10d3a8bc0cbd9a1d4c" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" }, - "nvim-web-devicons": { "branch": "master", "commit": "794bba734ec95eaff9bb82fbd112473be2087283" }, - "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, - "plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" }, - "rustaceanvim": { "branch": "master", "commit": "cd35b0f7fb0c9fe6879b084096230a74fefa4da8" }, + "neogit": { "branch": "master", "commit": "70ad95be902ee69b56410a5cfc690dd03104edb3" }, + "noice.nvim": { "branch": "main", "commit": "f119045f38792ad5311e5f9be7a879e4c1a95fe0" }, + "nui.nvim": { "branch": "main", "commit": "b1b3dcd6ed8f355c78bad3d395ff645be5f8b6ae" }, + "nvim-ansible": { "branch": "main", "commit": "cb5d0cc79c1864b72d5ae40a926a1176b18f1b65" }, + "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-lint": { "branch": "master", "commit": "e19842a05aae484957ad20710444757bc0a61d63" }, + "nvim-lspconfig": { "branch": "master", "commit": "b972e7154bc94ab4ecdbb38c8edbccac36f83996" }, + "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, + "nvim-snippets": { "branch": "main", "commit": "67f44a552f03b5de23af1900d01af3256a3da2bc" }, + "nvim-spectre": { "branch": "master", "commit": "5690ea46baf08bbc1623980012e14b6239ce582e" }, + "nvim-treesitter": { "branch": "master", "commit": "488e39a8f1fcb7935deaaf1852e3d6c28ca253d0" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" }, + "nvim-ts-autotag": { "branch": "main", "commit": "8ae54b90e36ef1fc5267214b30c2cbff71525fe4" }, + "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, + "oil.nvim": { "branch": "master", "commit": "2cb39e838e9dcd8b374f09a3a87a2e5ec9d372f6" }, + "persistence.nvim": { "branch": "main", "commit": "5fe077056c821aab41f87650bd6e1c48cd7dd047" }, + "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "rustaceanvim": { "branch": "master", "commit": "e306c742bd7f7183e371cd91268b72d9db1bbae0" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope.nvim": { "branch": "master", "commit": "35f94f0ef32d70e3664a703cefbe71bd1456d899" }, - "todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" }, - "tokyonight.nvim": { "branch": "main", "commit": "67afeaf7fd6ebba000633e89f63c31694057edde" }, - "treesitter-context": { "branch": "master", "commit": "4fe0a54e86859744968e1a5c7867b49c86855774" }, - "treesitter-just": { "branch": "main", "commit": "6c2f018ab1d90946c0ce029bb2f7d57f56895dff" }, - "trouble.nvim": { "branch": "main", "commit": "b9cf677f20bb2faa2dacfa870b084e568dca9572" }, - "venv-selector.nvim": { "branch": "main", "commit": "3c57922256e7e26205a25f5a42ecf7104d9f2c78" }, - "vim-alloy": { "branch": "main", "commit": "0334fc8c273ba77b607a86c8167bab3d52a166bd" }, - "vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" }, - "vim-just": { "branch": "main", "commit": "a2777b4b113dafc639f541ad4f0f7da0adc640f4" }, - "vim-startuptime": { "branch": "master", "commit": "ac2cccb5be617672add1f4f3c0a55ce99ba34e01" }, + "telescope.nvim": { "branch": "master", "commit": "c2ce039188e22288449e43b77710036e69a45a70" }, + "todo-comments.nvim": { "branch": "main", "commit": "e1549807066947818113a7d7ed48f637e49620d3" }, + "tokyonight.nvim": { "branch": "main", "commit": "b9b494fa7f7bbf2fe0747b47fa290fb7a4eddcc7" }, + "treesitter-just": { "branch": "main", "commit": "fd814fc6c579f68c2a642f5e0268cf69daae92d7" }, + "trouble.nvim": { "branch": "main", "commit": "a8264a65a0b894832ea642844f5b7c30112c458f" }, + "ts-comments.nvim": { "branch": "main", "commit": "f7ded340b4c6b317593b867838bf7ace354a67d4" }, + "venv-selector.nvim": { "branch": "main", "commit": "6a1b15eb35bbb827b6db428055087e2dbf32838f" }, + "vim-alloy": { "branch": "main", "commit": "0273f88f7199189f9a0f32213a34ab778e226f86" }, + "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, + "vim-just": { "branch": "main", "commit": "c78416aebe147ac7db304c26b32a52dae5985f6e" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/.config/nvim/lazyvim.json b/.config/nvim/lazyvim.json index f03853f..754f67b 100644 --- a/.config/nvim/lazyvim.json +++ b/.config/nvim/lazyvim.json @@ -1,9 +1,12 @@ { "extras": [ - + "lazyvim.plugins.extras.lang.ansible", + "lazyvim.plugins.extras.lang.toml", + "lazyvim.plugins.extras.ui.mini-indentscope", + "lazyvim.plugins.extras.util.mini-hipatterns" ], "news": { - "NEWS.md": "3314" + "NEWS.md": "4964" }, - "version": 3 + "version": 4 } \ No newline at end of file diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua index bc4bb41..46b4249 100644 --- a/.config/nvim/lua/config/lazy.lua +++ b/.config/nvim/lua/config/lazy.lua @@ -1,4 +1,5 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + if not vim.loop.fs_stat(lazypath) then -- bootstrap lazy.nvim vim.fn.system({ @@ -45,6 +46,7 @@ require("lazy").setup({ "gzip", -- "matchit", -- "matchparen", + "netrwPlugin", "tarPlugin", "tohtml", "tutor", diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index 49ba591..2d6c960 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -4,13 +4,6 @@ local opt = vim.opt --- Turn off netrw directory banner and use a nicer listing style -vim.g.netrw_banner = 0 -vim.g.netrw_liststyle = 3 -vim.g.netrw_fastbrowse = 1 -vim.g.netrw_browse_split = 0 -vim.g.netrw_altv = 1 - vim.g.loaded_perl_provider = 0 vim.g.loaded_python3_provider = 0 vim.g.loaded_node_provider = 0 @@ -46,28 +39,32 @@ opt.undofile = true opt.colorcolumn = "100" opt.wrap = false +-- +opt.inccommand = "split" + -- This allows '@' in filenames opt.isfname:append("@-@") -- Better completopt experience -opt.completeopt = "menuone,noselect" +opt.completeopt = { "menu", "menuone", "noselect" } vim.filetype.add({ - extension = { - service = "systemd", - socket = "systemd", - container = "systemd", - image = "systemd", - network = "systemd", - ["container.j2"] = "systemd.jinja", - ["service.j2"] = "systemd.jinja", - ["socket.j2"] = "systemd.jinja", - ["network.j2"] = "systemd.jinja", - ["image.j2"] = "systemd.jinja", - ["yml.j2"] = "yaml.jinja", - ["alloy.j2"] = "alloy.jinja", - }, - pattern = { - [".*/sway/conf%.d/.*"] = "swayconfig", - }, + extension = { + service = "systemd", + socket = "systemd", + container = "systemd", + image = "systemd", + network = "systemd", + ["container.j2"] = "systemd.jinja", + ["service.j2"] = "systemd.jinja", + ["socket.j2"] = "systemd.jinja", + ["network.j2"] = "systemd.jinja", + ["image.j2"] = "systemd.jinja", + ["yml.j2"] = "yaml.jinja", + ["yaml.j2"] = "yaml.jinja", + ["alloy.j2"] = "alloy.jinja", + }, + pattern = { + [".*/sway/conf%.d/.*"] = "swayconfig", + }, }) diff --git a/.config/nvim/lua/plugins/alloy.lua b/.config/nvim/lua/plugins/alloy.lua index 4c2b75d..ff96962 100644 --- a/.config/nvim/lua/plugins/alloy.lua +++ b/.config/nvim/lua/plugins/alloy.lua @@ -1,3 +1,3 @@ return { - "grafana/vim-alloy", + "grafana/vim-alloy", } diff --git a/.config/nvim/lua/plugins/caddyfile.lua b/.config/nvim/lua/plugins/caddyfile.lua new file mode 100644 index 0000000..51a990e --- /dev/null +++ b/.config/nvim/lua/plugins/caddyfile.lua @@ -0,0 +1,3 @@ +return { + "isobit/vim-caddyfile", +} diff --git a/.config/nvim/lua/plugins/disabled.lua b/.config/nvim/lua/plugins/disabled.lua index a65f247..8093ed9 100644 --- a/.config/nvim/lua/plugins/disabled.lua +++ b/.config/nvim/lua/plugins/disabled.lua @@ -1,5 +1,5 @@ return { - { "nvim-neo-tree/neo-tree.nvim", enabled = false, keys = false }, - { "echasnovski/mini.pairs", enabled = false, keys = false }, - { "kdheepak/lazygit.nvim", enabled = false, keys = false }, + { "nvim-neo-tree/neo-tree.nvim", enabled = false, keys = false }, + { "echasnovski/mini.pairs", enabled = false, keys = false }, + { "kdheepak/lazygit.nvim", enabled = false, keys = false }, } diff --git a/.config/nvim/lua/plugins/git-worktree.lua b/.config/nvim/lua/plugins/git-worktree.lua index 920c21e..196a2c8 100644 --- a/.config/nvim/lua/plugins/git-worktree.lua +++ b/.config/nvim/lua/plugins/git-worktree.lua @@ -1,52 +1,55 @@ return { - "polarmutex/git-worktree.nvim", - name = "git-worktree", - config = function() - require("telescope").load_extension("git_worktree") + "polarmutex/git-worktree.nvim", + name = "git-worktree", + config = function() + require("telescope").load_extension("git_worktree") - vim.keymap.set( - "n", - "gw", - "lua require('telescope').extensions.git_worktree.git_worktrees()", - { desc = "worktrees" } - ) - vim.keymap.set( - "n", - "gW", - "lua require('telescope').extensions.git_worktree.create_git_worktree()", - { desc = "worktree create" } - ) - end, - opts = function() - local Worktree = require("git-worktree") - Worktree.on_tree_change(function(op, metadata) - if op == Worktree.Operations.Create then - local Path = require("plenary.path") - local Job = require("plenary.job") - -- If we're dealing with create, the path is relative to the worktree and not absolute - -- so we need to convert it to an absolute path. - local git_path = metadata.path - if not Path:new(git_path):is_absolute() then - git_path = Path:new():absolute() - if git_path:sub(-#"/") == "/" then - git_path = string.sub(git_path, 1, string.len(git_path) - 1) - end - end - print(git_path) - -- git_path = string.match(git_path, "(.-)%.git") .. ".git" - -- bare_repo_path = - if Path:new(git_path .. "/.symlink"):exists() then - local worktree_path = git_path .. "/" .. metadata.path .. "/" - local link_gitignored_cmd = "ln -s " .. git_path .. "/.symlink/* " .. worktree_path - os.execute(link_gitignored_cmd) - end - -- Job:new({ - -- "git", - -- "branch", - -- "-u origin/" .. metadata.branch, - -- }):start() - --TODO setup branch tracking via `git branch -u origin/` - end - end) - end, + vim.keymap.set( + "n", + "gw", + "lua require('telescope').extensions.git_worktree.git_worktrees()", + { desc = "worktrees" } + ) + vim.keymap.set( + "n", + "gW", + "lua require('telescope').extensions.git_worktree.create_git_worktree()", + { desc = "worktree create" } + ) + end, + opts = function() + local Worktree = require("git-worktree") + Worktree.on_tree_change(function(op, metadata) + if op == Worktree.Operations.Create then + local Path = require("plenary.path") + local Job = require("plenary.job") + -- If we're dealing with create, the path is relative to the worktree and not absolute + -- so we need to convert it to an absolute path. + local git_path = metadata.path + if not Path:new(git_path):is_absolute() then + git_path = Path:new():absolute() + if git_path:sub(-#"/") == "/" then + git_path = string.sub(git_path, 1, string.len(git_path) - 1) + end + end + print(git_path) + -- git_path = string.match(git_path, "(.-)%.git") .. ".git" + -- bare_repo_path = + if Path:new(git_path .. "/.symlink"):exists() then + local worktree_path = git_path .. "/" .. metadata.path .. "/" + local link_gitignored_cmd = "ln -s " + .. git_path + .. "/.symlink/* " + .. worktree_path + os.execute(link_gitignored_cmd) + end + -- Job:new({ + -- "git", + -- "branch", + -- "-u origin/" .. metadata.branch, + -- }):start() + --TODO setup branch tracking via `git branch -u origin/` + end + end) + end, } diff --git a/.config/nvim/lua/plugins/gitsigns.lua b/.config/nvim/lua/plugins/gitsigns.lua index 7835f77..eb0f361 100644 --- a/.config/nvim/lua/plugins/gitsigns.lua +++ b/.config/nvim/lua/plugins/gitsigns.lua @@ -1,64 +1,64 @@ return { - "lewis6991/gitsigns.nvim", - opt = { - signs = { - add = { text = "+" }, - change = { text = "~" }, - delete = { text = "_" }, - topdelete = { text = "‾" }, - changedelete = { text = "~" }, + "lewis6991/gitsigns.nvim", + opt = { + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + current_line_blame = false, + on_attach = function(bufnr) + local gs = package.loaded.gitsigns + + local function map(mode, l, r, opts) + opts = opts or {} + opts.buffer = bufnr + vim.keymap.set(mode, l, r, opts) + end + + -- Navigation + map("n", "]c", function() + if vim.wo.diff then + return "]c" + end + vim.schedule(function() + gs.next_hunk() + end) + return "" + end, { expr = true }) + + map("n", "[c", function() + if vim.wo.diff then + return "[c" + end + vim.schedule(function() + gs.prev_hunk() + end) + return "" + end, { expr = true }) + + -- Actions + map({ "n", "v" }, "hs", ":Gitsigns stage_hunk") + map({ "n", "v" }, "hr", ":Gitsigns reset_hunk") + map("n", "hS", gs.stage_buffer) + map("n", "ha", gs.stage_hunk) + map("n", "hu", gs.undo_stage_hunk) + map("n", "hR", gs.reset_buffer) + map("n", "hp", gs.preview_hunk) + map("n", "hb", function() + gs.blame_line({ full = true }) + end) + map("n", "tb", gs.toggle_current_line_blame) + map("n", "hd", gs.diffthis) + map("n", "hD", function() + gs.diffthis("~") + end) + map("n", "td", gs.toggle_deleted) + + -- Text object + map({ "o", "x" }, "ih", ":Gitsigns select_hunk") + end, }, - current_line_blame = false, - on_attach = function(bufnr) - local gs = package.loaded.gitsigns - - local function map(mode, l, r, opts) - opts = opts or {} - opts.buffer = bufnr - vim.keymap.set(mode, l, r, opts) - end - - -- Navigation - map("n", "]c", function() - if vim.wo.diff then - return "]c" - end - vim.schedule(function() - gs.next_hunk() - end) - return "" - end, { expr = true }) - - map("n", "[c", function() - if vim.wo.diff then - return "[c" - end - vim.schedule(function() - gs.prev_hunk() - end) - return "" - end, { expr = true }) - - -- Actions - map({ "n", "v" }, "hs", ":Gitsigns stage_hunk") - map({ "n", "v" }, "hr", ":Gitsigns reset_hunk") - map("n", "hS", gs.stage_buffer) - map("n", "ha", gs.stage_hunk) - map("n", "hu", gs.undo_stage_hunk) - map("n", "hR", gs.reset_buffer) - map("n", "hp", gs.preview_hunk) - map("n", "hb", function() - gs.blame_line({ full = true }) - end) - map("n", "tb", gs.toggle_current_line_blame) - map("n", "hd", gs.diffthis) - map("n", "hD", function() - gs.diffthis("~") - end) - map("n", "td", gs.toggle_deleted) - - -- Text object - map({ "o", "x" }, "ih", ":Gitsigns select_hunk") - end, - }, } diff --git a/.config/nvim/lua/plugins/gleam.lua b/.config/nvim/lua/plugins/gleam.lua index e573971..0ac9421 100644 --- a/.config/nvim/lua/plugins/gleam.lua +++ b/.config/nvim/lua/plugins/gleam.lua @@ -1,3 +1,3 @@ return { - "gleam-lang/gleam.vim", + "gleam-lang/gleam.vim", } diff --git a/.config/nvim/lua/plugins/jinja.lua b/.config/nvim/lua/plugins/jinja.lua index 2792a27..77628b7 100644 --- a/.config/nvim/lua/plugins/jinja.lua +++ b/.config/nvim/lua/plugins/jinja.lua @@ -1,3 +1,3 @@ return { - "HiPhish/jinja.vim", + "HiPhish/jinja.vim", } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 18d3a2e..c989d60 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,14 +1,14 @@ return { - "neovim/nvim-lspconfig", - opts = { - servers = { - pyright = { - mason = false, - autostart = false, - }, - gleam = { - mason = false, - }, + "neovim/nvim-lspconfig", + opts = { + servers = { + pyright = { + mason = false, + autostart = false, + }, + gleam = { + mason = false, + }, + }, }, - }, } diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua index 6c3f6e8..c50a5f8 100644 --- a/.config/nvim/lua/plugins/neogit.lua +++ b/.config/nvim/lua/plugins/neogit.lua @@ -1,9 +1,9 @@ return { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", - "sindrets/diffview.nvim", - "nvim-telescope/telescope.nvim", - }, - config = true, + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", + "sindrets/diffview.nvim", + "nvim-telescope/telescope.nvim", + }, + config = true, } diff --git a/.config/nvim/lua/plugins/oil.lua b/.config/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..8a781d1 --- /dev/null +++ b/.config/nvim/lua/plugins/oil.lua @@ -0,0 +1,19 @@ +return { + "stevearc/oil.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("oil").setup({ + columns = { "icon" }, + view_options = { + show_hidden = true, + }, + }) + -- vim.keymap.set("n", "e", "Oil", { desc = "Open parent directory" }) + vim.keymap.set( + "n", + "e", + require("oil").toggle_float, + { desc = "Open parent directory (floating)" } + ) + end, +} diff --git a/.config/nvim/lua/plugins/tab_stuff.lua b/.config/nvim/lua/plugins/tab_stuff.lua deleted file mode 100644 index 390ff1e..0000000 --- a/.config/nvim/lua/plugins/tab_stuff.lua +++ /dev/null @@ -1,59 +0,0 @@ -return { - -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - unpack = unpack or table.unpack - local line, col = unpack(vim.api.nvim_win_get_cursor(0)) - return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil - end - - local luasnip = require("luasnip") - local cmp = require("cmp") - - opts.preselect = cmp.PreselectMode.None - opts.completion = { - completeopt = "noselect", - } - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- they way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping.confirm({ select = false }), - }) - end, - }, -} diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 372646d..75b8090 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -1,16 +1,18 @@ return { - "nvim-telescope/telescope.nvim", - keys = { - { "", "Telescope find_files", desc = "Find Files" }, - { "ff", "Telescope find_files", desc = "Find Files" }, - { "fg", "Telescope git_files", desc = "Find Git Files" }, - -- add a keymap to browse plugin files - { - "fp", - function() - require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) - end, - desc = "Find Plugin File", + "nvim-telescope/telescope.nvim", + keys = { + { "", "Telescope find_files", desc = "Find Files" }, + { "ff", "Telescope find_files", desc = "Find Files" }, + { "fg", "Telescope git_files", desc = "Find Git Files" }, + -- add a keymap to browse plugin files + { + "fp", + function() + require("telescope.builtin").find_files({ + cwd = require("lazy.core.config").options.root, + }) + end, + desc = "Find Plugin File", + }, }, - }, } diff --git a/.config/nvim/lua/plugins/treesitter-context.lua b/.config/nvim/lua/plugins/treesitter-context.lua deleted file mode 100644 index 9a7700c..0000000 --- a/.config/nvim/lua/plugins/treesitter-context.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter-context", - name = "treesitter-context", -} diff --git a/.config/nvim/lua/plugins/treesitter-just.lua b/.config/nvim/lua/plugins/treesitter-just.lua index 4e7308a..cd60618 100644 --- a/.config/nvim/lua/plugins/treesitter-just.lua +++ b/.config/nvim/lua/plugins/treesitter-just.lua @@ -1,4 +1,4 @@ return { - "IndianBoy42/tree-sitter-just", - name = "treesitter-just", + "IndianBoy42/tree-sitter-just", + name = "treesitter-just", } diff --git a/.config/nvim/lua/plugins/vim-just.lua b/.config/nvim/lua/plugins/vim-just.lua index 38e03cc..5966453 100644 --- a/.config/nvim/lua/plugins/vim-just.lua +++ b/.config/nvim/lua/plugins/vim-just.lua @@ -1,4 +1,4 @@ return { - "NoahTheDuke/vim-just", - name = "vim-just", + "NoahTheDuke/vim-just", + name = "vim-just", } diff --git a/.config/nvim/stylua.toml b/.config/nvim/stylua.toml index 5d6c50d..d4a4951 100644 --- a/.config/nvim/stylua.toml +++ b/.config/nvim/stylua.toml @@ -1,3 +1,3 @@ indent_type = "Spaces" -indent_width = 2 -column_width = 120 \ No newline at end of file +indent_width = 4 +column_width = 100