this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvim: drop the formatting plugin, use native lsp

Seth Etter b3abb422 0940e5a2

+31 -63
+10 -11
nvim/lazy-lock.json
··· 6 6 "copilot.vim": { "branch": "release", "commit": "d1e8429bef7f7709586886b0a23a46fbecc685c4" }, 7 7 "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, 8 8 "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, 9 - "dropbar.nvim": { "branch": "master", "commit": "f02be79babb6a534ce89f9ef0a9e1496bf7f9284" }, 10 - "formatter.nvim": { "branch": "master", "commit": "eb89a1f3e079f1b9680bc7293b75fffccb5e1598" }, 9 + "dropbar.nvim": { "branch": "master", "commit": "f7ecb0c3600ca1dc467c361e9af40f97289d7aad" }, 11 10 "gitlab.nvim": { "branch": "main", "commit": "a260f648fe92c5d640340e1c2d55db1fe523c8a5" }, 12 11 "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, 13 - "gitsigns.nvim": { "branch": "main", "commit": "e399f9748d7cfd8859747c8d6c4e9c8b4d50a1bd" }, 12 + "gitsigns.nvim": { "branch": "main", "commit": "8b729e489f1475615dc6c9737da917b3bc163605" }, 14 13 "goyo.vim": { "branch": "master", "commit": "fa0263d456dd43f5926484d1c4c7022dfcb21ba9" }, 15 14 "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 16 15 "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, 17 - "mason-lspconfig.nvim": { "branch": "main", "commit": "d39a75bbce4b8aad5d627191ea915179c77c100f" }, 18 - "mason.nvim": { "branch": "main", "commit": "7c7318e8bae7e3536ef6b9e86b9e38e74f2e125e" }, 16 + "mason-lspconfig.nvim": { "branch": "main", "commit": "87888865fa1ce1928a25b9abbea8c8f7839bf522" }, 17 + "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, 19 18 "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, 20 - "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, 19 + "nui.nvim": { "branch": "main", "commit": "7cd18e73cfbd70e1546931b7268b3eebaeff9391" }, 21 20 "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, 22 21 "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, 23 22 "nvim-config-local": { "branch": "main", "commit": "990f3e35e0fba8fb83012d7e85f9a6a77de7f87f" }, 24 23 "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, 25 - "nvim-lspconfig": { "branch": "master", "commit": "ac1dfbe3b60e5e23a2cff90e3bd6a3bc88031a57" }, 26 - "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, 27 - "nvim-web-devicons": { "branch": "master", "commit": "f1420728f59843eb2ef084406b3d0201a0a0932d" }, 24 + "nvim-lspconfig": { "branch": "master", "commit": "d45702594afc661a9dfa95e96acf18c56006d4d9" }, 25 + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, 26 + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, 28 27 "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 29 - "rose-pine": { "branch": "main", "commit": "491a0c77abc7ecb955c27a974091a5968232995f" }, 30 - "schemastore.nvim": { "branch": "main", "commit": "df87d16fc4ea7c2c67cfc00b513861738693fe07" }, 28 + "rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" }, 29 + "schemastore.nvim": { "branch": "main", "commit": "0098dde21296a454ae1426f9ac47340dd38c27ce" }, 31 30 "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, 32 31 "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, 33 32 "toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
+21 -52
nvim/lua/plugins/lsp.lua
··· 14 14 end, 15 15 }, 16 16 { 17 - "mhartington/formatter.nvim", 18 - config = function() 19 - require("formatter").setup({ 20 - filetype = { 21 - lua = { 22 - require("formatter.filetypes.lua").stylua, 23 - }, 24 - json = { 25 - require("formatter.defaults.prettier"), 26 - }, 27 - markdown = { 28 - require("formatter.defaults.prettier"), 29 - }, 30 - javascript = { 31 - require("formatter.defaults.prettier"), 32 - }, 33 - javascriptreact = { 34 - require("formatter.defaults.prettier"), 35 - }, 36 - typescript = { 37 - require("formatter.defaults.prettier"), 38 - }, 39 - typescriptreact = { 40 - require("formatter.defaults.prettier"), 41 - }, 42 - go = { 43 - function() 44 - return { 45 - exe = "goimports", 46 - stdin = true, 47 - } 48 - end, 49 - }, 50 - ["*"] = { 51 - require("formatter.filetypes.any").remove_trailing_whitespace, 52 - }, 53 - }, 54 - }) 55 - 56 - -- TODO: Turn this into a convenience function that you can 57 - -- enable or disable on a per-project and per-filetype basis. 58 - vim.api.nvim_create_augroup("FormatAutogroup", { clear = true }) 59 - vim.api.nvim_create_autocmd("BufWritePost", { 60 - group = "FormatAutogroup", 61 - pattern = "*", 62 - command = "FormatWrite", 63 - }) 64 - end, 65 - }, 66 - { 67 17 "mason-org/mason-lspconfig.nvim", 68 18 dependencies = { 69 19 "neovim/nvim-lspconfig", ··· 71 21 "klen/nvim-config-local", 72 22 }, 73 23 config = function() 74 - local util = require("lspconfig.util") 24 + local function not_deno(bufn, on_dir) 25 + local util = require("lspconfig.util") 26 + if util.root_pattern("deno.json", "deno.jsonc")(bufn) then 27 + return nil 28 + end 29 + on_dir(util.root_pattern("package.json", "tsconfig.json", ".git")(bufn)) 30 + end 75 31 76 32 require("mason").setup({}) 77 33 require("mason-lspconfig").setup({ 78 34 automatic_enable = false, 79 35 automatic_installation = true, 80 36 ensure_installed = { 37 + "efm", -- general purpose language server 81 38 "lua_ls", 82 39 "jsonls", 83 40 "vtsls", ··· 96 53 }, 97 54 } 98 55 LangServers.vtsls = { 56 + root_dir = not_deno, 99 57 single_file_support = false, 58 + settings = { 59 + javascript = { format = { enable = true } }, 60 + typescript = { format = { enable = true } }, 61 + } 100 62 } 101 63 LangServers.eslint = { 102 64 single_file_support = false, 103 65 } 104 66 LangServers.denols = { 105 - root_dir = util.root_pattern("deno.json", "deno.jsonc"), 67 + root_markers = { "deno.json", "deno.jsonc" }, 106 68 } 107 69 LangServers.yamlls = { 108 70 settings = { ··· 146 108 pattern = "ConfigLocalFinished", 147 109 callback = SetupLspHandlers, 148 110 }) 111 + vim.api.nvim_create_autocmd("BufWritePre", { 112 + pattern = { "<buffer>" }, 113 + callback = function() 114 + vim.lsp.buf.format() 115 + end, 116 + }) 117 + 149 118 end, 150 119 }, 151 120 {