Commit Graph

512 Commits

Author SHA1 Message Date
Junegunn Choi
279e1ec068 [fzf#vim#grep / Ag / Rg / RG] Multi-line display for narrow screens (#1549) 2024-06-07 08:38:27 +09:00
ykhan21
0a80e43f90 Fix environment variable reference (#1546) 2024-05-26 09:21:13 +09:00
Junegunn Choi
47077d0b17 Fix missing quote
Thanks @arekt
2024-05-25 17:02:44 +09:00
ykhan21
42507c3bea Add scoop_git_bash to Windows bash candidates (#1545) 2024-05-25 14:38:13 +09:00
Junegunn Choi
19de6507ff Fix Ag/Rg sink for win32unix (git bash, mintty) 2024-05-23 21:38:15 +09:00
Felix Endres
08dcd814a9 Improve :BCommits Preview (#1525)
Reduce the preview of :BCommits to the relevant part, when used with visual selection.
Only show the part of the diff that belongs to the selection.

That makes it very easy to quickly follow the evolution of a code block.
2024-05-23 12:56:13 +09:00
Junegunn Choi
71b0e0fb94 [Changes] Fix 'List index out of range: 0' error
Ignore change item that points to a non-existent line
2024-05-17 21:48:08 +09:00
Junegunn Choi
3656cbb9ef [preview.sh] Rename $BATNAME to $BATCAT (#1457) 2024-05-14 17:54:37 +09:00
Junegunn Choi
61edb0ca42 [preview.sh] Use $BATNAME if defined
Close #1457
2024-05-14 17:52:23 +09:00
Junegunn Choi
a50c2640b9 Fix Commands and Windows on Windows
Use tab character with --tabstop=1 instead of non-breaking space

Fix #1542
2024-05-14 17:39:29 +09:00
Junegunn Choi
d91dd754a9 [preview.sh] Fix handling of backslashes in paths on Windows 2024-05-14 09:34:55 +09:00
Junegunn Choi
99093bd103 [RG] Use 'cd .' as the dummy command on Windows 2024-05-08 00:06:01 +09:00
Junegunn Choi
269c08641e [RG] Do not append '|| :' on Windows 2024-04-29 00:09:13 +09:00
Junegunn Choi
503bb6fe9c [Tags] Require readtags from universal-ctags
Close #1540
2024-04-25 20:03:30 +09:00
Junegunn Choi
45d96c9cb1 Do not omit argument to bufnr() for Vim 8 compatibility
bufnr() requires an argument in Vim 8.0

Close #1521
2024-03-22 11:17:34 +09:00
Junegunn Choi
e69f2dcdad [Tags] Add '-' argument to readtags to split options and the search string 2024-03-11 12:08:01 +09:00
Junegunn Choi
0b3e015ad8 [Tags] Use 'readtags' if query string is given
This pre-filtering is critical when working with large tag files.

'readtags' can perform a binary search for the given prefix string
but fzf has to load the entire file into memory just to start searching.

Close #1529
Close #1524
2024-03-11 12:00:49 +09:00
Junegunn Choi
8ea9574b3e Update README: warp.dev 2024-02-15 14:30:15 +09:00
Junegunn Choi
20a1c014b5 Update README: warp.dev 2024-02-13 08:45:27 +09:00
Junegunn Choi
f6cb5b1789 [Helptags] Do not use 'Fatal'
Fix #1506
2024-01-08 16:43:32 +09:00
Junegunn Choi
1e054c1d07 [History] Fix error when there are no entries
Fix #1512
2023-10-27 11:43:42 +09:00
Junegunn Choi
d1016dbd7c [fzf#vim#buffers] Allow users to pass a custom list of buffer numbers
Introducing a global configuration variable may seem easier but this
method is more flexible in that it allows you to define multiple
variations of the command without having to repeatedly setting and
unsetting the variable.

  function! MyBuffers()
    return filter(range(1, bufnr('$')), 'buflisted(v:val) && getbufvar(v:val, "&filetype") != "qf"')
  endfunction

  command! -bar -bang Buffers call fzf#vim#buffers(MyBuffers(), fzf#vim#with_preview({'placeholder': '{1}'}), <bang>0)

Close #831
Close #393
2023-10-14 23:57:35 +09:00
Ivan Kovnatsky
f3b82091a6 Fix formatting around BLines (#1510)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-10-06 09:11:13 +09:00
Balki
678ee1a549 Replace unicode figure space (U+2007) with regular space (#1507) 2023-09-17 23:52:34 +09:00
Junegunn Choi
fe362d413a Restore the behavior of custom actions on Ag/Rg/Tags/Commits
Fix #1505
2023-09-16 19:36:06 +09:00
Junegunn Choi
937f430ce3 Add :Changes command
Close #1478
Close #1479
2023-09-14 22:45:00 +09:00
jiz4oh
587f55bf50 Use fzf#shellescape instead (#1503) 2023-09-07 11:31:15 +09:00
Junegunn Choi
7ba5be32bc [Buffers] Do not preview '[No Name]' 2023-09-06 18:26:23 +09:00
Junegunn Choi
2c501dc5a2 [Windows] Add preview
Close #1487
2023-09-06 18:26:23 +09:00
Nikita Kouevda
19dec6c038 Use s:conf for preview_bash and files_options (#1502)
Follow-up to 832a090870.
2023-09-06 11:14:08 +09:00
Junegunn Choi
1be10b0e50 Update README 2023-09-06 00:48:04 +09:00
Junegunn Choi
5c218e982d [Lines] Allow multiple selections 2023-09-06 00:46:24 +09:00
Junegunn Choi
832a090870 Add option to use location list instead of quickfix list
Close #432
Close #448
Close #846
Close #1095
Close #1500
2023-09-06 00:46:24 +09:00
Nikita Kouevda
5ab282c2f4 doc: Remove broken link to .vimrc (#1499) 2023-09-03 18:20:37 +09:00
Frederick Zhang
811f34b70b [[B]Commits] Bump Git commit hash length limit to 40 (#1495)
When working in large repositories, 9 characters can be ambiguous.
Bumping it to 40, which is the length of SHA-1. (The algorithm is not
that relevant though. Even when SHA-256 takes over, 40 characters should
still be enough for most repositories.)
2023-08-10 20:30:57 +09:00
Nicolas
e0d131d953 tagpreview: open vim in readonly mode, and exit on failure (#1488)
- When computing the center line, 'exit' on failure instead of 'return'.
- Open vim in read-only mode to avoid a non-zero exit code if the file is
already opened.

Signed-off-by: Nicolas VINCENT <nico.vince@gmail.com>
2023-07-17 18:57:01 +09:00
Edwin Steiner
1dcdb21db6 [Helptags] Remove dependencies of grep and sort (#1482)
* Remove dependency of fzf#vim#helptags on grep.

The grep command was used here only to dump file contents prefixed
with the filename and a colon. Since the function generates a temporary
Perl script anyway, it is simpler to do this directly in the Perl
script. This removes the dependency on grep and makes it easier to get
:Helptags to work on Windows.

A subsequent commit will also move the sorting of the helptags into the
Perl script. I did not do it in this commit, since the OS's "sort"
command can give a different sort order than Perl's sort function,
so I'm not sure what is preferred here.

Note: 'use autodie' is recommended over 'use Fatal' but the autodie
module has only been in Perl core since v5.10.1 (2009-08-22) while
Fatal is in core since 1996. The three-argument open requires v5.6
(2000).

* Remove dependency of fzf#vim#helptags on external sort command.

This moves the sorting of helptags into the generated Perl script and
thereby removes the dependency on an external "sort" command.

Note that Perl's sort function used here may give a different sort
order than the OS's sort command. (It does so for me on Windows but
I actually like Perl's ASCII sort order better, anyway.)

---------

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-06-09 16:46:50 +09:00
Kevin Ushey
5d87ac1fe8 Add :Jumps (#710)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-06-04 16:21:37 +09:00
Junegunn Choi
f5ba993af3 Require the latest fzf
It has a crucial fix for fzf#vim#grep2
2023-06-04 15:50:44 +09:00
Junegunn Choi
fd812b5710 [fzf#vim#grep[2]] Deprecate has_column argument
The boolean value tells the function if the output of the command
contains column numbers, but we can just see the selected lines if they
contain column numbers.

The argument is now removed from the documentation, and will be silently
ignored for backward compatibility.

Close #1480
2023-06-04 15:49:16 +09:00
Junegunn Choi
87b60bb133 Add :RG command and fzf#vim#grep2 function 2023-06-04 15:27:45 +09:00
Junegunn Choi
dc71692255 Update documentation and comments 2023-01-27 10:42:13 +09:00
Julian Prein
ca542801a1 [[B]Commits] Support arguments for git-log (#1455)
* [[B]Commits] Support arguments for git-log

Add support for command arguments that are passed to git-log (e.g.
:Commits -S foo -3).

The place of insertion is relevant. Generally the arguments should come
at the end to overwrite existing flags if necessary, but need to come
before the pathspec (i.e. `fzf#shellescape(current)`) in BCommits.

* [[B]Commits] Make sure all positional arguments are optional

Test cases:

    " With default options
    %call fzf#vim#commits()

    " Full screen
    %call fzf#vim#commits(1)

    " Not full screen
    %call fzf#vim#commits(0)

    " With extra fzf options
    %call fzf#vim#commits({ 'up': '50%', 'options': '--no-color' })

    " With extra fzf options (with preview) and in full screen
    %call fzf#vim#commits(fzf#vim#with_preview({ 'options': '--no-color', 'placeholder': '' }), 1)

    " With extra git log options
    %call fzf#vim#commits('-S foo')

    " With extra git log options in full screen
    %call fzf#vim#commits('-S foo', 1)

    " With extra git log options and fzf options
    %call fzf#vim#commits('-S foo', { 'options': '--no-color' })

    " In full-screen
    %call fzf#vim#commits('-S foo', { 'options': '--no-color' }, 1)

    " Command form
    Commits
    Commits!
    Commits -S foo
    Commits! -S foo

* [Commits] Enable file completion for arguments

This gets handy when BCommits is too narrow (e.g. multiple files or a
folder is specified).

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-01-27 10:40:32 +09:00
psyngw
bdf48c282a Fix: Windows preview window logic, including git diff preview (#1452)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2023-01-16 13:41:07 +09:00
Junegunn Choi
9c37e6801b Update RG example 2023-01-08 17:55:48 +09:00
ksmai
0f03107bc9 fix: GFiles is ignoring args (#1447)
The commit linked below removed `a:args` from the `git ls-files` command, making it
unable to take any options like `--cached`, `--others` and
`--exclude-standard`

531dd67350
2022-12-31 12:41:48 +09:00
Junegunn Choi
fd7fab77b2 [GFiles] Use ls-files --deduplicate only on git 2.31 or above
Close #1446
2022-12-24 10:34:55 +09:00
Nathan Thomas
7434543270 Add support for nushell (#1300)
Nushell doesn't allow programs surrounded in quotes to be executed.
2022-12-22 17:37:50 +09:00
Marc Mezzarobba
531dd67350 Make :GFiles work with "unusual" filenames (#1200)
git ls-files quotes file names containing "unusual" (non-ASCII?)
characters by default, breaking :GFiles

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2022-12-22 17:31:38 +09:00
JohanChane
9ceac71802 Fix ctags language force for C++ (#1425)
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2022-09-22 17:30:41 +09:00