From 0f88d612e371023b8b00d2b22adc54aa9572f573 Mon Sep 17 00:00:00 2001 From: Maciej Jur Date: Wed, 12 Jun 2024 00:40:52 +0200 Subject: [PATCH] nvim: remove mason --- nvim/lazy-lock.json | 40 ++++--- nvim/lua/config/manager.lua | 2 +- nvim/lua/config/plugins.lua | 217 ++++++++++-------------------------- 3 files changed, 78 insertions(+), 181 deletions(-) diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 64ef292..a833a47 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -3,31 +3,29 @@ "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "diffview.nvim": { "branch": "main", "commit": "ad03c42b2899117ff039d84ac24860a77116204b" }, - "dropbar.nvim": { "branch": "master", "commit": "9fc10fa1a34ec3e55b470962e4e94644611bd209" }, - "gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" }, - "haskell-tools.nvim": { "branch": "master", "commit": "35ac2d964b004d0d0e0cc9bab039b70be36ca0f7" }, - "kanagawa.nvim": { "branch": "master", "commit": "860e4f80df71221d18bf2cd9ef1deb4d364274d2" }, - "lazy.nvim": { "branch": "main", "commit": "9895337d1f4c0cea1186d92148e3d80f6551eda8" }, + "diffview.nvim": { "branch": "main", "commit": "3afa6a053f680e9f1329c4a151db988a482306cd" }, + "dropbar.nvim": { "branch": "master", "commit": "2b546383bdf4daa254ac70c760ee1e5524bc60b1" }, + "gitsigns.nvim": { "branch": "main", "commit": "4a143f13e122ab91abdc88f89eefbe70a4858a56" }, + "haskell-tools.nvim": { "branch": "master", "commit": "65d6993eba1a56bbd5211ef13a100d26ce3e644a" }, + "kanagawa.nvim": { "branch": "master", "commit": "08ed29989834f5f2606cb1ef9d5b24c5ea7b8fa5" }, + "lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" }, + "lazydev.nvim": { "branch": "main", "commit": "7cbb524c85f87017df9c1ea2377a1d840ad8ed51" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, - "mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" }, - "neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" }, - "nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" }, + "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" }, - "nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" }, - "nvim-dap-ui": { "branch": "master", "commit": "334cf3038c4756e6ab999cbac67c847fb654c190" }, - "nvim-lspconfig": { "branch": "master", "commit": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98" }, - "nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" }, + "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, + "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, + "nvim-lspconfig": { "branch": "master", "commit": "4d38bece98300e3e5cd24a9aa0d0ebfea4951c16" }, + "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, - "nvim-treesitter": { "branch": "master", "commit": "73fb37ed77b18ac357ca8e6e35835a8db6602332" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" }, - "nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" }, + "nvim-treesitter": { "branch": "master", "commit": "9a7ad2ff7a7ea81016aca2fc89c9b2c1a5365421" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, + "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "precognition.nvim": { "branch": "main", "commit": "5255b72c52b1159e9757f50389bde65e05e3bfb1" }, "rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "d829aa64059001ee7b2c8c8aa9c4e6df0b17d893" }, - "trouble.nvim": { "branch": "dev", "commit": "e2185bf6e63ef9bd75f1819f43846e2b0f10953b" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "trouble.nvim": { "branch": "main", "commit": "5e45bb78f8da3444d35616934c180fce3742c439" }, + "which-key.nvim": { "branch": "main", "commit": "0099511294f16b81c696004fa6a403b0ae61f7a0" } } \ No newline at end of file diff --git a/nvim/lua/config/manager.lua b/nvim/lua/config/manager.lua index 2a93505..957fc2a 100644 --- a/nvim/lua/config/manager.lua +++ b/nvim/lua/config/manager.lua @@ -3,7 +3,7 @@ local path = data .. '/lazy/lazy.nvim' -- Bootstrap -if not vim.loop.fs_stat(path) then +if not vim.uv.fs_stat(path) then vim.fn.system { 'git', 'clone', diff --git a/nvim/lua/config/plugins.lua b/nvim/lua/config/plugins.lua index 34630fd..8bb4326 100644 --- a/nvim/lua/config/plugins.lua +++ b/nvim/lua/config/plugins.lua @@ -61,6 +61,16 @@ return { end, }, + -- Keymap hints + { + 'folke/which-key.nvim', + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 300 + end, + config = true + }, + -- Treesitter { 'nvim-treesitter/nvim-treesitter', @@ -141,14 +151,35 @@ return { end, }, - -- Keymap hints + -- Configure LSP { - 'folke/which-key.nvim', - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 300 + 'neovim/nvim-lspconfig', + config = function() + local lsp = require 'lspconfig' + local cmp = require 'cmp_nvim_lsp' + + lsp.nixd.setup { + single_file_support = true, + capabilities = cmp.default_capabilities(), + } + + lsp.lua_ls.setup { + single_file_support = true, + capabilities = cmp.default_capabilities(), + } + + local signs = { + Error = "", + Warn = "", + Hint = "", + Info = "󰙎", + } + + for sign, text in pairs(signs) do + local name = 'DiagnosticSign' .. sign + vim.fn.sign_define(name, { text = text, texthl = name }) + end end, - config = true }, -- Notifications @@ -162,7 +193,6 @@ return { -- Project errors { "folke/trouble.nvim", - branch = "dev", config = function () local trouble = require 'trouble' @@ -180,9 +210,22 @@ return { -- Breadcrumbs { 'Bekaboo/dropbar.nvim', - dependencies = { - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } - } + -- dependencies = { + -- { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } + -- } + }, + + { + "tris203/precognition.nvim", + config = function() + local pc = require 'precognition' + + nv 'p' (pc.toggle) "Precognition: toggle" + + pc.setup { + startVisible = false, + } + end, }, -- Git - file hunks @@ -301,112 +344,15 @@ return { end, }, - -- Mason - { - 'williamboman/mason.nvim', - config = true, - }, - - -- Automatic LSP server setup for Mason - { - 'williamboman/mason-lspconfig.nvim', - dependencies = { - 'williamboman/mason.nvim', - 'neovim/nvim-lspconfig', - }, - config = function() - local config = require 'mason-lspconfig' - local lsp = require 'lspconfig' - local cmp = require 'cmp_nvim_lsp' - - local noop = function() end - - lsp.nixd.setup {} - - config.setup { - automatic_installation = false, - -- NOTE: hls is installed via GHCup - ensure_installed = { - -- 'lua_ls', -- Lua - -- 'fennel_ls', -- Fennel - -- 'rust_analyzer', -- Rust - -- 'clangd', -- C - -- 'bashls', -- Bash - -- 'html', -- HTML - -- 'cssls', -- CSS / SCSS - -- 'tsserver', -- TypeScript - -- 'svelte', -- Svelte - -- 'pyright', -- Python - -- 'rnix', -- Nix - -- 'purescriptls', -- Purescript - -- 'ltex', -- Literate - LaTeX, Markdown, etc. - -- 'rescriptls', -- ReScript - }, - } - - config.setup_handlers { - function(name) - lsp[name].setup { - single_file_support = true, - capabilities = cmp.default_capabilities(), - } - end, - ['rust_analyzer'] = noop, -- this is started by rustaceanvim - ['lua_ls'] = noop, -- this is started by neodev - } - - local signs = { - Error = "", - Warn = "", - Hint = "", - Info = "󰙎", - } - - for sign, text in pairs(signs) do - local name = 'DiagnosticSign' .. sign - vim.fn.sign_define(name, { text = text, texthl = name }) - end - end, - }, - - -- Automatic debugger install - { - 'jay-babu/mason-nvim-dap.nvim', - dependencies = { - 'mfussenegger/nvim-dap', - 'williamboman/mason.nvim', - }, - config = function() - local config = require 'mason-nvim-dap' - - config.setup { - automatic_installation = true, - ensure_installed = { - 'codelldb', - --'js-debug-adapter', - }, - } - end, - }, - -- Tools for Neovim { - 'folke/neodev.nvim', + 'folke/lazydev.nvim', ft = 'lua', - dependencies = { - 'neovim/nvim-lspconfig', + opts = { + library = { + 'lazy.nvim', + }, }, - config = function() - local neodev = require 'neodev' - local lsp = require 'lspconfig' - - neodev.setup() - lsp.lua_ls.setup { - settings = { - Lua = { completion = { callSnippet = 'Replace' } } - } - } - end }, -- Tools for Rust @@ -430,51 +376,4 @@ return { }, init = require 'config.plugins.haskell-tools' }, - - -- JS debugger - -- { - -- 'mxsdev/nvim-dap-vscode-js', - -- dependencies = { - -- 'microsoft/vscode-js-debug', - -- version = '1.x', - -- build = 'npm i && npm run compile vsDebugServerBundle && mv dist out', - -- }, - -- config = function() - -- local dap = require 'dap' - -- --local utils = require 'dap.utils' - -- local dap_js = require 'dap-vscode-js' - -- --local mason = require 'mason-registry' - -- - -- ---@diagnostic disable-next-line: missing-fields - -- dap_js.setup { - -- -- debugger_path = mason.get_package('js-debug-adapter'):get_install_path(), - -- debugger_path = vim.fn.stdpath 'data' .. '/lazy/vscode-js-debug', - -- adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, - -- } - -- - -- local langs = { 'javascript', 'typescript', 'svelte', 'astro' } - -- for _, lang in ipairs(langs) do - -- dap.configurations[lang] = { - -- { - -- type = 'pwa-node', - -- request = 'attach', - -- name = 'Attach debugger to existing `node --inspect` process', - -- cwd = '${workspaceFolder}', - -- skipFiles = { - -- '${workspaceFolder}/node_modules/**/*.js', - -- '${workspaceFolder}/packages/**/node_modules/**/*.js', - -- '${workspaceFolder}/packages/**/**/node_modules/**/*.js', - -- '/**', - -- 'node_modules/**', - -- }, - -- sourceMaps = true, - -- resolveSourceMapLocations = { - -- '${workspaceFolder}/**', - -- '!**/node_modules/**', - -- }, - -- }, - -- } - -- end - -- end, - -- }, }