vim.cmd [[ set nocompatible filetype plugin indent on syntax enable call plug#begin('~/.local/share/nvim/plugged') Plug 'tpope/vim-sensible' Plug 'junegunn/fzf.vim' Plug 'tpope/vim-surround' Plug 'tpope/vim-commentary' Plug 'jiangmiao/auto-pairs' Plug 'tpope/vim-repeat' Plug 'mattn/emmet-vim' Plug 'norcalli/nvim-colorizer.lua' call plug#end() ]] vim.opt.clipboard = "unnamedplus" vim.opt.updatetime = 300 vim.opt.timeoutlen = 500 vim.opt.signcolumn = "yes" vim.opt.completeopt = { "menuone", "noinsert", "noselect" } vim.opt.encoding = "utf-8" vim.opt.number = true vim.opt.relativenumber = true vim.opt.numberwidth = 4 vim.opt.tabstop = 4 vim.opt.shiftwidth = 4 vim.opt.expandtab = true vim.opt.smartindent = true vim.opt.incsearch = true vim.opt.hlsearch = true vim.opt.ignorecase = true vim.opt.smartcase = true vim.opt.wrap = true vim.opt.mouse = "a" vim.opt.scrolloff = 5 vim.opt.cursorline = true vim.opt.showmode = false vim.opt.shortmess:append("I") vim.opt.autoindent = true vim.opt.termguicolors = true vim.opt.list = true vim.opt.undodir = vim.fn.stdpath("cache") .. "/undo" vim.opt.undofile = true vim.opt.wrapscan = true vim.opt.shortmess:append("c") vim.opt.autoread = true vim.opt.cmdheight = 1 vim.opt.belloff = "all" vim.opt.laststatus = 2 vim.opt.scrolljump = 3 vim.opt.hidden = true vim.opt.splitbelow = true vim.opt.splitright = true vim.opt.backup = false vim.opt.writebackup = false vim.opt.lazyredraw = true vim.opt.smoothscroll = true vim.api.nvim_set_hl(0, "Normal", { fg = "#a6536f", bg = "NONE", ctermfg = 132, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "NormalNC", { fg = "#bb6c82", bg = "NONE", ctermfg = 168, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "LineNr", { fg = "#743c5e", bg = "NONE", ctermfg = 132, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "CursorLine", { bg = "#3f1f32", fg = "NONE", blend = 30 }) vim.api.nvim_set_hl(0, "VertSplit", { fg = "#3f1f32", bg = "NONE", ctermfg = 237, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "StatusLine", { fg = "#a6536f", bg = "#2a1c2e", ctermfg = 132, ctermbg = 235, }) vim.api.nvim_set_hl(0, "StatusLineMode", { fg = "#f7d8e5", bg = "#5e2f4c", bold = true, ctermfg = 224, ctermbg = 131, }) vim.api.nvim_set_hl(0, "Visual", { bg = "#5a2c3a", fg = "NONE", ctermbg = 52, ctermfg = "NONE" }) vim.api.nvim_set_hl(0, "VisualNOS", { bg = "#5a2c3a", fg = "NONE", ctermbg = 52, ctermfg = "NONE" }) vim.api.nvim_set_hl(0, "VisualSB", { bg = "#5a2c3a", fg = "NONE", ctermbg = 52, ctermfg = "NONE" }) vim.api.nvim_set_hl(0, "Search", { fg = "#b0576f", bg = "#1c1533", ctermfg = 131, ctermbg = 234 }) vim.api.nvim_set_hl(0, "IncSearch", { fg = "#f5a3ba", bg = "#1c1533", ctermfg = 218, ctermbg = 234 }) vim.api.nvim_set_hl(0, "Pmenu", { fg = "#b0576f", bg = "NONE", ctermfg = 131, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "PmenuSel", { fg = "#000000", bg = "#b0576f", ctermfg = 0, ctermbg = 131 }) vim.api.nvim_set_hl(0, "WildMenu", { fg = "#b0576f", bg = "NONE", ctermfg = 131, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "Folded", { fg = "#c18299", bg = "NONE", ctermfg = 174, ctermbg = "NONE" }) vim.api.nvim_set_hl(0, "SignColumn", { fg = "#f0b6c8", bg = "NONE", ctermfg = 224, ctermbg = "NONE" }) local mode_names = { n = "ROOT NRM", i = "ROOT INS", v = "ROOT VSL", V = "ROOT VLI", [""] = "ROOT VBL", R = "ROOT RPL", c = "ROOT CMD", } function _G.ModeName() return mode_names[vim.fn.mode()] or "UNK" end vim.opt.statusline = table.concat { "%#StatusLineMode# ", "%{v:lua.ModeName()} ", "%#StatusLine# ", "%f %m %r ", "%=", "Ln:%l/%L ", "Col:%c ", "[%p%%]", } vim.g.mapleader = " " local map = vim.keymap.set map("n", "w", ":w") map("n", "q", ":q") map("n", "h", ":nohlsearch", { silent = true }) map("n", "n", ":set relativenumber!") map("n", "", "h") map("n", "", "j") map("n", "", "k") map("n", "", "l") map("n", "v", ":Ex") map("", "j", "gj") map("", "k", "gk") vim.keymap.set({ "n", "v" }, "cd", vim.cmd.Ex) vim.keymap.set({ "n", "v" }, "d", '"_d', { desc = "Delete without yanking" }) vim.keymap.set("n", "bn", ":bnext", { desc = "Next buffer" }) vim.keymap.set("n", "bp", ":bprevious", { desc = "Previous buffer" }) vim.keymap.set("n", "", "h", { desc = "Move to left window" }) vim.keymap.set("n", "", "j", { desc = "Move to bottom window" }) vim.keymap.set("n", "", "k", { desc = "Move to top window" }) vim.keymap.set("n", "", "l", { desc = "Move to right window" }) local modes_to_disable = { "n", "v", "x", "s", "c" } local arrows = { "", "", "", "" } for _, mode in ipairs(modes_to_disable) do for _, key in ipairs(arrows) do vim.keymap.set(mode, key, "", { silent = true }) end end vim.keymap.set("n", "sv", ":vsplit", { desc = "Split window vertically" }) vim.keymap.set("n", "sh", ":split", { desc = "Split window horizontally" }) vim.keymap.set("n", "", ":resize +2", { desc = "Increase window height" }) vim.keymap.set("n", "", ":resize -2", { desc = "Decrease window height" }) vim.keymap.set("n", "", ":vertical resize -2", { desc = "Decrease window width" }) vim.keymap.set("n", "", ":vertical resize +2", { desc = "Increase window width" }) vim.keymap.set("n", "", ":m .+1==", { desc = "Move line down" }) vim.keymap.set("n", "", ":m .-2==", { desc = "Move line up" }) vim.keymap.set("v", "", ":m '>+1gv=gv", { desc = "Move selection down" }) vim.keymap.set("v", "", ":m '<-2gv=gv", { desc = "Move selection up" }) require('colorizer').setup { '*', css = { names = true }, html = { names = true }, }