From 8811e6fedd52cf5b2858e8dc8de7f335e5278729 Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Mon, 4 Apr 2022 11:55:57 +0300 Subject: [PATCH] docs: more docs ig --- dotfiles/neovim/README.md | 34 ++++++++++++++++++-- dotfiles/neovim/lua/my/plugins/lspconfig.lua | 12 +++---- dotfiles/neovim/lua/my/plugins/telescope.lua | 4 ++- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/dotfiles/neovim/README.md b/dotfiles/neovim/README.md index 20d21c1..8d8adba 100644 --- a/dotfiles/neovim/README.md +++ b/dotfiles/neovim/README.md @@ -2,7 +2,7 @@ ## Keybinds -Table of my own keybinds. Here as documentation for myself. I am yet to include any of the keybinds for the lspconfig, telescope or cmp here. +Table of my own keybinds. Here as documentation for myself. I am yet to include any of the keybinds for cmp here. > Things written using italics are chords > (aka all the keys need to be pressed at the same time) @@ -12,15 +12,43 @@ Table of my own keybinds. Here as documentation for myself. I am yet to include | vv | Create vertical split | | | \\ | Save | | | jj | Exit insert mode | | -| C-n | Open tree | nvim-tree | -| _vp_ | Run command in another tmux pane | vimux, arpeggio | | _k_ | Insert digraph | | | _a_ | Swap last 2 used buffers | | +| C-n | Open tree | nvim-tree | +| _vp_ | Run command in another tmux pane | vimux | | _sk_ | Move to previous lh-bracket marker | lh-brackets | | _sj_ | Move to next lh-bracket marker | lh-brackets | | _mo_ | Move outside the current brackets | lh-brackets | | _ml_ | Remove all markers and move to the last one | lh-brackets | | C-hjkl | Navigation between vim & tmux panes | vim-tmux-navigator | +| J | Show line diagnostics | lspconfig | +| K | Show hover info | lspconfig | +| L | Signature help (?) | lspconfig | +| gD | Go to declaration | lspconfig | +| gd | Go to definition | lspconfig | +| gi | Go to implementation | lspconfig | +| rn | Rename | lspconfig | +| f | format | lspconfig | + +### Lh-brackets + +The default brackets I load in each buffer are (), [], "", '', {} and \`\`. Different brackets are added in different filetypes. + +### Telescope + +| Keybind | Description | Plugins | +| ---------- | ------------------------------ | ---------------------- | +| Ctrl-P | Find files | | +| Ctrl-F | Grep in project | | +| d | Diagnostics | lspconfig | +| wd | Workspace diagnostics | lspconfig | +| ca | Code actions | lspconfig | +| t | Show builtin pickers | | +| s | Show symbols using tree-sitter | | +| gj | List git commits | | +| gk | List git branches | | +| p | Interactive file broswer | telescope-file-browser | +| _ui_ | Insert unicode char | | ### Idris diff --git a/dotfiles/neovim/lua/my/plugins/lspconfig.lua b/dotfiles/neovim/lua/my/plugins/lspconfig.lua index 05445a7..eba77dd 100644 --- a/dotfiles/neovim/lua/my/plugins/lspconfig.lua +++ b/dotfiles/neovim/lua/my/plugins/lspconfig.lua @@ -31,19 +31,19 @@ function M.on_attach(client, bufnr) map(bufnr, 'n', 'L', 'lua vim.lsp.buf.signature_help()') -- Workspace stuff - map(bufnr, 'n', 'wa', + map(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()') - map(bufnr, 'n', 'wr', + map(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()') - map(bufnr, 'n', 'wl', + map(bufnr, 'n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))') -- Code actions - map(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()') - map(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()') + map(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()') + map(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()') -- map(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()') map(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()') - map(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()') + map(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()') end local function on_attach_typescript(client, bufnr) diff --git a/dotfiles/neovim/lua/my/plugins/telescope.lua b/dotfiles/neovim/lua/my/plugins/telescope.lua index 155bdaf..ab7be4c 100644 --- a/dotfiles/neovim/lua/my/plugins/telescope.lua +++ b/dotfiles/neovim/lua/my/plugins/telescope.lua @@ -28,7 +28,9 @@ local bindings = { }, ["extensions.file_browser.file_browser"] = "p", extensions = { - unicode = {picker = {mode = "i", kind = "dropdown", key = "uu"}} + unicode = { + picker = {mode = "i", kind = "dropdown", key = "ui", chord = 1} + } } }