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 (<leader>sv, <leader>sh) - Add bufdelete, editorconfig, and toggleterm plugins - Enable custom plugins import Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
217f4f0526
commit
967d525c9d
24
init.lua
24
init.lua
|
|
@ -212,6 +212,10 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
||||||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<leader>sv', '<cmd>vsp<CR>', { desc = '[S]plit [V]ertical' })
|
||||||
|
vim.keymap.set('n', '<leader>sh', '<cmd>sp<CR>', { desc = '[S]plit [H]orizontal' })
|
||||||
|
|
||||||
|
|
||||||
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||||
|
|
@ -606,7 +610,7 @@ require('lazy').setup({
|
||||||
-- https://github.com/pmizio/typescript-tools.nvim
|
-- https://github.com/pmizio/typescript-tools.nvim
|
||||||
--
|
--
|
||||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||||
-- ts_ls = {},
|
ts_ls = {},
|
||||||
|
|
||||||
stylua = {}, -- Used to format Lua code
|
stylua = {}, -- Used to format Lua code
|
||||||
|
|
||||||
|
|
@ -649,7 +653,8 @@ require('lazy').setup({
|
||||||
-- You can press `g?` for help in this menu.
|
-- You can press `g?` for help in this menu.
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
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 }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
@ -693,11 +698,12 @@ require('lazy').setup({
|
||||||
end,
|
end,
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
-- Conform can also run multiple formatters sequentially
|
javascript = { 'prettier', stop_after_first = true },
|
||||||
-- python = { "isort", "black" },
|
typescript = { 'prettier', stop_after_first = true },
|
||||||
--
|
javascriptreact = { 'prettier', stop_after_first = true },
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
typescriptreact = { 'prettier', stop_after_first = true },
|
||||||
-- javascript = { "prettierd", "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.debug',
|
||||||
-- require 'kickstart.plugins.indent_line',
|
-- require 'kickstart.plugins.indent_line',
|
||||||
-- require 'kickstart.plugins.lint',
|
require 'kickstart.plugins.lint',
|
||||||
require 'kickstart.plugins.autopairs',
|
require 'kickstart.plugins.autopairs',
|
||||||
require 'kickstart.plugins.neo-tree',
|
require 'kickstart.plugins.neo-tree',
|
||||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
|
||||||
|
|
@ -937,7 +943,7 @@ require('lazy').setup({
|
||||||
-- This is the easiest way to modularize your config.
|
-- 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.
|
-- 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`
|
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
|
||||||
-- Or use telescope!
|
-- Or use telescope!
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,21 @@
|
||||||
|
|
||||||
---@module 'lazy'
|
---@module 'lazy'
|
||||||
---@type LazySpec
|
---@type LazySpec
|
||||||
return {}
|
return {
|
||||||
|
{
|
||||||
|
'famiu/bufdelete.nvim',
|
||||||
|
keys = {
|
||||||
|
{ '<leader>bd', '<cmd>Bdelete<CR>', desc = '[B]uffer [D]elete' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ 'editorconfig/editorconfig-vim' },
|
||||||
|
{
|
||||||
|
'akinsho/toggleterm.nvim',
|
||||||
|
version = '*',
|
||||||
|
opts = {
|
||||||
|
open_mapping = [[<C-\>]],
|
||||||
|
direction = 'horizontal',
|
||||||
|
size = 15,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@ return {
|
||||||
local lint = require 'lint'
|
local lint = require 'lint'
|
||||||
lint.linters_by_ft = {
|
lint.linters_by_ft = {
|
||||||
markdown = { 'markdownlint' }, -- Make sure to install `markdownlint` via mason / npm
|
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,
|
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue