From c057d8c0ab43e459a45cb2edd888d358d26e65b8 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Mon, 10 Oct 2022 17:24:57 +0200 Subject: [PATCH] added borders to telescope --- .luarc.json | 4 + lua/plugins/lsp/init.lua | 171 ++++++++++++++++++++----------------- lua/plugins/tokyonight.lua | 54 ++++++------ 3 files changed, 122 insertions(+), 107 deletions(-) create mode 100644 .luarc.json diff --git a/.luarc.json b/.luarc.json new file mode 100644 index 0000000..2ada10e --- /dev/null +++ b/.luarc.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", + "Lua.completion.autoRequire": false +} \ No newline at end of file diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua index cd022f6..d698e61 100644 --- a/lua/plugins/lsp/init.lua +++ b/lua/plugins/lsp/init.lua @@ -1,91 +1,102 @@ local M = { - event = "BufReadPre" + event = "BufReadPre", } function M.config() - require("lua-dev").setup({ - library = { - runtime = "~/projects/neovim/runtime/" - } - }) - require("mason") - require("plugins.lsp.diagnostics").setup() - require("fidget").setup({text = {spinner = "dots"} }) - local function on_attach(client, bufnr) - --require("nvim-navic").attach(client, bufnr) - require("plugins.lsp.formatting").setup(client, bufnr) - --require("plugins.lsp.keys").setup(client, bufnr) - end + require("lua-dev").setup({ + library = { + runtime = "~/projects/neovim/runtime/", + }, + }) + require("mason") + require("plugins.lsp.diagnostics").setup() + require("fidget").setup({ text = { spinner = "dots" } }) + local function on_attach(client, bufnr) + require("nvim-navic").attach(client, bufnr) + require("plugins.lsp.formatting").setup(client, bufnr) + --require("plugins.lsp.keys").setup(client, bufnr) + end - ---@type lspconfig.options - local servers = { - sumneko_lua = { - single_file_support = true, - settings = { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - workspaceWord = false, - }, - misc = { - parameters = { - "--log-level=trace", - }, - }, - diagnostics = { - groupFileStatus = { - ["ambiguity"] = "Opened", - ["await"] = "Opened", - ["codestyle"] = "None", - ["duplicate"] = "Opened", - ["global"] = "Opened", - ["luadoc"] = "Opened", - ["redefined"] = "Opened", - ["strict"] = "Opened", - ["strong"] = "Opened", - ["type-check"] = "Opened", - ["unbalanced"] = "Opened", - ["unused"] = "Opened", - }, - unusedLocalExclude = { "_*" }, - }, - format = { - enable = false, - defaultConfig = { - indent_style = "space", - indent_size = "2", - continuation_indent_size = "2", - }, - }, - }, - }, - }, - vimls = {}, - } - local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) - capabilities.textDocument.foldingRange = { - dymanicRegistration = false, - lineFoldingOnly = true, - } - - ---@type _.lspconfig.options - local options = { - on_attach = on_attach, - capabilities = capabilities, - flags = { - debounce_text_change = 150, - } - } + ---@type lspconfig.options + local servers = { + gopls = {}, + rust_analyzer = { + settings = { + ["rust-analyzer"] = { + cargo = { allFeatures = true }, + checkOnSave = { + command = "clippy", + extraArgs = { "--no-deps" }, + }, + }, + }, + }, + sumneko_lua = { + single_file_support = true, + settings = { + Lua = { + workspace = { + checkThirdParty = false, + }, + completion = { + workspaceWord = false, + }, + misc = { + parameters = { + "--log-level=trace", + }, + }, + diagnostics = { + groupFileStatus = { + ["ambiguity"] = "Opened", + ["await"] = "Opened", + ["codestyle"] = "None", + ["duplicate"] = "Opened", + ["global"] = "Opened", + ["luadoc"] = "Opened", + ["redefined"] = "Opened", + ["strict"] = "Opened", + ["strong"] = "Opened", + ["type-check"] = "Opened", + ["unbalanced"] = "Opened", + ["unused"] = "Opened", + }, + unusedLocalExclude = { "_*" }, + }, + format = { + enable = false, + defaultConfig = { + indent_style = "space", + indent_size = "2", + continuation_indent_size = "2", + }, + }, + }, + }, + }, + vimls = {}, + } + local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) + capabilities.textDocument.foldingRange = { + dymanicRegistration = false, + lineFoldingOnly = true, + } - for server, opts in pairs(servers) do - opts = vim.tbl_deep_extend("force", {}, options, opts or {}) - require("lspconfig")[server].setup(opts) - end + ---@type _.lspconfig.options + local options = { + on_attach = on_attach, + capabilities = capabilities, + flags = { + debounce_text_change = 150, + }, + } - require("plugins.null-ls").setup(options) + for server, opts in pairs(servers) do + opts = vim.tbl_deep_extend("force", {}, options, opts or {}) + require("lspconfig")[server].setup(opts) + end + require("plugins.null-ls").setup(options) end return M diff --git a/lua/plugins/tokyonight.lua b/lua/plugins/tokyonight.lua index 0dc8ee4..0aa257d 100644 --- a/lua/plugins/tokyonight.lua +++ b/lua/plugins/tokyonight.lua @@ -5,8 +5,8 @@ return { local tokyonight = require("tokyonight") tokyonight.setup({ style = "moon", - -- transparent = true, - -- hide_inactive_statusline = false, + --transparent = true, + hide_inactive_statusline = false, sidebars = { "qf", "vista_kind", @@ -24,34 +24,34 @@ return { hl.CursorLineNr = { fg = c.orange, bold = true } -- borderless telescope - local prompt = "#2d3149" - hl.TelescopeNormal = { - bg = c.bg_dark, - fg = c.fg_dark, - } + --local prompt = "#2d3149" + --hl.TelescopeNormal = { + -- bg = c.bg_dark, + -- fg = c.fg_dark, + --} hl.TelescopeBorder = { bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopePromptNormal = { - bg = prompt, - } - hl.TelescopePromptBorder = { - bg = prompt, - fg = prompt, - } - hl.TelescopePromptTitle = { - bg = c.fg_gutter, - fg = c.orange, - } - hl.TelescopePreviewTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopeResultsTitle = { - bg = c.bg_dark, - fg = c.bg_dark, + -- fg = c.bg_dark, } + --hl.TelescopePromptNormal = { + -- bg = prompt, + --} + --hl.TelescopePromptBorder = { + -- bg = prompt, + -- fg = prompt, + --} + --hl.TelescopePromptTitle = { + -- bg = c.fg_gutter, + -- fg = c.orange, + --} + --hl.TelescopePreviewTitle = { + -- bg = c.bg_dark, + -- fg = c.bg_dark, + --} + --hl.TelescopeResultsTitle = { + -- bg = c.bg_dark, + -- fg = c.bg_dark, + --} end, }) tokyonight.load()