add gx support

This commit is contained in:
Oliver Ladner 2024-02-03 22:14:07 +01:00
commit 2b25b70c29
2 changed files with 37 additions and 26 deletions

View file

@ -5,42 +5,24 @@ Some of these are plain Vim commands, others are specific to Neovim.
## BASICS
- `Space` leader key
- `:so` Source file
- `:checkhealth` check base and all plugins
- `:checkhealth <pluginname>` check for problems of a plugin
- `:checkhealth [<pluginname>]` check base or <pluginname> status
- `:verbose set expandtab?` check where `expandtab` has been set last
### Lazy
- `:Lazy` show package manager UI
- `:Lazy restore` revert plugins to the state reflected in `lazy-lock.json`
### Mason
- `:Mason` show Mason UI
### Treesitter
- `:TSUpdate` update all parsers
- `:TSModuleInfo` show installed parsers
### LSP
- `:TSUpdate` update all treesitter parsers
- `:TSModuleInfo` show installed treesitter parsers
- `:LspInfo` show currently attached LSP client details
- `:ConformInfo` useful to debug why a formatter times out
- `Ctrl`+`n/p` scroll down/up through LSP suggestions
- `Ctrl`+`l` accept selected suggestion
## NAVIGATION
## NAVIGATING
## Tabs
Use buffers in situations where
- `Ctrl`+`t` open a file in e.g. a Telescope finder in a new tab
- `gt` or `gT` switch between open tabs (forward/reverse direction)
## Window/split
## Windows/splits
- `Ctrl`+`wq` close window
- `Ctrl`+`ws` split window **horizontally**
@ -50,7 +32,7 @@ Use buffers in situations where
- `Ctrl`+`wr` swap position of two windows
- `Ctrl`+`wT` move active split window to new tab
## Buffer
## Buffers
- `Space`+`Space` shows buffers sorted by last used (via `Telescope buffers`)
- `:bd` close current buffer
@ -62,9 +44,32 @@ Use buffers in situations where
- `w` move to **start of next word** (ignores punctuation due to remap)
- `e` move to **end of next word** (ignores punctuation due to remap)
- `b` move to **start of previous word** (ignores punctuation due to remap)
- `Ctrl`+`0` start of line
- `Ctrl`+`$` end of line
- `Ctrl`+`d` scroll **down** 1/2 page while keeping the cursor centered
- `Ctrl`+`u` scroll **up** 1/2 page while keeping the cursor centered
- `Ctrl`+`o` jump to location you were before (e.g. after using `gg`)
- `Ctrl`+`i` jump back to location you were before (after using `Ctrl`+`o`)
- `f<char>` jump forward to `<char>`
- `F<char>` jump backwards to `<char>`
- `t<char>` jump forward just before `<char>`
- `T<char>` jump backwards just before `<char>`
- `;` jump to next occurence of <char> (same line only)
- `,` jump to previous occurence of <char> (same line only)
## LSP
- `Ctrl`+`n/p` scroll down/up through LSP suggestions
- `Ctrl`+`l` accept selected suggestion
- `gd` go to definition
## Diagnostics
- `gd` go to definition
- `leader`+`qq` toggle trouble.nvim quickfix list
- `leader`+`da` go to next diagnostic (any severity)
- `leader`+`dw` go to next diagnostic (warning severity)
- `leader`+`de` go to next diagnostic (error severity)
## Telescope windows
@ -76,6 +81,8 @@ Use buffers in situations where
- `Ctrl`+`v` open file in **vertical** split
- `Ctrl`+`x` open file in **horizontal** split
- `Ctrl`+`t` open file in new tab
- `Ctrl`+`q` send all items to quickfix list
- `Alt`+`q` send selected items to quickfix list
## EDITING
@ -104,9 +111,12 @@ Use buffers in situations where
- `V` line mode
- `Ctrl`+`v` block mode
## SEARCH
## SEARCH/OPEN
- `leader`+`fg` search text in files (also searches for text under cursor)
- `leader`+`ff` search files (respects `.gitignore`)
- `leader`+`e` toggles Oil file explorer
- `leader`+`fo` recently opened files
- `gf` open file under cursor in a new buffer
- `gx` open link under cursor in default browser
- `*` search marked word

View file

@ -10,7 +10,8 @@ return {
config = function()
local oil = require("oil")
oil.setup({
default_file_explorer = true,
-- Leave netrw there, so we can open link with `gx`
default_file_explorer = false,
columns = {
--"size",
"icon",