diff --git a/lazy-lock.json b/lazy-lock.json index 3443e5c..68400dd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -13,7 +13,6 @@ "gitsigns.nvim": { "branch": "main", "commit": "4455bb5364d29ff86639dfd5533d4fe4b48192d4" }, "lazy.nvim": { "branch": "main", "commit": "f145e6f42a56306c5536e9efbfe41f7efbec285d" }, "leap.nvim": { "branch": "main", "commit": "14b5a65190fe69388a8f59c695ed3394a10d6af8" }, - "lsp_signature.nvim": { "branch": "master", "commit": "17ff7a405fea8376b015b8ea7910d2e59958bf68" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "5230617372e656d4a2e1e236e03bf7e7b4b97273" }, "mason.nvim": { "branch": "main", "commit": "7d7efc738e08fc5bee822857db45cb6103f0b0c1" }, @@ -41,6 +40,7 @@ "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, "tokyonight.nvim": { "branch": "main", "commit": "161114bd39b990995e08dbf941f6821afbdcd666" }, "trouble.nvim": { "branch": "main", "commit": "2af0dd9767526410c88c628f1cbfcb6cf22dd683" }, + "typescript.nvim": { "branch": "main", "commit": "5b3680e5c386e8778c081173ea0c978c14a40ccb" }, "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, diff --git a/lua/config/keymaps.lua b/lua/config/keymaps.lua index 6010513..63fccbb 100644 --- a/lua/config/keymaps.lua +++ b/lua/config/keymaps.lua @@ -186,7 +186,8 @@ keymap("i", "", "", opts) -- prefix = "" -- }) -- end -keymap("v", "lf", "'<,'>lua vim.lsp.buf.format{ async = true }", opts) -keymap("x", "lf", "'<,'>lua vim.lsp.buf.format{ async = true }", opts) +-- keymap("n", "lf", "lua vim.lsp.buf.format()", opts) +-- keymap("v", "lf", "'<,'>lua vim.lsp.buf.format{ async = true }", opts) +-- keymap("x", "lf", "'<,'>lua vim.lsp.buf.format{ async = true }", opts) -- -- otherkeymaps() diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 17218d7..ba9b44b 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -11,7 +11,9 @@ require("lazy").setup({ -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.lang.typescript" }, + { import = "lazyvim.plugins.extras.linting.eslint" }, + { import = "lazyvim.plugins.extras.formatting.prettier" }, -- { import = "lazyvim.plugins.extras.lang.json" }, -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..86230b7 --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,17 @@ +return { + { + "neovim/nvim-lspconfig", + init = function() + local format = function() + require("lazyvim.plugins.lsp.format").format({ force = true }) + end + + local keys = require("lazyvim.plugins.lsp.keymaps").get() + keys[#keys + 1] = { "lf", format, desc = "Format Document", has = "documentFormatting" } + keys[#keys + 1] = { "lf", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" } + end, + opts = { + autoformat = false, + }, + }, +}