summaryrefslogtreecommitdiff
path: root/lua/config
diff options
context:
space:
mode:
authorRaymaekers Luca <luca@spacehb.net>2025-03-17 15:34:15 +0100
committerRaymaekers Luca <luca@spacehb.net>2025-03-17 15:34:15 +0100
commitda7035666495a278bfc7885e4d9f11557f210357 (patch)
treedee15f2eaa55b7e392bff39aaff2e2f966751377 /lua/config
parent53f6e19f84ba06bbf143339deba84bc51cd6706e (diff)
checkpoint
Diffstat (limited to 'lua/config')
-rw-r--r--lua/config/lazy.lua54
-rw-r--r--lua/config/map.lua2
-rw-r--r--lua/config/projects.lua24
3 files changed, 79 insertions, 1 deletions
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",
+ "<S-Tab>",
+ function()
+ require("multiple-cursors").align()
+ end,
+ },
+ },
+ },
+ keys = {
+ { "<C-j>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "n", "x" }, desc = "Add cursor and move down" },
+ { "<C-k>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "x" }, desc = "Add cursor and move up" },
+
+ { "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "n", "i", "x" }, desc = "Add cursor and move up" },
+ {
+ "<C-Down>",
+ "<Cmd>MultipleCursorsAddDown<CR>",
+ mode = { "n", "i", "x" },
+ desc = "Add cursor and move down",
+ },
+
+ {
+ "<Leader>m",
+ "<Cmd>MultipleCursorsAddVisualArea<CR>",
+ mode = { "x" },
+ desc = "Add cursors to the lines of the visual area",
+ },
+
+ { "<Leader>a", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "x" }, desc = "Add cursors to cword" },
+ {
+ "<Leader>A",
+ "<Cmd>MultipleCursorsAddMatchesV<CR>",
+ mode = { "n", "x" },
+ desc = "Add cursors to cword in previous area",
+ },
+
+ {
+ "<Leader>d",
+ "<Cmd>MultipleCursorsAddJumpNextMatch<CR>",
+ mode = { "n", "x" },
+ desc = "Add cursor and jump to next cword",
+ },
+ { "<Leader>D", "<Cmd>MultipleCursorsJumpNextMatch<CR>", mode = { "n", "x" }, desc = "Jump to next cword" },
+
+ { "<Leader>l", "<Cmd>MultipleCursorsLock<CR>", 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", "<M-b>", "<cmd>make<cr>", { 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