From e2f456d3cd12e57231fa77e1877bd7d2f3061952 Mon Sep 17 00:00:00 2001 From: GasparVardanyan Date: Fri, 27 Sep 2024 21:48:00 +0400 Subject: [PATCH] backup --- ginit.vim | 29 +++++++++++++++++++++++++++++ lua/mappings.lua | 24 ++++++++++++++++++++---- lua/options.lua | 2 +- lua/plugins/init.lua | 7 +++++++ 4 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 ginit.vim diff --git a/ginit.vim b/ginit.vim new file mode 100644 index 0000000..33af4f4 --- /dev/null +++ b/ginit.vim @@ -0,0 +1,29 @@ +" Enable Mouse +set mouse=a + +" Set Editor Font +if exists(':GuiFont') + " Use GuiFont! to ignore font errors + GuiFont {font_name}:h{size} +endif + +" Disable GUI Tabline +if exists(':GuiTabline') + GuiTabline 0 +endif + +" Disable GUI Popupmenu +if exists(':GuiPopupmenu') + GuiPopupmenu 0 +endif + +" Enable GUI ScrollBar +if exists(':GuiScrollBar') + GuiScrollBar 1 +endif + +" Right Click Context Menu (Copy-Cut-Paste) +nnoremap :call GuiShowContextMenu() +inoremap :call GuiShowContextMenu() +xnoremap :call GuiShowContextMenu()gv +snoremap :call GuiShowContextMenu()gv diff --git a/lua/mappings.lua b/lua/mappings.lua index 561e6a5..0a52c47 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -18,13 +18,29 @@ vim.api.nvim_create_autocmd({"User"}, { if data.data == "gitsigns.nvim" then local gs = package.loaded.gitsigns - map("n", "[h", gs.prev_hunk) - map("n", "]h", gs.next_hunk) - map("n", "gd", gs.preview_hunk) - map("n", "gu", gs.reset_hunk) + map("n", "[h", gs.prev_hunk, { desc = "Next Hunk" }) + map("n", "]h", gs.next_hunk, { desc = "Previous Hunk"}) + map("n", "gd", gs.preview_hunk, { desc = "Diff Hunk"}) + map("n", "gu", gs.reset_hunk, { desc = "Undo Hunk"}) + + elseif data.data == "nvim-spectre" then end end }) +map('n', 'S', 'lua require("spectre").toggle()', { + desc = "Toggle Spectre" +}) +map('n', 'sw', 'lua require("spectre").open_visual({select_word=true})', { + desc = "Search current word" +}) +map('v', 'sw', 'lua require("spectre").open_visual()', { + desc = "Search current word" +}) +map('n', 'sp', 'lua require("spectre").open_file_search({select_word=true})', { + desc = "Search on current file" +}) + + -- map({ "n", "i", "v" }, "", " w ") diff --git a/lua/options.lua b/lua/options.lua index 4565e09..ccf76f0 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,6 +1,6 @@ require "nvchad.options" -vim.opt.foldmethod = "marker" +vim.opt.foldmethod = "manual" vim.opt.colorcolumn = "81" vim.opt.number = true vim.opt.relativenumber = true diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 00a972f..8f09103 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,4 +1,11 @@ return { + { + "nvim-pack/nvim-spectre", + dependencies = { + "nvim-lua/plenary.nvim", + "folke/trouble.nvim" + }, + }, { "kdheepak/lazygit.nvim", cmd = {