From 8deae594e4bbebe65d1a4bc2f8f37ba3ee53c722 Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sun, 10 Sep 2023 17:09:17 -0700 Subject: [PATCH 1/2] Added telescope to lazy init.lua --- nvim.init.lazy.lua | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/nvim.init.lazy.lua b/nvim.init.lazy.lua index 7775dcc..12cb4d8 100644 --- a/nvim.init.lazy.lua +++ b/nvim.init.lazy.lua @@ -35,7 +35,15 @@ require("lazy").setup({ "nathanaelkane/vim-indent-guides", -- "https://github.com/intel-sandbox/vim-iosf.git", -- intel -- "https://github.com/intel-sandbox/vim-pcietrk", -- intel - "vhda/verilog_systemverilog.vim" + "vhda/verilog_systemverilog.vim", + { + 'nvim-telescope/telescope.nvim', tag = '0.1.2', + dependencies = { 'nvim-lua/plenary.nvim' } + }, + { + 'nvim-telescope/telescope-fzf-native.nvim', + build = 'make' + } }) -- LuaLine @@ -232,5 +240,38 @@ vim.cmd("au! BufRead,BufNewFile *.sv,*.svh set filetype=verilog_systemv vim.cmd("au! BufRead,BufNewFile *iosfsb_trk.out set filetype=iosfsbtrk") vim.cmd("au! BufRead,BufNewFile *iosf_trk.out set filetype=iosftrk") +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + +-- Enable telescope fzf native, if installed +pcall(require('telescope').load_extension, 'fzf') + +-- See `:help telescope.builtin` +vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) +vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) +vim.keymap.set('n', '/', function() + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) +end, { desc = '[/] Fuzzily search in current buffer]' }) + +vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) +vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) +vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) +vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) +vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ft=lua ts=4 sts=4 sw=4 et From 4fd1cc8d319f9847569fdfb305ecd43fb459c2db Mon Sep 17 00:00:00 2001 From: Mahesh Asolkar Date: Sun, 10 Sep 2023 17:11:35 -0700 Subject: [PATCH 2/2] Excluding gitsigns config Need to address some error with luv callbacks --- nvim.init.lazy.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/nvim.init.lazy.lua b/nvim.init.lazy.lua index 12cb4d8..dfe8d05 100644 --- a/nvim.init.lazy.lua +++ b/nvim.init.lazy.lua @@ -94,17 +94,17 @@ require('lualine').setup { } } --- Gitsigns --- See `:help gitsigns.txt` -require('gitsigns').setup { - signs = { - add = { text = '+' }, - change = { text = '~' }, - delete = { text = '_' }, - topdelete = { text = '‾' }, - changedelete = { text = '~' }, - }, -} +-- -- Gitsigns +-- -- See `:help gitsigns.txt` +-- require('gitsigns').setup { +-- signs = { +-- add = { text = '+' }, +-- change = { text = '~' }, +-- delete = { text = '_' }, +-- topdelete = { text = '‾' }, +-- changedelete = { text = '~' }, +-- }, +-- } -- Onedark theme require('onedark').setup {