new go binds and format readme tables

This commit is contained in:
Buliway 2025-01-12 22:21:48 +03:00
parent 2239bd1539
commit 7612d675b2
4 changed files with 79 additions and 66 deletions

View file

@ -57,70 +57,72 @@ ln -s ~/nixos-private-dots/nvim ~/.config/nvim
Я не помню откуда эти бинды, может они есть в стоке, а может нет, но они полезные. Я не помню откуда эти бинды, может они есть в стоке, а может нет, но они полезные.
| Bind | Description | | Bind | Description |
| -------------- | ---------------------------------- | |---------------------|-------------------------------------|
| `K` | Hover documentation | | `K` | Hover documentation |
| `ctrl+o` | Go back | | `ctrl+o` | Go back |
| `ctrl+i` | Go forward (if you went backwards) | | `ctrl+i` | Go forward (if you went backwards) |
| `p` | Paste from nvim register | | `p` | Paste from nvim register |
| `ctrl+shift+v` | Paste from system clipboard | | `ctrl+shift+v` | Paste from system clipboard |
| `y` | Yank(copy) to nvim register | | `y` | Yank(copy) to nvim register |
| `space y` | Yank(copy) to system clipboard | | `space y` | Yank(copy) to system clipboard |
| `d` | Delete(copy) to nvim register | | `d` | Delete(copy) to nvim register |
| `space d` | Delete(copy) to system clipboard | | `space d` | Delete(copy) to system clipboard |
| `alt + up/down/j/k` | Move lines in visual mode | | `alt + up/down/j/k` | Move lines in visual mode |
| `[d` | Go to previous `D`iagnostic message | | `[d` | Go to previous `D`iagnostic message |
| `]d` | Go to next `D`iagnostic message | | `]d` | Go to next `D`iagnostic message |
| `space e` | Show diagnostic `E`rror message | | `space e` | Show diagnostic `E`rror message |
| `space q` | Open diagnostic `Q`uickfix | | `space q` | Open diagnostic `Q`uickfix |
Бинды в таблице ниже нажимаются без пробела перед ними. Просто бинд Бинды в таблице ниже нажимаются без пробела перед ними. Просто бинд
| Bind | Description | File | | Bind | Description | File |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | -------------- | |-----------|-----------------------------------------------------------------------------------------------------------------------------------------|----------------|
| <nobr>`esc esc`</nobr> | Exit terminal mode (This won't work in all terminal emulators/tmux/etc. Try your own mapping or use `<C-\><C-n>` to exit terminal mode) | settings.lua | | `esc esc` | Exit terminal mode (This won't work in all terminal emulators/tmux/etc. Try your own mapping or use `<C-\><C-n>` to exit terminal mode) | settings.lua |
| `esc` | Creal highlights on search when pressing Esc in normal mode | settings.lua | | `esc` | Creal highlights on search when pressing Esc in normal mode | settings.lua |
| `gp` | `G`oto context (`p`arent) | treesitter.lua | | `gp` | `G`oto context (`p`arent) | treesitter.lua |
| `gd` | `G`oto `D`efinition | lsp.lua | | `gd` | `G`oto `D`efinition | lsp.lua |
| `gr` | `G`oto `R`eferences | lsp.lua | | `gr` | `G`oto `R`eferences | lsp.lua |
| `gI` | `G`oto `I`mplementation | lsp.lua | | `gI` | `G`oto `I`mplementation | lsp.lua |
| `gD` | `G`oto `D`eclaration. This is not Goto Definition, this is Goto Declaration. For example, in C this would take you to the header | lsp.lua | | `gD` | `G`oto `D`eclaration. This is not Goto Definition, this is Goto Declaration. For example, in C this would take you to the header | lsp.lua |
| `gc` | Toggle Comment from mini-comment plugin | - | | `gc` | Toggle Comment from mini-comment plugin | - |
| `\` | Toggle file tree | file-tree.lua | | `\` | Toggle file tree | file-tree.lua |
Перед каждым из биндов в нижней таблице надо нажать `leader`, что есть `space`, пробел. Перед каждым из биндов в нижней таблице надо нажать `leader`, что есть `space`, пробел.
| Bind | Description | File | | Bind | Description | File |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | |---------|---------------------------------------------------------------------------------------------------------------------------------------------------|----------------|
| `tt` | `T`oggle `T`erminal | terminal.lua | | `tt` | `T`oggle `T`erminal | terminal.lua |
| `gta` | `G`o `T`ag `A`dd. Add json tags for struct | golang.lua | | `gta` | `G`o `T`ag `A`dd. Add json tags for struct | golang.lua |
| `gtr` | `G`o `T`ag `R`emove. Remove json tags for struct | golang.lua | | `gtr` | `G`o `T`ag `R`emove. Remove json tags for struct | golang.lua |
| `gfs` | `G`o `F`ill `S`truct | golang.lua | | `gs` | `G`o fill `S`truct | golang.lua |
| `gfc` | `G`o `F`ill Switch `C`ase | golang.lua | | `gc` | `G`o fill Switch `C`ase | golang.lua |
| `gie` | `G`o `I`f `E`rr | golang.lua | | `gp` | `G`o fix `P`lurals (change func foo(b int, a int, r int) -> func foo(b, a, r int)) | golang.lua |
| `gfp` | `G`o `F`ix `P`lurals | golang.lua | | `ge` | `G`o if `E`rr | golang.lua |
| `D` | Type `D`efinition. Jump to the typo of the word under your cursor. Useful when you're not sure what type a variable is and you want to see the definition of its *type*, not where it was *defined*. | lsp.lua | | `gi` | `G`o `I`mports | golang.lua |
| `ds` | `D`ocument `S`ymbols. Fuzzy find all the symbols in your current document. Symbols are things like variables, funckions, types, etc. | lsp.lua | | `D` | Type `D`efinition. Jump to the typo of the word under your cursor. | lsp.lua |
| `ws` | `W`orkspace `S`ymbols. Fuzzy find all the symbols in your currend workspace. Similar to document symbols, except searches over you entire project | lsp.lua | | | Useful when you're not sure what type a variable is and you want to see the definition of its *type*, not where it was *defined*. | |
| `rn` | `R`e`n`ame. Rename the variable under your cursor. Most Language Servers support renaming across files, etc. | lsp.lua | | `ds` | `D`ocument `S`ymbols. Fuzzy find all the symbols in your current document. Symbols are things like variables, funckions, types, etc. | lsp.lua |
| `ca` | `C`ode `A`ction. Execute a code action, usually your cursor needs to be on top of an error or a suggestion from your LSP for this to activate | lsp.lua | | `ws` | `W`orkspace `S`ymbols. Fuzzy find all the symbols in your currend workspace. Similar to document symbols, except searches over you entire project | lsp.lua |
| `sh` | `S`earch `H`elp | health.lua | | `rn` | `R`e`n`ame. Rename the variable under your cursor. Most Language Servers support renaming across files, etc. | lsp.lua |
| `sk` | `S`earch `K`eymaps | health.lua | | `ca` | `C`ode `A`ction. Execute a code action, usually your cursor needs to be on top of an error or a suggestion from your LSP for this to activate | lsp.lua |
| `sf` | `S`earch `F`iles | health.lua | | `sh` | `S`earch `H`elp | health.lua |
| `ss` | `S`earch `S`elect Telescope | health.lua | | `sk` | `S`earch `K`eymaps | health.lua |
| `sw` | `S`earch current `W`ord | health.lua | | `sf` | `S`earch `F`iles | health.lua |
| `sg` | `S`earch by `G`rep | health.lua | | `ss` | `S`earch `S`elect Telescope | health.lua |
| `sd` | `S`earch `D`iagnostics | health.lua | | `sw` | `S`earch current `W`ord | health.lua |
| `sr` | `S`earch `R`esume | health.lua | | `sg` | `S`earch by `G`rep | health.lua |
| `s.` | `S`earch Recent Files ("." for repeat) | health.lua | | `sd` | `S`earch `D`iagnostics | health.lua |
| `space` | Find existing buffers. Аналог перелючения между вкладками | health.lua | | `sr` | `S`earch `R`esume | health.lua |
| `/` | Fuzzily search in current buffer | health.lua | | `s.` | `S`earch Recent Files ("." for repeat) | health.lua |
| `s/` | `S`earch `/` in Open Files. Live Grep in Open Files | health.lua | | `space` | Find existing buffers. Аналог перелючения между вкладками | health.lua |
| `sn` | `S`earch `N`eovim files. Shortcut for searching your Neovim configuration files | health.lua | | `/` | Fuzzily search in current buffer | health.lua |
| `st` | `S`earch `T`hemes | health.lua | | `s/` | `S`earch `/` in Open Files. Live Grep in Open Files | health.lua |
| `q` | Open diagnostic `Q`uicfix list | settings.lua | | `sn` | `S`earch `N`eovim files. Shortcut for searching your Neovim configuration files | health.lua |
| `f` | `F`ormat buffer | autoformat.lua | | `st` | `S`earch `T`hemes | health.lua |
| `q` | Open diagnostic `Q`uicfix list | settings.lua |
| `f` | `F`ormat buffer | autoformat.lua |
### Git ### Git
@ -130,19 +132,19 @@ ln -s ~/nixos-private-dots/nvim ~/.config/nvim
Без пробела Без пробела
| Bind | Description | File | | Bind | Description | File |
| ---- | ----------------------------- | ------------ | |------|-------------------------------|--------------|
| `]c` | Jump to next git `C`hange | gitsigns.lua | | `]c` | Jump to next git `C`hange | gitsigns.lua |
| `[c` | Jump to previous git `C`hange | gitsigns.lua | | `[c` | Jump to previous git `C`hange | gitsigns.lua |
Visual mode. С пробелом Visual mode. С пробелом
| Bind | Description | File | | Bind | Description | File |
| ---- | ---------------- | ------------ | |------|------------------|--------------|
| `hs` | `S`tage git hunk | gitsigns.lua | | `hs` | `S`tage git hunk | gitsigns.lua |
| `hr` | `R`eset git hunk | gitsigns.lua | | `hr` | `R`eset git hunk | gitsigns.lua |
Normal mode. С пробелом Normal mode. С пробелом
| Bind | Description | File | | Bind | Description | File |
| ---- | ------------------------------ | ------------ | |------|--------------------------------|--------------|
| `hs` | Git `S`tage hunk | gitsigns.lua | | `hs` | Git `S`tage hunk | gitsigns.lua |
| `hr` | Git `R`eset hunk | gitsigns.lua | | `hr` | Git `R`eset hunk | gitsigns.lua |
| `hS` | Git `S`tage buffer | gitsigns.lua | | `hS` | Git `S`tage buffer | gitsigns.lua |
@ -159,7 +161,7 @@ Normal mode. С пробелом
Без пробела Без пробела
| Bind | Description | File | | Bind | Description | File |
| ---- | ------------------------------ | --------- | |------|--------------------------------|-----------|
| `F5` | Debug: Start/Continue | debug.lua | | `F5` | Debug: Start/Continue | debug.lua |
| `F1` | Debug: Step Into | debug.lua | | `F1` | Debug: Step Into | debug.lua |
| `F2` | Debug: Step Over | debug.lua | | `F2` | Debug: Step Over | debug.lua |
@ -168,7 +170,7 @@ Normal mode. С пробелом
С пробелом С пробелом
| Bind | Description | File | | Bind | Description | File |
| ---- | -------------------------- | --------- | |------|----------------------------|-----------|
| `b` | Debug: Toggle `B`reakpoint | debug.lua | | `b` | Debug: Toggle `B`reakpoint | debug.lua |
| `B` | Debug: Set `B`reakpoint | debug.lua | | `B` | Debug: Set `B`reakpoint | debug.lua |

View file

@ -96,6 +96,14 @@ require('lazy').setup({
-- Plugins for git -- Plugins for git
require 'custom.plugins.git', require 'custom.plugins.git',
-- Autoformat markdown tables
{
'Kicamon/markdown-table-mode.nvim',
config = function()
require('markdown-table-mode').setup()
end,
},
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config. -- This is the easiest way to modularize your config.
-- --

View file

@ -21,6 +21,7 @@
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
"lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" }, "lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
"luvit-meta": { "branch": "main", "commit": "55709f183b0742a7e4f47688c284f81148ad4dc0" }, "luvit-meta": { "branch": "main", "commit": "55709f183b0742a7e4f47688c284f81148ad4dc0" },
"markdown-table-mode.nvim": { "branch": "main", "commit": "870d0449c1c78c673faa9637a63036f9537b4caa" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },

View file

@ -12,10 +12,12 @@ return {
require('go').setup() require('go').setup()
vim.keymap.set({ 'n' }, '<leader>gta', ':GoAddTag<CR>', { desc = '[G]o [T]ag [A]dd' }) vim.keymap.set({ 'n' }, '<leader>gta', ':GoAddTag<CR>', { desc = '[G]o [T]ag [A]dd' })
vim.keymap.set({ 'n' }, '<leader>gtr', ':GoRmTag<CR>', { desc = '[G]o [T]ag [R]emove' }) vim.keymap.set({ 'n' }, '<leader>gtr', ':GoRmTag<CR>', { desc = '[G]o [T]ag [R]emove' })
vim.keymap.set({ 'n' }, '<leader>gfs', ':GoFillStruct<CR>', { desc = '[G]o [F]ill [S]truct' }) vim.keymap.set({ 'n' }, '<leader>gs', ':GoFillStruct<CR>', { desc = '[G]o fill [S]truct' })
vim.keymap.set({ 'n' }, '<leader>gfc', ':GoFillSwitch<CR>', { desc = '[G]o [F]ill Switch [C]ase' }) vim.keymap.set({ 'n' }, '<leader>gc', ':GoFillSwitch<CR>', { desc = '[G]o fill Switch [C]ase' })
vim.keymap.set({ 'n' }, '<leader>gie', ':GoIfErr<CR>', { desc = '[G]o [I]f [E]rr' }) -- Go Fix Plurals - change func foo(b int, a int, r int) -> func foo(b, a, r int)
vim.keymap.set({ 'n' }, '<leader>gfp', ':GoFixPlurals<CR>', { desc = '[G]o [F]ix [P]lurals' }) vim.keymap.set({ 'n' }, '<leader>gp', ':GoFixPlurals<CR>', { desc = '[G]o fix [P]lurals' })
vim.keymap.set({ 'n' }, '<leader>ge', ':GoIfErr<CR>', { desc = '[G]o if [E]rr' })
vim.keymap.set({ 'n' }, '<leader>gi', ':GoImports<CR>', { desc = '[G]o [I]mports' })
end, end,
event = { 'CmdlineEnter' }, event = { 'CmdlineEnter' },
ft = { 'go', 'gomod' }, ft = { 'go', 'gomod' },