forked from extern/nix-config
Switch from ag (the_silver_searcher) to rg (ripgrep)
This commit is contained in:
parent
55abdf0757
commit
0ef785bc4f
@ -19,4 +19,4 @@
|
||||
##################################################################################
|
||||
|
||||
# See: https://unix.stackexchange.com/questions/138425/
|
||||
i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | ag '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
|
||||
i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | rg '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
|
||||
|
@ -28,7 +28,7 @@ source ~/.vim/keybindings.vim
|
||||
|
||||
let g:ale_lint_on_text_changed = 'never' " Do not lint while typing
|
||||
let g:ale_lint_on_insert_leave = 1 " Only lint after leaving insert mode
|
||||
let g:ackprg = 'ag --vimgrep' " Use ag instead of ack / grep
|
||||
let g:ackprg = 'rg --vimgrep' " Use rg instead of ag / ack / grep
|
||||
let g:plug_window = 'rightbelow topleft new' " Show vim-plug above instead of to the left
|
||||
let g:vimfiler_as_default_explorer = 1 " Replace netrw with vimfiler as the default FileEx
|
||||
let g:indentLine_enabled = 0 " Disable indent lines by default
|
||||
|
@ -76,7 +76,7 @@ alias compare="grep -nFxvf" # Usage: compare <file1> <file2>
|
||||
alias dog="pygmentize -g"
|
||||
|
||||
# Easily show all of the todos in a given project
|
||||
alias todo="ag TODO"
|
||||
alias todo="rg TODO"
|
||||
|
||||
# Use exa as a drop-in replacement for "tree" (faster, more colors, etc.)
|
||||
alias tree="exa --long --tree"
|
||||
|
@ -87,7 +87,7 @@ function ss() {
|
||||
|
||||
# Automatically open the readme in any repository
|
||||
function readme() {
|
||||
local readme=`ls | ag README`
|
||||
local readme=`ls | rg README`
|
||||
if [[ $readme ]]; then
|
||||
nvim $readme
|
||||
else
|
||||
|
@ -22,8 +22,8 @@ export VISUAL="vim"
|
||||
export EDITOR="vim"
|
||||
export BROWSER="inox"
|
||||
|
||||
# Use ag instead of grep for fzf (much faster)
|
||||
export FZF_DEFAULT_COMMAND='ag -l -g ""'
|
||||
# Use rg instead of ag / ack / grep for fzf (much faster)
|
||||
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow --glob "!.git/*"'
|
||||
|
||||
# Required to make gpg-agent work in cases like git commit
|
||||
export GPG_TTY=$(tty)
|
||||
|
@ -66,7 +66,7 @@ Note that you should *never* give a file or directory more permissions than need
|
||||
### Searching Through Files
|
||||
|
||||
- Search all files in a directory (and all subdirectories) for a given string: `grep -inr <search_term>` **OR** `g <search_term>`
|
||||
- Search all files in a directory (including subdirectories) for a given string and ignore dotfiles: `ag <search_term>`
|
||||
- Search all files in a directory (including subdirectories) for a given string and ignore dotfiles: `rg <search_term>`
|
||||
|
||||
### System Commands
|
||||
|
||||
|
@ -61,8 +61,8 @@ i npm # Install npm, a package manager for node.js
|
||||
i llvm # Install llvm, used to make the crystal binary
|
||||
i exa # Install exa, a drop-in replacement for ls (and tree)
|
||||
|
||||
i the_silver_searcher # Install ag, used to easily search through files
|
||||
i fdupes # Install fdupes, used to quickly find duplicate files
|
||||
i ripgrep # Install rg, a faster alternative to ag / ack / grep
|
||||
|
||||
i tig # Install tig, used to browse git commits
|
||||
i ncdu # Install ncdu, used to easily see disk usage
|
||||
|
Loading…
Reference in New Issue
Block a user