diff options
Diffstat (limited to 'lua')
-rw-r--r-- | lua/conf/opts.lua | 2 | ||||
-rw-r--r-- | lua/conf/plugins/dap.lua | 20 | ||||
-rw-r--r-- | lua/conf/plugins/telescope.lua | 23 | ||||
-rw-r--r-- | lua/core/lsp/functions.lua | 8 | ||||
-rw-r--r-- | lua/core/misc.lua | 4 |
5 files changed, 26 insertions, 31 deletions
diff --git a/lua/conf/opts.lua b/lua/conf/opts.lua index dc2c3e7..b78bed7 100644 --- a/lua/conf/opts.lua +++ b/lua/conf/opts.lua @@ -186,6 +186,6 @@ do -- statusline " "..percentage() -- percentage through the buffer } end - vim.opt.statusline="%!v:lua.Status()" + vim.opt.statusline = "%!v:lua.Status()" vim.opt.laststatus = 3 end diff --git a/lua/conf/plugins/dap.lua b/lua/conf/plugins/dap.lua index 5abe1b3..4ec6706 100644 --- a/lua/conf/plugins/dap.lua +++ b/lua/conf/plugins/dap.lua @@ -57,7 +57,7 @@ return { "mfussenegger/nvim-dap", -- define codelldb dap.adapters.codelldb = { type = "executable", - command = "codelldb", + command = "codelldb" } -- define the c configuration for codelldb @@ -79,17 +79,19 @@ return { "mfussenegger/nvim-dap", dap.configurations.rust = dap.configurations.c -- keybinds - map("n", "<Leader>ec", dap.continue, { desc = "dap continue " }) - map("n", "<Leader>el", dap.run_last, { desc = "dap run last" }) - map("n", "<Leader>et", function() + map("n", "<leader>ec", dap.continue, { desc = "dap continue " }) + map("n", "<leader>el", dap.run_last, { desc = "dap run last" }) + map("n", "<leader>et", function() dap.terminate() unset_hover_bind() end, { desc = "dap terminate " }) - map("n", "<Leader>eb", require("dap.breakpoints").toggle, { desc = "dap toggle breakpoint" }) - map("n", "<Leader>e]", dap.step_over, { desc = "dap step over" }) - map("n", "<Leader>e[", dap.step_back, { desc = "dap step back" }) - map("n", "<Leader>er", dap.repl.toggle, { desc = "dap repl toggle" }) - map("n", "<Leader>eR", dap.restart, { desc = "dap restart" }) + map("n", "<leader>eb", require("dap.breakpoints").toggle, { + desc = "dap toggle breakpoint" + }) + map("n", "<leader>e]", dap.step_over, { desc = "dap step over" }) + map("n", "<leader>e[", dap.step_back, { desc = "dap step back" }) + map("n", "<leader>er", dap.repl.toggle, { desc = "dap repl toggle" }) + map("n", "<leader>eR", dap.restart, { desc = "dap restart" }) -- events dap.listeners.after['event_initialized']['me'] = set_hover_bind diff --git a/lua/conf/plugins/telescope.lua b/lua/conf/plugins/telescope.lua index 66c098a..c0bb20d 100644 --- a/lua/conf/plugins/telescope.lua +++ b/lua/conf/plugins/telescope.lua @@ -10,7 +10,6 @@ return { "nvim-telescope/telescope.nvim", vim.cmd("make") end }, - "mollerhoj/telescope-recent-files.nvim", "nvim-telescope/telescope-ui-select.nvim" }, @@ -53,30 +52,26 @@ return { "nvim-telescope/telescope.nvim", -- load in the fzf extension telescope.load_extension("fzf") - telescope.load_extension("recent-files") telescope.load_extension("ui-select") -- keymaps local telebuilt = require("telescope.builtin") - map("n", "<leader>f", function() - telescope.extensions["recent-files"].recent_files { follow = true } - end, { desc = "Find files." }) - map("n", "<leader>s", telebuilt.live_grep, { desc = "Find string in project." }) - map("n", "<leader>b", telebuilt.current_buffer_fuzzy_find, { - desc = "Find string in current buffer.", - }) + map("n", "<leader>f", telebuilt.find_files, { desc = "Find files." }) + map("n", "<leader>o", telebuilt.oldfiles, { desc = "Find old." }) + map("n", "<leader>s", telebuilt.live_grep, { desc = "Find strings." }) map("n", "<leader>i", telebuilt.help_tags, { - desc = "find help tags.", + desc = "find help tags." + }) + map("n", "<leader>l", telebuilt.lsp_document_symbols, { + desc = "Find symbols." }) -- find over specific directories map("n", "<leader>tc", function() - require("telescope.builtin").find_files { - cwd = vim.fn.stdpath("config") - } + telebuilt.find_files { cwd = vim.fn.stdpath("config") } end, { desc = "find config files" }) map("n", "<leader>tp", function() - require("telescope.builtin").find_files { + telebuilt.find_files { cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site/pack/deps/opt") } end, { desc = "find files in plugin directory" }) diff --git a/lua/core/lsp/functions.lua b/lua/core/lsp/functions.lua index 1c9f18a..0ec2c93 100644 --- a/lua/core/lsp/functions.lua +++ b/lua/core/lsp/functions.lua @@ -53,10 +53,7 @@ local function attach(bufnr) map("n", "gr", function() vim.lsp.buf.references(nil, list_opts) end, opts) map("n", "<S-Tab>", function() vim.lsp.buf.signature_help(signature_opts) end, opts) map("n", { "<leader>r", "<F2>" }, vim.lsp.buf.rename, opts) - map("n", { "gA", "<F4>" }, vim.lsp.buf.code_action, { - buffer = bufnr, - desc = "check code actions", - }) + map("n", { "gA", "<F4>" }, vim.lsp.buf.code_action, opts) -- Diagnostics map("n", "[d", function() @@ -67,6 +64,7 @@ local function attach(bufnr) end, opts) end +--- setup vim lsp options function M.setup() vim.diagnostic.config { virtual_text = false, @@ -81,7 +79,7 @@ function M.setup() [vim.diagnostic.severity.ERROR] = "x", [vim.diagnostic.severity.WARN] = "!", [vim.diagnostic.severity.INFO] = "i", - [vim.diagnostic.severity.HINT] = "h", + [vim.diagnostic.severity.HINT] = "h" } } } diff --git a/lua/core/misc.lua b/lua/core/misc.lua index d9c8613..fab3258 100644 --- a/lua/core/misc.lua +++ b/lua/core/misc.lua @@ -114,7 +114,7 @@ function M.cpyhl(hlgroup, namespace) return {} end - for _, key in pairs({"foreground", "background", "special"}) do + for _, key in pairs({ "foreground", "background", "special" }) do if hl[key] then hl[key] = string.format("#%06x", hl[key]) end @@ -123,7 +123,6 @@ function M.cpyhl(hlgroup, namespace) end --- highlight something with some highlight group for a certain amount of time ----@param opts table? options --- example: --- ```lua --- { @@ -145,6 +144,7 @@ end --- ``` --- opts is optional and if empty will simply highlight the current line for --- 250ms using IncSearch as the highlight group +---@param opts table? options function M.timeout_highlight(opts) opts = opts or {} opts.hl = opts.hl or "IncSearch" |