summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--lazy-lock.json14
-rw-r--r--lua/tjk/options.lua53
-rw-r--r--lua/tjk/plugins/cmp.lua38
-rw-r--r--lua/tjk/plugins/colorizer.lua1
-rw-r--r--lua/tjk/plugins/indentblankline.lua8
-rw-r--r--lua/tjk/plugins/lsp.lua23
-rw-r--r--lua/tjk/plugins/manageself.lua1
-rw-r--r--lua/tjk/plugins/snacks.lua15
-rw-r--r--lua/tjk/plugins/treesitter.lua5
10 files changed, 85 insertions, 74 deletions
diff --git a/.gitignore b/.gitignore
index 6b82688..a0e76af 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-lazy-lock.json
.netrwhist
diff --git a/lazy-lock.json b/lazy-lock.json
new file mode 100644
index 0000000..039d177
--- /dev/null
+++ b/lazy-lock.json
@@ -0,0 +1,14 @@
+{
+ "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/options.lua b/lua/tjk/options.lua
index 945536a..782c2ea 100644
--- a/lua/tjk/options.lua
+++ b/lua/tjk/options.lua
@@ -1,46 +1,49 @@
-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.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
-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
-- experimental
-opt.smartindent = true
---opt.wildmode = "longest:list:full" -- Better auto-complete
+vim.o.smartindent = true
+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__/" }
-- 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
end
diff --git a/lua/tjk/plugins/cmp.lua b/lua/tjk/plugins/cmp.lua
index 346e006..9f16db2 100644
--- a/lua/tjk/plugins/cmp.lua
+++ b/lua/tjk/plugins/cmp.lua
@@ -1,30 +1,14 @@
return {
- "hrsh7th/nvim-cmp",
- dependencies = {
- "hrsh7th/cmp-path",
- "hrsh7th/cmp-nvim-lsp",
- "hrsh7th/cmp-buffer",
- "ray-x/cmp-treesitter",
+ -- 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 },
},
- 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..1bdb94d 100644
--- a/lua/tjk/plugins/colorizer.lua
+++ b/lua/tjk/plugins/colorizer.lua
@@ -3,6 +3,7 @@ return {
enabled = vim.opt.termguicolors._value,
opts = {
"css",
+ "scss",
"sass",
"javascript",
"html",
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
index 050a5a6..1c2eeb7 100644
--- a/lua/tjk/plugins/lsp.lua
+++ b/lua/tjk/plugins/lsp.lua
@@ -1,16 +1,17 @@
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()
- }
+ 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
index 098c300..b2c989f 100644
--- a/lua/tjk/plugins/manageself.lua
+++ b/lua/tjk/plugins/manageself.lua
@@ -1,3 +1,4 @@
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
new file mode 100644
index 0000000..434cd68
--- /dev/null
+++ b/lua/tjk/plugins/snacks.lua
@@ -0,0 +1,15 @@
+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/treesitter.lua b/lua/tjk/plugins/treesitter.lua
index 835e1af..a73d6e7 100644
--- a/lua/tjk/plugins/treesitter.lua
+++ b/lua/tjk/plugins/treesitter.lua
@@ -6,6 +6,7 @@ return {
-- "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
@@ -20,9 +21,9 @@ return {
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "comment",
- "javascript", "html", "css", "scss", "python", "php" },
+ "javascript", "jinja2", "html", "css", "scss", "python", "php" },
auto_install = true, -- install available parsers when entering new buffers
- highlight = { enable = true, disable = { "yaml" } },
+ highlight = { enable = true, disable = { "yaml", "dockerfile" } },
indent = { enable = true, disable = { "yaml" } },
--playground = { enable = true }, -- treesitter debug
})