summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-27 16:21:02 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-27 16:21:02 +0100
commitb51afe268a6015ce31cf9162545411dd9fce93ad (patch)
tree0773b31d812fa552aca5834918e7e5a81f2f0eae
parenta33f663f2998135b0e42e1bdfb8b172242c04424 (diff)
checkpoint
-rw-r--r--after/plugin/conform.lua4
-rw-r--r--lua/config/lazy.lua7
-rw-r--r--lua/config/lsp.lua24
-rw-r--r--lua/config/map.lua2
4 files changed, 30 insertions, 7 deletions
diff --git a/after/plugin/conform.lua b/after/plugin/conform.lua
index 060a99c..3d2deed 100644
--- a/after/plugin/conform.lua
+++ b/after/plugin/conform.lua
@@ -20,6 +20,10 @@ conform.formatters["clang-format"] = {
.. "AlignAfterOpenBracket: BlockIndent, "
.. "AlignArrayOfStructures: Right, "
.. "BreakBeforeBraces: Linux, "
+ .. "PointerAlignment: Left,"
+ .. "AllowShortIfStatementsOnASingleLine: true, "
+ .. "AllowShortLoopsOnASingleLine: true, "
+ .. "AllowAllArgumentsOnNextLine: true, "
.. "ColumnLimit: "
.. vim.o.tw
.. "}",
diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua
index 5d61d75..4c053d0 100644
--- a/lua/config/lazy.lua
+++ b/lua/config/lazy.lua
@@ -49,12 +49,7 @@ require("lazy").setup({
},
{
"ray-x/lsp_signature.nvim",
- event = "VeryLazy",
- config = function()
- require("lsp_signature").setup({
- -- hint_enable = false,
- })
- end,
+ event = "LspAttach",
},
{
--snippets
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
index 0869f41..70c88d8 100644
--- a/lua/config/lsp.lua
+++ b/lua/config/lsp.lua
@@ -102,6 +102,9 @@ cmp.setup({
require("luasnip").lsp_expand(args.body)
end,
},
+ completion = {
+ autocomplete = false,
+ },
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
@@ -160,3 +163,24 @@ vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.s
vim.diagnostic.config({
float = { border = _border },
})
+
+local autocmd = vim.api.nvim_create_autocmd
+autocmd("LspAttach", {
+ callback = function(args)
+ local client = vim.lsp.get_client_by_id(args.data.client_id)
+ if client == nil then
+ return
+ end
+ if vim.tbl_contains({ "null-ls" }, client.name) then -- blacklist lsp
+ return
+ end
+ require("lsp_signature").on_attach({
+ hint_enable = false,
+ doc_lines = 0,
+ bind = true,
+ handler_opts = {
+ border = "rounded",
+ },
+ }, args.bufnr)
+ end,
+})
diff --git a/lua/config/map.lua b/lua/config/map.lua
index b223650..c676ba5 100644
--- a/lua/config/map.lua
+++ b/lua/config/map.lua
@@ -95,4 +95,4 @@ end, { desc = "Toggle diagnostics" })
-- editing
map("n", " sf", ":%s/\\<<C-R><C-W>\\>//gc<Left><Left><Left>", { desc = "Replace word under cursor in file" })
-map("n", " sl", "", { desc = "Replace word under cursor on current line" })
+map("n", " sl", ":s/\\<<C-R><C-W>\\>//g<Left><Left>", { desc = "Replace word under cursor on current line" })