{"id":15893893,"url":"https://github.com/chinanf-boy/fzf-zh","last_synced_at":"2025-03-20T14:30:44.095Z","repository":{"id":90548329,"uuid":"148095176","full_name":"chinanf-boy/fzf-zh","owner":"chinanf-boy","description":"cn翻译: \u003cfzf\u003e 一种通用的命令行模糊查找器 ❤ 校对 中","archived":false,"fork":false,"pushed_at":"2019-03-29T04:44:55.000Z","size":44,"stargazers_count":12,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T00:20:20.062Z","etag":null,"topics":["docs","go","zh"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinanf-boy.png","metadata":{"files":{"readme":"README-VIM.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-10T03:39:18.000Z","updated_at":"2024-11-10T10:57:05.000Z","dependencies_parsed_at":"2023-07-18T16:25:53.794Z","dependency_job_id":null,"html_url":"https://github.com/chinanf-boy/fzf-zh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Ffzf-zh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Ffzf-zh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Ffzf-zh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinanf-boy%2Ffzf-zh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinanf-boy","download_url":"https://codeload.github.com/chinanf-boy/fzf-zh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244075595,"owners_count":20393979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docs","go","zh"],"created_at":"2024-10-06T08:14:00.821Z","updated_at":"2025-03-20T14:30:44.085Z","avatar_url":"https://github.com/chinanf-boy.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"FZF Vim integration\n===================\n\nThis repository only enables basic integration with Vim. If you're looking for\nmore, check out [fzf.vim](https://github.com/junegunn/fzf.vim) project.\n\n(Note: To use fzf in GVim, an external terminal emulator is required.)\n\n`:FZF[!]`\n---------\n\nIf you have set up fzf for Vim, `:FZF` command will be added.\n\n```vim\n\" Look for files under current directory\n:FZF\n\n\" Look for files under your home directory\n:FZF ~\n\n\" With options\n:FZF --no-sort --reverse --inline-info /tmp\n\n\" Bang version starts fzf in fullscreen mode\n:FZF!\n```\n\nSimilarly to [ctrlp.vim](https://github.com/kien/ctrlp.vim), use enter key,\n`CTRL-T`, `CTRL-X` or `CTRL-V` to open selected files in the current window,\nin new tabs, in horizontal splits, or in vertical splits respectively.\n\nNote that the environment variables `FZF_DEFAULT_COMMAND` and\n`FZF_DEFAULT_OPTS` also apply here.\n\n### Configuration\n\n- `g:fzf_action`\n    - Customizable extra key bindings for opening selected files in different ways\n- `g:fzf_layout`\n    - Determines the size and position of fzf window\n- `g:fzf_colors`\n    - Customizes fzf colors to match the current color scheme\n- `g:fzf_history_dir`\n    - Enables history feature\n- `g:fzf_launcher`\n    - (Only in GVim) Terminal emulator to open fzf with\n    - `g:Fzf_launcher` for function reference\n\n#### Examples\n\n```vim\n\" This is the default extra key bindings\nlet g:fzf_action = {\n  \\ 'ctrl-t': 'tab split',\n  \\ 'ctrl-x': 'split',\n  \\ 'ctrl-v': 'vsplit' }\n\n\" An action can be a reference to a function that processes selected lines\nfunction! s:build_quickfix_list(lines)\n  call setqflist(map(copy(a:lines), '{ \"filename\": v:val }'))\n  copen\n  cc\nendfunction\n\nlet g:fzf_action = {\n  \\ 'ctrl-q': function('s:build_quickfix_list'),\n  \\ 'ctrl-t': 'tab split',\n  \\ 'ctrl-x': 'split',\n  \\ 'ctrl-v': 'vsplit' }\n\n\" Default fzf layout\n\" - down / up / left / right\nlet g:fzf_layout = { 'down': '~40%' }\n\n\" You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)\nlet g:fzf_layout = { 'window': 'enew' }\nlet g:fzf_layout = { 'window': '-tabnew' }\nlet g:fzf_layout = { 'window': '10split enew' }\n\n\" Customize fzf colors to match your color scheme\nlet g:fzf_colors =\n\\ { 'fg':      ['fg', 'Normal'],\n  \\ 'bg':      ['bg', 'Normal'],\n  \\ 'hl':      ['fg', 'Comment'],\n  \\ 'fg+':     ['fg', 'CursorLine', 'CursorColumn', 'Normal'],\n  \\ 'bg+':     ['bg', 'CursorLine', 'CursorColumn'],\n  \\ 'hl+':     ['fg', 'Statement'],\n  \\ 'info':    ['fg', 'PreProc'],\n  \\ 'border':  ['fg', 'Ignore'],\n  \\ 'prompt':  ['fg', 'Conditional'],\n  \\ 'pointer': ['fg', 'Exception'],\n  \\ 'marker':  ['fg', 'Keyword'],\n  \\ 'spinner': ['fg', 'Label'],\n  \\ 'header':  ['fg', 'Comment'] }\n\n\" Enable per-command history.\n\" CTRL-N and CTRL-P will be automatically bound to next-history and\n\" previous-history instead of down and up. If you don't like the change,\n\" explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS.\nlet g:fzf_history_dir = '~/.local/share/fzf-history'\n```\n\n`fzf#run`\n---------\n\nFor more advanced uses, you can use `fzf#run([options])` function with the\nfollowing options.\n\n| Option name                | Type          | Description                                                      |\n| -------------------------- | ------------- | ---------------------------------------------------------------- |\n| `source`                   | string        | External command to generate input to fzf (e.g. `find .`)        |\n| `source`                   | list          | Vim list as input to fzf                                         |\n| `sink`                     | string        | Vim command to handle the selected item (e.g. `e`, `tabe`)       |\n| `sink`                     | funcref       | Reference to function to process each selected item              |\n| `sink*`                    | funcref       | Similar to `sink`, but takes the list of output lines at once    |\n| `options`                  | string/list   | Options to fzf                                                   |\n| `dir`                      | string        | Working directory                                                |\n| `up`/`down`/`left`/`right` | number/string | Use tmux pane with the given size (e.g. `20`, `50%`)             |\n| `window` (Vim 8 / Neovim)  | string        | Command to open fzf window (e.g. `vertical aboveleft 30new`)     |\n| `launcher`                 | string        | External terminal emulator to start fzf with (GVim only)         |\n| `launcher`                 | funcref       | Function for generating `launcher` string (GVim only)            |\n\n`options` entry can be either a string or a list. For simple cases, string\nshould suffice, but prefer to use list type if you're concerned about escaping\nissues on different platforms.\n\n```vim\ncall fzf#run({'options': '--reverse --prompt \"C:\\\\Program Files\\\\\"'})\ncall fzf#run({'options': ['--reverse', '--prompt', 'C:\\Program Files\\']})\n```\n\n`fzf#wrap`\n----------\n\n`fzf#wrap([name string,] [opts dict,] [fullscreen boolean])` is a helper\nfunction that decorates the options dictionary so that it understands\n`g:fzf_layout`, `g:fzf_action`, `g:fzf_colors`, and `g:fzf_history_dir` like\n`:FZF`.\n\n```vim\ncommand! -bang MyStuff\n  \\ call fzf#run(fzf#wrap('my-stuff', {'dir': '~/my-stuff'}, \u003cbang\u003e0))\n```\n\nfzf inside terminal buffer\n--------------------------\n\nThe latest versions of Vim and Neovim include builtin terminal emulator\n(`:terminal`) and fzf will start in a terminal buffer in the following cases:\n\n- On Neovim\n- On GVim\n- On Terminal Vim with the non-default layout\n    - `call fzf#run({'left': '30%'})` or `let g:fzf_layout = {'left': '30%'}`\n\n### Hide statusline\n\nWhen fzf starts in a terminal buffer, you may want to hide the statusline of\nthe containing buffer.\n\n```vim\nautocmd! FileType fzf\nautocmd  FileType fzf set laststatus=0 noshowmode noruler\n  \\| autocmd BufLeave \u003cbuffer\u003e set laststatus=2 showmode ruler\n```\n\nGVim\n----\n\nWith the latest version of GVim, fzf will start inside the builtin terminal\nemulator of Vim. Please note that this terminal feature of Vim is still young\nand unstable and you may run into some issues.\n\nIf you have an older version of GVim, you need an external terminal emulator\nto start fzf with. `xterm` command is used by default, but you can customize\nit with `g:fzf_launcher`.\n\n```vim\n\" This is the default. %s is replaced with fzf command\nlet g:fzf_launcher = 'xterm -e bash -ic %s'\n\n\" Use urxvt instead\nlet g:fzf_launcher = 'urxvt -geometry 120x30 -e sh -c %s'\n```\n\nIf you're running MacVim on OSX, I recommend you to use iTerm2 as the\nlauncher. Refer to the [this wiki page][macvim-iterm2] to see how to set up.\n\n[macvim-iterm2]: https://github.com/junegunn/fzf/wiki/On-MacVim-with-iTerm2\n\n[License](LICENSE)\n------------------\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Junegunn Choi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Ffzf-zh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinanf-boy%2Ffzf-zh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinanf-boy%2Ffzf-zh/lists"}