hachem.wtf
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-12-06 01:31:03 +0100
committerhachem <im@hachem.wtf>2025-12-06 01:31:03 +0100
commitee0282c364bcb3e79dc842697eaeca829f9e7725 (patch)
tree79c1c427d5658015ec9f17e55d09473c661c8ed9
parentebfc44f83640fadf7338c20b652ca3408f21bbd2 (diff)
update
-rw-r--r--.config/nvim/init.lua219
1 files changed, 112 insertions, 107 deletions
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
index 7ff6cb7..d4776ed 100644
--- a/.config/nvim/init.lua
+++ b/.config/nvim/init.lua
@@ -1,4 +1,4 @@
--- BOOTSTRAP LAZY.NVIM
+-- BOOTSTRAP lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
@@ -22,12 +22,14 @@ require("lazy").setup({
"lukas-reineke/indent-blankline.nvim",
"windwp/nvim-autopairs",
- -- Better file explorer
+ -- File explorer
{
"stevearc/oil.nvim",
opts = {
default_file_explorer = true,
- view_options = { show_hidden = true },
+ view_options = {
+ show_hidden = true,
+ },
},
},
@@ -40,80 +42,78 @@ require("lazy").setup({
vim.g.gruvbox_baby_background_color = "medium"
vim.g.gruvbox_baby_telescope_theme = 1
vim.g.gruvbox_baby_transparent_mode = 1
-
vim.cmd.colorscheme("gruvbox-baby")
end,
},
-{
- "folke/noice.nvim",
- event = "VeryLazy",
- dependencies = {
- "MunifTanjim/nui.nvim",
- "rcarriga/nvim-notify",
- },
- config = function()
- require("noice").setup({
- presets = {
- bottom_search = true,
- command_palette = true,
- long_message_to_split = true,
- inc_rename = false,
- lsp_doc_border = true,
- },
-
- --- ASCII-only UI patch
- routes = {
- {
- filter = { event = "msg_show", kind = "", find = "" },
- opts = { skip = true },
+ -- Noice UI
+ {
+ "folke/noice.nvim",
+ event = "VeryLazy",
+ dependencies = {
+ "MunifTanjim/nui.nvim",
+ "rcarriga/nvim-notify",
+ },
+ config = function()
+ require("noice").setup({
+ presets = {
+ bottom_search = true,
+ command_palette = true,
+ long_message_to_split = true,
+ inc_rename = false,
+ lsp_doc_border = true,
},
- },
- cmdline = {
- format = {
- cmdline = { icon = ":" },
- search_down = { icon = "/" },
- search_up = { icon = "?" },
+ -- ASCII-only UI patch
+ routes = {
+ {
+ filter = { event = "msg_show", kind = "", find = "" },
+ opts = { skip = true },
+ },
},
- },
- lsp = {
- progress = {
- enabled = true,
+ cmdline = {
format = {
- progress = function(message)
- return string.format(
- "%s [%s%%]",
- message.title or "LSP",
- message.percentage or "?"
- )
- end,
+ cmdline = { icon = ":" },
+ search_down = { icon = "/" },
+ search_up = { icon = "?" },
},
- format_done = function(message)
- return "LSP done"
- end,
},
- },
- })
- -- nvim-notify ASCII settings
- local notify = require("notify")
- notify.setup({
- render = "compact",
- stages = "static",
- icons = {
- ERROR = "E",
- WARN = "W",
- INFO = "I",
- DEBUG = ">",
- TRACE = "-",
- },
- })
- vim.notify = notify
- end,
-},
- -- Lualine — ASCII only UI
+ lsp = {
+ progress = {
+ enabled = true,
+ format = {
+ progress = function(msg)
+ return string.format("%s [%s%%]",
+ msg.title or "LSP",
+ msg.percentage or "?"
+ )
+ end,
+ },
+ format_done = function(_) return "LSP done" end,
+ },
+ },
+ })
+
+ -- nvim-notify ASCII settings
+ local notify = require("notify")
+ notify.setup({
+ render = "compact",
+ stages = "static",
+ icons = {
+ ERROR = "E",
+ WARN = "W",
+ INFO = "I",
+ DEBUG = ">",
+ TRACE = "-",
+ },
+ })
+ vim.notify = notify
+ end,
+ },
+
+ -- Lualine ASCII UI
{
"nvim-lualine/lualine.nvim",
config = function()
@@ -143,7 +143,7 @@ require("lazy").setup({
local config = {
options = {
- globalstatus = true, -- sits at bottom
+ globalstatus = true,
component_separators = "",
section_separators = "",
theme = {
@@ -172,42 +172,48 @@ require("lazy").setup({
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
+
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
ins_left({
function() return "|" end,
- color = { fg = colors.blue, bg = "NONE" },
+ color = { fg = colors.blue },
})
ins_left({
function() return "*" end,
color = function()
local mode_color = {
- n = colors.red, i = colors.green, v = colors.blue,
- V = colors.blue, c = colors.magenta, s = colors.orange,
- S = colors.orange, ic = colors.yellow, R = colors.violet,
- t = colors.red,
+ n = colors.red,
+ i = colors.green,
+ v = colors.blue,
+ V = colors.blue,
+ c = colors.magenta,
+ s = colors.orange,
+ S = colors.orange,
+ ic = colors.yellow,
+ R = colors.violet,
+ t = colors.red,
}
- return { fg = mode_color[vim.fn.mode()], bg = "NONE" }
+ return { fg = mode_color[vim.fn.mode()] }
end,
})
ins_left({
"filesize",
cond = conditions.buffer_not_empty,
- color = { bg = "NONE" },
})
ins_left({
"filename",
cond = conditions.buffer_not_empty,
- color = { fg = colors.magenta, gui = "bold", bg = "NONE" },
+ color = { fg = colors.magenta, gui = "bold" },
})
- ins_left({ "location", color = { bg = "NONE" } })
- ins_left({ "progress", color = { fg = colors.fg, gui = "bold", bg = "NONE" } })
+ ins_left("location")
+ ins_left({ "progress", color = { gui = "bold" } })
ins_left({
"diagnostics",
@@ -215,9 +221,7 @@ require("lazy").setup({
symbols = { error = "E:", warn = "W:", info = "I:" },
})
- ins_left({
- function() return "%=" end,
- })
+ ins_left(function() return "%=" end)
ins_left({
function()
@@ -232,26 +236,26 @@ require("lazy").setup({
return msg
end,
icon = "LSP:",
- color = { fg = "#ffffff", gui = "bold", bg = "NONE" },
+ color = { fg = "#ffffff", gui = "bold" },
})
ins_right({
"o:encoding",
fmt = string.upper,
- color = { fg = colors.green, gui = "bold", bg = "NONE" },
+ color = { fg = colors.green, gui = "bold" },
})
ins_right({
"fileformat",
fmt = string.upper,
icons_enabled = false,
- color = { fg = colors.green, gui = "bold", bg = "NONE" },
+ color = { fg = colors.green, gui = "bold" },
})
ins_right({
"branch",
icon = "git:",
- color = { fg = colors.violet, gui = "bold", bg = "NONE" },
+ color = { fg = colors.violet, gui = "bold" },
})
ins_right({
@@ -261,7 +265,7 @@ require("lazy").setup({
ins_right({
function() return "|" end,
- color = { fg = colors.blue, bg = "NONE" },
+ color = { fg = colors.blue },
})
lualine.setup(config)
@@ -286,14 +290,8 @@ require("lazy").setup({
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
- "lua",
- "vim",
- "c",
- "cpp",
- "markdown",
- "python",
- "rust",
- "bash",
+ "lua", "vim", "c", "cpp", "markdown",
+ "python", "rust", "bash",
},
})
end,
@@ -311,10 +309,15 @@ require("lazy").setup({
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
+
require("luasnip.loaders.from_vscode").lazy_load()
cmp.setup({
- snippet = { expand = function(args) luasnip.lsp_expand(args.body) end },
+ snippet = {
+ expand = function(args)
+ luasnip.lsp_expand(args.body)
+ end,
+ },
mapping = cmp.mapping.preset.insert({
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
@@ -381,7 +384,7 @@ require("lazy").setup({
},
},
- -- Git signs (ASCII)
+ -- Git signs ASCII
{
"lewis6991/gitsigns.nvim",
config = function()
@@ -406,7 +409,7 @@ require("lazy").setup({
},
})
--- CURSOR/SELECTION aesthetics
+-- Cursor/selection aesthetics
vim.api.nvim_set_hl(0, "CursorLine", { bg = "#1c1c1c" })
vim.api.nvim_set_hl(0, "Visual", { bg = "#262626" })
@@ -416,7 +419,7 @@ vim.fn.sign_define("DiagnosticSignWarn", { text = "W", texthl = "DiagnosticWarn
vim.fn.sign_define("DiagnosticSignInfo", { text = "I", texthl = "DiagnosticInfo" })
vim.fn.sign_define("DiagnosticSignHint", { text = "H", texthl = "DiagnosticHint" })
--- OPTIONS
+-- Options
local opt = vim.opt
opt.number = true
opt.mouse = "a"
@@ -433,19 +436,19 @@ opt.cursorline = true
opt.scrolloff = 10
opt.clipboard = "unnamedplus"
--- typo forgiveness
+-- Typo forgiveness
vim.cmd([[
- cnoreabbrev W w
- cnoreabbrev Q q
- cnoreabbrev WQ wq
- cnoreabbrev Wq wq
- cnoreabbrev wQ wq
- cnoreabbrev WQA wqa
- cnoreabbrev WQa wqa
- cnoreabbrev Wqa wqa
+ cnoreabbrev W w
+ cnoreabbrev Q q
+ cnoreabbrev WQ wq
+ cnoreabbrev Wq wq
+ cnoreabbrev wQ wq
+ cnoreabbrev WQA wqa
+ cnoreabbrev WQa wqa
+ cnoreabbrev Wqa wqa
]])
--- KEYMAPS
+-- Keymaps
local map = vim.keymap.set
map("n", "<Esc>", ":nohl<CR>")
map("n", "-", require("oil").open, { desc = "Open parent directory" })
@@ -457,5 +460,7 @@ map("n", "<leader>fb", telescope.buffers)
-- Yank highlight
vim.api.nvim_create_autocmd("TextYankPost", {
- callback = function() vim.highlight.on_yank() end,
+ callback = function()
+ vim.highlight.on_yank()
+ end,
})