diff options
| author | Tim Keller <tjk@tjkeller.xyz> | 2026-05-21 22:43:45 -0500 |
|---|---|---|
| committer | Tim Keller <tjk@tjkeller.xyz> | 2026-05-21 22:44:06 -0500 |
| commit | b289c88c8af8f35faf16ccc4fbb0af7798d2316a (patch) | |
| tree | da9908ca8312cce48863ecd33d8e3e09a64efc5c /lua | |
| parent | a1991e505485abe9425560714d45b1fe1b2a7cfe (diff) | |
| download | nvim-b289c88c8af8f35faf16ccc4fbb0af7798d2316a.tar.xz nvim-b289c88c8af8f35faf16ccc4fbb0af7798d2316a.zip | |
get rid of lazy.nvim in favor of natively installed packages. some general refactoring
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/tjk/colorscheme.lua | 63 | ||||
| -rw-r--r-- | lua/tjk/keybindings.lua | 1 | ||||
| -rw-r--r-- | lua/tjk/lazy.lua | 37 | ||||
| -rw-r--r-- | lua/tjk/lsp.lua | 24 | ||||
| -rw-r--r-- | lua/tjk/options.lua | 5 | ||||
| -rw-r--r-- | lua/tjk/plugins.lua | 60 | ||||
| -rw-r--r-- | lua/tjk/plugins/autoclose.lua | 9 | ||||
| -rw-r--r-- | lua/tjk/plugins/cmp.lua | 14 | ||||
| -rw-r--r-- | lua/tjk/plugins/colorizer.lua | 12 | ||||
| -rw-r--r-- | lua/tjk/plugins/colorscheme.lua | 71 | ||||
| -rw-r--r-- | lua/tjk/plugins/lsp.lua | 17 | ||||
| -rw-r--r-- | lua/tjk/plugins/manageself.lua | 4 | ||||
| -rw-r--r-- | lua/tjk/plugins/snacks.lua | 15 | ||||
| -rw-r--r-- | lua/tjk/plugins/tabline.lua | 4 | ||||
| -rw-r--r-- | lua/tjk/plugins/treesitter.lua | 31 |
15 files changed, 147 insertions, 220 deletions
diff --git a/lua/tjk/colorscheme.lua b/lua/tjk/colorscheme.lua new file mode 100644 index 0000000..e4b9c8e --- /dev/null +++ b/lua/tjk/colorscheme.lua @@ -0,0 +1,63 @@ +-- use another colorscheme if running as root +if os.getenv "USER" == "root" then + vim.cmd.colorscheme "koehler" + return +end + +-- use dark gruvbox variant +vim.o.background = "dark" + +-- https://github.com/ellisonleao/gruvbox.nvim +require("gruvbox").setup { + italic = { + strings = false, + emphasis = true, + comments = false, + operators = false, + folds = true, + }, + invert_selection = true, -- swap fg w/ bg on select + contrast = "hard", -- preferred theme variant + palette_overrides = { + light0 = "#ffffff", -- use white instead of the default off-white for text + light1 = "#ffffff", + dark2 = "#363636", -- darker whitespace characters + }, + overrides = { + CursorLine = { bg = "#282828" }, -- dark0 (non hard) + Directory = { link = "GruvboxGreenBold" }, + -- treesitter overrides (more similar to builtin python syntax highlighting) + -- treesitter selectors can be overridden per language using @selector.language + ["@variable"] = { link = "GruvboxFg0" }, + ["@punctuation.bracket"] = { link = "GruvboxFg0" }, + ["@punctuation.delimiter"] = { link = "GruvboxFg0" }, + ["@keyword.import"] = { link = "GruvboxBlue" }, + ["@function"] = { link = "GruvboxAqua" }, + ["@function.method"] = { link = "GruvboxAqua" }, + ["@function.method"] = { link = "GruvboxAqua" }, + ["@attribute.builtin"] = { link = "GruvboxGreenBold" }, + ["@attribute"] = { link = "GruvboxGreenBold" }, + ["@operator"] = { link = "GruvboxRed" }, + ["@variable.member"] = { link = "GruvboxFg0" }, + ["@variable.parameter"] = { link = "GruvboxFg0" }, + ["@function.call"] = { link = "GruvboxPurple" }, + ["@function.method.call"] = { link = "GruvboxPurple" }, + -- rainbow delimiters colors + RainbowDelimiterRed = { fg = "#ff4433" }, + RainbowDelimiterYellow = { fg = "#ffff22" }, + RainbowDelimiterBlue = { fg = "#66f3ff" }, + RainbowDelimiterOrange = { fg = "#ffaa00" }, + RainbowDelimiterGreen = { fg = "#99ff44" }, + RainbowDelimiterViolet = { fg = "#aa00ff" }, + RainbowDelimiterCyan = { fg = "#22ddff" }, + -- TODO italic string start / end + --["@string_start"] = { italic = true }, + --["@string_end"] = { italic = true }, + }, +} + +-- set colorscheme +vim.cmd.colorscheme "gruvbox" + +-- fix todo comment highlighting (here instead of theme overrides since this replaces the bg w/ default) +vim.api.nvim_set_hl(0, "Todo", { fg = "#ffffff", bold = true }) diff --git a/lua/tjk/keybindings.lua b/lua/tjk/keybindings.lua index 4070949..7871a64 100644 --- a/lua/tjk/keybindings.lua +++ b/lua/tjk/keybindings.lua @@ -29,7 +29,6 @@ key("n", "<C-S-Tab>", "gT") key("n", "<C-t>", "gt") key("n", "<C-T>", "gT") - -- copy text to x11 buffer key("", "<C-c>", [["+y]]) key("", "<C-x>", [["+x]]) diff --git a/lua/tjk/lazy.lua b/lua/tjk/lazy.lua deleted file mode 100644 index e0faf05..0000000 --- a/lua/tjk/lazy.lua +++ /dev/null @@ -1,37 +0,0 @@ --- install lazy.nvim via instructions from github -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - --- require lazy module with safety check -local success, lazy = pcall(require, "lazy") - -if not success then - vim.notify("Failed to load lazy.nvim plugin manager") - return -end - --- setup lazy & enable plugins -return lazy.setup( - {{ import = "tjk.plugins" }}, - { - -- auto update plugins - checker = { - enabled = true, - notify = false - }, - -- disable change notification - change_detection = { - notify = false - }, - } -) diff --git a/lua/tjk/lsp.lua b/lua/tjk/lsp.lua new file mode 100644 index 0000000..396b643 --- /dev/null +++ b/lua/tjk/lsp.lua @@ -0,0 +1,24 @@ +vim.lsp.enable({ + "cssls", + "eslint", + "html", + "jinja_lsp", + "jsonls", + "pylsp", + "somesass_ls", + "svelte", + "tailwindcss", + "ts_ls" +}) + +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + vim.o.signcolumn = "yes:1" + local client = assert(vim.lsp.get_client_by_id(args.data.client_id)) + if client:supports_method("textDocument/completion") then + vim.o.complete = { "o", ".", "w", "b", "u" } + vim.o.completeopt = { "menu", "menuone", "popup", "noinsert" } + vim.lsp.completion.enable(true, client.id, args.buf) + end + end +}) diff --git a/lua/tjk/options.lua b/lua/tjk/options.lua index ee407f6..da82181 100644 --- a/lua/tjk/options.lua +++ b/lua/tjk/options.lua @@ -6,13 +6,8 @@ vim.o.termguicolors = true -- truecolor in terminal emulator, will be di vim.o.wrap = false -- disable word wrapping vim.o.cursorline = true -- highlight current line vim.o.title = true -- set window title of the terminal emulator to current nvim buffer -vim.o.signcolumn = "yes" -- keep left side column reserved for lsp ---vim.o.winborder = "single" -- border around floating windows vim.cmd.aunmenu "PopUp" -- disable right click menu --- TODO remove this when issue #32660 is fixed by #33145 -vim.g._ts_force_sync_parsing = true - -- line numbers vim.o.number = true -- enable line numbers vim.o.relativenumber = true -- enable relative line numbers diff --git a/lua/tjk/plugins.lua b/lua/tjk/plugins.lua new file mode 100644 index 0000000..b1c857a --- /dev/null +++ b/lua/tjk/plugins.lua @@ -0,0 +1,60 @@ +vim.cmd.packadd "nvim.undotree" +vim.cmd.packadd "nvim.difftool" + +-- https://github.com/m4xshen/autoclose.nvim +require("autoclose").setup { + options = { pair_spaces = true }, +} + +-- TODO native cmp +-- https://github.com/Saghen/blink.cmp +require("blink-cmp").setup { + keymap = { + preset = "super-tab", + ["<C-k>"] = { "select_prev", "fallback" }, + ["<C-j>"] = { "select_next", "fallback" }, + }, + cmdline = { enabled = false }, +} + +-- https://github.com/catgoose/nvim-colorizer.lua +require("colorizer").setup { + lazy_load = true, + options = { + parsers = { + css = true, -- preset: enables names, hex, rgb, hsl, oklch, css_var + tailwind = { enable = true, update_names = true, lsp = true }, -- tailwind + lsp context + xterm = { enable = true }, -- xterm 256-color codes (#xNN, \e[38;5;NNNm) + xcolor = { enable = true }, -- LaTeX xcolor expressions (e.g. red!30) + }, + }, +} + +-- https://git.tjkeller.xyz/minitab.nvim +require("minitab").setup() + +-- https://github.com/nvim-treesitter/nvim-treesitter +-- TODO "geigerzaehler/tree-sitter-jinja2", -- adds filetype for htmljinja, not recognized by ts by default. Requires gcc in path +require("nvim-treesitter.configs").setup { + highlight = { enable = true, disable = { "yaml", "dockerfile" } }, + indent = { enable = true, disable = { "yaml" } }, +} + +-- https://github.com/windwp/nvim-ts-autotag +require("nvim-ts-autotag").setup { + per_filetype = { ["html"] = { enable_close = true } }, +} + +-- https://github.com/HiPhish/rainbow-delimiters.nvim +--require("rainbow-delimiters.setup").setup() + +-- https://github.com/folke/snacks.nvim +require("snacks").setup { + indent = { + enabled = true, + only_scope = true, + animate = { enabled = false }, + scope = { enabled = false }, + }, + quickfile = { enabled = true }, +} diff --git a/lua/tjk/plugins/autoclose.lua b/lua/tjk/plugins/autoclose.lua deleted file mode 100644 index 32afa9f..0000000 --- a/lua/tjk/plugins/autoclose.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "m4xshen/autoclose.nvim", -- autoclose parenthesis - opts = { - options = { - pair_spaces = true, - }, - }, - config = true, -} diff --git a/lua/tjk/plugins/cmp.lua b/lua/tjk/plugins/cmp.lua deleted file mode 100644 index 9f16db2..0000000 --- a/lua/tjk/plugins/cmp.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - -- TODO look into native cmp - "saghen/blink.cmp", - opts = { - keymap = { - preset = "super-tab", - - ["<C-k>"] = { "select_prev", "fallback" }, - ["<C-j>"] = { "select_next", "fallback" }, - }, - - cmdline = { enabled = false }, - }, -} diff --git a/lua/tjk/plugins/colorizer.lua b/lua/tjk/plugins/colorizer.lua deleted file mode 100644 index 888a6a7..0000000 --- a/lua/tjk/plugins/colorizer.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - "norcalli/nvim-colorizer.lua", -- css color highlighter - enabled = vim.opt.termguicolors._value, - opts = { - "css", - "scss", - "sass", - "javascript", - "html", - "svelte", - } -} diff --git a/lua/tjk/plugins/colorscheme.lua b/lua/tjk/plugins/colorscheme.lua deleted file mode 100644 index 2bffef6..0000000 --- a/lua/tjk/plugins/colorscheme.lua +++ /dev/null @@ -1,71 +0,0 @@ --- use another colorscheme if running as root -if os.getenv "USER" == "root" then - vim.cmd.colorscheme "koehler" - return {} -end - -return { - "ellisonleao/gruvbox.nvim", - enabled = vim.opt.termguicolors._value, - priority = 9001, - config = function() - vim.o.background = "dark" - - local gruvbox = require("gruvbox") - local colors = gruvbox.palette - - gruvbox.setup({ - italic = { - strings = false, - emphasis = true, - comments = false, - operators = false, - folds = true, - }, - invert_selection = true, - contrast = "hard", - palette_overrides = { - light0 = "#ffffff", -- use white instead of the default off-white for text - light1 = "#ffffff", - dark2 = "#363636", -- darker whitespace characters - }, - overrides = { - CursorLine = { bg = "#282828" }, -- dark0 (non hard) - Directory = { link = "GruvboxGreenBold" }, - -- treesitter overrides (more similar to builtin python syntax highlighting) - -- treesitter selectors can be overridden per language using @selector.language - ["@variable"] = { link = "GruvboxFg0" }, - ["@punctuation.bracket"] = { link = "GruvboxFg0" }, - ["@punctuation.delimiter"] = { link = "GruvboxFg0" }, - ["@keyword.import"] = { link = "GruvboxBlue" }, - ["@function"] = { link = "GruvboxAqua" }, - ["@function.method"] = { link = "GruvboxAqua" }, - ["@function.method"] = { link = "GruvboxAqua" }, - ["@attribute.builtin"] = { link = "GruvboxGreenBold" }, - ["@attribute"] = { link = "GruvboxGreenBold" }, - ["@operator"] = { link = "GruvboxRed" }, - ["@variable.member"] = { link = "GruvboxFg0" }, - ["@variable.parameter"] = { link = "GruvboxFg0" }, - ["@function.call"] = { link = "GruvboxPurple" }, - ["@function.method.call"] = { link = "GruvboxPurple" }, - -- rainbow delimiters colors - RainbowDelimiterRed = { fg = "#ff4433" }, - RainbowDelimiterYellow = { fg = "#ffff22" }, - RainbowDelimiterBlue = { fg = "#66f3ff" }, - RainbowDelimiterOrange = { fg = "#ffaa00" }, - RainbowDelimiterGreen = { fg = "#99ff44" }, - RainbowDelimiterViolet = { fg = "#aa00ff" }, - RainbowDelimiterCyan = { fg = "#22ddff" }, - -- TODO italic string start / end - --["@string_start"] = { italic = true }, - --["@string_end"] = { italic = true }, - }, - }) - - -- set colorscheme - vim.cmd.colorscheme "gruvbox" - - -- fix todo comment highlighting (here instead of theme overrides since this replaces the bg w/ default) - vim.api.nvim_set_hl(0, "Todo", { fg = "#ffffff", bold = true }) - end, -} diff --git a/lua/tjk/plugins/lsp.lua b/lua/tjk/plugins/lsp.lua deleted file mode 100644 index 1c2eeb7..0000000 --- a/lua/tjk/plugins/lsp.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "neovim/nvim-lspconfig", - config = function() - vim.lsp.enable({ - "cssls", - "eslint", - "html", - "jinja_lsp", - "jsonls", - "pylsp", - "somesass_ls", - "svelte", - "tailwindcss", - "ts_ls" - }) - end -} diff --git a/lua/tjk/plugins/manageself.lua b/lua/tjk/plugins/manageself.lua deleted file mode 100644 index b2c989f..0000000 --- a/lua/tjk/plugins/manageself.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - -- TODO replace with vim.pack when moving to v0.12 - "folke/lazy.nvim", -- so lazy can manage itself -} diff --git a/lua/tjk/plugins/snacks.lua b/lua/tjk/plugins/snacks.lua deleted file mode 100644 index 434cd68..0000000 --- a/lua/tjk/plugins/snacks.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - opts = { - indent = { - enabled = true, - only_scope = true, - char = "▏", -- TODO doesn't work - animate = { enabled = false }, - scope = { enabled = false }, - }, - quickfile = { enabled = true }, - }, -} diff --git a/lua/tjk/plugins/tabline.lua b/lua/tjk/plugins/tabline.lua deleted file mode 100644 index dbac957..0000000 --- a/lua/tjk/plugins/tabline.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - url = "https://git.tjkeller.xyz/minitab.nvim", - config = true, -} diff --git a/lua/tjk/plugins/treesitter.lua b/lua/tjk/plugins/treesitter.lua deleted file mode 100644 index a73d6e7..0000000 --- a/lua/tjk/plugins/treesitter.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - dependencies = { - --{ - -- "nvim-treesitter/playground", -- inspect treesitter structure - -- cmd = "TSPlaygroundToggle" - --}, - "geigerzaehler/tree-sitter-jinja2", -- adds filetype for htmljinja, not recognized by ts by default. Requires gcc in path - "HiPhish/rainbow-delimiters.nvim", -- colored delimiters per scope level - { - "windwp/nvim-ts-autotag", -- close tags in html/xml type languages - opts = { - per_filetype = { - ["html"] = { enable_close = true }, - } - } - }, - }, - config = function() - local configs = require("nvim-treesitter.configs") - configs.setup({ - ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "comment", - "javascript", "jinja2", "html", "css", "scss", "python", "php" }, - auto_install = true, -- install available parsers when entering new buffers - highlight = { enable = true, disable = { "yaml", "dockerfile" } }, - indent = { enable = true, disable = { "yaml" } }, - --playground = { enable = true }, -- treesitter debug - }) - end -} |
