mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-01 19:47:41 +00:00
nvim: Docs, simplification, new plugins
This commit is contained in:
@@ -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", "<leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
vim.api.nvim_set_keymap("v", "<leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
vim.api.nvim_set_keymap("v", "<leader>rv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
vim.api.nvim_set_keymap("v", "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local refactoring_opts = { noremap = true, silent = true, expr = false }
|
||||
map("v", "<leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], refactoring_opts)
|
||||
map("v", "<leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], refactoring_opts)
|
||||
map("v", "<leader>rv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], refactoring_opts)
|
||||
map("v", "<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], refactoring_opts)
|
||||
|
||||
-- Extract block doesn't need visual mode
|
||||
vim.api.nvim_set_keymap("n", "<leader>rb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
vim.api.nvim_set_keymap("n", "<leader>rbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
map("n", "<leader>rb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], refactoring_opts)
|
||||
map("n", "<leader>rbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], refactoring_opts)
|
||||
|
||||
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
|
||||
vim.api.nvim_set_keymap("n", "<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], {noremap = true, silent = true, expr = false})
|
||||
map("n", "<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],refactoring_opts)
|
||||
|
||||
-- prompt for a refactor to apply when the remap is triggered
|
||||
map("v", "<leader>rr", ":lua require('refactoring').select_refactor()<CR>", refactoring_opts)
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user