From ee38af01aa8d3fb98e02bc0984093e2940e10daa Mon Sep 17 00:00:00 2001 From: subcrip Date: Thu, 18 Apr 2024 10:52:27 +0800 Subject: [PATCH] Update init.lua Signed-off-by: subcrip --- init.lua | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 17b9fae..b4fef1d 100644 --- a/init.lua +++ b/init.lua @@ -52,7 +52,13 @@ local plugins = { {"loctvl842/monokai-pro.nvim", name="monokai", priority=1000}, { 'nvim-telescope/telescope.nvim', tag = '0.1.5', - dependencies = { 'nvim-lua/plenary.nvim' } + dependencies = { + 'nvim-lua/plenary.nvim', + { + "isak102/telescope-git-file-history.nvim", + dependencies = { "tpope/vim-fugitive" } + } + } }, {"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}, { @@ -419,7 +425,20 @@ local plugins = { { 'Civitasv/cmake-tools.nvim' }, { 'p00f/cphelper.nvim' }, { "savq/melange-nvim" }, - { 'hrsh7th/vim-vsnip' } + { 'hrsh7th/vim-vsnip' }, + { 'octarect/telescope-menu.nvim' }, + { + "NeogitOrg/neogit", + dependencies = { + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration + + -- Only one of these is needed, not both. + "nvim-telescope/telescope.nvim", -- optional + "ibhagwan/fzf-lua", -- optional + }, + config = true + }, } local opts = { } @@ -657,6 +676,10 @@ vim.keymap.set('n', 'r', 'TroubleToggle lsp_references'); vim.keymap.set('n', '1', 'CphReceive'); vim.keymap.set('n', '2', 'CphTest'); vim.keymap.set('n', '3', 'r ~/RustIsBestLang/src/bin/template.ccG'); +vim.keymap.set('n', '', 'BufferPick', {noremap=true}); +vim.keymap.set('n', 'p', 'Telescope menu git', {noremap=true}); +vim.keymap.set('n', 'g', 'Neogit kind=split_above', {noremap=true}); + require("nvim-treesitter.configs").setup { incremental_selection = { enable = true, @@ -670,7 +693,7 @@ require("nvim-treesitter.configs").setup { vim.api.nvim_create_autocmd("FileType", { pattern = "cpp", callback = function() - vim.api.nvim_buf_set_keymap(0, 'n', "b", "10spte g++ -std=c++17 -Wall -Ofast -g -fsanitize=address -fsanitize=undefined % && ./a.out < std.ini", { + vim.api.nvim_buf_set_keymap(0, 'n', "b", "10spte clang++ -std=c++17 -DONLINE_JUDGE -Wl,-z,stack-size=268435456 -Wall -Ofast -g -fsanitize=address -fsanitize=undefined % && ./a.out < std.ini", { silent = true, noremap = true }) @@ -1236,3 +1259,35 @@ require("cmake-tools").setup { refresh_rate_ms = 100, -- how often to iterate icons }, } + +require('telescope').load_extension('git_file_history') + +require("telescope").setup { + extensions = { + menu = { + default = { + items = { + -- You can add an item of menu in the form of { "", "" } + { "Checkhealth", "checkhealth" }, + { "Show LSP Info", "LspInfo" }, + { "Files", "Telescope find_files" }, + + -- The above examples are syntax-sugars of the following; + { display = "Change colorscheme", value = "Telescope colorscheme" }, + }, + }, + git = { + items = { + { "File History", "Telescope git_file_history" }, + { "Branches", "Telescope git_branches" }, + { "Commits", "Telescope git_commits" }, + { "Stash", "Telescope git_stash" }, + { "Status", "Telescope git_status" }, + { "Files", "Telescope git_files" }, + } + }, + }, + }, +} + +require("telescope").load_extension("menu")