From 0ab8e71f2f51bfde65304f0774c2cf02ea1432e0 Mon Sep 17 00:00:00 2001 From: naman Date: Mon, 11 Mar 2024 23:55:12 +0530 Subject: [PATCH] autoformat --- init.lua | 22 +++++++++++++++------- lazy-lock.json | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 29d4914f..d084b4f5 100644 --- a/init.lua +++ b/init.lua @@ -97,6 +97,8 @@ require('lazy').setup({ }, }, + { 'stevearc/conform.nvim', opts = {} }, + { -- Autocompletion 'hrsh7th/nvim-cmp', @@ -114,7 +116,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -187,7 +189,7 @@ require('lazy').setup({ }, -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, + { 'numToStr/Comment.nvim', opts = {} }, -- Fuzzy Finder (files, lsp, etc) { @@ -222,7 +224,7 @@ require('lazy').setup({ -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', + require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.debug', -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` @@ -507,6 +509,13 @@ require('which-key').register { require('mason').setup() require('mason-lspconfig').setup() +-- Enable Formatters +local mason = require 'mason'; + +mason.setup { + ensure_installed = { "prettier" } +} + -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- @@ -516,7 +525,6 @@ require('mason-lspconfig').setup() -- If you want to override the default filetypes that your language server will attach to you can -- define the property 'filetypes' to the map in question. local servers = { - -- clangd = {}, -- gopls = {}, pyright = { python = { @@ -525,12 +533,12 @@ local servers = { } } }, - clangd = {}, -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, + tsserver = {}, + eslint = {}, + html = { filetypes = { 'html', 'twig', 'hbs' } }, lua_ls = { Lua = { diff --git a/lazy-lock.json b/lazy-lock.json index 4ae1c13b..8754abbc 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,6 +3,7 @@ "LuaSnip": { "branch": "master", "commit": "2dbef19461198630b3d7c39f414d09fb07d1fdd2" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "conform.nvim": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" }, "fidget.nvim": { "branch": "main", "commit": "ad8873c16faa123fe3f9fd6539c41dfb0f97a9e9" }, "friendly-snippets": { "branch": "main", "commit": "b8fae73a479ae0a1c54f5c98fa687ae8a0addc53" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },