1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 11:00:05 +08:00

Add key binding SPC p F (#4309)

This commit is contained in:
Wang Shidong 2021-07-03 21:53:20 +08:00 committed by GitHub
parent 5b7535bf80
commit ca70bd8eb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 72 additions and 59 deletions

View File

@ -270,6 +270,18 @@ function! SpaceVim#layers#leaderf#config() abort
\ ], \ ],
\ 1) \ 1)
let lnum = expand('<slnum>') + s:lnum - 1
call SpaceVim#mapping#space#def('nnoremap', ['p', 'F'],
\ 'LeaderfFileCword',
\ ['find cursor file in current project',
\ [
\ '[SPC p F] is to find cursor file in the root of the current project',
\ '',
\ 'Definition: ' . s:filename . ':' . lnum,
\ ]
\ ],
\ 1)
let lnum = expand('<slnum>') + s:lnum - 1 let lnum = expand('<slnum>') + s:lnum - 1
call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'], call SpaceVim#mapping#space#def('nnoremap', ['p', 'f'],
\ 'Leaderf file --fullPath ' \ 'Leaderf file --fullPath '

View File

@ -1889,8 +1889,9 @@ Denite/Unite 是一个强大的信息筛选浏览器,这类似于 Emacs 中的
#### 在工程中搜索文件 #### 在工程中搜索文件
| 快捷键 | 功能描述 | | 快捷键 | 功能描述 |
| --------- | ------------------------ | | --------- | ---------------------------- |
| `SPC p f` | 在当前工程中查找文件 | | `SPC p f` | 在当前工程中查找文件 |
| `SPC p F` | 在当前工程中查找光标下的文件 |
| `SPC p /` | 在当前工程中搜索文本内容 | | `SPC p /` | 在当前工程中搜索文本内容 |
| `SPC p k` | 关闭当前工程的所有缓冲区 | | `SPC p k` | 关闭当前工程的所有缓冲区 |
| `SPC p p` | 显示所有工程 | | `SPC p p` | 显示所有工程 |

View File

@ -492,7 +492,7 @@ the variable `colorscheme`. For instance, to specify `desert`:
``` ```
| Mappings | Descriptions | | Mappings | Descriptions |
| --------- | ---------------------------------------------------------------------------------------- | | --------- | ------------------------------------------------------------------------------------- |
| `SPC T n` | switch to a random colorscheme listed in [colorscheme layer](../layers/colorscheme/). | | `SPC T n` | switch to a random colorscheme listed in [colorscheme layer](../layers/colorscheme/). |
| `SPC T s` | select a theme using a [fuzzy finder](#fuzzy-finder). | | `SPC T s` | select a theme using a [fuzzy finder](#fuzzy-finder). |
@ -671,7 +671,7 @@ Unicode symbols are displayed by default. Add `statusline_unicode_symbols = fals
The letters displayed in the statusline correspond to the key bindings used to toggle them. The letters displayed in the statusline correspond to the key bindings used to toggle them.
| Key Bindings | Unicode | ASCII | Mode | | Key Bindings | Unicode | ASCII | Mode |
| ------------ | ------- | ----- | ------------------------------------------------ | | ------------ | ------- | ----- | ----------------------------------------------- |
| `SPC t 8` | ⑧ | 8 | toggle character highlighting for long lines | | `SPC t 8` | ⑧ | 8 | toggle character highlighting for long lines |
| `SPC t f` | ⓕ | f | fill-column-indicator mode | | `SPC t f` | ⓕ | f | fill-column-indicator mode |
| `SPC t s` | ⓢ | s | syntax checking (neomake) | | `SPC t s` | ⓢ | s | syntax checking (neomake) |
@ -876,7 +876,7 @@ Navigation is centered on the `hjkl` keys with the hope of providing a fast navi
If only one file buffer is opened, a file is opened in the active window, otherwise we need to use vim-choosewin to select a window to open the file. If only one file buffer is opened, a file is opened in the active window, otherwise we need to use vim-choosewin to select a window to open the file.
| Key Bindings | Descriptions | | Key Bindings | Descriptions |
| --------------- | ----------------------------------------- | | --------------- | ---------------------------------------- |
| `l` / `<Enter>` | open file in one window | | `l` / `<Enter>` | open file in one window |
| `s g` | open file in a vertically split window | | `s g` | open file in a vertically split window |
| `s v` | open file in a horizontally split window | | `s v` | open file in a horizontally split window |
@ -1128,7 +1128,7 @@ Key bindings available in visual mode:
#### Increase/Decrease numbers #### Increase/Decrease numbers
| Key Bindings | Descriptions | | Key Bindings | Descriptions |
| ------------ | ------------------------------------------------------------------- | | ------------ | ------------------------------------------------------------------------ |
| `SPC n +` | increase the number under the cursor by one and initiate transient state | | `SPC n +` | increase the number under the cursor by one and initiate transient state |
| `SPC n -` | decrease the number under the cursor by one and initiate transient state | | `SPC n -` | decrease the number under the cursor by one and initiate transient state |
@ -1426,7 +1426,6 @@ It is `[]` by default.
The first item is the name of the tool, the second one is the default searching command. The first item is the name of the tool, the second one is the default searching command.
#### Vim and SpaceVim files #### Vim and SpaceVim files
Convenient key bindings are located under the prefix `SPC f v` to quickly navigate between Vim and SpaceVim specific files. Convenient key bindings are located under the prefix `SPC f v` to quickly navigate between Vim and SpaceVim specific files.
@ -1619,7 +1618,7 @@ The following table summurizes the search key bindings:
With `<scope>` being one of the following: With `<scope>` being one of the following:
| Scope | Description | | Scope | Description |
| ------- | -------------------------------- | | ----- | -------------------------------- |
| `b` | All open buffers | | `b` | All open buffers |
| `d` | Current buffer's directory | | `d` | Current buffer's directory |
| `f` | Arbitrary directory | | `f` | Arbitrary directory |
@ -1903,6 +1902,7 @@ Project manager commands start with `p`:
| Key Bindings | Descriptions | | Key Bindings | Descriptions |
| ------------ | ---------------------------------------- | | ------------ | ---------------------------------------- |
| `SPC p f` | find files in current project | | `SPC p f` | find files in current project |
| `SPC p F` | find cursor file in current project |
| `SPC p /` | fuzzy search for text in current project | | `SPC p /` | fuzzy search for text in current project |
| `SPC p k` | kill all buffers of current project | | `SPC p k` | kill all buffers of current project |
| `SPC p p` | list all projects | | `SPC p p` | list all projects |
@ -2032,7 +2032,7 @@ To run the task in the background, you need to set `isBackground` to `true`:
The following task properties are available: The following task properties are available:
| Name | Description | | Name | Description |
| -------------- | ------------------------------------------------------------------------------------------------------ | | -------------- | --------------------------------------------------------------------------------------- |
| command | The actual command to execute. | | command | The actual command to execute. |
| args | The arguments passed to the command, it should be a list of strings and may be omitted. | | args | The arguments passed to the command, it should be a list of strings and may be omitted. |
| options | Override the defaults for `cwd`,`env` or `shell`. | | options | Override the defaults for `cwd`,`env` or `shell`. |
@ -2046,18 +2046,18 @@ run it in background by setting `isBackground` to `true`.
SpaceVim supports variable substitution in the task properties, The following predefined variables are supported: SpaceVim supports variable substitution in the task properties, The following predefined variables are supported:
| Name | Description | | Name | Description |
| -------------------------- | ------------------------------------------------------ | | --------------------------- | ------------------------------------------------------ |
| ${workspaceFolder} | The project's root directory | | \${workspaceFolder} | The project's root directory |
| ${workspaceFolderBasename} | The name of current project's root directory | | \${workspaceFolderBasename} | The name of current project's root directory |
| ${file} | The path of current file | | \${file} | The path of current file |
| ${relativeFile} | The current file relative to project root | | \${relativeFile} | The current file relative to project root |
| ${relativeFileDirname} | The current file's dirname relative to workspaceFolder | | \${relativeFileDirname} | The current file's dirname relative to workspaceFolder |
| ${fileBasename} | The current file's basename | | \${fileBasename} | The current file's basename |
| ${fileBasenameNoExtension} | The current file's basename without file extension | | \${fileBasenameNoExtension} | The current file's basename without file extension |
| ${fileDirname} | The current file's dirname | | \${fileDirname} | The current file's dirname |
| ${fileExtname} | The current file's extension | | \${fileExtname} | The current file's extension |
| ${cwd} | The task runner's current working directory on startup | | \${cwd} | The task runner's current working directory on startup |
| ${lineNumber} | The current selected line number in the active file | | \${lineNumber} | The current selected line number in the active file |
For example: Supposing that you have the following requirements: For example: Supposing that you have the following requirements:
@ -2066,17 +2066,17 @@ The directory `/home/your-username/your-project` opened as your root workspace.
So you will have the following values for each variable: So you will have the following values for each variable:
| Name | Value | | Name | Value |
| -------------------------- | -------------------------------------------------- | | --------------------------- | -------------------------------------------------- |
| ${workspaceFolder} | `/home/your-username/your-project/` | | \${workspaceFolder} | `/home/your-username/your-project/` |
| ${workspaceFolderBasename} | `your-project` | | \${workspaceFolderBasename} | `your-project` |
| ${file} | `/home/your-username/your-project/folder/file.ext` | | \${file} | `/home/your-username/your-project/folder/file.ext` |
| ${relativeFile} | `folder/file.ext` | | \${relativeFile} | `folder/file.ext` |
| ${relativeFileDirname} | `folder/` | | \${relativeFileDirname} | `folder/` |
| ${fileBasename} | `file.ext` | | \${fileBasename} | `file.ext` |
| ${fileBasenameNoExtension} | `file` | | \${fileBasenameNoExtension} | `file` |
| ${fileDirname} | `/home/your-username/your-project/folder/` | | \${fileDirname} | `/home/your-username/your-project/folder/` |
| ${fileExtname} | `.ext` | | \${fileExtname} | `.ext` |
| ${lineNumber} | line number of the cursor | | \${lineNumber} | line number of the cursor |
#### Task Problems Matcher #### Task Problems Matcher