diff --git a/init.lua b/init.lua index ed464d6e..3c2dc059 100644 --- a/init.lua +++ b/init.lua @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- 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! vim.o.mouse = 'a' @@ -205,6 +205,9 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +-- custom keymaps +vim.keymap.set('i', 'jj', '', { desc = 'Escape from Insert mode' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -247,7 +250,20 @@ rtp:prepend(lazypath) -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- 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, -- 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 preset = 'default', + -- [''] = { 'select_and_accept' }, + -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps }, diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8..de86a12f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,61 @@ -- I promise not to create any merge conflicts in this directory :) -- -- 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 l', function() + conform.format({ + lsp_fallback = true, + async = false, + timeout_ms = 500, + }) + end, { desc = 'Format file or range (in visual mode)' }) + end, + }, +}