From 439f26e10527e10a9bf5c812cb44023b4b2c24f0 Mon Sep 17 00:00:00 2001 From: Pgolik Date: Mon, 3 Jun 2024 08:54:07 +0200 Subject: [PATCH] Add files via upload --- init.lua | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/init.lua b/init.lua index 4eff0741..071cf074 100644 --- a/init.lua +++ b/init.lua @@ -378,6 +378,7 @@ require('lazy').setup({ { 'nvim-telescope/telescope-ui-select.nvim' }, -- Useful for getting pretty icons, but requires a Nerd Font. + { 'nvim-telescope/telescope-live-grep-args.nvim' }, { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, }, config = function() @@ -412,10 +413,15 @@ require('lazy').setup({ -- }, -- }, -- pickers = {} + shorten_path = true, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), }, + ['live_grep_args'] = { + auto_quoting = true, + theme = 'dropdown', + }, }, } @@ -430,12 +436,13 @@ require('lazy').setup({ vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', 'sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) - vim.keymap.set('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) + vim.keymap.set('n', 'sg', ":lua require('telescope').extensions.live_grep_args.live_grep_args()", { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + pcall(require('telescope').load_extension, 'live_grep_args') -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. @@ -640,7 +647,7 @@ require('lazy').setup({ local servers = { clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -650,7 +657,7 @@ require('lazy').setup({ -- But for many setups, the LSP (`ts_ls`) will work just fine -- ts_ls = {}, -- - + pylsp = {}, cmake = {}, lua_ls = { -- cmd = {...}, @@ -734,9 +741,10 @@ require('lazy').setup({ formatters_by_ft = { cmake = { 'cmakelang' }, cpp = { 'clang_format' }, + json = { 'clang_format' }, lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + python = { 'isort' }, -- -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, @@ -815,7 +823,7 @@ require('lazy').setup({ -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, --[''] = cmp.mapping.select_next_item(), --[''] = cmp.mapping.select_prev_item(), @@ -967,14 +975,28 @@ require('lazy').setup({ -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - { 'kdheepak/lazygit.nvim' }, + { + 'NeogitOrg/neogit', + dependencies = { + 'nvim-lua/plenary.nvim', -- required + 'sindrets/diffview.nvim', -- optional - Diff integratio + + -- Only one of these is needed, not both. + 'nvim-telescope/telescope.nvim', -- optional + 'ibhagwan/fzf-lua', -- optional + }, + keys = { + { 'l', ':Neogit cwd=%:p:h kind=split', { desc = 'Open neogit in current direcotry' } }, + }, + config = true, + }, { 'nvim-tree/nvim-tree.lua', config = function() @@ -984,6 +1006,9 @@ require('lazy').setup({ width = 30, preserve_window_proportions = true, }, + update_focused_file = { + enable = true, + }, } end, },