1
Fork 0

feat: greek letter keyboard layout + custom brackets in nvim

This commit is contained in:
Matei Adriel 2022-04-04 02:10:26 +03:00
commit 0c1f2b4297
39 changed files with 1228 additions and 87 deletions
dotfiles/neovim/lua/my/plugins

View file

@ -1,4 +1,5 @@
local mapSilent = require("my.keymaps").mapSilent
local arpeggio = require("my.plugins.arpeggio")
local M = {}
@ -25,19 +26,42 @@ local bindings = {
git_commits = "<space>gj",
git_branches = "<space>gk"
},
["extensions.file_browser.file_browser"] = "<space>p"
["extensions.file_browser.file_browser"] = "<space>p",
extensions = {
unicode = {picker = {mode = "i", kind = "dropdown", key = "uu"}}
}
}
local function setupKeybinds(obj, path)
if path == nil then path = "" end
for name, keybinds in pairs(obj) do
if (type(keybinds) == "table") then
if (type(keybinds) == "table") and keybinds.key == nil then
-- This means we found a table of keybinds, so we go deeper
setupKeybinds(keybinds, path .. "." .. name)
else
local config = keybinds
local pickerArgument = ""
local key = config
local mode = "n"
local bind = mapSilent
if type(config) == "table" then
key = config.key
if config.mode ~= nil then mode = config.mode end
if config.kind ~= nil then
pickerArgument = "require('telescope.themes').get_" ..
config.kind .. "({})"
end
if config.chord then
-- Useful for insert mode bindings
bind = arpeggio.chordSilent
end
end
-- Maps the keybind to the action
mapSilent('n', keybinds, "<cmd>lua require('telescope" .. path ..
"')." .. name .. "()<CR>")
bind(mode, key,
"<cmd>lua require('telescope" .. path .. "')." .. name .. "(" ..
pickerArgument .. ")<CR>")
end
end
end
@ -47,6 +71,7 @@ function M.setup()
local settings = {
defaults = {mappings = {i = {["<C-h>"] = "which_key"}}},
pickers = {find_files = {hidden = true}},
extensions = {
file_browser = {
mappings = {