diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | after/ftplugin/nix.lua | 4 | ||||
| -rw-r--r-- | after/ftplugin/sass.lua | 7 | ||||
| l--------- | after/ftplugin/scss.lua | 1 | ||||
| -rw-r--r-- | init.lua | 5 | ||||
| -rw-r--r-- | lua/tjk/keybindings.lua | 3 | ||||
| -rw-r--r-- | lua/tjk/lazy.lua | 37 | ||||
| -rw-r--r-- | lua/tjk/lsp.lua | 26 | ||||
| -rw-r--r-- | lua/tjk/misc.lua | 29 | ||||
| -rw-r--r-- | lua/tjk/options.lua | 57 | ||||
| -rw-r--r-- | lua/tjk/pluginloader.lua | 4 | ||||
| -rw-r--r-- | lua/tjk/plugins/alignment.lua | 5 | ||||
| -rw-r--r-- | lua/tjk/plugins/autoclose.lua | 10 | ||||
| -rw-r--r-- | lua/tjk/plugins/cmp.lua | 37 | ||||
| -rw-r--r-- | lua/tjk/plugins/colorizer.lua | 21 | ||||
| -rw-r--r-- | lua/tjk/plugins/colorscheme.lua | 108 | ||||
| -rw-r--r-- | lua/tjk/plugins/indentblankline.lua | 8 | ||||
| -rw-r--r-- | lua/tjk/plugins/lsp.lua | 16 | ||||
| -rw-r--r-- | lua/tjk/plugins/manageself.lua | 3 | ||||
| -rw-r--r-- | lua/tjk/plugins/minitab.lua | 5 | ||||
| -rw-r--r-- | lua/tjk/plugins/snacks.lua | 13 | ||||
| -rw-r--r-- | lua/tjk/plugins/tabline.lua | 4 | ||||
| -rw-r--r-- | lua/tjk/plugins/treesitter.lua | 63 | ||||
| -rw-r--r-- | lua/tjk/plugins/ui2.lua | 7 |
24 files changed, 243 insertions, 232 deletions
@@ -1,2 +1,2 @@ -lazy-lock.json .netrwhist +nvim-pack-lock.json # Managed by nix diff --git a/after/ftplugin/nix.lua b/after/ftplugin/nix.lua new file mode 100644 index 0000000..a1371c2 --- /dev/null +++ b/after/ftplugin/nix.lua @@ -0,0 +1,4 @@ +--vim.bo.expandtab = true +vim.bo.tabstop = 2 +vim.bo.shiftwidth = 2 +vim.bo.softtabstop = 2 diff --git a/after/ftplugin/sass.lua b/after/ftplugin/sass.lua new file mode 100644 index 0000000..049ac89 --- /dev/null +++ b/after/ftplugin/sass.lua @@ -0,0 +1,7 @@ +-- tabs instead of spaces +vim.opt_local.expandtab = false +--vim.opt_local.cinoptions = true +--vim.opt_local.preserveindent = true +vim.opt_local.softtabstop = 0 +vim.opt_local.shiftwidth = 4 +vim.opt_local.tabstop = 4 diff --git a/after/ftplugin/scss.lua b/after/ftplugin/scss.lua new file mode 120000 index 0000000..a593f83 --- /dev/null +++ b/after/ftplugin/scss.lua @@ -0,0 +1 @@ +sass.lua
\ No newline at end of file @@ -1,4 +1,5 @@ -require("tjk.options") require("tjk.keybindings") +require("tjk.lsp") require("tjk.misc") -require("tjk.lazy") -- plugin manager +require("tjk.options") +require("tjk.pluginloader") diff --git a/lua/tjk/keybindings.lua b/lua/tjk/keybindings.lua index 4070949..cd3b961 100644 --- a/lua/tjk/keybindings.lua +++ b/lua/tjk/keybindings.lua @@ -6,6 +6,8 @@ vim.g.mapleader = "," key("n", "<leader>l", [[:setlocal spell! spelllang=en_us<CR>]]) -- toggle cursorcolumn key("n", "<leader>c", [[:set cursorcolumn!<CR>]]) +-- show undotree +key("n", "<leader>u", [[:Undotree<CR>]]) -- scroll doc with ctrl+[jk] key({ "n", "v" }, "<C-j>", "<C-e>") @@ -29,7 +31,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..6f4c110 --- /dev/null +++ b/lua/tjk/lsp.lua @@ -0,0 +1,26 @@ +-- TODO enable with keybind +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" + -- TODO native cmp + --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/misc.lua b/lua/tjk/misc.lua index 14c5bd8..1c4318f 100644 --- a/lua/tjk/misc.lua +++ b/lua/tjk/misc.lua @@ -1,21 +1,22 @@ --- Use tabs instead of spaces for certain filetypes -local tabs_instead_of_spaces_filetypes = { - "sass", - "scss", -} +local user_at_host = vim.uv.os_get_passwd().username .. "@" .. vim.uv.os_gethostname() -local tabs_instead_of_spaces = function(args) - local o = vim.opt_local - o.expandtab = false - --o.cinoptions = true - o.preserveindent = true - o.softtabstop = 0 - o.shiftwidth = 4 - o.tabstop = 4 +-- insert user@host into statusline if running in ssh session +if vim.env.SSH_CONNECTION ~= nil or vim.env.SSH_TTY ~= nil then + local ssh_status = "[" .. user_at_host .. "] " + vim.o.statusline = vim.o.statusline:gsub("%%f", ssh_status .. "%%f", 1) -- before filename end -vim.api.nvim_create_autocmd("FileType", { pattern = tabs_instead_of_spaces_filetypes, callback = tabs_instead_of_spaces }) +-- insert user@host into titlestring +-- builtin titlestring must be reconstructed +function _G.title_flags() + local f = (vim.bo.readonly and "=" or "") .. (vim.bo.modified and "+" or "") + if not vim.bo.modifiable then f = f .. "-" end + return f ~= "" and (" " .. f) or "" +end + +vim.o.titlestring = '%t%{v:lua.title_flags()} (' .. user_at_host .. ' %{expand("%:p:~:h")}%a) - Nvim' +-- vim.cmd [[ "" Extra functionality diff --git a/lua/tjk/options.lua b/lua/tjk/options.lua index 945536a..321d85b 100644 --- a/lua/tjk/options.lua +++ b/lua/tjk/options.lua @@ -1,46 +1,53 @@ -local opt = vim.opt -local api = vim.api - -- misc -opt.autochdir = true -- stay in current directory when opening a file -opt.splitright = true -- open splits on right instead of left -opt.splitbelow = true -- open splits on bottom instead of top -opt.termguicolors = true -- truecolor in terminal emulator, will be disabled in tty -opt.wrap = false -- disable word wrapping -opt.cursorline = true -- highlight current line -opt.title = true -- set window title of the terminal emulator to current nvim buffer +vim.o.autochdir = true -- stay in current directory when opening a file +vim.o.splitright = true -- open splits on right instead of left +vim.o.splitbelow = true -- open splits on bottom instead of top +vim.o.termguicolors = true -- truecolor in terminal emulator, will be disabled in tty +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.cmd.aunmenu "PopUp" -- disable right click menu -- line numbers -opt.number = true -- enable line numbers -opt.relativenumber = true -- enable relative line numbers +vim.o.number = true -- enable line numbers +vim.o.relativenumber = true -- enable relative line numbers -- show whitespace characters -opt.list = true -- show whitespace characters defined in listchars -opt.listchars = "tab:▏ ,space:·" -- highlight tabs and spaces +vim.o.list = true -- show whitespace characters defined in listchars +vim.o.listchars = "tab:│ ,space:·" -- highlight tabs and spaces -- tabbing -opt.tabstop = 4 -- set tabwidth to 4 instead of 8 -opt.shiftwidth = 4 -- tab key will only insert one tab +vim.o.tabstop = 4 -- set tabwidth to 4 instead of 8 +vim.o.shiftwidth = 4 -- tab key will only insert one tab -- search -opt.ignorecase = true -- case-insensitive search... -opt.smartcase = true -- ...unless the search term is capital +vim.o.ignorecase = true -- case-insensitive search... +vim.o.smartcase = true -- ...unless the search term is capital + +-- indentation +vim.o.autoindent = true +vim.o.smartindent = true -- experimental -opt.smartindent = true ---opt.wildmode = "longest:list:full" -- Better auto-complete +vim.opt.wildmode = { "list:longest", "list:full" } -- Better auto-complete -- dont continue comments on to new lines (:help fo-table) -api.nvim_create_autocmd("FileType", { pattern = "*", callback = function() - opt.formatoptions:remove { "c", "r", "o" } +vim.api.nvim_create_autocmd("FileType", { pattern = "*", callback = function() + vim.opt.formatoptions:remove { "c", "r", "o" } end}) -- ignore __pycache__ directories in file listings -opt.wildignore = "__pycache__/,*/__pycache__/" +vim.opt.wildignore = { "__pycache__/", "*/__pycache__/" } + +-- add builtin plugins +vim.cmd.packadd "nvim.undotree" +vim.cmd.packadd "nvim.difftool" -- for running in tty if os.getenv "TERM" == "linux" then vim.cmd.colorscheme "vim" - opt.termguicolors = false - opt.list = false + vim.o.termguicolors = false + vim.o.list = false +else + vim.g.clipboard = "osc52" -- force osc52 support for copying to clipboard in remote terminals. # TODO this should be auto-detected end diff --git a/lua/tjk/pluginloader.lua b/lua/tjk/pluginloader.lua new file mode 100644 index 0000000..7230de7 --- /dev/null +++ b/lua/tjk/pluginloader.lua @@ -0,0 +1,4 @@ +require("lazy-like-loader").setup { + package = "tjk.plugins", + packAddMissing = false, +} diff --git a/lua/tjk/plugins/alignment.lua b/lua/tjk/plugins/alignment.lua new file mode 100644 index 0000000..c4f7fb6 --- /dev/null +++ b/lua/tjk/plugins/alignment.lua @@ -0,0 +1,5 @@ +return { + "mini.align", + "https://github.com/nvim-mini/mini.align", + setup = true, +} diff --git a/lua/tjk/plugins/autoclose.lua b/lua/tjk/plugins/autoclose.lua index 32afa9f..f356f89 100644 --- a/lua/tjk/plugins/autoclose.lua +++ b/lua/tjk/plugins/autoclose.lua @@ -1,9 +1,7 @@ return { - "m4xshen/autoclose.nvim", -- autoclose parenthesis - opts = { - options = { - pair_spaces = true, - }, + "autoclose", + "https://github.com/m4xshen/autoclose.nvim", + setup = { + options = { pair_spaces = true }, }, - config = true, } diff --git a/lua/tjk/plugins/cmp.lua b/lua/tjk/plugins/cmp.lua index 346e006..6c87867 100644 --- a/lua/tjk/plugins/cmp.lua +++ b/lua/tjk/plugins/cmp.lua @@ -1,30 +1,13 @@ +-- TODO replace with native cmp return { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "ray-x/cmp-treesitter", + "blink-cmp", + { src = "https://github.com/Saghen/blink.cmp", version = "v1" }, + setup = { + keymap = { + preset = "super-tab", + ["<C-k>"] = { "select_prev", "fallback" }, + ["<C-j>"] = { "select_next", "fallback" }, + }, + cmdline = { enabled = false }, }, - config = function() - local cmp = require("cmp") - cmp.setup { - sources = { - { name = "path" }, - { name = "lsp" }, - { name = "buffer" }, - { name = "treesitter" }, - }, - mapping = cmp.mapping.preset.insert { - --['<C-b>'] = cmp.mapping.scroll_docs(-4), - --['<C-f>'] = cmp.mapping.scroll_docs(4), - --['<C-Space>'] = cmp.mapping.complete(), - --['<C-e>'] = cmp.mapping.abort(), - --['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - ["<C-j>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert }, - ["<C-k>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert }, - ['<Tab>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - }, - } - end } diff --git a/lua/tjk/plugins/colorizer.lua b/lua/tjk/plugins/colorizer.lua index 964b6f4..120fbb8 100644 --- a/lua/tjk/plugins/colorizer.lua +++ b/lua/tjk/plugins/colorizer.lua @@ -1,10 +1,15 @@ return { - "norcalli/nvim-colorizer.lua", -- css color highlighter - enabled = vim.opt.termguicolors._value, - opts = { - "css", - "sass", - "javascript", - "html", - } + "colorizer", + "https://github.com/catgoose/nvim-colorizer.lua", + 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) + }, + }, + }, } diff --git a/lua/tjk/plugins/colorscheme.lua b/lua/tjk/plugins/colorscheme.lua index 2bffef6..4a3756d 100644 --- a/lua/tjk/plugins/colorscheme.lua +++ b/lua/tjk/plugins/colorscheme.lua @@ -1,67 +1,63 @@ -- use another colorscheme if running as root if os.getenv "USER" == "root" then vim.cmd.colorscheme "koehler" - return {} + return end return { - "ellisonleao/gruvbox.nvim", - enabled = vim.opt.termguicolors._value, - priority = 9001, - config = function() + "gruvbox", + "https://github.com/ellisonleao/gruvbox.nvim", + 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 }, + }, + }, + loadFn = function() + -- use dark gruvbox variant 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" diff --git a/lua/tjk/plugins/indentblankline.lua b/lua/tjk/plugins/indentblankline.lua deleted file mode 100644 index 826f1ae..0000000 --- a/lua/tjk/plugins/indentblankline.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "lukas-reineke/indent-blankline.nvim", - enabled = vim.opt.termguicolors._value, - main = "ibl", - opts = { - scope = { enabled = false }; - } -} diff --git a/lua/tjk/plugins/lsp.lua b/lua/tjk/plugins/lsp.lua deleted file mode 100644 index 050a5a6..0000000 --- a/lua/tjk/plugins/lsp.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - "neovim/nvim-lspconfig", - dependencies = { - "williamboman/mason.nvim", -- install lsp's - "williamboman/mason-lspconfig.nvim", - }, - config = function() - require("mason").setup() - require("mason-lspconfig").setup { automatic_installation = true } - local lspconfig = require("lspconfig") - lspconfig.pylsp.setup { - autostart = false, - capabilities = require("cmp_nvim_lsp").default_capabilities() - } - end -} diff --git a/lua/tjk/plugins/manageself.lua b/lua/tjk/plugins/manageself.lua deleted file mode 100644 index 098c300..0000000 --- a/lua/tjk/plugins/manageself.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - "folke/lazy.nvim", -- so lazy can manage itself -} diff --git a/lua/tjk/plugins/minitab.lua b/lua/tjk/plugins/minitab.lua new file mode 100644 index 0000000..cdc6052 --- /dev/null +++ b/lua/tjk/plugins/minitab.lua @@ -0,0 +1,5 @@ +return { + "minitab", + "https://git.tjkeller.xyz/minitab.nvim", + setup = true, +} diff --git a/lua/tjk/plugins/snacks.lua b/lua/tjk/plugins/snacks.lua new file mode 100644 index 0000000..8444595 --- /dev/null +++ b/lua/tjk/plugins/snacks.lua @@ -0,0 +1,13 @@ +return { + "snacks", + "https://github.com/folke/snacks.nvim", + setup = { + indent = { + enabled = true, + only_scope = true, + 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 index 835e1af..b7a8d94 100644 --- a/lua/tjk/plugins/treesitter.lua +++ b/lua/tjk/plugins/treesitter.lua @@ -1,30 +1,45 @@ return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - dependencies = { - --{ - -- "nvim-treesitter/playground", -- inspect treesitter structure - -- cmd = "TSPlaygroundToggle" - --}, - "HiPhish/rainbow-delimiters.nvim", -- colored delimiters per scope level + "nvim-treesitter", + "https://github.com/nvim-treesitter/nvim-treesitter", + setup = { + highlight = { enable = true, disable = { "yaml", "dockerfile" } }, + --indent = { enable = true }, -- FIXME + }, + dependents = { + { + "nvim-ts-autotag", + "https://github.com/windwp/nvim-ts-autotag", + setup = { + per_filetype = { ["html"] = { enable_close = true } }, + }, + }, + { + "rainbow-delimiters.setup", + "https://github.com/HiPhish/rainbow-delimiters.nvim", + }, { - "windwp/nvim-ts-autotag", -- close tags in html/xml type languages - opts = { - per_filetype = { - ["html"] = { enable_close = true }, - } - } + "tree-sitter-jinja2", + "https://github.com/geigerzaehler/tree-sitter-jinja2", + setup = true, }, }, - config = function() - local configs = require("nvim-treesitter.configs") - configs.setup({ - ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "comment", - "javascript", "html", "css", "scss", "python", "php" }, - auto_install = true, -- install available parsers when entering new buffers - highlight = { enable = true, disable = { "yaml" } }, - indent = { enable = true, disable = { "yaml" } }, - --playground = { enable = true }, -- treesitter debug + loadFn = function() + vim.g._ts_force_sync_parsing = true -- #32660 + + vim.api.nvim_create_autocmd("FileType", { + callback = function() + -- highlight + local ok, err = pcall(vim.treesitter.start) + if not ok then + return + end + vim.bo.syntax = "" -- disable legacy syntax for this buffer + -- folding + --vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()' + --vim.wo[0][0].foldmethod = 'expr' + -- indentation + vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" + end, }) - end + end, } diff --git a/lua/tjk/plugins/ui2.lua b/lua/tjk/plugins/ui2.lua new file mode 100644 index 0000000..5d1dc9e --- /dev/null +++ b/lua/tjk/plugins/ui2.lua @@ -0,0 +1,7 @@ +return { + "vim._core.ui2", + source = nil, + setup = { + enable = true, + }, +} |
