From c512fa1226606d7ff0cb463c94182a480db4bb15 Mon Sep 17 00:00:00 2001 From: Eduardo Cueto-Mendoza Date: Wed, 25 Sep 2024 17:19:14 +0100 Subject: [PATCH] Added compiler and extras --- lua/eddie/lazy.lua | 20 ++++++++++++++++++++ lua/eddie/options.lua | 4 ++-- lua/eddie/remaps.lua | 14 +++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lua/eddie/lazy.lua b/lua/eddie/lazy.lua index 062bb76..a16a028 100644 --- a/lua/eddie/lazy.lua +++ b/lua/eddie/lazy.lua @@ -184,6 +184,26 @@ local plugins = { { 'sakhnik/nvim-gdb', }, + -- Compiler + { -- This plugin + "Zeioth/compiler.nvim", + cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" }, + dependencies = { "stevearc/overseer.nvim", "nvim-telescope/telescope.nvim" }, + opts = {}, + }, + { -- The task runner we use + "stevearc/overseer.nvim", + commit = "6271cab7ccc4ca840faa93f54440ffae3a3918bd", + cmd = { "CompilerOpen", "CompilerToggleResults", "CompilerRedo" }, + opts = { + task_list = { + direction = "bottom", + min_height = 25, + max_height = 25, + default_detail = 1 + }, + }, + }, } require('lazy').setup(plugins, { diff --git a/lua/eddie/options.lua b/lua/eddie/options.lua index b55748e..b90b446 100644 --- a/lua/eddie/options.lua +++ b/lua/eddie/options.lua @@ -129,7 +129,7 @@ then vim.opt.updatetime = 50 - vim.opt.colorcolumn = "80" + vim.opt.colorcolumn = "110" -- LSP options vim.diagnostic.config({ @@ -212,7 +212,7 @@ then vim.opt.updatetime = 50 - vim.opt.colorcolumn = "80" + vim.opt.colorcolumn = "110" -- LSP options vim.diagnostic.config({ diff --git a/lua/eddie/remaps.lua b/lua/eddie/remaps.lua index 1dd8a35..a44d603 100644 --- a/lua/eddie/remaps.lua +++ b/lua/eddie/remaps.lua @@ -60,7 +60,7 @@ vim.keymap.set("n", "U", "GitGutterUndoHunk", { desc = "Revert vim.keymap.set("n", "cf", "let @+ = expand(\"%\")", { desc = "Copy File Name" }) vim.keymap.set("n", "cp", "let @+ = expand(\"%:p\")", { desc = "Copy File Path" }) -vim.keymap.set("n", "", function() +vim.keymap.set("n", "so", function() vim.cmd("so") end, { desc = "Source current file" }) @@ -70,6 +70,18 @@ vim.keymap.set("n", "", ":resize -2", { desc = "Resize Horizontal Sp vim.keymap.set("n", "", ":vertical resize -2", { desc = "Resize Vertical Split Down" }) vim.keymap.set("n", "", ":vertical resize +2", { desc = "Resize Vertical Split Up" }) +-- Open compiler +vim.api.nvim_set_keymap('n', '', "CompilerOpen", { noremap = true, silent = true }) + +-- Redo last selected option +vim.api.nvim_set_keymap('n', '', + "CompilerStop" -- (Optional, to dispose all tasks before redo) + .. "CompilerRedo", + { noremap = true, silent = true }) + +-- Toggle compiler results +vim.api.nvim_set_keymap('n', 't', "CompilerToggleResults", { noremap = true, silent = true }) + -- Visual -- -- Stay in indent mode vim.keymap.set("v", "<", "