diff options
Diffstat (limited to '')
-rw-r--r-- | lua/conf/binds.lua (renamed from lua/core/binds.lua) | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lua/core/binds.lua b/lua/conf/binds.lua index b1e98be..5fc8055 100644 --- a/lua/core/binds.lua +++ b/lua/conf/binds.lua @@ -1,3 +1,5 @@ +local conf = require('core.conf') + local function map(mode, bind, cmd, opts) opts = opts or {} opts['noremap'] = true @@ -52,6 +54,9 @@ map('n', '][', '<cmd>tabc<CR>') map('n', '[[', '<cmd>tabp<CR>') map('n', ']]', '<cmd>tabN<CR>') +-- config binds --------------------------------------------------------------- +map('n', '<leader>m', conf.configmenu, { desc = 'Neovim config manager menu', }) + -- plugin binds --------------------------------------------------------------- -- pretty lsp view @@ -78,7 +83,7 @@ if pcall(require, "telescope") then { desc = 'Find LSP Symbols.' }) -- search for keybinds map('n', '<leader>sk', telebuilt.keymaps, - { desc = 'Find nvim Highlights.' }) + { desc = 'Find nvim Keymaps.' }) -- search for highlights map('n', '<leader>sh', telebuilt.highlights, { desc = 'Find nvim Highlights.' }) @@ -89,7 +94,13 @@ if pcall(require, "telescope") then map('n', '<leader>sv', telebuilt.vim_options, { desc = 'Find vim options.' }) -- search for string in project map('n', '<leader>sp', function() - telebuilt.grep_string({ search = vim.fn.input('Find string in project > ')}) + vim.ui.input({ prompt = 'Find string in project' }, function(input) + if not input or input == '' then + vim.notify('No query!', vim.log.levels.WARN, { title = misc.appid }) + return nil + end + telebuilt.grep_string({ search = input }) + end) end, { desc = 'Find string in project.' }) -- Code Actions (requires telescope) if pcall(require, "actions-preview") then @@ -141,17 +152,18 @@ end -- venn function _G.Toggle_venn() + local mapb = vim.api.nvim_buf_set_keymap local venn_enabled = vim.inspect(vim.b.venn_enabled) if venn_enabled == "nil" then vim.b.venn_enabled = true vim.cmd([[setlocal ve=all]]) -- draw a line on HJKL keystokes - vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", {noremap = true}) - vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", {noremap = true}) + mapb(0, "n", "J", "<C-v>j:VBox<CR>", { noremap = true }) + mapb(0, "n", "K", "<C-v>k:VBox<CR>", { noremap = true }) + mapb(0, "n", "L", "<C-v>l:VBox<CR>", { noremap = true }) + mapb(0, "n", "H", "<C-v>h:VBox<CR>", { noremap = true }) -- draw a box by pressing "f" with visual selection - vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", {noremap = true}) + mapb(0, "v", "f", ":VBox<CR>", { noremap = true }) else vim.cmd[[setlocal ve=]] vim.cmd[[mapclear <buffer>]] @@ -159,4 +171,4 @@ function _G.Toggle_venn() end end -- toggle keymappings for venn using <leader>v -vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true}) +map('n', '<leader>v', ":lua Toggle_venn()<CR>") |