.dotfiles/private_dot_config/nvim/lua/plugins/editor.lua
tombdf 14db16c15d
feat(nvim): update LazyVim config and add Haskell/Scala
Switch to snacks_picker and snacks_explorer plugins, add language support for
Haskell and Scala development. Add live-share.nvim for collaborative editing.
Remove minimap and update editor configs. Add GHCup and Coursier install
scripts.
2025-04-25 11:58:27 +01:00

252 lines
7.0 KiB
Lua

return {
{ "nvzone/volt", lazy = true },
{ "nvzone/menu", lazy = true },
{ "nvzone/minty", cmd = { "Shades", "Huefy" } },
{
"snacks.nvim",
opts = {
dashboard = {
preset = {
header = [[
I use
██████ █████ █████ █████ ███
░░██████ ░░███ ░░███ ░░███ ░░░
░███░███ ░███ ██████ ██████ ░███ ░███ ████ █████████████
░███░░███░███ ███░░███ ███░░███ ░███ ░███ ░░███ ░░███░░███░░███
░███ ░░██████ ░███████ ░███ ░███ ░░███ ███ ░███ ░███ ░███ ░███
░███ ░░█████ ░███░░░ ░███ ░███ ░░░█████░ ░███ ░███ ░███ ░███
█████ ░░█████░░██████ ░░██████ ░░███ █████ █████░███ █████
░░░░░ ░░░░░ ░░░░░░ ░░░░░░ ░░░ ░░░░░ ░░░░░ ░░░ ░░░░░
btw
]],
},
},
terminal = {
win = {
keys = {
-- nav_h = { "<C-j>", [[<C-\><C-n><C-w>h]], desc = "Go to Left Window", mode = "t" },
nav_k = { "<C-l>", [[<C-\><C-n><C-w>k]], desc = "Go to Upper Window", mode = "t" },
nav_j = { "<C-k>", [[<C-\><C-n><C-w>j]], desc = "Go to Lower Window", mode = "t" },
-- nav_l = { "<C-h>", [[<C-\><C-n><C-w>l]], desc = "Go to Right Window", mode = "t" },
-- Using C-m cause the enter key to not work in terminal
},
},
},
},
},
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
cmd = "Neotree",
keys = {
{ "<leader>e", false },
{ "<leader>E", false },
{
"<C-n>",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.fn.getcwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
},
opts = {
close_if_last_window = true,
window = {
width = 30,
mappings = {
["<space>"] = "none",
["j"] = "none",
["k"] = "none",
["l"] = "none",
["m"] = "none",
},
},
},
},
{
"Bekaboo/dropbar.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
config = function()
local dropbar_api = require("dropbar.api")
vim.keymap.set("n", "<Leader>;", dropbar_api.pick, { desc = "Pick symbols in winbar" })
vim.keymap.set("n", "[;", dropbar_api.goto_context_start, { desc = "Go to start of current context" })
vim.keymap.set("n", "];", dropbar_api.select_next_context, { desc = "Select next context" })
end,
init = function()
require("which-key").add({
{ "<Leader>;", name = "Pick symbols in winbar", prefix = ";", icon = { icon = "", color = "blue" } },
})
end,
},
-- Hex editor
{
"RaafatTurki/hex.nvim",
config = true,
lazy = false,
},
-- Auto-save
{
"okuuva/auto-save.nvim",
event = { "InsertLeave", "TextChanged" },
opts = {
noautocmd = true,
},
},
-- Remember last position
{
"ethanholz/nvim-lastplace",
event = "BufRead",
config = true,
},
-- Better word movement
{
"chrisgrieser/nvim-spider",
lazy = true,
},
-- Underline current word
-- {
-- "itchyny/vim-cursorword",
-- event = { "BufEnter", "BufNewFile" },
-- },
-- Full visual line
{
"0xAdk/full_visual_line.nvim",
keys = "V",
opts = {},
},
{
"saghen/blink.cmp",
opts = {
keymap = {
["<TAB>"] = { "select_next", "fallback" },
["<S-TAB>"] = { "select_prev", "fallback" },
},
},
},
-- {
-- "csessh/stopinsert.nvim",
-- opts = {
-- idle_time_ms = 15000,
-- },
-- },
-- Minimap
-- {
-- "gorbit99/codewindow.nvim",
-- lazy = false,
-- keys = {
-- {
-- "<leader>m",
-- function()
-- require("codewindow").toggle_minimap()
-- end,
-- desc = "Toggle Minimap",
-- },
-- },
-- opts = {
-- z_index = 50,
-- auto_enable = true,
-- minimap_width = 10,
-- screen_bounds = "background",
-- window_border = "none",
-- },
-- },
-- Split or join code blocks
{
"Wansmer/treesj",
dependencies = { "nvim-treesitter/nvim-treesitter" },
opts = { use_default_keymaps = false },
keys = {
{
"n",
"<leader>A",
function()
require("treesj").toggle()
end,
desc = "Toggle split/join block",
},
},
},
{
"brenton-leighton/multiple-cursors.nvim",
version = "*",
opts = {},
keys = {
{ "<C-Up>", "<Cmd>MultipleCursorsAddUp<CR>", mode = { "i", "x" }, desc = "Add cursor and move up" },
{ "<C-Down>", "<Cmd>MultipleCursorsAddDown<CR>", mode = { "i", "x" }, desc = "Add cursor and move down" },
{
"<C-LeftMouse>",
"<Cmd>MultipleCursorsMouseAddDelete<CR>",
mode = { "n", "v", "i" },
desc = "Add or remove cursor",
},
{ "<leader>Ca", "<Cmd>MultipleCursorsAddMatches<CR>", mode = { "n", "v", "x" }, desc = "Add cursors to cword" },
{
"<leader>CA",
"<Cmd>MultipleCursorsAddMatchesV<CR>",
mode = { "n", "v", "x" },
desc = "Add cursors to cword in previous area",
},
{
"<leader>Cd",
"<Cmd>MultipleCursorsAddJumpNextMatch<CR>",
mode = { "n", "v", "x" },
desc = "Add cursor and jump to next cword",
},
{ "<leader>CD", "<Cmd>MultipleCursorsJumpNextMatch<CR>", mode = { "n", "v", "x" }, desc = "Jump to next cword" },
{ "<leader>Cl", "<Cmd>MultipleCursorsLock<CR>", mode = { "n", "v", "x" }, desc = "Lock virtual cursors" },
},
init = function()
require("which-key").add({
{ "<Leader>C", name = "cursor", prefix = "C", icon = { icon = "󰗧", color = "cyan" } },
})
end,
},
{
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim" },
opts = {},
},
{
"2kabhishek/nerdy.nvim",
cmd = "Nerdy",
},
{
"ThePrimeagen/vim-be-good",
},
{
"azratul/live-share.nvim",
dependencies = {
"jbyuki/instant.nvim",
},
config = function()
vim.g.instant_username = "king_terry"
require("live-share").setup({
port_internal = 8765,
max_attempts = 40, -- 10 seconds
service = "serveo.net",
})
end,
},
}