From 4e31578c1e4b9e989cec824e3e832ac2aa66efcd Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Mon, 17 Mar 2025 15:43:07 +0100 Subject: checkpoint --- lua/config/lsp.lua | 12 +++++++----- lua/config/map.lua | 3 +++ lua/config/projects.lua | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 lua/config/projects.lua (limited to 'lua') diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 49f415f..10235bf 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -143,14 +143,16 @@ ls.add_snippets("c", { parse_snippet( "uints", [[#include -typedef uint8_t u8; +typedef uint8_t u8; typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef int8_t s8; -typedef int16_t s16; -typedef int32_t s32; -typedef int64_t s64; +typedef int8_t i8; +typedef int16_t i16; +typedef int32_t i32; +typedef int64_t i64; +typedef float f32; +typedef double f64; ]] ), }) diff --git a/lua/config/map.lua b/lua/config/map.lua index 7dcf82a..a39f362 100644 --- a/lua/config/map.lua +++ b/lua/config/map.lua @@ -4,6 +4,7 @@ local map = vim.keymap.set vim.g.mapleader = " " vim.g.maplocalleader = "," + -- open config map("n", " c", function() vim.cmd("cd ~/.config/nvim") @@ -13,6 +14,8 @@ end, { desc = "Open neovim config file" }) map("v", "J", ":m '>+1gv=gv", { desc = "Move selected text up" }) map("v", "K", ":m '<-2gv=gv", { desc = "Move selected text down" }) +map("n", "", "make", { desc = "Make" }) + -- better find next and previous map("n", "n", "nzzzv", { desc = "Keep cursor in middle with search" }) map("n", "N", "Nzzzv", { desc = "Keep cursor in middle with search" }) diff --git a/lua/config/projects.lua b/lua/config/projects.lua new file mode 100644 index 0000000..0b81def --- /dev/null +++ b/lua/config/projects.lua @@ -0,0 +1,24 @@ +local M = {} + +local HOME = os.getenv("HOME") +local CWD = vim.fn.getcwd() + +M.Projects = { + MetaC = { + Path = HOME .. "/proj/metac", + Options = function() + vim.o.makeprg = M.Projects.MetaC.Path .. "/misc/build.sh" + end, + }, +} + +M.InProject = false + +for At, Project in pairs(M.Projects) do + if string.find(CWD, Project.Path) then + M.InProject = true + Project.Options() + end +end + +return M -- cgit v1.2.3