From 967d525c9d463057ffb7538c32f647e38b4a768d Mon Sep 17 00:00:00 2001 From: probalazs Date: Thu, 16 Apr 2026 19:46:07 +0200 Subject: [PATCH] Add TypeScript support, split keymaps, and custom plugins - Enable ts_ls LSP with prettier formatter and eslint_d linter - Add prettier and eslint_d auto-install via Mason - Enable lint plugin for JS/TS filetypes - Add split keymaps (sv, sh) - Add bufdelete, editorconfig, and toggleterm plugins - Enable custom plugins import Co-Authored-By: Claude Sonnet 4.6 --- init.lua | 24 +++++++++++++++--------- lua/custom/plugins/init.lua | 19 ++++++++++++++++++- lua/kickstart/plugins/lint.lua | 4 ++++ 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 60307b99..50c65ba0 100644 --- a/init.lua +++ b/init.lua @@ -212,6 +212,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', 'sv', 'vsp', { desc = '[S]plit [V]ertical' }) +vim.keymap.set('n', 'sh', 'sp', { desc = '[S]plit [H]orizontal' }) + + -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes -- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) -- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) @@ -606,7 +610,7 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, + ts_ls = {}, stylua = {}, -- Used to format Lua code @@ -649,7 +653,8 @@ require('lazy').setup({ -- You can press `g?` for help in this menu. local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { - -- You can add other tools here that you want Mason to install + 'prettier', + 'eslint_d', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -693,11 +698,12 @@ require('lazy').setup({ end, formatters_by_ft = { lua = { 'stylua' }, - -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, - -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + javascript = { 'prettier', stop_after_first = true }, + typescript = { 'prettier', stop_after_first = true }, + javascriptreact = { 'prettier', stop_after_first = true }, + typescriptreact = { 'prettier', stop_after_first = true }, + json = { 'prettier', stop_after_first = true }, + css = { 'prettier', stop_after_first = true }, }, }, }, @@ -928,7 +934,7 @@ require('lazy').setup({ -- -- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', + require 'kickstart.plugins.lint', require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps @@ -937,7 +943,7 @@ require('lazy').setup({ -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index b3ddcfdd..5319ba5f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -5,4 +5,21 @@ ---@module 'lazy' ---@type LazySpec -return {} +return { + { + 'famiu/bufdelete.nvim', + keys = { + { 'bd', 'Bdelete', desc = '[B]uffer [D]elete' }, + }, + }, + { 'editorconfig/editorconfig-vim' }, + { + 'akinsho/toggleterm.nvim', + version = '*', + opts = { + open_mapping = [[]], + direction = 'horizontal', + size = 15, + }, + }, +} diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 556f3178..14d97802 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -9,6 +9,10 @@ return { local lint = require 'lint' lint.linters_by_ft = { markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm + javascript = { 'eslint_d' }, + typescript = { 'eslint_d' }, + javascriptreact = { 'eslint_d' }, + typescriptreact = { 'eslint_d' }, } -- To allow other plugins to add linters to require('lint').linters_by_ft,