Add goto and search functions
This commit is contained in:
parent
1f2e6d6540
commit
5d737ff9ff
|
@ -37,7 +37,7 @@ nnoremap _ ddkP
|
||||||
|
|
||||||
nnoremap <silent> <leader>ev <cmd>tabnew $MYVIMRC<cr>
|
nnoremap <silent> <leader>ev <cmd>tabnew $MYVIMRC<cr>
|
||||||
nnoremap <silent> <leader>sv <cmd>source $MYVIMRC<cr>
|
nnoremap <silent> <leader>sv <cmd>source $MYVIMRC<cr>
|
||||||
nnoremap <C-s> <cmd>%s//gc<left><left><left>
|
nnoremap <C-s> :%s//gc<left><left><left>
|
||||||
nnoremap <silent> <C-w>t <cmd>tabnew<cr>
|
nnoremap <silent> <C-w>t <cmd>tabnew<cr>
|
||||||
nnoremap dL 0D
|
nnoremap dL 0D
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ local pylsp_settings = {
|
||||||
plugins = {
|
plugins = {
|
||||||
pycodestyle = {
|
pycodestyle = {
|
||||||
enabled = true,
|
enabled = true,
|
||||||
ignore = {'E501'}
|
ignore = {'E501', 'E711'}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
home/aliases
16
home/aliases
|
@ -28,7 +28,7 @@ alias feh="feh -."
|
||||||
alias info="info --vi-keys"
|
alias info="info --vi-keys"
|
||||||
|
|
||||||
# grepa
|
# grepa
|
||||||
alias grepa="grep -n --color=always -r --exclude-dir=venv"
|
alias grepa="grep -I -n --color=always -r --exclude-dir=venv"
|
||||||
|
|
||||||
# less
|
# less
|
||||||
alias less="less -R"
|
alias less="less -R"
|
||||||
|
@ -42,6 +42,16 @@ alias sl="ls"
|
||||||
#la
|
#la
|
||||||
alias la="ls -a"
|
alias la="ls -a"
|
||||||
|
|
||||||
finder() {
|
search() {
|
||||||
grepa "$1" | less
|
grepa "$@" . | sed -nE '/^.{,200}$/p'
|
||||||
|
}
|
||||||
|
|
||||||
|
goto() {
|
||||||
|
open="$(search "$@" | fzf --ansi)"
|
||||||
|
if [ ! -z "$open" ]; then
|
||||||
|
file="$(echo "$open" | cut -d: -f1 -)"
|
||||||
|
line="$(echo "$open" | cut -d: -f2 -)"
|
||||||
|
|
||||||
|
vim "$file" -c "normal! $line"gg
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue