Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a default mapping for :LeanRestartFile and related tips #357

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,16 @@ This can be configured by putting a line at the top of your `~/.config/nvim/init
| `<LocalLeader>v` | interactively configure infoview view options |
| `<LocalLeader><Tab>` | jump into the infoview window associated with the current lean file |
| `<LocalLeader>\\` | show what abbreviation produces the symbol under the cursor |
| `<LocalLeader>r` | Restart the Lean server for the current file. |

> [!TIP]
> See `:help <LocalLeader>` if you haven't previously interacted with the local leader key.
> Some nvim users remap this key to make it easier to reach, so you may want to consider what key that means for your own keyboard layout.
> My (Julian's) `<Leader>` is set to `<Space>`, and my `<LocalLeader>` to `<Space><Space>`, which may be a good choice for you if you have no other preference.

> [!TIP]
> If you are also looking for a way to restart the Lean server, you can use the `:LspRestart` command, or map it to a key of your choice. It will restart the language servers for the current buffer/file, so this also applies to other language servers you may be using.

### In Infoview Windows

| Key | Function |
Expand Down
5 changes: 5 additions & 0 deletions lua/lean/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ local lean = {
'<Cmd>LeanAbbreviationsReverseLookup<CR>',
{ desc = 'Show how to type the unicode character under the cursor.' },
},
{
'<LocalLeader>r',
'<Cmd>LeanRestartFile<CR>',
{ desc = 'Restart the Lean server for the current file.' },
},
},
}

Expand Down