Skip to content

Commit e003262

Browse files
committed
Adds personal plugins and config
1 parent 3824342 commit e003262

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

init.lua

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ require('lazy').setup({
112112
},
113113

114114
-- Useful plugin to show you pending keybinds.
115-
{ 'folke/which-key.nvim', opts = {} },
115+
{ 'folke/which-key.nvim', opts = {} },
116116
{
117117
-- Adds git related signs to the gutter, as well as utilities for managing changes
118118
'lewis6991/gitsigns.nvim',
@@ -190,10 +190,10 @@ require('lazy').setup({
190190

191191
{
192192
-- Theme inspired by Atom
193-
'navarasu/onedark.nvim',
193+
'rebelot/kanagawa.nvim',
194194
priority = 1000,
195195
config = function()
196-
vim.cmd.colorscheme 'onedark'
196+
vim.cmd.colorscheme 'kanagawa'
197197
end,
198198
},
199199

@@ -252,6 +252,23 @@ require('lazy').setup({
252252
},
253253
build = ':TSUpdate',
254254
},
255+
{
256+
"gbprod/substitute.nvim",
257+
opts = {
258+
259+
}
260+
},
261+
{
262+
"kylechui/nvim-surround",
263+
version = "*", -- Use for stability; omit to use `main` branch for the latest features
264+
event = "VeryLazy",
265+
config = function()
266+
require("nvim-surround").setup({
267+
-- Configuration here, or leave empty to use defaults
268+
})
269+
end
270+
}
271+
255272

256273
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
257274
-- These are some example plugins that I've included in the kickstart repository.
@@ -276,15 +293,15 @@ require('lazy').setup({
276293
vim.o.hlsearch = false
277294

278295
-- Make line numbers default
279-
vim.wo.number = true
296+
vim.wo.rnu = true
280297

281298
-- Enable mouse mode
282299
vim.o.mouse = 'a'
283300

284301
-- Sync clipboard between OS and Neovim.
285302
-- Remove this option if you want your OS clipboard to remain independent.
286303
-- See `:help 'clipboard'`
287-
vim.o.clipboard = 'unnamedplus'
304+
-- vim.o.clipboard = 'unnamedplus'
288305

289306
-- Enable break indent
290307
vim.o.breakindent = true
@@ -314,6 +331,7 @@ vim.o.termguicolors = true
314331
-- Keymaps for better default experience
315332
-- See `:help vim.keymap.set()`
316333
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
334+
vim.keymap.set('i', 'jk', "<esc>")
317335

318336
-- Remap for dealing with word wrap
319337
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
325343
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
326344
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
327345

346+
-- [[ substitute ]]
347+
348+
vim.keymap.set("n", "gr", require('substitute').operator, { noremap = true })
349+
vim.keymap.set("n", "grr", require('substitute').line, { noremap = true })
350+
vim.keymap.set("x", "gr", require('substitute').visual, { noremap = true })
351+
352+
-- [[ clipboad ]]
353+
vim.keymap.set({ "n", "v" }, "<leader>y", '"+y')
354+
vim.keymap.set({ "n", "v" }, "<leader>p", '"+p')
355+
vim.keymap.set({ "n", "v" }, "<leader>gr", function() require('substitute').operator({ register = "+" }) end,
356+
{ noremap = true })
357+
vim.keymap.set({ "n", "v" }, "<leader>grr", function() require('substitute').line({ register = "+" }) end,
358+
{ noremap = true })
359+
328360
-- [[ Highlight on yank ]]
329361
-- See `:help vim.highlight.on_yank()`
330362
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
@@ -506,7 +538,7 @@ local on_attach = function(_, bufnr)
506538
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
507539

508540
nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
509-
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
541+
nmap('gR', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
510542
nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
511543
nmap('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
512544
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')

0 commit comments

Comments
 (0)