diff --git a/config/nvim/init.lua b/config/nvim/init.lua index a448b0b..a2a7deb 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -123,6 +123,10 @@ vim.o.termguicolors = true -- Set completeopt to have a better completion experience vim.o.completeopt = 'menuone,noselect' +-- Configure and disable providers. +vim.g.python3_host_prog = '/opt/homebrew/bin/python3' +vim.g.loaded_ruby_provider = 0 + -- [[ Basic Keymaps ]] -- Set as the leader key -- See `:help mapleader` @@ -490,7 +494,12 @@ map('n', 'bw', 'BufferOrderByWindowNumber', opts) -- :BarbarEnable - enables barbar (enabled by default) -- :BarbarDisable - very bad command, should never be used - +vim.api.nvim_create_autocmd("BufWritePost", { pattern = "plugins.lua", command = "source | PackerSync" }) +vim.api.nvim_create_autocmd("BufRead", { pattern = "*/node_modules/*", command = "lua vim.diagnostic.disable(0)" }) +vim.api.nvim_create_autocmd("BufNewFile", { pattern = "*/node_modules/*", command = "lua vim.diagnostic.disable(0)" }) +-- Enable spell checking for certain file types +vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, { pattern = { "*.txt", "*.md", "*.tex" }, + command = "setlocal spell" }) -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/config/nvim/lua/custom/plugins.lua b/config/nvim/lua/custom/plugins.lua index b693c34..bf62b46 100644 --- a/config/nvim/lua/custom/plugins.lua +++ b/config/nvim/lua/custom/plugins.lua @@ -1,25 +1,36 @@ return function(use) - use({ - "folke/which-key.nvim", - config = function() - require("which-key").setup({}) - end - }) - -- catppuccin theme + -- 💥 Create key bindings that stick. + -- WhichKey is a lua plugin that displays a popup with + -- possible keybindings of the command you started typing. + use({ "folke/which-key.nvim", config = function() require("which-key").setup({}) end }) + + -- 🍨 Soothing pastel theme for (Neo)vim + -- https://github.com/catppuccin/nvim use { "catppuccin/nvim", as = "catppuccin" } vim.cmd.colorscheme('catppuccin-latte') + -- markdown preview plugin for (neo)vim -- https://github.com/iamcco/markdown-preview.nvim - use({ - "iamcco/markdown-preview.nvim", + use({ "iamcco/markdown-preview.nvim", run = function() vim.fn["mkdp#util#install"]() end, }) + -- The neovim tabline plugin. -- https://github.com/romgrk/barbar.nvim use 'nvim-tree/nvim-web-devicons' - use {'romgrk/barbar.nvim', wants = 'nvim-web-devicons'} + use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' } + -- Pretty UI + use 'stevearc/dressing.nvim' -- Neovim plugin to improve the default vim.ui interfaces + use 'rcarriga/nvim-notify' -- A fancy, configurable, notification manager for NeoVim + use 'vigoux/notifier.nvim' -- Non-intrusive notification system for neovim + use { 'folke/todo-comments.nvim', -- ✅ Highlight, list and search todo comments in your projects + requires = 'nvim-lua/plenary.nvim', + config = function() require('todo-comments').setup {} end, + } + + -- The Refactoring library based off the Refactoring book by Martin Fowler -- https://github.com/ThePrimeagen/refactoring.nvim use { "ThePrimeagen/refactoring.nvim", @@ -28,17 +39,32 @@ return function(use) {"nvim-treesitter/nvim-treesitter"} } } + + -- An asynchronous linter plugin for Neovim complementary to the built-in Language Server Protocol support. + -- https://github.com/mfussenegger/nvim-lint + use 'mfussenegger/nvim-lint' + vim.api.nvim_create_autocmd({ "BufWritePost" }, { + callback = function() require("lint").try_lint() end, + }) + + -- Remaps for the refactoring operations currently offered by the plugin - vim.api.nvim_set_keymap("v", "re", [[ lua require('refactoring').refactor('Extract Function')]], {noremap = true, silent = true, expr = false}) - vim.api.nvim_set_keymap("v", "rf", [[ lua require('refactoring').refactor('Extract Function To File')]], {noremap = true, silent = true, expr = false}) - vim.api.nvim_set_keymap("v", "rv", [[ lua require('refactoring').refactor('Extract Variable')]], {noremap = true, silent = true, expr = false}) - vim.api.nvim_set_keymap("v", "ri", [[ lua require('refactoring').refactor('Inline Variable')]], {noremap = true, silent = true, expr = false}) + local map = vim.api.nvim_set_keymap + local refactoring_opts = { noremap = true, silent = true, expr = false } + map("v", "re", [[ lua require('refactoring').refactor('Extract Function')]], refactoring_opts) + map("v", "rf", [[ lua require('refactoring').refactor('Extract Function To File')]], refactoring_opts) + map("v", "rv", [[ lua require('refactoring').refactor('Extract Variable')]], refactoring_opts) + map("v", "ri", [[ lua require('refactoring').refactor('Inline Variable')]], refactoring_opts) -- Extract block doesn't need visual mode - vim.api.nvim_set_keymap("n", "rb", [[ lua require('refactoring').refactor('Extract Block')]], {noremap = true, silent = true, expr = false}) - vim.api.nvim_set_keymap("n", "rbf", [[ lua require('refactoring').refactor('Extract Block To File')]], {noremap = true, silent = true, expr = false}) + map("n", "rb", [[ lua require('refactoring').refactor('Extract Block')]], refactoring_opts) + map("n", "rbf", [[ lua require('refactoring').refactor('Extract Block To File')]], refactoring_opts) -- Inline variable can also pick up the identifier currently under the cursor without visual mode - vim.api.nvim_set_keymap("n", "ri", [[ lua require('refactoring').refactor('Inline Variable')]], {noremap = true, silent = true, expr = false}) + map("n", "ri", [[ lua require('refactoring').refactor('Inline Variable')]],refactoring_opts) + + -- prompt for a refactor to apply when the remap is triggered + map("v", "rr", ":lua require('refactoring').select_refactor()", refactoring_opts) + end diff --git a/config/nvim/plugin/packer_compiled.lua b/config/nvim/plugin/packer_compiled.lua index 2613de4..d013746 100644 --- a/config/nvim/plugin/packer_compiled.lua +++ b/config/nvim/plugin/packer_compiled.lua @@ -105,6 +105,11 @@ _G.packer_plugins = { path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/cmp_luasnip", url = "https://github.com/saadparwaiz1/cmp_luasnip" }, + ["dressing.nvim"] = { + loaded = true, + path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/dressing.nvim", + url = "https://github.com/stevearc/dressing.nvim" + }, ["fidget.nvim"] = { loaded = true, path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/fidget.nvim", @@ -140,16 +145,31 @@ _G.packer_plugins = { path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/mason.nvim", url = "https://github.com/williamboman/mason.nvim" }, + ["notifier.nvim"] = { + loaded = true, + path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/notifier.nvim", + url = "https://github.com/vigoux/notifier.nvim" + }, ["nvim-cmp"] = { loaded = true, path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-cmp", url = "https://github.com/hrsh7th/nvim-cmp" }, + ["nvim-lint"] = { + loaded = true, + path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-lint", + url = "https://github.com/mfussenegger/nvim-lint" + }, ["nvim-lspconfig"] = { loaded = true, path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", url = "https://github.com/neovim/nvim-lspconfig" }, + ["nvim-notify"] = { + loaded = true, + path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-notify", + url = "https://github.com/rcarriga/nvim-notify" + }, ["nvim-treesitter"] = { loaded = true, path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/nvim-treesitter", @@ -200,6 +220,12 @@ _G.packer_plugins = { path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/telescope.nvim", url = "https://github.com/nvim-telescope/telescope.nvim" }, + ["todo-comments.nvim"] = { + config = { "\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0" }, + loaded = true, + path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/todo-comments.nvim", + url = "https://github.com/folke/todo-comments.nvim" + }, ["vim-fugitive"] = { loaded = true, path = "/Users/ivuorinen/.local/share/nvim/site/pack/packer/start/vim-fugitive", @@ -224,6 +250,10 @@ _G.packer_plugins = { } time([[Defining packer_plugins]], false) +-- Config for: todo-comments.nvim +time([[Config for todo-comments.nvim]], true) +try_loadstring("\27LJ\2\n?\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\18todo-comments\frequire\0", "config", "todo-comments.nvim") +time([[Config for todo-comments.nvim]], false) -- Config for: which-key.nvim time([[Config for which-key.nvim]], true) try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14which-key\frequire\0", "config", "which-key.nvim")