All Projects → jesseleite → vim-agriculture

jesseleite / vim-agriculture

Licence: MIT license
🚜 Vim plugin to improve project searching with tools like ag and rg

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-agriculture

sif
A minimal (and experimental) ACK written in Go
Stars: ✭ 20 (-83.19%)
Mutual labels:  ag, ack
cmake4vim
Vim plugin for CMake projects
Stars: ✭ 89 (-25.21%)
Mutual labels:  fzf
dotstow
dotfiles managed with stow
Stars: ✭ 60 (-49.58%)
Mutual labels:  fzf
fzf-marker
The terminal command tweak from @pindexis/marker
Stars: ✭ 22 (-81.51%)
Mutual labels:  fzf
dotfiles
mac OS, Arch Linux, and Debian/Ubuntu
Stars: ✭ 286 (+140.34%)
Mutual labels:  fzf
fzf-docker
🐳 Docker completion in zsh using fzf 🌸
Stars: ✭ 41 (-65.55%)
Mutual labels:  fzf
nvim configration
Neovim diy develop enviroment.This project integrates neovim tmux zsh and some very useful plugs of them including YouCompleteMe FZF auto pairs nerdtree ncm2 and so on.
Stars: ✭ 22 (-81.51%)
Mutual labels:  fzf
fzfx
fzfX delivers the power of finding, previewing, editing and managing any file in few key strokes.
Stars: ✭ 71 (-40.34%)
Mutual labels:  fzf
dotfiles
shell, git, vim, tmux .etc dotfiles, managed via gnu stow
Stars: ✭ 20 (-83.19%)
Mutual labels:  fzf
fzf-zsh-plugin
ZSH plugin to enable fzf searches of a lot more stuff - docker, tmux, homebrew and more.
Stars: ✭ 117 (-1.68%)
Mutual labels:  fzf
jq-zsh-plugin
jq zsh plugin
Stars: ✭ 155 (+30.25%)
Mutual labels:  fzf
config
holy cow, wholly config! Vim, Zshell, Ack, & the rest of my dot-files.
Stars: ✭ 21 (-82.35%)
Mutual labels:  ack
fern-mapping-fzf.vim
fern.vim plugin for fzf.
Stars: ✭ 22 (-81.51%)
Mutual labels:  fzf
funboost
pip install funboost,python全功能分布式函数调度框架,。支持python所有类型的并发模式和全球一切知名消息队列中间件,python函数加速器,框架包罗万象,一统编程思维,兼容50% python编程业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数。旧名字是function_scheduling_distributed_framework
Stars: ✭ 351 (+194.96%)
Mutual labels:  ack
bkt
bkt is a subprocess caching utility, available as a command line binary and a Rust library.
Stars: ✭ 117 (-1.68%)
Mutual labels:  fzf
tmuxinator-fzf-start
Uses fzf to provide a selection list for starting tmuxinator projects
Stars: ✭ 31 (-73.95%)
Mutual labels:  fzf
fish
Fish config with awesome flexible prompt, unicode symbols, better fzf integration and lot of handy functions.
Stars: ✭ 27 (-77.31%)
Mutual labels:  fzf
pmy
🚀 General purpose context-aware zsh completion engine powered by fuzzy finder.
Stars: ✭ 119 (+0%)
Mutual labels:  fzf
Dotfiles
Well documented awesome dotfiles 😍 Many neovim lua configs, handy zsh/bash functions, fzf functions + more
Stars: ✭ 64 (-46.22%)
Mutual labels:  fzf
cdhist
Linux shell cd history.
Stars: ✭ 40 (-66.39%)
Mutual labels:  fzf

Vim Agriculture 🚜

A vim plugin to improve the project search experience when using tools like ag and rg.

Rationale

I was inspired by fzf.vim's ability to quickly :Ag search multiple words without quotes, narrow down multiple results in realtime with extended search syntax, then populate quickfix for a large refactor 👌

:Ag function index

But I found myself missing the ability to pass command line options like I could with ack.vim's :Ack 😢

:Ack -Q -i 'function index' vendor

Furthermore, fzf.vim's :Ag treats quotes as a literal part of the search query, which is inconsistent with ag on the command line.

Thus, the intention of this plugin is to bring the best of both worlds to your favourite search wrapper. Perform multi-word searches with or without quotes, pass command line options, and do it all from one command.

Read more about my project searching workflow with fzf.vim and agriculture ❤️

Installation

Install using vim-plug or similar:

Plug 'jesseleite/vim-agriculture'

Usage

If you are already using fzf.vim, you can use the provided :AgRaw / :RgRaw commands.

:AgRaw func.*index
:AgRaw 'func.*index'
:AgRaw -Q 'function index()' app/Http/Controllers

Likewise for :RgRaw, just substitute AgRaw in RgRaw in the above examples.

If you are using another search wrapper, you'll need to wrap your input with agriculture#smart_quote_input().

Mappings

If you are using one of the provided commands, you can hook into the provided <Plug> mappings in your .vimrc:

nmap <Leader>/ <Plug>AgRawSearch
vmap <Leader>/ <Plug>AgRawVisualSelection
nmap <Leader>* <Plug>AgRawWordUnderCursor

Likewise for :RgRaw, just substitute AgRaw in RgRaw in the above examples.

Customization

Command Line Options

If you are using one of the provided commands, you can also set default command line options in your .vimrc:

let g:agriculture#ag_options = '--case-sensitive'

Again likewise for :RgRaw with g:agriculture#rg_options.

Disable Smart Quoting

If you are using one of the provided commands, and want to disable smart quoting for CLI consistency:

let g:agriculture#disable_smart_quoting = 1

Preview Window

Preview windows are now rendered by default in many fzf.vim commands. If you wish to customize or disable this behaviour, see fzf.vim's documentation on preview windows.

How It Works

Your input will be automatically quoted unless the following conditions are met:

  • Quotes in your query, signifying you might want to handle your own quoting/escaping, ie.
    :Ag -Q "Already quoted this pattern."
    :Ag Why you "scruffy looking nerf herder"!
    :Ag Who's scruffy looking?
    
  • A space followed by a dash in your query, signifying you might be passing an option, ie.
    :Ag -Q function index
    :Ag Which way to the beach? -> that way!
    
  • An escaped pattern followed by an unescaped space, signifying you might be passing a path, ie.
    :Ag an\ escaped\ pattern vendor/folder
    

TL;DR: If you use quotes, dashes, or need to pass a path, it's recommended you quote/escape your own pattern and vim-agriculture will stay out of your way 👍

Who am I?

Just a hack 🔨

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].