diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 47e0b45..91040f0 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,2 +1,3 @@ require('set') require('plugins') +require('keymaps') diff --git a/nvim/.config/nvim/lua/overseer/template/user/cargo_build.lua b/nvim/.config/nvim/lua/overseer/template/user/cargo_build.lua new file mode 100644 index 0000000..1a48724 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cargo_build.lua @@ -0,0 +1,25 @@ +return { + name = "Cargo Build", + builder = function() + local file = vim.fn.expand("%:p") + return { + cmd = { + "cargo" + }, + args = { + "build" + }, + components = { + { + "on_output_quickfix" + }, + "default" + } + } + end, + condition = { + filetype = { + "rust", + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cargo_clean.lua b/nvim/.config/nvim/lua/overseer/template/user/cargo_clean.lua new file mode 100644 index 0000000..35b29e3 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cargo_clean.lua @@ -0,0 +1,22 @@ +return { + name = "Cargo Clean", + builder = function() + local file = vim.fn.expand("%:p") + return { + cmd = { + "cargo" + }, + args = { + "clean", + }, + components = { + "default" + } + } + end, + condition = { + filetype = { + "rust", + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cargo_run.lua b/nvim/.config/nvim/lua/overseer/template/user/cargo_run.lua new file mode 100644 index 0000000..eae1511 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cargo_run.lua @@ -0,0 +1,22 @@ +return { + name = "Cargo Run", + builder = function() + local file = vim.fn.expand("%:p") + return { + cmd = { + "cargo" + }, + args = { + "run" + }, + components = { + "default" + } + } + end, + condition = { + filetype = { + "rust" + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cargo_test.lua b/nvim/.config/nvim/lua/overseer/template/user/cargo_test.lua new file mode 100644 index 0000000..fca2191 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cargo_test.lua @@ -0,0 +1,24 @@ +return { + name = "Cargo Test", + builder = function() + return { + cmd = { + "cargo" + }, + args = { + "test", + }, + components = { + { + "on_output_quickfix" + }, + "default" + } + } + end, + condition = { + filetype = { + "rust", + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cmake_build.lua b/nvim/.config/nvim/lua/overseer/template/user/cmake_build.lua new file mode 100644 index 0000000..ba9460b --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cmake_build.lua @@ -0,0 +1,28 @@ +return { + name = "CMake Build", + builder = function() + local file = vim.fn.expand("%:p") + return { + cmd = { + "cmake" + }, + args = { + "--build", + "build", + "-j16" + }, + components = { + { + "on_output_quickfix" + }, + "default" + } + } + end, + condition = { + filetype = { + "cmake", + "cpp" + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cmake_clean.lua b/nvim/.config/nvim/lua/overseer/template/user/cmake_clean.lua new file mode 100644 index 0000000..fed851d --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cmake_clean.lua @@ -0,0 +1,24 @@ +return { + name = "CMake Clean", + builder = function() + local file = vim.fn.expand("%:p") + return { + cmd = { + "rm" + }, + args = { + "-r", + "build", + }, + components = { + "default" + } + } + end, + condition = { + filetype = { + "cmake", + "cpp" + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cmake_generate.lua b/nvim/.config/nvim/lua/overseer/template/user/cmake_generate.lua new file mode 100644 index 0000000..f922107 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cmake_generate.lua @@ -0,0 +1,58 @@ +return { + name = "CMake Generate", + params = { + build_type = { + type = "enum", + choices = { + "Debug", + "Release", + "RelWithDebInfo", + "MinSizeRel" + }, + default = "Release" + }, + generator = { + type = "enum", + choices = { + "Ninja", + "Unix Makefiles" + }, + default = "Ninja" + }, + compiler = { + type = "enum", + choices = { + "g++", + "clang++" + }, + default = "g++" + } + }, + builder = function(params) + return { + cmd = { + "cmake" + }, + args = { + "-B", + "build", + "-S", + ".", + "-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", + "-DCMAKE_BUILD_TYPE=" .. params.build_type, + "-DCMAKE_CXX_COMPILER=" .. params.compiler, + "-G", + params.generator + }, + components = { + "default" + } + } + end, + condition = { + filetype = { + "cmake", + "cpp" + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/cmake_test.lua b/nvim/.config/nvim/lua/overseer/template/user/cmake_test.lua new file mode 100644 index 0000000..23bf155 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/cmake_test.lua @@ -0,0 +1,27 @@ +return { + name = "CMake Test", + builder = function() + return { + cmd = { + "ctest" + }, + args = { + "--test-dir", + "build", + "--output-on-failure", + }, + components = { + { + "on_output_quickfix" + }, + "default" + } + } + end, + condition = { + filetype = { + "cmake", + "cpp" + } + } +} diff --git a/nvim/.config/nvim/lua/overseer/template/user/python_run.lua b/nvim/.config/nvim/lua/overseer/template/user/python_run.lua new file mode 100644 index 0000000..860de41 --- /dev/null +++ b/nvim/.config/nvim/lua/overseer/template/user/python_run.lua @@ -0,0 +1,22 @@ +return { + name = "Python Run", + builder = function() + local file = vim.fn.expand("%:p") + return { + cmd = { + "python" + }, + args = { + file + }, + components = { + "default" + } + } + end, + condition = { + filetype = { + "python" + } + } +} diff --git a/nvim/.config/nvim/lua/plugins/noice.lua b/nvim/.config/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..c654a05 --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/noice.lua @@ -0,0 +1,28 @@ +vim.pack.add({ + { src = "https://github.com/MunifTanjim/nui.nvim" }, + { src = "https://github.com/folke/noice.nvim" } +}) + +require("noice").setup({ + messages = { enabled = false }, + views = { + cmdline_popup = { + backend = "popup", + relative = "editor", + position = { + row = -1, + col = "0%" + }, + border = { + style = "none" + } + }, + cmdline_popupmenu = { + relative = "editor", + position = { + row = -2, + col = "0%" + } + } + } +}) diff --git a/nvim/.config/nvim/lua/plugins/overseer.lua b/nvim/.config/nvim/lua/plugins/overseer.lua new file mode 100644 index 0000000..e9779fc --- /dev/null +++ b/nvim/.config/nvim/lua/plugins/overseer.lua @@ -0,0 +1,22 @@ +vim.pack.add({ + { src = "https://github.com/stevearc/overseer.nvim", version = "v1.6.0" } +}) + +require("overseer").setup({ + templates = { + "user.cargo_build", + "user.cargo_clean", + "user.cargo_run", + "user.cargo_test", + "user.cmake_generate", + "user.cmake_build", + "user.cmake_clean", + "user.cmake_test", + "user.python_run" + } +}) + +vim.keymap.set("n", "oo", function() require("overseer").toggle() end, { desc = "Toggle" }) +vim.keymap.set("n", "or", ":OverseerRun", { desc = "Run" }) +vim.keymap.set("n", "oq", ":OverseerQuickAction", { desc = "Quick Action" }) +vim.keymap.set("n", "of", ":OverseerQuickAction open float", { desc = "Open Float" }) diff --git a/nvim/.config/nvim/lua/plugins/telescope.lua b/nvim/.config/nvim/lua/plugins/telescope.lua index eddfe38..9c7ee07 100644 --- a/nvim/.config/nvim/lua/plugins/telescope.lua +++ b/nvim/.config/nvim/lua/plugins/telescope.lua @@ -1,17 +1,26 @@ vim.pack.add({ - { - src = "https://github.com/nvim-lua/plenary.nvim" - }, - { - src = "https://github.com/nvim-telescope/telescope.nvim" - } + { src = "https://github.com/nvim-lua/plenary.nvim" }, + { src = "https://github.com/nvim-telescope/telescope.nvim" }, + { src = "https://github.com/nvim-telescope/telescope-ui-select.nvim" } }) vim.pack.add({}) vim.keymap.set('n', 'ff', function() require("telescope.builtin").find_files() end, { desc = "Files" }) vim.keymap.set('n', 'fg', function() require("telescope.builtin").live_grep() end, { desc = "grep" }) -vim.keymap.set('n', 'fa', function() require("telescope.builtin").find_files({ hidden = true }) end, { desc = "All files" }) +vim.keymap.set('n', 'fa', function() require("telescope.builtin").find_files({ hidden = true }) end, + { desc = "All files" }) vim.keymap.set('n', 'fb', function() require("telescope.builtin").buffers() end, { desc = "Buffers" }) vim.keymap.set('n', 'fh', function() require("telescope.builtin").help_tags() end, { desc = "Help tags" }) + +-- require("telescope").setup { +-- -- extensions = { +-- -- ["ui-select"] = { +-- -- require("telescope.themes").get_dropdown { +-- -- } +-- -- } +-- -- } +-- } + +require("telescope").load_extension("ui-select") diff --git a/nvim/.config/nvim/lua/set.lua b/nvim/.config/nvim/lua/set.lua index bf61bbb..31380b8 100644 --- a/nvim/.config/nvim/lua/set.lua +++ b/nvim/.config/nvim/lua/set.lua @@ -21,3 +21,5 @@ vim.api.nvim_create_autocmd('FileType', { pattern = 'cpp', callback = function() vim.bo.commentstring = '// %s' end }) + +vim.opt.cmdheight = 0 diff --git a/nvim/.config/nvim/nvim-pack-lock.json b/nvim/.config/nvim/nvim-pack-lock.json index 2db6c3a..e525265 100644 --- a/nvim/.config/nvim/nvim-pack-lock.json +++ b/nvim/.config/nvim/nvim-pack-lock.json @@ -8,6 +8,10 @@ "rev": "292492a", "src": "https://github.com/rmagatti/auto-session" }, + "dressing.nvim": { + "rev": "2d7c2db", + "src": "https://github.com/stevearc/dressing.nvim" + }, "gruvbox.nvim": { "rev": "5e0a460", "src": "https://github.com/ellisonleao/gruvbox.nvim" @@ -29,6 +33,14 @@ "rev": "ad7146a", "src": "https://github.com/mason-org/mason.nvim" }, + "noice.nvim": { + "rev": "7bfd942", + "src": "https://github.com/folke/noice.nvim" + }, + "nui.nvim": { + "rev": "de74099", + "src": "https://github.com/MunifTanjim/nui.nvim" + }, "nvim-lspconfig": { "rev": "2010fc6", "src": "https://github.com/neovim/nvim-lspconfig" @@ -45,6 +57,11 @@ "rev": "7e1cd77", "src": "https://github.com/stevearc/oil.nvim" }, + "overseer.nvim": { + "rev": "c77c78b", + "src": "https://github.com/stevearc/overseer.nvim", + "version": "'v1.6.0'" + }, "plenary.nvim": { "rev": "b9fd522", "src": "https://github.com/nvim-lua/plenary.nvim" @@ -53,10 +70,18 @@ "rev": "eae46b4", "src": "https://github.com/rmagatti/session-lens" }, + "snacks.nvim": { + "rev": "9a15b31", + "src": "https://github.com/folke/snacks.nvim" + }, "sqlite.nvim": { "rev": "a8466c8", "src": "https://github.com/3rd/sqlite.nvim" }, + "telescope-ui-select.nvim": { + "rev": "6e51d7d", + "src": "https://github.com/nvim-telescope/telescope-ui-select.nvim" + }, "telescope.nvim": { "rev": "0294ae3", "src": "https://github.com/nvim-telescope/telescope.nvim"