diff --git a/init.lua b/init.lua index ba15d7f..660bd71 100644 --- a/init.lua +++ b/init.lua @@ -9,6 +9,7 @@ require("settings/lazy") -- Keymaps require('keymaps/system') +require('keymaps/functions') require('keymaps/plugins') -- Autocommands diff --git a/lazy-lock.json b/lazy-lock.json index 02e3abc..78f0bb5 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,7 +6,7 @@ "diaglist.nvim": { "branch": "master", "commit": "8aba9fcf62cc60e1d5ce941faedecc399d9a1e8b" }, "fidget.nvim": { "branch": "main", "commit": "64463022a1f2ff1318ab22a2ea4125ed9313a483" }, "flexoki": { "branch": "main", "commit": "079554c242a86be5d1a95598c7c6368d6eedd7a3" }, - "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, + "gitsigns.nvim": { "branch": "main", "commit": "6bd29494e3f79ff08be1d35bc1926ed23c22ed9a" }, "jsctags": { "branch": "master", "commit": "22d3fb848c429d4704dc3a8946bc3a4423a8e4a4" }, "kommentary": { "branch": "main", "commit": "d5a111a3bc4109a8f913a5863c9092b3b3801482" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, @@ -19,23 +19,24 @@ "nginx.vim": { "branch": "master", "commit": "cffaec54f0c7f9518de053634413a20e90eac825" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, - "nvim-dap": { "branch": "master", "commit": "818cd8787a77a97703eb1d9090543a374f79a9ac" }, + "nvim-dap": { "branch": "master", "commit": "cdfd55a133f63228c55f91378f12908cb2a78ded" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, - "nvim-lint": { "branch": "master", "commit": "8a6aae10d15069c952428fa6bebf82c2d164b502" }, - "nvim-lspconfig": { "branch": "master", "commit": "5eeb45c8c469b84777a5bd8796b698c8a1c780a7" }, + "nvim-lint": { "branch": "master", "commit": "1e6b2ac034d1a7588d11b0b8e862a7ad89368376" }, + "nvim-lspconfig": { "branch": "master", "commit": "0b38bc74487e73489624d61396af7805af9cc75f" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "main", "commit": "6e42d823ce0a5a76180c473c119c7677738a09d1" }, + "nvim-treesitter": { "branch": "main", "commit": "b033ab331ca0bccbd93c3c2b4f886fdfc09abec0" }, "nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" }, "phpctags": { "branch": "master", "commit": "5ed731eb86227d416977b0a1fd06e77e58363818" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "reticle.nvim": { "branch": "main", "commit": "66bfa2b1c28fd71bb8ae4e871e0cd9e9c509ea86" }, "tagbar": { "branch": "master", "commit": "7bfffca1f121afb7a9e38747500bf5270e006bb1" }, "telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" }, - "telescope.nvim": { "branch": "master", "commit": "e709d31454ee6e6157f0537f861f797bd44c0bad" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-fish": { "branch": "master", "commit": "50b95cbbcd09c046121367d49039710e9dc9c15f" }, "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-signify": { "branch": "master", "commit": "9ec7989ef5f92c5073de26abb46fc6a998b75ef8" }, - "vim-test": { "branch": "master", "commit": "aa619692ff48a3cf3e6bdb893765039488d4e5f3" } + "vim-test": { "branch": "master", "commit": "aa619692ff48a3cf3e6bdb893765039488d4e5f3" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/keymaps/functions.lua b/lua/keymaps/functions.lua index 9021151..2949c37 100644 --- a/lua/keymaps/functions.lua +++ b/lua/keymaps/functions.lua @@ -1,2 +1,2 @@ -- Quick compilation with GCC and running -vim.keymap.set('n', 'co', ':!gcc -o test % && ./test', {noremap = true}) +vim.keymap.set('n', 'c', '!gcc -o test % && ./test', { noremap = true }) diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index ae92864..9d10975 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -7,7 +7,7 @@ return { keys = { { '', 'BufferLineCycleNext', mode = { 'n' }, desc = 'Move to the next tab', noremap = true, silent = true }, { '', 'BufferLineCyclePrev', mode = { 'n' }, desc = 'Move to the previous tab', noremap = true, silent = true }, - { '', 'lua require("bufferline").go_to(vim.fn.input("Enter tab number: "), true)', mode = { 'n' }, desc = 'Move to the tab', noremap = true, silent = true }, + { '', 'lua require("bufferline").go_to(vim.fn.input("Enter tab number: "), true)', mode = { 'n' }, desc = 'Move to the tab', noremap = true, silent = true }, }, version = '*', dependencies = { diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 98cf837..b641df3 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -5,10 +5,10 @@ return { enabled = true, lazy = true, keys = { - { '', 'Telescope find_files', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope find', noremap = true, silent = true }, - { '', 'Telescope live_grep', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope grep', noremap = true, silent = true }, - { '', 'Telescope buffers', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope buffers', noremap = true, silent = true }, - { '?', 'Telescope help_tags', mode = { 'n', 'i', 'v', 't' }, desc = 'Telescope help', noremap = true, silent = true }, + { '', 'Telescope find_files', mode = { 'n', 'i', 'v', 't' }, desc = 'Search files', noremap = true, silent = true }, + { '', 'Telescope live_grep', mode = { 'n', 'i', 'v', 't' }, desc = 'Grep files', noremap = true, silent = true }, + { '', 'Telescope buffers', mode = { 'n', 'v', 't' }, desc = 'Search buffers', noremap = true, silent = true }, + { '?', 'Telescope help_tags', mode = { 'n', 'v', 't' }, desc = 'Help', noremap = true, silent = true }, }, dependencies = { -- Functions for Telescope diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua new file mode 100644 index 0000000..431ec11 --- /dev/null +++ b/lua/plugins/which-key.lua @@ -0,0 +1,15 @@ +-- 💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, +-- by showing available keybindings in a popup as you type. +return { + 'folke/which-key.nvim', + event = 'VeryLazy', + opts = { + preset = 'helix', + triggers = { + { '', mode = { 'n', 'i', 'v', 't' } }, + } + }, + keys = { + -- { '', function() require('which-key').show({ global = false }) end, mode = { 'n' }, desc = 'Buffer Local Keymaps (which-key)', noremap = true, silent = true }, + }, +} diff --git a/lua/settings/system.lua b/lua/settings/system.lua index 949084c..db290c8 100644 --- a/lua/settings/system.lua +++ b/lua/settings/system.lua @@ -1,5 +1,5 @@ -- Leader button -vim.g.mapleader = ' ' +vim.g.mapleader = '`' vim.g.maplocalleader = '\\' -- Использовать системный буфер обмена