diff --git a/init.lua b/init.lua index af847d2..2aedc38 100644 --- a/init.lua +++ b/init.lua @@ -42,9 +42,14 @@ require("lazy").setup({ { "hrsh7th/cmp-cmdline" }, { "L3MON4D3/LuaSnip" }, { "saadparwaiz1/cmp_luasnip" }, + { "rafamadriz/friendly-snippets" }, + { + "stevearc/conform.nvim", + event = "BufReadPre", -- lazy-load when opening a file + }, -- 🌳 TREESITTER - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, { "nvim-tree/nvim-tree.lua" }, { "nvim-tree/nvim-web-devicons" }, @@ -56,7 +61,7 @@ require("lazy").setup({ { "nvim-lualine/lualine.nvim" }, -- 💻 TERMINAL - { "akinsho/toggleterm.nvim", version = "*" }, + { "akinsho/toggleterm.nvim", version = "*" }, -- 🤖 COPILOT { "github/copilot.vim" }, @@ -91,6 +96,8 @@ require("core.keymaps") require("plugins.colorscheme") require("plugins.cmp") require("plugins.lsp") +require("plugins.conform") + require("nvim-tree").setup({ sort = { diff --git a/lazy-lock.json b/lazy-lock.json index fcf96f0..654ce59 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,23 +1,25 @@ { "CopilotChat.nvim": { "branch": "main", "commit": "f68deee85b8d734db1a9fbf63ce17a8164921267" }, - "LuaSnip": { "branch": "master", "commit": "73813308abc2eaeff2bc0d3f2f79270c491be9d7" }, + "LuaSnip": { "branch": "master", "commit": "113f831c4dc5b8c4e97454a7f89bb21746fe6484" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, + "conform.nvim": { "branch": "master", "commit": "fbcb4fa7f34bfea9be702ffff481a8e336ebf6ed" }, "copilot.lua": { "branch": "master", "commit": "92e08cd472653beaece28ad9c8508a851a613358" }, "copilot.vim": { "branch": "release", "commit": "da369d90cfd6c396b1d0ec259836a1c7222fb2ea" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "github-nvim-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, "gitsigns.nvim": { "branch": "main", "commit": "1ee5c1fd068c81f9dd06483e639c2aa4587dc197" }, "lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" }, - "lualine.nvim": { "branch": "master", "commit": "b8c23159c0161f4b89196f74ee3a6d02cdc3a955" }, + "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "6bdb14f230de0904229ec367b410fb817e59b072" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, "nvim-ide": { "branch": "main", "commit": "fb6d6fe65be188bc80559d377e72831a373085bd" }, - "nvim-lspconfig": { "branch": "master", "commit": "623bcf08d5f9ff4ee3ce2686fa1f1947a045b1a5" }, + "nvim-lspconfig": { "branch": "master", "commit": "ac98db2f9f06a56498ec890a96928774eae412c3" }, "nvim-tree.lua": { "branch": "master", "commit": "e397756d2a79d74314ea4cd3efc41300e91c0ff0" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "b8221e42cf7287c4dcde81f232f58d7b947c210d" }, diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua new file mode 100644 index 0000000..9f6f089 --- /dev/null +++ b/lua/plugins/conform.lua @@ -0,0 +1,23 @@ +-- Conform setup for Prettier / other formatters +require("conform").setup({ + formatters_by_ft = { + javascript = { "prettier" }, + javascriptreact = { "prettier" }, + typescript = { "prettier" }, + typescriptreact = { "prettier" }, + vue = { "prettier" }, + html = { "prettier" }, + css = { "prettier" }, + json = { "prettier" }, + markdown = { "prettier" }, + lua = { "stylua" }, + c = { "clang-format" }, + cpp = { "clang-format" }, + cs = { "csharpier" }, + python = { "black" }, + go = { "gofmt" }, + rust = { "rustfmt" }, + sh = { "shfmt" }, + }, + format_on_save = false, -- keep manual control +})