diff --git a/init.lua b/init.lua index 04be6ac8..bc9152f7 100644 --- a/init.lua +++ b/init.lua @@ -68,7 +68,17 @@ require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration -- Auto Pair quotes/parens/brackets/etc. - 'jiangmiao/auto-pairs', + { + 'windwp/nvim-autopairs', + event = "InsertEnter", + opts = {} -- this is equalent to setup({}) function + }, + -- { + -- 'vuki656/package-info.nvim', + -- dependencies = { + -- 'MunifTanjim/nui.nvim' + -- } + -- }, -- VimBeGood, practing and learning vim control 'ThePrimeagen/vim-be-good', @@ -216,7 +226,7 @@ require('lazy').setup({ -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] @@ -386,6 +396,27 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous dia vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' }) vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) +-- Show dependency versions +vim.keymap.set({ "n" }, "ns", require("package-info").show, { silent = true, noremap = true }) + +-- Hide dependency versions +vim.keymap.set({ "n" }, "nc", require("package-info").hide, { silent = true, noremap = true }) + +-- Toggle dependency versions +vim.keymap.set({ "n" }, "nt", require("package-info").toggle, { silent = true, noremap = true }) + +-- Update dependency on the line +vim.keymap.set({ "n" }, "nu", require("package-info").update, { silent = true, noremap = true }) + +-- Delete dependency on the line +vim.keymap.set({ "n" }, "nd", require("package-info").delete, { silent = true, noremap = true }) + +-- Install a new dependency +vim.keymap.set({ "n" }, "ni", require("package-info").install, { silent = true, noremap = true }) + +-- Install a different dependency version +vim.keymap.set({ "n" }, "np", require("package-info").change_version, { silent = true, noremap = true }) + vim.diagnostic.config { update_in_insert = true diff --git a/lua/custom/plugins/package-info.lua b/lua/custom/plugins/package-info.lua new file mode 100644 index 00000000..7c5fb50d --- /dev/null +++ b/lua/custom/plugins/package-info.lua @@ -0,0 +1,58 @@ +return { + 'vuki656/package-info.nvim', + dependencies = { + 'MunifTanjim/nui.nvim' + }, + config = function() + require('package-info').setup({ + colors = { + up_to_date = "#3C4048", -- Text color for up to date dependency virtual text + outdated = "#d19a66", -- Text color for outdated dependency virtual text + }, + icons = { + enable = true, -- Whether to display icons + style = { + up_to_date = "|  ", -- Icon for up to date dependencies + outdated = "|  ", -- Icon for outdated dependencies + }, + }, + autostart = true, -- Whether to autostart when `package.json` is opened + hide_up_to_date = false, -- It hides up to date versions when displaying virtual text + hide_unstable_versions = false, -- It hides unstable versions from version list e.g next-11.1.3-canary3 + -- Can be `npm`, `yarn`, or `pnpm`. Used for `delete`, `install` etc... + -- The plugin will try to auto-detect the package manager based on + -- `yarn.lock` or `package-lock.json`. If none are found it will use the + -- provided one, if nothing is provided it will use `yarn` + package_manager = "pnpm" + }) + end +} + +-- return { +-- colors = { +-- up_to_date = "#3C4048", -- Text color for up to date dependency virtual text +-- outdated = "#d19a66", -- Text color for outdated dependency virtual text +-- }, +-- icons = { +-- enable = true, -- Whether to display icons +-- style = { +-- up_to_date = "|  ", -- Icon for up to date dependencies +-- outdated = "|  ", -- Icon for outdated dependencies +-- }, +-- }, +-- autostart = true, -- Whether to autostart when `package.json` is opened +-- hide_up_to_date = false, -- It hides up to date versions when displaying virtual text +-- hide_unstable_versions = false, -- It hides unstable versions from version list e.g next-11.1.3-canary3 +-- -- Can be `npm`, `yarn`, or `pnpm`. Used for `delete`, `install` etc... +-- -- The plugin will try to auto-detect the package manager based on +-- -- `yarn.lock` or `package-lock.json`. If none are found it will use the +-- -- provided one, if nothing is provided it will use `yarn` +-- package_manager = "pnpm" +-- }) + +-- vim.api.nvim_set_keymap( +-- "n", +-- "ns", +-- "lua require('package-info').show()", +-- { silent = true, noremap = true } +-- ) \ No newline at end of file diff --git a/lua/custom/plugins/tsc-vim.lua b/lua/custom/plugins/tsc-vim.lua new file mode 100644 index 00000000..14d34495 --- /dev/null +++ b/lua/custom/plugins/tsc-vim.lua @@ -0,0 +1,12 @@ +return { + 'dmmulroy/tsc.nvim', + dependencies = { + 'rcarriga/nvim-notify' + }, + config = function() + require('tsc').setup({ + spinner = { "(╯°□°)╯︵ ┻━┻", "(╯°□°)╯︵ ┻━┻", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }, + pretty_errors = true, + }) + end +} \ No newline at end of file