Modified a bunch of stuff to work with the native vim.keymap.set function
This commit is contained in:
parent
cc6a209d8d
commit
7c77d3a8dd
|
@ -3,11 +3,11 @@ local arpeggio = require("my.plugins.arpeggio")
|
|||
|
||||
local M = {}
|
||||
|
||||
function M.map(mode, lhs, rhs, opts)
|
||||
local function map(mode, lhs, rhs, opts)
|
||||
if string.len(mode) > 1 then
|
||||
for i = 1, #mode do
|
||||
local c = mode:sub(i, i)
|
||||
M.map(c, lhs, rhs, opts)
|
||||
map(c, lhs, rhs, opts)
|
||||
end
|
||||
else
|
||||
local options = helpers.mergeTables(opts, { noremap = true })
|
||||
|
@ -17,11 +17,11 @@ end
|
|||
|
||||
function M.mapSilent(mode, lhs, rhs, opts)
|
||||
local options = helpers.mergeTables(opts, { silent = true })
|
||||
M.map(mode, lhs, rhs, options)
|
||||
map(mode, lhs, rhs, options)
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
M.map("n", "qq", ":wq<cr>") -- Save and quit
|
||||
vim.keymap.set("n", "qq", ":wq<cr>") -- Save and quit
|
||||
|
||||
-- Create chords
|
||||
if arpeggio ~= nil then
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
local mapSilent = require("my.keymaps").mapSilent
|
||||
|
||||
local M = {}
|
||||
|
||||
local bindings = {
|
||||
|
@ -13,7 +11,7 @@ local bindings = {
|
|||
function M.setup()
|
||||
for action, keybind in pairs(bindings) do
|
||||
-- Maps the keybind to the action
|
||||
mapSilent('n', keybind, "<cmd>lua require('fzf-lua')." .. action .. "()<CR>")
|
||||
vim.keymap.set('n', keybind, require('fzf-lua')[action])
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ function M.setup()
|
|||
require('nvim-autopairs').setup()
|
||||
require "gitlinker".setup()
|
||||
|
||||
|
||||
vscode.unless(function()
|
||||
require("presence"):setup({})
|
||||
require("my.plugins.dashboard").setup()
|
||||
|
@ -20,7 +19,6 @@ function M.setup()
|
|||
require("my.plugins.vimux").setup()
|
||||
end)
|
||||
|
||||
require("my.plugins.vim-tmux-navigator").setup()
|
||||
require("my.plugins.neogit").setup()
|
||||
require("my.plugins.comment").setup()
|
||||
require("my.plugins.telescope").setup()
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
local A = require("my.helpers.augroup")
|
||||
local map = require("my.keymaps").mapSilent
|
||||
local arpeggio = require("my.plugins.arpeggio")
|
||||
local M = {}
|
||||
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
local mapSilent = require("my.keymaps").mapSilent
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
require 'nvim-tree'.setup()
|
||||
-- Toggle nerdtree with Control-t
|
||||
mapSilent("n", "<C-n>", ":NvimTreeToggle<CR>")
|
||||
-- Toggle nerdtree with Control-n
|
||||
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>")
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
local map = require("my.keymaps").map
|
||||
|
||||
local M = {}
|
||||
|
||||
-- For some reason the default mappings do not work for me
|
||||
function M.setup()
|
||||
vim.g.tmux_navigator_no_mappings = 1
|
||||
|
||||
map("n", "<C-h>", ":TmuxNavigateLeft<cr>")
|
||||
map("n", "<C-j>", ":TmuxNavigateDown<cr>")
|
||||
map("n", "<C-k>", ":TmuxNavigateUp<cr>")
|
||||
map("n", "<C-l>", ":TmuxNavigateRight<cr>")
|
||||
end
|
||||
|
||||
return M
|
Loading…
Reference in a new issue