From c67128b08261489d084992a75be780ba98e5db33 Mon Sep 17 00:00:00 2001 From: Spencer-Rhodes Date: Mon, 22 Apr 2024 14:54:26 -0700 Subject: [PATCH] Quality of life enhancements like dark mode theme switching, reduced autocomplete noise, etc --- init.lua | 5 ---- lua/custom/helpers/icons.lua | 10 ++++++++ lua/custom/options.lua | 8 +++--- lua/custom/plugins/autocomplete.lua | 4 +-- lua/custom/plugins/init.lua | 35 +++++++++++++++++++++++++- lua/custom/plugins/ui.lua | 38 ++++++++++++++++++++++++++--- 6 files changed, 85 insertions(+), 15 deletions(-) diff --git a/init.lua b/init.lua index c63b0fa..4649bc7 100644 --- a/init.lua +++ b/init.lua @@ -5,11 +5,6 @@ vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' local preferred_border = vim.g.pref_border_style or 'single' -local preferred_transparency = vim.g.pref_blend or 0 -local layer_theme = vim.g.pref_layer_colorscheme -local alt_theme = "catppuccin-mocha" -local theme_light = "tokyonight-day" -local theme_dark = "retrobox" -- [[ Setting options ]] require('custom.options') diff --git a/lua/custom/helpers/icons.lua b/lua/custom/helpers/icons.lua index 98b34c8..43e530e 100644 --- a/lua/custom/helpers/icons.lua +++ b/lua/custom/helpers/icons.lua @@ -57,4 +57,14 @@ return { Value = " ", Variable = " ", }, + modes = { + insert = "✎", + normal = "𝌗", + visual = "", + select = "", + ["v-line"] = "", + -- command = "˃:", + command = "⌘", + terminal = "˃ˍ", + }, } diff --git a/lua/custom/options.lua b/lua/custom/options.lua index 1a1f27c..837858c 100644 --- a/lua/custom/options.lua +++ b/lua/custom/options.lua @@ -6,9 +6,11 @@ local globals = { pref_tab_order = 'BufferOrderByDirectory', pref_border_style = 'single', pref_blend = 0, - -- pref_colorscheme = 'catppuccin', - pref_colorscheme = 'nordic', - pref_layer_colorscheme = 'gruvbox', + pref_colorscheme_layers = 'nordic', + pref_colorscheme_light = "catppuccin-latte", + pref_colorscheme_dark = "retrobox", + pref_colorscheme = 'retrobox', + pref_colorscheme_alt = "catppuccin-mocha", pref_autoformat = false, } diff --git a/lua/custom/plugins/autocomplete.lua b/lua/custom/plugins/autocomplete.lua index f06c8ef..2d53393 100644 --- a/lua/custom/plugins/autocomplete.lua +++ b/lua/custom/plugins/autocomplete.lua @@ -19,7 +19,7 @@ return { dependencies = { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-buffer", + -- "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "saadparwaiz1/cmp_luasnip", "L3MON4D3/LuaSnip", @@ -88,7 +88,7 @@ return { -- { name = "html-css" }, { name = "nvim_lsp" }, { name = "luasnip" }, - { name = "buffer" }, + -- { name = "buffer" }, { name = "path" }, }), formatting = { diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d..f476400 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,5 +1,38 @@ + -- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { + { + -- https://github.com/klen/nvim-config-local + "klen/nvim-config-local", + opts = { + -- Default options (optional) + + -- Config file patterns to load (lua supported) + config_files = { ".nvim.lua", ".nvimrc", ".exrc" }, + + -- Where the plugin keeps files data + hashfile = vim.fn.stdpath("data") .. "/config-local", + + autocommands_create = true, -- Create autocommands (VimEnter, DirectoryChanged) + commands_create = true, -- Create commands (ConfigLocalSource, ConfigLocalEdit, ConfigLocalTrust, ConfigLocalIgnore) + silent = false, -- Disable plugin messages (Config loaded/ignored) + lookup_parents = false, -- Lookup config files in parent directories + }, + config = true, + }, + { + -- https://github.com/ahonn/vim-fileheader + 'ahonn/vim-fileheader', + enabled = false, + config = function() + vim.notify('Configuring vim-fileheader') + vim.g.fileheader_auto_add = 0 + vim.g.fileheader_auto_update = 0 + vim.g.fileheader_show_email = 0 + vim.g.fileheader_by_git_config = 0 + end + }, +} diff --git a/lua/custom/plugins/ui.lua b/lua/custom/plugins/ui.lua index 278e93a..92f9418 100644 --- a/lua/custom/plugins/ui.lua +++ b/lua/custom/plugins/ui.lua @@ -1,4 +1,4 @@ -local layer_theme = vim.g.pref_layer_colorscheme or 'evening' +local layer_theme = vim.g.pref_colorscheme_layers or 'default' local icons = require('custom.helpers.icons') return { @@ -26,6 +26,34 @@ return { -- end, }, + { + -- https://github.com/eliseshaffer/darklight.nvim#colorscheme + 'eliseshaffer/darklight.nvim', + lazy = false, + opts = { + mode = 'colorscheme', + light_mode_colorscheme = vim.g.pref_colorscheme_light or 'default', + dark_mode_colorscheme = vim.g.pref_colorscheme_dark or 'default', + }, + config = true, + }, + + { + -- https://github.com/f-person/auto-dark-mode.nvim#using-lazy + "f-person/auto-dark-mode.nvim", + config = { + update_interval = 1000, + set_dark_mode = function() + vim.api.nvim_set_option("background", "dark") + vim.cmd("colorscheme " .. vim.g.pref_colorscheme_dark) + end, + set_light_mode = function() + vim.api.nvim_set_option("background", "light") + vim.cmd("colorscheme " .. vim.g.pref_colorscheme_light) + end, + }, + }, + -- Other UI { -- Breadcrumbs dropbar (like IntelliJ's): Requires nvim 0.10+ @@ -101,7 +129,7 @@ return { { -- https://github.com/folke/styler.nvim#readme "folke/styler.nvim", - enabled = false, + enabled = true, -- lazy = true, opts = { themes = { @@ -395,11 +423,13 @@ return { { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, -- See `:help lualine.txt` opts = { options = { icons_enabled = true, - theme = 'powerline_dark', + -- theme = 'powerline_dark', + theme = 'PaperColor', component_separators = '/', -- section_separators = '', }, @@ -409,7 +439,7 @@ return { 'mode', icons_enabled = true, fmt = function(str) - return str:sub(1, 1) + return icons.modes[str:lower()] or str:sub(1, 2) end } },