summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.lua6
-rw-r--r--lazy-lock.json14
-rw-r--r--lua/tjk/colorscheme.lua63
-rw-r--r--lua/tjk/keybindings.lua1
-rw-r--r--lua/tjk/lazy.lua37
-rw-r--r--lua/tjk/lsp.lua24
-rw-r--r--lua/tjk/options.lua5
-rw-r--r--lua/tjk/plugins.lua60
-rw-r--r--lua/tjk/plugins/autoclose.lua9
-rw-r--r--lua/tjk/plugins/cmp.lua14
-rw-r--r--lua/tjk/plugins/colorizer.lua12
-rw-r--r--lua/tjk/plugins/colorscheme.lua71
-rw-r--r--lua/tjk/plugins/lsp.lua17
-rw-r--r--lua/tjk/plugins/manageself.lua4
-rw-r--r--lua/tjk/plugins/snacks.lua15
-rw-r--r--lua/tjk/plugins/tabline.lua4
-rw-r--r--lua/tjk/plugins/treesitter.lua31
17 files changed, 151 insertions, 236 deletions
diff --git a/init.lua b/init.lua
index 64a2c57..ba9f608 100644
--- a/init.lua
+++ b/init.lua
@@ -1,4 +1,6 @@
-require("tjk.options")
+require("tjk.colorscheme")
require("tjk.keybindings")
+require("tjk.lsp")
require("tjk.misc")
-require("tjk.lazy") -- plugin manager
+require("tjk.options")
+require("tjk.plugins")
diff --git a/lazy-lock.json b/lazy-lock.json
deleted file mode 100644
index 039d177..0000000
--- a/lazy-lock.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "autoclose.nvim": { "branch": "main", "commit": "3f86702b54a861a17d7994b2e32a7c648cb12fb1" },
- "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
- "gruvbox.nvim": { "branch": "main", "commit": "58a2cda2e953a99e2f87c12b7fb4602da4e0709c" },
- "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
- "minitab.nvim": { "branch": "master", "commit": "f6183e8cb6f408e54dd5d1d13c0075376655a3ec" },
- "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
- "nvim-lspconfig": { "branch": "master", "commit": "63a38440989c58e1f100373ab603fd24665bdc9a" },
- "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
- "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
- "rainbow-delimiters.nvim": { "branch": "master", "commit": "97bf4b8ef9298644a29fcd9dd41a0210cf08cac7" },
- "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
- "tree-sitter-jinja2": { "branch": "main", "commit": "adf1a59c10c6ed2cd59a2834d925b7a58d8a5e4a" }
-}
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
-}