Adds personal plugins and config

This commit is contained in:
Chris 2023-12-04 21:39:22 +01:00
parent 3824342d10
commit e003262117
1 changed files with 38 additions and 6 deletions

View File

@ -112,7 +112,7 @@ require('lazy').setup({
},
-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} },
{ 'folke/which-key.nvim', opts = {} },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
@ -190,10 +190,10 @@ require('lazy').setup({
{
-- Theme inspired by Atom
'navarasu/onedark.nvim',
'rebelot/kanagawa.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onedark'
vim.cmd.colorscheme 'kanagawa'
end,
},
@ -252,6 +252,23 @@ require('lazy').setup({
},
build = ':TSUpdate',
},
{
"gbprod/substitute.nvim",
opts = {
}
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
}
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository.
@ -276,7 +293,7 @@ require('lazy').setup({
vim.o.hlsearch = false
-- Make line numbers default
vim.wo.number = true
vim.wo.rnu = true
-- Enable mouse mode
vim.o.mouse = 'a'
@ -284,7 +301,7 @@ vim.o.mouse = 'a'
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
vim.o.clipboard = 'unnamedplus'
-- vim.o.clipboard = 'unnamedplus'
-- Enable break indent
vim.o.breakindent = true
@ -314,6 +331,7 @@ vim.o.termguicolors = true
-- Keymaps for better default experience
-- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
vim.keymap.set('i', 'jk', "<esc>")
-- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
@ -325,6 +343,20 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
-- [[ substitute ]]
vim.keymap.set("n", "gr", require('substitute').operator, { noremap = true })
vim.keymap.set("n", "grr", require('substitute').line, { noremap = true })
vim.keymap.set("x", "gr", require('substitute').visual, { noremap = true })
-- [[ clipboad ]]
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p')
vim.keymap.set({ "n", "v" }, "<leader>gr", function() require('substitute').operator({ register = "+" }) end,
{ noremap = true })
vim.keymap.set({ "n", "v" }, "<leader>grr", function() require('substitute').line({ register = "+" }) end,
{ noremap = true })
-- [[ Highlight on yank ]]
-- See `:help vim.highlight.on_yank()`
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
@ -506,7 +538,7 @@ local on_attach = function(_, bufnr)
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gR', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')