Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
vim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dotfiles
vim
Commits
46374cfb
Commit
46374cfb
authored
3 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
FZF tuning
parent
f16213ae
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
.vimrc
+21
-4
21 additions, 4 deletions
.vimrc
with
21 additions
and
4 deletions
.vimrc
+
21
−
4
View file @
46374cfb
...
@@ -1136,7 +1136,7 @@ let $FZF_DEFAULT_COMMAND='rg --vimgrep --no-heading --color=never --smart-case -
...
@@ -1136,7 +1136,7 @@ let $FZF_DEFAULT_COMMAND='rg --vimgrep --no-heading --color=never --smart-case -
" Ripgrep advanced
" Ripgrep advanced
function
!
RipgrepFzf
(
query
,
fullscreen
)
function
!
RipgrepFzf
(
query
,
fullscreen
)
let
command_fmt
=
'rg --column --line-number --no-heading --color=always --smart-case --hidden %s || true'
let
command_fmt
=
'rg --column --line-number --no-heading --color=always --smart-case --hidden
-g\!.git -g\!.pijul -g\!.ccls-cache
%s || true'
let
initial_command
=
printf
(
command_fmt
,
shellescape
(
a:query
))
let
initial_command
=
printf
(
command_fmt
,
shellescape
(
a:query
))
let
reload_command
=
printf
(
command_fmt
,
'{q}'
)
let
reload_command
=
printf
(
command_fmt
,
'{q}'
)
let
spec
=
{
'options'
:
[
'--phony'
,
'--query'
,
a:query
,
'--bind'
,
'change:reload:'
.
reload_command
]}
let
spec
=
{
'options'
:
[
'--phony'
,
'--query'
,
a:query
,
'--bind'
,
'change:reload:'
.
reload_command
]}
...
@@ -1145,12 +1145,29 @@ endfunction
...
@@ -1145,12 +1145,29 @@ endfunction
command
!
-
nargs
=
*
-
bang RG
call
RipgrepFzf
(<
q
-
args
>,
<
bang
>
0
)
command
!
-
nargs
=
*
-
bang RG
call
RipgrepFzf
(<
q
-
args
>,
<
bang
>
0
)
" Pijul
function
!
RipgrepPijulFzf
(
query
,
fullscreen
)
let
command_fmt
=
'pijul log || %s || true'
let
initial_command
=
printf
(
command_fmt
,
shellescape
(
a:query
))
let
reload_command
=
printf
(
command_fmt
,
'{q}'
)
let
spec
=
{
'options'
:
[
'--phony'
,
'--query'
,
a:query
,
'--bind'
,
'change:reload:'
.
reload_command
]}
call
fzf#
vim
#
grep
(
initial_command
,
1
,
fzf#
vim
#with_preview
(
spec
),
a:fullscreen
)
endfunction
command
!
-
nargs
=
*
-
bang PJ
call
RipgrepPijulFzf
(<
q
-
args
>,
<
bang
>
0
)
" Git grep
" Git grep
command
!
-
bang
-
nargs
=
* GGrep
command
!
-
bang
-
nargs
=
* GGrep
\
call
fzf#
vim
#
grep
(
\
call
fzf#
vim
#
grep
(
\
'git grep --line-number '
.
shellescape
(<
q
-
args
>),
0
,
\
'git grep --line-number '
.
shellescape
(<
q
-
args
>),
0
,
\
fzf#
vim
#with_preview
({
'dir'
:
systemlist
(
'git rev-parse --show-toplevel'
)[
0
]}),
<
bang
>
0
)
\
fzf#
vim
#with_preview
({
'dir'
:
systemlist
(
'git rev-parse --show-toplevel'
)[
0
]}),
<
bang
>
0
)
" Pijul grep
command
!
-
bang
-
nargs
=
* PGrep
\
call
fzf#
vim
#
grep
(
\
'pijul log'
.
shellescape
(<
q
-
args
>),
0
,
\
fzf#
vim
#with_preview
(),
<
bang
>
0
)
" Enable Ag and Rg for fzf plugin
" Enable Ag and Rg for fzf plugin
"command! -bang -nargs=* Ag call fzf#vim#ag_interactive(<q-args>, fzf#vim#with_preview('right:50%:hidden', 'alt-h'))
"command! -bang -nargs=* Ag call fzf#vim#ag_interactive(<q-args>, fzf#vim#with_preview('right:50%:hidden', 'alt-h'))
...
@@ -1162,18 +1179,18 @@ command! -bang -nargs=* GGrep
...
@@ -1162,18 +1179,18 @@ command! -bang -nargs=* GGrep
let
g:rg_command
=
'
let
g:rg_command
=
'
\
rg
--
files
--
column
--
line
-
number
--
no
-
heading
--
fixed
-
strings
--
ignore
-
case
--
no
-
ignore
--
hidden
--
follow
--
color
"always"
\
rg
--
files
--
column
--
line
-
number
--
no
-
heading
--
fixed
-
strings
--
ignore
-
case
--
no
-
ignore
--
hidden
--
follow
--
color
"always"
\
-
g
"*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf,robot,rs}"
\
-
g
"*.{js,json,php,md,styl,jade,html,config,py,cpp,c,go,hs,rb,conf,robot,rs}"
\
-
g
"!{.git,node_modules,vendor}/*"
'
\
-
g
"!{.git,
.pijul,
node_modules,vendor}/*"
'
"command! -bang -nargs=* F call fzf#vim#grep(g:rg_command .shellescape(<q-args>), 1, <bang>0)
"command! -bang -nargs=* F call fzf#vim#grep(g:rg_command .shellescape(<q-args>), 1, <bang>0)
command
!
-
bang
-
nargs
=
* Rgrust
command
!
-
bang
-
nargs
=
* Rgrust
\
call
fzf#
vim
#
grep
(
\
call
fzf#
vim
#
grep
(
\
'rg -g!target -g!book -g!docs --column --line-number --no-heading --smart-case -- '
.
shellescape
(<
q
-
args
>),
1
,
\
'rg -g!target -g!book -g!docs --column --line-number --no-heading --smart-case
--hidden -g\!.git -g\!.pijul -g\!.ccls-cache
-- '
.
shellescape
(<
q
-
args
>),
1
,
\
fzf#
vim
#with_preview
(),
<
bang
>
0
)
\
fzf#
vim
#with_preview
(),
<
bang
>
0
)
command
!
-
bang
-
nargs
=
* Rgg
command
!
-
bang
-
nargs
=
* Rgg
\
call
fzf#
vim
#
grep
(
\
call
fzf#
vim
#
grep
(
\
'rg --column --line-number --no-heading --color=always '
.
shellescape
(<
q
-
args
>),
1
,
\
'rg --column --line-number --no-heading --color=always
--hidden -g\!.git -g\!.pijul -g\!.ccls-cache
'
.
shellescape
(<
q
-
args
>),
1
,
\
<
bang
>
0
? fzf#
vim
#with_preview
(
'up:60%'
)
\
<
bang
>
0
? fzf#
vim
#with_preview
(
'up:60%'
)
\
:
fzf#
vim
#with_preview
(
'up:50%'
,
'?'
),
\
:
fzf#
vim
#with_preview
(
'up:50%'
,
'?'
),
\
<
bang
>
0
)
\
<
bang
>
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment