From 7ac7bf0f1fb27032ee1140d46e1e168b26548078 Mon Sep 17 00:00:00 2001 From: Barak Michener Date: Sat, 18 Sep 2021 17:20:29 -0700 Subject: [PATCH] update vimrc, add lightspeed and better grep --- .vim/nvim.lua | 9 +++++++++ .vimrc | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.vim/nvim.lua b/.vim/nvim.lua index 3f09002..f60287d 100644 --- a/.vim/nvim.lua +++ b/.vim/nvim.lua @@ -168,6 +168,15 @@ local dropdown = require'telescope.themes'.get_dropdown({ --winblend = 10 }) +live_grep_repo = function(conf) + --local opt = dropdown + local opt = { + cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] + } + for k,v in pairs(conf) do opt[k] = v end + builtin.live_grep(opt) +end + git_grep_word = function(conf) local opt = dropdown opt.cwd = vim.fn.systemlist("git rev-parse --show-toplevel")[1] diff --git a/.vimrc b/.vimrc index 0ad1687..b191007 100644 --- a/.vimrc +++ b/.vimrc @@ -218,6 +218,8 @@ Plug 'glepnir/lspsaga.nvim' Plug 'Shougo/defx.nvim', { 'do': ':UpdateRemotePlugins' } Plug 'kristijanhusak/defx-icons' +Plug 'ggandor/lightspeed.nvim' + Plug 'Shougo/unite.vim' " TODO: Look into Coqtail, same author Plug 'whonore/coquille', {'branch': 'pathogen-bundle', 'for': 'coq'} @@ -1000,7 +1002,7 @@ call denite#custom#var('grep', { "nnoremap :Files! `git rev-parse --show-toplevel` "nnoremap :GFiles nnoremap lua require('telescope.builtin').git_files() -nnoremap ag lua git_grep_word{ word_match = "-w", only_sort_text = true, search = ''} +nnoremap ag lua live_grep_repo{ word_match = "-w", only_sort_text = true, search = ''} nnoremap aw lua git_grep_word{ word_match = "-w", only_sort_text = true } " For C++ -- A is a great plugin which allows you to jump from the c file to the