neovim replace keymap cmds with lua

This commit is contained in:
Noah Masur 2022-07-10 17:54:21 +00:00
parent 4851637770
commit 4f1c61bbe0
2 changed files with 30 additions and 29 deletions

View File

@ -29,29 +29,31 @@ key("v", "<A-j>", ":m '>+1<CR>gv=gv")
key("v", "<A-k>", ":m '<-2<CR>gv=gv") key("v", "<A-k>", ":m '<-2<CR>gv=gv")
-- Telescope (fuzzy finder) -- Telescope (fuzzy finder)
key("n", "<Leader>k", ":Telescope keymaps<CR>") local telescope = require("telescope.builtin")
key("n", "<Leader>/", ":Telescope live_grep<CR>") local telescope_ext = require("telescope").extensions
key("n", "<Leader>ff", ":Telescope find_files<CR>") key("n", "<Leader>k", telescope.keymaps)
key("n", "<Leader>fp", ":Telescope git_files<CR>") key("n", "<Leader>/", telescope.live_grep)
key("n", "<Leader>ff", telescope.find_files)
key("n", "<Leader>fp", telescope.git_files)
key("n", "<Leader>fN", find_notes) key("n", "<Leader>fN", find_notes)
key("n", "<Leader>N", grep_notes) key("n", "<Leader>N", grep_notes)
key("n", "<Leader>fD", find_downloads) key("n", "<Leader>fD", find_downloads)
key("n", "<Leader>fa", ":Telescope file_browser<CR>") key("n", "<Leader>fa", telescope_ext.file_browser.file_browser)
key("n", "<Leader>fw", ":Telescope grep_string<CR>") key("n", "<Leader>fw", telescope.grep_string)
key("n", "<Leader>wt", ":Telescope tmux sessions<CR>") -- key("n", "<Leader>wt", ":Telescope tmux sessions<CR>")
key("n", "<Leader>ww", ":Telescope tmux windows<CR>") -- key("n", "<Leader>ww", ":Telescope tmux windows<CR>")
key("n", "<Leader>w/", ":Telescope tmux pane_contents<CR>") -- key("n", "<Leader>w/", ":Telescope tmux pane_contents<CR>")
key("n", "<Leader>fz", ":Telescope zoxide list<CR>") key("n", "<Leader>fz", telescope_ext.zoxide.list)
key("n", "<Leader>b", ":Telescope buffers<CR>") key("n", "<Leader>b", telescope.buffers)
key("n", "<Leader>hh", ":Telescope help_tags<CR>") key("n", "<Leader>hh", telescope.help_tags)
key("n", "<Leader>fr", ":Telescope oldfiles<CR>") key("n", "<Leader>fr", telescope.oldfiles)
key("n", "<Leader>cc", ":Telescope commands<CR>") key("n", "<Leader>cc", telescope.commands)
key("n", "<Leader>cr", "<Cmd>lua command_history()<CR>") key("n", "<Leader>cr", command_history)
key("n", "<Leader>s", ":Telescope current_buffer_fuzzy_find<CR>") key("n", "<Leader>s", telescope.current_buffer_fuzzy_find)
key("n", "<Leader>gc", ":Telescope git_commits<CR>") key("n", "<Leader>gc", telescope.git_commits)
key("n", "<Leader>gf", ":Telescope git_bcommits<CR>") key("n", "<Leader>gf", telescope.git_bcommits)
key("n", "<Leader>gb", ":Telescope git_branches<CR>") key("n", "<Leader>gb", telescope.git_branches)
key("n", "<Leader>gs", ":Telescope git_status<CR>") key("n", "<Leader>gs", telescope.git_status)
-- Buffer tabs (tmux interferes) -- Buffer tabs (tmux interferes)
-- key("n", "<C-L>", "gt") -- key("n", "<C-L>", "gt")
@ -64,12 +66,12 @@ key("n", "gd", vim.lsp.buf.definition, { silent = true })
key("n", "gT", vim.lsp.buf.type_definition, { silent = true }) key("n", "gT", vim.lsp.buf.type_definition, { silent = true })
key("n", "gi", vim.lsp.buf.implementation, { silent = true }) key("n", "gi", vim.lsp.buf.implementation, { silent = true })
key("n", "gh", vim.lsp.buf.hover, { silent = true }) key("n", "gh", vim.lsp.buf.hover, { silent = true })
key("n", "gr", "<Cmd>Telescope lsp_references<CR>", { silent = true }) key("n", "gr", telescope.lsp_references, { silent = true })
key("n", "<Leader>R", "<Cmd>lua vim.lsp.buf.rename()<CR>", { silent = true }) key("n", "<Leader>R", vim.lsp.buf.rename, { silent = true })
key("n", "]e", "<Cmd>lua vim.diagnostic.goto_next()<CR>", { silent = true }) key("n", "]e", vim.diagnostic.goto_next, { silent = true })
key("n", "[e", "<Cmd>lua vim.diagnostic.goto_prev()<CR>", { silent = true }) key("n", "[e", vim.diagnostic.goto_prev, { silent = true })
key("n", "<Leader>e", "<Cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", { silent = true }) key("n", "<Leader>e", vim.lsp.diagnostic.show_line_diagnostics, { silent = true })
key("n", "<Leader>E", "<Cmd>lua vim.lsp.buf.code_action()<CR>", { silent = true }) key("n", "<Leader>E", vim.lsp.buf.code_action, { silent = true })
-- File commands -- File commands
key("n", "<Leader>q", ":quit<CR>") key("n", "<Leader>q", ":quit<CR>")

View File

@ -28,9 +28,8 @@ M.packer = function(use)
}, },
extensions = { extensions = {
fzy_native = {}, fzy_native = {},
tmux = {}, -- tmux = {},
zoxide = {}, zoxide = {},
--neoclip = {},
project = { project = {
base_dirs = { "~/dev" }, base_dirs = { "~/dev" },
}, },
@ -43,7 +42,7 @@ M.packer = function(use)
use("nvim-telescope/telescope-fzy-native.nvim") use("nvim-telescope/telescope-fzy-native.nvim")
-- Jump around tmux sessions -- Jump around tmux sessions
use("camgraff/telescope-tmux.nvim") -- use("camgraff/telescope-tmux.nvim")
-- Jump directories -- Jump directories
use({ use({