From 2f241668564647d4516b948c4625519d9dce66e4 Mon Sep 17 00:00:00 2001 From: winston Date: Fri, 21 Oct 2022 17:01:46 +0200 Subject: [PATCH] feat(nvim,wezterm,yabai): the big OLEDppuccin update --- dot_config/nvim/lua/config/catppuccin.lua | 30 ++++++--- dot_config/nvim/lua/lsp.lua | 43 ++++++++++--- dot_config/nvim/lua/plugins.lua | 61 ++++++++----------- .../plugins/executable_colordummy.sh | 4 ++ dot_config/wezterm/wezterm.lua | 19 ++++-- dot_config/yabai/executable_yabairc | 5 +- 6 files changed, 99 insertions(+), 63 deletions(-) diff --git a/dot_config/nvim/lua/config/catppuccin.lua b/dot_config/nvim/lua/config/catppuccin.lua index b005b27..feaf6d3 100644 --- a/dot_config/nvim/lua/config/catppuccin.lua +++ b/dot_config/nvim/lua/config/catppuccin.lua @@ -1,5 +1,17 @@ local colors = require("catppuccin.palettes").get_palette() -vim.g.catppuccin_flavour = "frappe" +vim.g.catppuccin_flavour = "mocha" + +local darkmode_overrides = { + base = "#000000", + crust = "#000000", + mantle = "#000000", + -- surface0 = "#101010", + -- surface1 = "#141414", + -- surface2 = "#181818", + -- overlay1 = "#202020", + -- overlay2 = "#242424", + -- overlay3 = "#282828", +} require("catppuccin").setup({ dim_inactive = { @@ -62,22 +74,20 @@ require("catppuccin").setup({ telescope = true, ts_rainbow = true, vim_sneak = false, + vimwiki = true, }, custom_highlights = { DashboardHeader = { fg = colors.pink }, DashboardCenter = { fg = colors.peach }, DashboardShortCut = { fg = colors.yellow }, DashboardFooter = { fg = colors.maroon }, + TelescopeBorder = { fg = colors.overlay0 }, + }, + color_overrides = { + mocha = darkmode_overrides, + macchiato = darkmode_overrides, + frappe = darkmode_overrides, }, }) vim.api.nvim_command("colorscheme catppuccin") - --- vim.api.nvim_create_autocmd("ColorScheme", { --- pattern = "*", --- callback = function() --- package.loaded["feline"] = nil --- package.loaded["catppuccin.groups.integrations.feline"] = nil --- require("config.feline") --- end, --- }) diff --git a/dot_config/nvim/lua/lsp.lua b/dot_config/nvim/lua/lsp.lua index d284097..e645549 100644 --- a/dot_config/nvim/lua/lsp.lua +++ b/dot_config/nvim/lua/lsp.lua @@ -18,12 +18,12 @@ if not present or not cmp then end local has_words_before = function() - local line, col = table.unpack(vim.api.nvim_win_get_cursor(0)) + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 - and vim.api - .nvim_buf_get_lines(0, line - 1, line, true)[1] - :sub(col, col) - :match("%s") + and vim.api + .nvim_buf_get_lines(0, line - 1, line, true)[1] + :sub(col, col) + :match("%s") == nil end @@ -42,8 +42,14 @@ cmp.setup({ end, }, window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), + completion = { + border = { "╔", "═", "╗", "║", "╝", "═", "╚", "║" }, + winhighlight = "Normal:CmpPmenu,FloatBorder:CmpBorder,CursorLine:PmenuSel,Search:None", + }, + documentation = { + border = { "╔", "═", "╗", "║", "╝", "═", "╚", "║" }, + winhighlight = "Normal:CmpPmenu,FloatBorder:CmpBorder,CursorLine:PmenuSel,Search:None", + }, }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(-4), @@ -78,6 +84,13 @@ cmp.setup({ }, { { name = "buffer" }, }), + formatting = { + format = require("lspkind").cmp_format({ + mode = "symbol_text", + maxwidth = 50, + ellipsis_char = "...", + }), + }, }) cmp.setup.filetype("gitcommit", { @@ -98,7 +111,7 @@ cmp.setup.cmdline({ "/", "?" }, { cmp.setup.cmdline(":", { mapping = cmp.mapping.preset.cmdline(), sources = cmp.config.sources({ - { name = "path" }, + { name = "path", option = { trailing_slash = true } }, }, { { name = "cmdline" }, }), @@ -185,6 +198,20 @@ lspconfig.denols.setup({ root_dir = lspconfig.util.root_pattern("deps.ts"), single_file_support = false, }) +lspconfig.ltex.setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + require("ltex_extra").setup({ + load_langs = { "en-US", "de-AT" }, + init_check = true, + path = vim.fn.stdpath("data") .. "/dictionary", + }) + on_attach(client, bufnr) + end, + settings = { + ltex = {}, + }, +}) local null = require("null-ls") local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) diff --git a/dot_config/nvim/lua/plugins.lua b/dot_config/nvim/lua/plugins.lua index 8bd5a78..24f70f4 100644 --- a/dot_config/nvim/lua/plugins.lua +++ b/dot_config/nvim/lua/plugins.lua @@ -24,7 +24,6 @@ return packer.startup({ use({ "catppuccin/nvim", as = "catppuccin", - run = ":CatppuccinCompile", config = function() require("config/catppuccin") end, @@ -41,18 +40,7 @@ return packer.startup({ use({ "lukas-reineke/indent-blankline.nvim", config = function() - require("indent_blankline").setup({ - space_char_blankline = " ", - show_current_conext = true, - char_highlight_list = { - "IndentBlanklineIndent1", - "IndentBlanklineIndent2", - "IndentBlanklineIndent3", - "IndentBlanklineIndent4", - "IndentBlanklineIndent5", - "IndentBlanklineIndent6", - }, - }) + require("indent_blankline").setup({}) vim.g.indent_blankline_filetype_exclude = { "dashboard", "help", @@ -83,27 +71,6 @@ return packer.startup({ component_separators = { left = "", right = "" }, section_separators = { left = "", right = "" }, }, - sections = { - lualine_x = { - { - "diagnostics", - sources = { "nvim_lsp" }, - -- Displays diagnostics for the defined severity types - sections = { "error", "warn", "info", "hint" }, - diagnostics_color = { - -- Same values as the general color option can be used here. - error = "DiagnosticError", -- Changes diagnostics' error color. - warn = "DiagnosticWarn", -- Changes diagnostics' warn color. - info = "DiagnosticInfo", -- Changes diagnostics' info color. - hint = "DiagnosticHint", -- Changes diagnostics' hint color. - }, - symbols = { error = "E", warn = "W", info = "I", hint = "H" }, - colored = true, -- Displays diagnostics status in color if set to true. - update_in_insert = false, -- Update diagnostics in insert mode. - always_visible = false, -- Show diagnostics even if there are none. - }, - }, - }, }) end, }) @@ -126,6 +93,8 @@ return packer.startup({ require("config/treesitter") end, }) + use("nvim-treesitter/playground") + use({ "p00f/nvim-ts-rainbow", requires = "nvim-treesitter/nvim-treesitter", @@ -219,9 +188,23 @@ return packer.startup({ "nvim-telescope/telescope.nvim", requires = "nvim-lua/plenary.nvim", config = function() + require("telescope").setup({ + defaults = { + borderchars = { + "═", + "║", + "═", + "║", + "╔", + "╗", + "╝", + "╚", + }, + }, + }) Map("n", "fr", "Telescope asynctasks all") Map("n", "fb", "Telescope file_browser") - Map("n", "ff", "Telescope find_files") + Map("n", "fd", "Telescope find_files") Map("n", "fg", "Telescope live_grep") Map("n", "fh", "Telescope help_tags") Map("n", "fp", "Telescope project") @@ -284,6 +267,7 @@ return packer.startup({ use("hrsh7th/cmp-vsnip") use("hrsh7th/vim-vsnip") use("petertriho/cmp-git") + use("onsails/lspkind.nvim") use("rafamadriz/friendly-snippets") use("jose-elias-alvarez/null-ls.nvim") use({ @@ -293,13 +277,14 @@ return packer.startup({ require("config/lspsaga") end, }) + use({ "barreiroleo/ltex-extra.nvim" }) use("b0o/schemastore.nvim") use({ "github/copilot.vim", config = function() local opt = { noremap = true, silent = true, expr = true } - Map("i", "", "copilot#Accept()", opt) + Map("i", "", 'copilot#Accept("")', opt) vim.g.copilot_no_tab_map = true end, }) @@ -352,7 +337,9 @@ return packer.startup({ end, config = { display = { - open_fn = require("packer.util").float, + open_fn = function() + return require("packer.util").float({ border = "double" }) + end, }, }, }) diff --git a/dot_config/sketchybar/plugins/executable_colordummy.sh b/dot_config/sketchybar/plugins/executable_colordummy.sh index a3f4ae7..9b89ad9 100644 --- a/dot_config/sketchybar/plugins/executable_colordummy.sh +++ b/dot_config/sketchybar/plugins/executable_colordummy.sh @@ -34,6 +34,10 @@ if [[ $THEME == 'dark' ]]; then BASE="303446" MANTLE="292c3c" CRUST="232634" + # overrides + BASE="000000" + MANTLE="000000" + CRUST="000000" else ROSEWATER="dc8a78" FLAMINGO="dd7878" diff --git a/dot_config/wezterm/wezterm.lua b/dot_config/wezterm/wezterm.lua index d0eb525..9b35437 100644 --- a/dot_config/wezterm/wezterm.lua +++ b/dot_config/wezterm/wezterm.lua @@ -5,7 +5,10 @@ local wezterm = require("wezterm") -- kept seperately from the rest of the config so that I can easily change them local fonts = { berkeley = { - font = "Berkeley Mono", + font = { + family = "Berkeley Mono", + weight = "Bold", + }, size = 16, }, comic = { @@ -198,11 +201,16 @@ wezterm.on("update-status", function(window, pane) end) -- }}} -local darkTheme = "Catppuccin Frappe" +local custom = wezterm.color.get_builtin_schemes()["Catppuccin Mocha"] +custom.background = "#000000" +custom.tab_bar.background = "#040404" +custom.tab_bar.inactive_tab.bg_color = "#0f0f0f" +custom.tab_bar.new_tab.bg_color = "#080808" + +local darkTheme = "OLEDppuccin" local lightTheme = "Catppuccin Latte" local function scheme_for_appearance(appearance) - wezterm.log_info(appearance) if string.match(wezterm.target_triple, "linux") then return darkTheme end @@ -287,7 +295,6 @@ return { }, action = wezterm.action_callback(function(window, pane) local url = window:get_selection_text_for_pane(pane) - wezterm.log_info("opening: " .. url) wezterm.open_with(url) end), }), @@ -349,6 +356,9 @@ return { -- don't attempt to resize the window (tiling wm) adjust_window_size_when_changing_font_size = false, -- theme + color_schemes = { + ["OLEDppuccin"] = custom, + }, color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()), -- nightly only clean_exit_codes = { 130 }, @@ -358,4 +368,5 @@ return { max_fps = 240, -- scrollbar, currently hidden by default, but better make sure enable_scroll_bar = false, + hide_tab_bar_if_only_one_tab = true, } diff --git a/dot_config/yabai/executable_yabairc b/dot_config/yabai/executable_yabairc index e3f95a7..c2d96cd 100644 --- a/dot_config/yabai/executable_yabairc +++ b/dot_config/yabai/executable_yabairc @@ -23,10 +23,7 @@ yabai -m config \ mouse_drop_action swap \ window_origin_display default \ window_placement second_child \ - active_window_border_color 0xfff5c2e7 \ - normal_window_border_color 0xffb4befe \ - insert_feedback_color 0xfff9e2af \ - window_border on \ + window_border off \ window_border_width 2 \ window_opacity on \ window_opacity_duration 0.1 \