From ba5103f6968698a9c3b6c870bd8a30e27a46e996 Mon Sep 17 00:00:00 2001 From: Keyoonz Date: Tue, 18 Nov 2025 14:50:52 +0100 Subject: [PATCH] added 42 coding stuff --- init.lua | 1 + lua/config/options.lua | 1 + lua/plugins/42formatter.lua | 11 +++++++++++ lua/plugins/42header.lua | 15 +++++++++++++++ lua/plugins/bufferline.lua | 3 +++ lua/plugins/lsp.lua | 4 ++-- 6 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 lua/plugins/42formatter.lua create mode 100644 lua/plugins/42header.lua diff --git a/init.lua b/init.lua index c67a70c..67c67d8 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,4 @@ require("config.keymaps") require("config.options") require("config.lazy") + diff --git a/lua/config/options.lua b/lua/config/options.lua index 7b268a3..2f9cfc5 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -13,3 +13,4 @@ vim.opt.tabstop = 4 vim.opt.expandtab = false vim.opt.cmdheight = 0 + diff --git a/lua/plugins/42formatter.lua b/lua/plugins/42formatter.lua new file mode 100644 index 0000000..c3dc31d --- /dev/null +++ b/lua/plugins/42formatter.lua @@ -0,0 +1,11 @@ +return { + "Diogo-ss/42-C-Formatter.nvim", + cmd = "CFormat42", + config = function() + local formatter = require "42-formatter" + formatter.setup({ + formatter = 'python -m c_formatter_42', + filetypes = { c = true, h = true, cpp = true, hpp = true }, + }) + end +} diff --git a/lua/plugins/42header.lua b/lua/plugins/42header.lua new file mode 100644 index 0000000..980db7b --- /dev/null +++ b/lua/plugins/42header.lua @@ -0,0 +1,15 @@ +return { + "Diogo-ss/42-header.nvim", + cmd = { "Stdheader" }, + keys = { "" }, + opts = { + default_map = true, -- Default mapping in normal mode. + auto_update = true, -- Update header when saving. + user = "mbonnard", -- Your user. + mail = "mbonnard@student.42angouleme.fr", -- Your mail. + -- add other options. + }, + config = function(_, opts) + require("42header").setup(opts) + end, +} diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 551ec11..763fc88 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -25,5 +25,8 @@ return { keys = { { "", "BufferLineCyclePrev", desc = "Prev Buffer" }, { "", "BufferLineCycleNext", desc = "Next Buffer" }, + { "bd", function () + Snacks.bufdelete(n) + end, desc = "Next Buffer" }, } } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 636561b..4bc711d 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -21,8 +21,8 @@ return { { 'neovim/nvim-lspconfig', config = function() - local lspconfig = require 'lspconfig' - lspconfig.harper_ls.setup { filetypes = { 'markdown' } } + -- local lspconfig = require 'lspconfig' + vim.lsp.config('harper_ls', { filetypes = { 'markdown' }}) end, }, }