updating gruvbox and init keymaps and autopairs
This commit is contained in:
parent
efd4b6978e
commit
176bbfbd92
|
|
@ -4,7 +4,7 @@ vim.pack.add({
|
|||
|
||||
-- Default options:
|
||||
require("gruvbox").setup({
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
terminal_colors = false, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
|
|
@ -20,11 +20,201 @@ require("gruvbox").setup({
|
|||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
contrast = "", -- can be "hard", "soft" or empty string
|
||||
palette_overrides = {},
|
||||
overrides = {},
|
||||
contrast = "soft", -- can be "hard", "soft" or empty string
|
||||
palette_overrides = {
|
||||
-- 1. Darken all root background variants (from hardest to softest)
|
||||
dark0_hard = "#0d0f10", -- The main background when contrast = "hard"
|
||||
dark0 = "#121415", -- The standard medium background
|
||||
dark0_soft = "#181a1b", -- The background when contrast = "soft"
|
||||
|
||||
-- 2. Darken the secondary UI layer (used for active lines and selection areas)
|
||||
dark1 = "#1d1f21", -- Used for things like CursorLine background
|
||||
dark2 = "#282a2e", -- Used for subtle UI dividers
|
||||
dark3 = "#373b41", -- Used for inactive tabs or panels
|
||||
dark4 = "#4c566a", -- Used for fold markers and subtle lines
|
||||
|
||||
-- 3. Soften the text color (prevents blinding stark white text against the dark backdrop)
|
||||
light0_hard = "#e5e9f0",
|
||||
light0 = "#d8dee9", -- The main text color (foreground)
|
||||
light0_soft = "#c8d0e0",
|
||||
},
|
||||
|
||||
|
||||
overrides = {
|
||||
-- Comments: dusty earth gray, slightly desaturated
|
||||
["@comment"] = { fg = "#6b6863", italic = true },
|
||||
["Comment"] = { fg = "#6b6863", italic = true },
|
||||
|
||||
-- Strings: olive/pastel green instead of bright green
|
||||
["@string"] = { fg = "#879050" },
|
||||
["String"] = { fg = "#878057" },
|
||||
|
||||
-- Keywords: pale brick red, muted
|
||||
["@keyword"] = { fg = "#a86a63" },
|
||||
["Keyword"] = { fg = "#a86a63" },
|
||||
["@keyword.conditional"] = { fg = "#a86a63" },
|
||||
|
||||
-- Functions: warm dusty brown/orange
|
||||
["@function"] = { fg = "#c2a073" },
|
||||
["Function"] = { fg = "#c2a073" },
|
||||
|
||||
-- Types: muted warm taupe/beige
|
||||
["@type"] = { fg = "#a89688" },
|
||||
["Type"] = { fg = "#a89688" },
|
||||
|
||||
-- Numbers: soft desaturated orange
|
||||
["@number"] = { fg = "#b8956a" },
|
||||
["Number"] = { fg = "#b8956a" },
|
||||
|
||||
-- Booleans: muted warm brown
|
||||
["@boolean"] = { fg = "#9a7b6f" },
|
||||
["Boolean"] = { fg = "#9a7b6f" },
|
||||
|
||||
-- Operators: desaturated warm gray
|
||||
["@operator"] = { fg = "#8b8580" },
|
||||
["Operator"] = { fg = "#8b8580" },
|
||||
|
||||
-- Special/Tags: muted dusty blue
|
||||
["@tag"] = { fg = "#7a8b9a" },
|
||||
["Tag"] = { fg = "#7a8b9a" },
|
||||
|
||||
-- Defaults: muted slate gray
|
||||
["@variable"] = { fg = "#a39a91" },
|
||||
["Variable"] = { fg = "#a39a91" },
|
||||
|
||||
-- Constants: soft desaturated teal
|
||||
["@constant"] = { fg = "#8a9a8b" },
|
||||
["Constant"] = { fg = "#8a9a8b" },
|
||||
|
||||
-- Exceptions: muted warm red
|
||||
["@exception"] = { fg = "#a67b7b" },
|
||||
["Exception"] = { fg = "#a67b7b" },
|
||||
|
||||
-- Parameters: dusty lavender gray
|
||||
["@parameter"] = { fg = "#a1958a" },
|
||||
["Parameter"] = { fg = "#a1958a" },
|
||||
|
||||
-- Methods: warm muted copper
|
||||
["@method"] = { fg = "#c4a88b" },
|
||||
["Method"] = { fg = "#c4a88b" },
|
||||
|
||||
-- Fields: soft desaturated brown
|
||||
["@field"] = { fg = "#9a8b7b" },
|
||||
["Field"] = { fg = "#9a8b7b" },
|
||||
|
||||
-- Properties: muted sage green
|
||||
["@property"] = { fg = "#8a9a7b" },
|
||||
["Property"] = { fg = "#8a9a7b" },
|
||||
|
||||
-- Import: dusty cool gray
|
||||
["@include"] = { fg = "#8f8780" },
|
||||
["Include"] = { fg = "#8f8780" },
|
||||
|
||||
-- Definitions: muted warm gray
|
||||
["@define"] = { fg = "#8f8a85" },
|
||||
["Define"] = { fg = "#8f8a85" },
|
||||
|
||||
-- Macros: soft desaturated purple
|
||||
["@macro"] = { fg = "#8a7b9a" },
|
||||
["Macro"] = { fg = "#8a7b9a" },
|
||||
|
||||
-- Title: warm muted orange
|
||||
["Title"] = { fg = "#c9a66b" },
|
||||
|
||||
-- Directory: dusty blue-gray
|
||||
["Directory"] = { fg = "#7a8590" },
|
||||
|
||||
-- Statement: pale brick
|
||||
["Statement"] = { fg = "#b55a5a" },
|
||||
|
||||
-- Work: muted warm tone
|
||||
["Work"] = { fg = "#c9a66b" },
|
||||
|
||||
-- Cursor: keep bright for visibility
|
||||
["Cursor"] = { fg = "#121415", bg = "#d8dee9" },
|
||||
["CursorLine"] = { bg = "#1d1f21" },
|
||||
["CursorColumn"] = { bg = "#1d1f21" },
|
||||
|
||||
-- UI elements: subtle muted tones
|
||||
["LineNr"] = { fg = "#5a5d63" },
|
||||
["LineNrActive"] = { fg = "#9aa0a6" },
|
||||
["VertSplit"] = { fg = "#282a2e" },
|
||||
["FoldColumn"] = { fg = "#5a5d63" },
|
||||
["Folded"] = { fg = "#5a5d63", bg = "#181a1b" },
|
||||
["SignColumn"] = { fg = "#5a5d63" },
|
||||
|
||||
-- Status lines: muted dark
|
||||
["StatusLine"] = { fg = "#9aa0a6", bg = "#181a1b" },
|
||||
["StatusLineNC"] = { fg = "#6b6863", bg = "#181a1b" },
|
||||
["TabLine"] = { fg = "#9aa0a6", bg = "#181a1b" },
|
||||
["TabLineSel"] = { fg = "#d8dee9", bg = "#282a2e" },
|
||||
|
||||
-- Search/highlights: softened
|
||||
["Search"] = { fg = "#121415", bg = "#c9a66b" },
|
||||
["IncSearch"] = { fg = "#121415", bg = "#b55a5a" },
|
||||
["MatchParen"] = { bg = "#282a2e", bold = true },
|
||||
|
||||
-- Diff: muted colors
|
||||
["DiffAdd"] = { fg = "#121415", bg = "#8a9a7b" },
|
||||
["DiffChange"] = { fg = "#121415", bg = "#8a8590" },
|
||||
["DiffDelete"] = { fg = "#121415", bg = "#a67b7b" },
|
||||
["DiffText"] = { fg = "#121415", bg = "#c9a66b" },
|
||||
|
||||
-- Alerts: softened
|
||||
["InfoMsg"] = { fg = "#7a8b9a" },
|
||||
["Question"] = { fg = "#9aa0a6" },
|
||||
|
||||
-- Visual: muted
|
||||
["Visual"] = { bg = "#3d2d31" },
|
||||
["VisualNOS"] = { bg = "#3d1a1e" },
|
||||
|
||||
-- Quickfix: subtle
|
||||
["QuickfixLine"] = { bg = "#282a2e" },
|
||||
|
||||
-- Pmenu: dusty
|
||||
["Pmenu"] = { fg = "#9aa0a6", bg = "#181a1b" },
|
||||
["PmenuSel"] = { fg = "#d8dee9", bg = "#282a2e" },
|
||||
["PmenuSbar"] = { bg = "#181a1b" },
|
||||
["PmenuThumb"] = { bg = "#373b41" },
|
||||
|
||||
-- Whitespace: very subtle
|
||||
["Whitespace"] = { fg = "#373b41" },
|
||||
["@punctuation.bracket"] = { fg = "#987f87" },
|
||||
["@punctuation.delimiter"] = { fg = "#6b8580" },
|
||||
["@punctuation.special"] = { fg = "#987f87" },
|
||||
["@punctuation.braces"] = { fg = "#987f87"},["Delimiter"] = { fg = "#987f87" },
|
||||
["Special"] = { fg = "#987f87" },
|
||||
|
||||
|
||||
|
||||
["ErrorMsg"] = { fg = "#a86a63" }, -- muted brick
|
||||
["WarningMsg"] = { fg = "#b59a78" }, -- aged brass
|
||||
|
||||
["DiagnosticError"] = { fg = "#a86a63" },
|
||||
["DiagnosticWarn"] = { fg = "#b59a78" },
|
||||
["DiagnosticInfo"] = { fg = "#7f8c94" },
|
||||
["DiagnosticHint"] = { fg = "#8a9684" },
|
||||
|
||||
|
||||
-- 1. Force the file tree backgrounds to perfectly match your root dark/muted palette
|
||||
NeoTreeNormal = { fg = "#d8dee9", bg = "#0d0f10" }, -- Uses your custom dark palette values
|
||||
NeoTreeNormalNC = { fg = "#c8d0e0", bg = "#0d0f10" }, -- Keeps background locked when focusing code windows
|
||||
|
||||
-- 2. Blend the vertical layout line seamlessly
|
||||
NeoTreeWinSeparator = { fg = "#1d1f21", bg = "NONE" },
|
||||
|
||||
-- 3. Mute or adjust specific directory components
|
||||
NeoTreeDirectoryName = { fg = "#286770" }, -- Classic Gruvbox blue made flat
|
||||
NeoTreeDirectoryIcon = { fg = "#ce9b0f" }, -- Keep the iconic yellow but bounded
|
||||
NeoTreeFileName = { fg = "#d8dee9" }, -- Clean primary font color
|
||||
|
||||
-- 4. Keep git modification trackers subtle
|
||||
NeoTreeGitModified = { fg = "#8a9a8b" }, -- Soft olive instead of glaring neon green
|
||||
NeoTreeGitUntracked = { fg = "#cc7917" },
|
||||
},
|
||||
|
||||
dim_inactive = false,
|
||||
transparent_mode = false,
|
||||
})
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
|
|
|
|||
|
|
@ -16,3 +16,53 @@ end
|
|||
--1) this one is for moving lines like in vscode, up and down with alt j or down with alt-k
|
||||
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==")
|
||||
vim.keymap.set("n", "<A-k>", ":m .-2<CR>==")
|
||||
vim.keymap.set('n', '<leader>tv', '<Cmd>vsplit | terminal<CR>i', { desc = 'Open terminal vertical split and enter insert' })
|
||||
|
||||
-- Enable the autocomplete pop-up menu to appear automatically as you type
|
||||
vim.opt.autocomplete = true
|
||||
|
||||
-- Set a minimal delay (in milliseconds) before the menu pops up
|
||||
-- 100ms-150ms is usually the sweet spot to prevent it from flickering on every keystroke
|
||||
vim.opt.autocompletedelay = 200
|
||||
|
||||
-- Scan only the current buffer for auto-completion matches
|
||||
-- '.' tells Vim to only scan the current buffer
|
||||
vim.opt.complete = "."
|
||||
|
||||
-- Configure the completion menu to use fuzzy matching and adjust behavior
|
||||
-- 'menuone' shows the popup even if there's only one match
|
||||
-- 'noselect' prevents automatically selecting/inserting the first match until you choose it
|
||||
-- 'fuzzy' enables the matching logic you requested
|
||||
vim.opt.completeopt = { "menuone", "noselect", "fuzzy" }
|
||||
|
||||
-- Helper function to check if the popup menu (pum) is visible
|
||||
local pumvisible = function()
|
||||
return vim.fn.pumvisible() == 1
|
||||
end
|
||||
|
||||
-- Use Tab to cycle down the menu (if open), otherwise insert a literal Tab
|
||||
vim.keymap.set("i", "<Tab>", function()
|
||||
if pumvisible() then
|
||||
return "<C-n>"
|
||||
else
|
||||
return "<Tab>"
|
||||
end
|
||||
end, { expr = true })
|
||||
|
||||
-- Use Shift+Tab to cycle up the menu (if open)
|
||||
vim.keymap.set("i", "<S-Tab>", function()
|
||||
if pumvisible() then
|
||||
return "<C-p>"
|
||||
else
|
||||
return "<S-Tab>"
|
||||
end
|
||||
end, { expr = true })
|
||||
|
||||
-- Force a global statusline across all windows (or 2 for split-specific)
|
||||
vim.opt.laststatus = 3
|
||||
|
||||
-- Customize the native statusline to ONLY show the file path and the line:col
|
||||
-- %f = relative path, %= = separation point to push items right, %l:%c = line:col
|
||||
vim.opt.statusline = "%f %{mode()} %l:%c"
|
||||
-- set esc keybind to jj
|
||||
vim.keymap.set('i', 'jj', '<Esc>', { desc = 'Exit Insert mode' })
|
||||
|
|
|
|||
|
|
@ -1,5 +1,26 @@
|
|||
-- autopairs
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
|
||||
-- 1. Load the plugin
|
||||
vim.pack.add { 'https://github.com/windwp/nvim-autopairs' }
|
||||
require('nvim-autopairs').setup {}
|
||||
|
||||
-- 2. Initialize nvim-autopairs with Treesitter and FastWrap enabled
|
||||
local npairs = require('nvim-autopairs')
|
||||
|
||||
npairs.setup({
|
||||
check_ts = true, -- Enable Treesitter integration
|
||||
fast_wrap = {
|
||||
-- Enabling this automatically maps <M-e> by default
|
||||
-- You do not need a separate vim.keymap line for it.
|
||||
},
|
||||
})
|
||||
|
||||
-- 3. Setup completion integration (Safe-pcalled in case cmp hasn't loaded yet)
|
||||
local status_cmp, cmp = pcall(require, 'cmp')
|
||||
local status_handlers, cmp_autopairs = pcall(require, 'nvim-autopairs.completion.cmp')
|
||||
|
||||
if status_cmp and status_handlers then
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done() -- Automatically adds brackets after selecting a function/method[cite: 1]
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue