From da7035666495a278bfc7885e4d9f11557f210357 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 17 Mar 2025 15:34:15 +0100 Subject: checkpoint --- lua/config/lazy.lua | 54 ++++++++++++++++++++++++++++++++++++++++++++++++- lua/config/map.lua | 2 ++ lua/config/projects.lua | 24 ++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 lua/config/projects.lua (limited to 'lua') diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index d29aa3a..1bd0b8a 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -19,7 +19,59 @@ require("lazy").setup({ "lewis6991/gitsigns.nvim", "tpope/vim-vinegar", "tpope/vim-eunuch", - "mg979/vim-visual-multi", + -- "mg979/vim-visual-multi", + { + "brenton-leighton/multiple-cursors.nvim", + version = "*", -- Use the latest tagged version + opts = { + custom_key_maps = { + { + "n", + "", + function() + require("multiple-cursors").align() + end, + }, + }, + }, + keys = { + { "", "MultipleCursorsAddDown", mode = { "n", "x" }, desc = "Add cursor and move down" }, + { "", "MultipleCursorsAddUp", mode = { "n", "x" }, desc = "Add cursor and move up" }, + + { "", "MultipleCursorsAddUp", mode = { "n", "i", "x" }, desc = "Add cursor and move up" }, + { + "", + "MultipleCursorsAddDown", + mode = { "n", "i", "x" }, + desc = "Add cursor and move down", + }, + + { + "m", + "MultipleCursorsAddVisualArea", + mode = { "x" }, + desc = "Add cursors to the lines of the visual area", + }, + + { "a", "MultipleCursorsAddMatches", mode = { "n", "x" }, desc = "Add cursors to cword" }, + { + "A", + "MultipleCursorsAddMatchesV", + mode = { "n", "x" }, + desc = "Add cursors to cword in previous area", + }, + + { + "d", + "MultipleCursorsAddJumpNextMatch", + mode = { "n", "x" }, + desc = "Add cursor and jump to next cword", + }, + { "D", "MultipleCursorsJumpNextMatch", mode = { "n", "x" }, desc = "Jump to next cword" }, + + { "l", "MultipleCursorsLock", mode = { "n", "x" }, desc = "Lock virtual cursors" }, + }, + }, "jghauser/follow-md-links.nvim", "stevearc/conform.nvim", "norcalli/nvim-colorizer.lua", diff --git a/lua/config/map.lua b/lua/config/map.lua index 7dcf82a..058acbf 100644 --- a/lua/config/map.lua +++ b/lua/config/map.lua @@ -109,3 +109,5 @@ vim.api.nvim_create_user_command("Scratch", function() setlocal noswapfile ]]) end, {}) + +map("n", "", "make", { desc = "Make" }) diff --git a/lua/config/projects.lua b/lua/config/projects.lua new file mode 100644 index 0000000..9a6ecda --- /dev/null +++ b/lua/config/projects.lua @@ -0,0 +1,24 @@ +local M = {} + +-- TODO: windows +local HOME = os.getenv("HOME") +local CWD = vim.fn.getcwd() + +-- NOTE(luca): This must be global so that the path can be referenced in the Options function +M.Projects = { + Metac = { + Path = HOME .. "/proj/metac", + Options = function() + vim.o.makeprg = M.Projects.Metac.Path .. "/misc/build.sh" + end, + }, +} + +for _, Project in pairs(M.Projects) do + if string.find(CWD, Project.Path) then + M.IsInProject = true + Project.Options() + end +end + +return M -- cgit v1.2.3