diff options
Diffstat (limited to 'lua/tjk')
| -rw-r--r-- | lua/tjk/options.lua | 53 | ||||
| -rw-r--r-- | lua/tjk/plugins/cmp.lua | 38 | ||||
| -rw-r--r-- | lua/tjk/plugins/colorizer.lua | 1 | ||||
| -rw-r--r-- | lua/tjk/plugins/indentblankline.lua | 8 | ||||
| -rw-r--r-- | lua/tjk/plugins/lsp.lua | 23 | ||||
| -rw-r--r-- | lua/tjk/plugins/manageself.lua | 1 | ||||
| -rw-r--r-- | lua/tjk/plugins/snacks.lua | 15 | ||||
| -rw-r--r-- | lua/tjk/plugins/treesitter.lua | 5 |
8 files changed, 71 insertions, 73 deletions
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 }) |
