chore: dev coding setups
This commit is contained in:
parent
482f46a442
commit
ec61e182d8
22
init.lua
22
init.lua
|
|
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
|
||||||
vim.o.number = true
|
vim.o.number = true
|
||||||
-- You can also add relative line numbers, to help with jumping.
|
-- You can also add relative line numbers, to help with jumping.
|
||||||
-- Experiment for yourself to see if you like it!
|
-- Experiment for yourself to see if you like it!
|
||||||
-- vim.o.relativenumber = true
|
vim.o.relativenumber = true
|
||||||
|
|
||||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||||
vim.o.mouse = 'a'
|
vim.o.mouse = 'a'
|
||||||
|
|
@ -205,6 +205,9 @@ vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper win
|
||||||
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||||
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||||
|
|
||||||
|
-- custom keymaps
|
||||||
|
vim.keymap.set('i', 'jj', '<Esc>', { desc = 'Escape from Insert mode' })
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See `:help lua-guide-autocommands`
|
-- See `:help lua-guide-autocommands`
|
||||||
|
|
||||||
|
|
@ -247,7 +250,20 @@ rtp:prepend(lazypath)
|
||||||
-- NOTE: Here is where you install your plugins.
|
-- NOTE: Here is where you install your plugins.
|
||||||
require('lazy').setup({
|
require('lazy').setup({
|
||||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||||
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
|
{
|
||||||
|
"NMAC427/guess-indent.nvim",
|
||||||
|
config = function()
|
||||||
|
require('guess-indent').setup({
|
||||||
|
override_editorconfig = true,
|
||||||
|
filetype_exclude = {},
|
||||||
|
})
|
||||||
|
-- Set default indentation
|
||||||
|
vim.o.tabstop = 2
|
||||||
|
vim.o.shiftwidth = 2
|
||||||
|
vim.o.softtabstop = 2
|
||||||
|
vim.o.expandtab = true
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- NOTE: Plugins can also be added by using a table,
|
-- NOTE: Plugins can also be added by using a table,
|
||||||
-- with the first argument being the link and the following
|
-- with the first argument being the link and the following
|
||||||
|
|
@ -837,6 +853,8 @@ require('lazy').setup({
|
||||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||||
preset = 'default',
|
preset = 'default',
|
||||||
|
|
||||||
|
-- ['<CR>'] = { 'select_and_accept' },
|
||||||
|
|
||||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,61 @@
|
||||||
-- I promise not to create any merge conflicts in this directory :)
|
-- I promise not to create any merge conflicts in this directory :)
|
||||||
--
|
--
|
||||||
-- See the kickstart.nvim README for more information
|
-- See the kickstart.nvim README for more information
|
||||||
return {}
|
return {
|
||||||
|
{
|
||||||
|
'AndrewRadev/tagalong.vim',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
|
config = function()
|
||||||
|
require('nvim-ts-autotag').setup {
|
||||||
|
opts = {
|
||||||
|
-- Defaults
|
||||||
|
enable_close = true, -- Auto close tags
|
||||||
|
enable_rename = true, -- Auto rename pairs of tags
|
||||||
|
enable_close_on_slash = false, -- Auto close on trailing </
|
||||||
|
},
|
||||||
|
-- Also override individual filetype configs, these take priority.
|
||||||
|
-- Empty by default, useful if one of the "opts" global settings
|
||||||
|
-- doesn't work well in a specific filetype
|
||||||
|
per_filetype = {
|
||||||
|
['html'] = {
|
||||||
|
enable_close = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'stevearc/conform.nvim',
|
||||||
|
event = {
|
||||||
|
'BufReadPre',
|
||||||
|
'BufNewFile',
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local conform = require('conform')
|
||||||
|
|
||||||
|
conform.setup({
|
||||||
|
formatters_by_ft = {
|
||||||
|
lua = { 'stylelua' },
|
||||||
|
typescript = { 'prettierd', 'prettier', 'biome' },
|
||||||
|
typescriptreact = { 'prettierd', 'prettier', 'biome' },
|
||||||
|
javascript = { 'prettierd', 'prettier', 'biome' },
|
||||||
|
javascriptreact = { 'prettierd', 'prettier', 'biome' },
|
||||||
|
},
|
||||||
|
format_on_save = {
|
||||||
|
lsp_fallback = true,
|
||||||
|
timeout_ms = 500,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>l', function()
|
||||||
|
conform.format({
|
||||||
|
lsp_fallback = true,
|
||||||
|
async = false,
|
||||||
|
timeout_ms = 500,
|
||||||
|
})
|
||||||
|
end, { desc = 'Format file or range (in visual mode)' })
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue