From 8ccb9684f5baa2a5a02e70302b3fb25d3444e7e4 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Sun, 17 Dec 2023 23:23:47 +0100 Subject: [PATCH] Change theme to moonfly --- lua/lsp.lua | 13 ++++++- lua/plugins.lua | 12 ++++-- lua/plugins/catppuccin.lua | 76 -------------------------------------- lua/plugins/cmp.lua | 17 ++++++++- lua/plugins/moonfly.lua | 26 +++++++++++++ 5 files changed, 61 insertions(+), 83 deletions(-) delete mode 100644 lua/plugins/catppuccin.lua create mode 100644 lua/plugins/moonfly.lua diff --git a/lua/lsp.lua b/lua/lsp.lua index 32f32bc..da999db 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -71,7 +71,7 @@ function P._setup_diagnostics() float = { show_header = false, source = "always", - border = "rounded", + border = "single", focusable = false, format = function (diagnostic) return string.format("%s", diagnostic.message) @@ -129,6 +129,17 @@ function P.on_attach(client, bufnr) vim.opt.updatetime = 300 require("lsp-inlayhints").on_attach(client, bufnr, false) + + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = "single" + } + ) + vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = "single" + } + ) end function P.reload_server_buf(name) diff --git a/lua/plugins.lua b/lua/plugins.lua index 5e609bb..55b403a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -18,11 +18,11 @@ vim.loader.enable() local plugins = { { - "catppuccin/nvim", + "bluz71/vim-moonfly-colors", priority = 1000, lazy = false, - name = "catppuccin", - config = require("plugins.catppuccin"), + name = "moonfly", + config = require("plugins.moonfly"), }, { "rcarriga/nvim-notify", @@ -236,6 +236,10 @@ local plugins = { }, } -local opts = {} +local opts = { + install = { + colorscheme = { "moonfly" } + } +} require("lazy").setup(plugins, opts) diff --git a/lua/plugins/catppuccin.lua b/lua/plugins/catppuccin.lua deleted file mode 100644 index f9737c9..0000000 --- a/lua/plugins/catppuccin.lua +++ /dev/null @@ -1,76 +0,0 @@ ---[[ - Copyright 2023 Oscar Wallberg - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - https://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -]] - --- https://github.com/catppuccin/nvim - -local function setup() - local catppuccin = require("catppuccin") - - -- Sometimes requires running :CatppuccinCompile, - -- like when switching to a font that supports italics. - catppuccin.setup({ - flavour = "mocha", -- latte, frappe, macchiato, mocha - no_italic = false, - styles = { - comments = { "italic", }, - }, - integrations = { - cmp = true, - gitsigns = true, - nvimtree = true, - treesitter = true, - notify = true, - aerial = true, - indent_blankline = { - enabled = true, - colored_indent_levels = false, - }, - mason = true, - neogit = true, - noice = true, - dap = { - enabled = true, - enable_ui = true, - }, - native_lsp = { - enabled = true, - virtual_text = { - errors = { "italic", }, - hints = { "italic", }, - warnings = { "italic", }, - information = { "italic", }, - }, - underlines = { - errors = { "underline", }, - hints = { "underline", }, - warnings = { "underline", }, - information = { "underline", }, - }, - inlay_hints = { - background = true, - }, - }, - telescope = { - enabled = true, - }, - lsp_trouble = true, - }, - }) - - catppuccin.load() -end - -return setup diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index d62545e..ec64c57 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -36,7 +36,7 @@ local function setup() lspkind = module end) - cmp.setup({ + local opt = { enabled = function () -- disable completion in comments local context = require "cmp.config.context" @@ -125,7 +125,20 @@ local function setup() { name = "path", }, -- { name = 'buffer' }, }, - }) + } + + utils.try_require("moonfly", module_name, function (_) + local winhighlight = { + winhighlight = + "Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel", + } + opt.window = { + completion = cmp.config.window.bordered(winhighlight), + documentation = cmp.config.window.bordered(winhighlight), + } + end) + + cmp.setup(opt) cmp.setup.cmdline( "/", diff --git a/lua/plugins/moonfly.lua b/lua/plugins/moonfly.lua new file mode 100644 index 0000000..01d58f9 --- /dev/null +++ b/lua/plugins/moonfly.lua @@ -0,0 +1,26 @@ +--[[ + Copyright 2023 Oscar Wallberg + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +]] + +-- https://github.com/bluz71/vim-moonfly-colors + +local function setup() + vim.g.moonflyNormalFloat = true + + vim.cmd.colorscheme("moonfly") +end + +return setup +