From 6e13939c5bf46dcf6120c6061137752beac84dc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Kmie=C4=87?= Date: Mon, 22 Apr 2024 23:54:16 +0200 Subject: [PATCH] Nvim: minor cmake and telescope changes --- .config/nvim/lua/plugins/context.lua | 11 ++++++++++- .config/nvim/lua/plugins/lspconfig.lua | 2 +- .config/nvim/lua/plugins/telescope.lua | 15 +-------------- .config/nvim/lua/plugins/trouble.lua | 3 +++ .config/nvim/lua/plugins/vim-cmake.lua | 10 +++++----- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.config/nvim/lua/plugins/context.lua b/.config/nvim/lua/plugins/context.lua index 31e702e..dc7a743 100644 --- a/.config/nvim/lua/plugins/context.lua +++ b/.config/nvim/lua/plugins/context.lua @@ -9,6 +9,7 @@ return { enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) throttle = true, -- Throttles plugin updates (may improve performance) max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit. + mode = 'topline', patterns = { -- Match patterns for TS nodes. These get wrapped to match at word boundaries. -- For all filetypes -- Note that setting an entry here replaces all other patterns for this entry. @@ -35,7 +36,15 @@ return { -- Treat patterns.rust as a Lua pattern (i.e "^impl_item$" will -- exactly match "impl_item" only) rust = true, - } + }, + on_attach = function(buf) + local max_filesize = 100 * 1024 + local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) + if ok and stats and stats.size > max_filesize then + return false + end + return true + end } end } diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua index 0b56b73..fec213d 100644 --- a/.config/nvim/lua/plugins/lspconfig.lua +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -19,7 +19,7 @@ return { -- Options other than `highlight' and `priority' only work -- if `inline' is disabled -- Only show inlay hints for the current line - only_current_line = true, + only_current_line = false, -- Event which triggers a refresh of the inlay hints. -- You can make this { "CursorMoved" } or { "CursorMoved,CursorMovedI" } but -- not that this may cause higher CPU usage. diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua index 4602129..76d4be2 100644 --- a/.config/nvim/lua/plugins/telescope.lua +++ b/.config/nvim/lua/plugins/telescope.lua @@ -3,7 +3,7 @@ return { dependencies = { 'debugloop/telescope-undo.nvim', 'molecule-man/telescope-menufacture', - 'xiyaowong/telescope-emoji.nvim', + 'nvim-telescope/telescope-symbols.nvim', { { "isak102/telescope-git-file-history.nvim", @@ -22,23 +22,10 @@ return { main_menu = { [{'i', 'n'}] = '' } } }, - emoji = { - action = function(emoji) - -- argument emoji is a table. - -- {name="", value="", cagegory="", description=""} - - vim.fn.setreg("*", emoji.value) - print([[Press p or "*p to paste this emoji]] .. emoji.value) - - -- insert emoji when picked - vim.api.nvim_put({ emoji.value }, 'c', false, true) - end, - } } } require('telescope').load_extension('undo') require('telescope').load_extension('menufacture') - require("telescope").load_extension("emoji") require("telescope").load_extension("git_file_history") local def = { noremap = true, silent = true } local map = vim.keymap.set diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua index f4f7146..10cf0ab 100644 --- a/.config/nvim/lua/plugins/trouble.lua +++ b/.config/nvim/lua/plugins/trouble.lua @@ -1,4 +1,7 @@ return { 'folke/trouble.nvim', + dependencies = { + 'kyazdani42/nvim-web-devicons', + }, config = true, } diff --git a/.config/nvim/lua/plugins/vim-cmake.lua b/.config/nvim/lua/plugins/vim-cmake.lua index 9bd3c74..e38f0ac 100644 --- a/.config/nvim/lua/plugins/vim-cmake.lua +++ b/.config/nvim/lua/plugins/vim-cmake.lua @@ -18,9 +18,9 @@ return { require("cmake-tools").setup { cmake_command = "cmake", - ctest_command = "ctest", + ctest_command = "ctest --verbose", cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, - cmake_build_options = { "-j 15" }, + cmake_build_options = { "-j15" }, cmake_build_directory = "build", cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false @@ -38,7 +38,7 @@ return { console = "integratedTerminal", }, cmake_executor = { -- executor to use - name = "toggleterm", -- name of the executor + name = "quickfix", -- name of the executor opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values. default_opts = { -- a list of default and possible values for executors quickfix = { @@ -87,7 +87,7 @@ return { }, }, cmake_runner = { -- runner to use - name = "toggleterm", -- name of the runner + name = "quickfix", -- name of the runner opts = {}, -- the options the runner will get, possible values depend on the runner type. See `default_opts` for possible values. default_opts = { -- a list of default and possible values for runners quickfix = { @@ -105,7 +105,7 @@ return { overseer = { new_task_opts = { strategy = { - "toggleterm", + "quickfix", direction = "horizontal", autos_croll = true, quit_on_exit = "success"