Revamped config
This commit is contained in:
@@ -7,7 +7,7 @@ local mkdirrun = augroup("MkdirRun", { clear = true })
|
||||
local yank = augroup("kickstart-highlight-yank", { clear = true })
|
||||
|
||||
cmd("ThemeSwitcher", function()
|
||||
require("taken.functions.themes").themeselector()
|
||||
require("taken.utils.themes").themeselector()
|
||||
end, {
|
||||
desc = "Select a theme",
|
||||
})
|
||||
@@ -34,6 +34,6 @@ autocmd("BufWritePre", {
|
||||
group = mkdirrun,
|
||||
pattern = { "*" },
|
||||
callback = function()
|
||||
require("taken.functions.mkdir").run()
|
||||
require("taken.utils.mkdir").run()
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
require("taken.core.bootstrap")
|
||||
require("taken.core.cmd")
|
||||
require("taken.core.opts")
|
||||
require("taken.core.gui")
|
||||
require("taken.core.remaps")
|
||||
require("taken.core.bootstrap")
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
local set = vim.keymap.set
|
||||
|
||||
local v = {
|
||||
local M = {
|
||||
v = {
|
||||
["J"] = { ":m '>+1<CR>gv=gv" },
|
||||
["K"] = { ":m '<-2<CR>gv=gv" },
|
||||
}
|
||||
|
||||
local n = {
|
||||
},
|
||||
n = {
|
||||
["<leader>P"] = { [["+p]], desc = "Paste from sys clipboard" },
|
||||
|
||||
["J"] = { "mzJ`z" },
|
||||
@@ -47,7 +45,7 @@ local n = {
|
||||
|
||||
["<leader>ht"] = {
|
||||
function()
|
||||
require("taken.functions.themes").themeselector()
|
||||
require("taken.utils.themes").themeselector()
|
||||
end,
|
||||
desc = "Theme selector",
|
||||
},
|
||||
@@ -59,33 +57,11 @@ local n = {
|
||||
|
||||
-- lazy
|
||||
["<leader>lu"] = { "<cmd>Lazy<CR>", desc = "Lazy UI" },
|
||||
}
|
||||
|
||||
local vn = {
|
||||
},
|
||||
vn = {
|
||||
["<leader>y"] = { [["+y]], desc = "Yank in to sys clipboard" },
|
||||
["<leader>d"] = { [["_d]], desc = "Actually deletes text" },
|
||||
},
|
||||
}
|
||||
|
||||
for map, command in pairs(v) do
|
||||
if command.desc then
|
||||
set("v", map, command[1], { desc = command.desc, silent = true })
|
||||
else
|
||||
set("v", map, command[1], { silent = true })
|
||||
end
|
||||
end
|
||||
|
||||
for map, command in pairs(n) do
|
||||
if command.desc then
|
||||
set("n", map, command[1], { desc = command.desc, silent = true })
|
||||
else
|
||||
set("n", map, command[1], { silent = true })
|
||||
end
|
||||
end
|
||||
|
||||
for map, command in pairs(vn) do
|
||||
if command.desc then
|
||||
set({ "v", "n" }, map, command[1], { desc = command.desc, silent = true })
|
||||
else
|
||||
set({ "v", "n" }, map, command[1], { silent = true })
|
||||
end
|
||||
end
|
||||
require("taken.utils.maps").setmap(M)
|
||||
|
||||
@@ -11,7 +11,7 @@ return {
|
||||
local lspconfig = require("lspconfig")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local on_attach = require("taken.core.on_attach")
|
||||
local on_attach = require("taken.utils.on_attach")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = "ﴞ ", Info = " " }
|
||||
|
||||
@@ -16,7 +16,7 @@ return {
|
||||
local typescript_tools = require("typescript-tools")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local on_attach = require("taken.core.on_attach")
|
||||
local on_attach = require("taken.utils.on_attach")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
typescript_tools.setup({
|
||||
|
||||
34
lua/taken/utils/maps.lua
Normal file
34
lua/taken/utils/maps.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local M = {}
|
||||
local set = vim.keymap.set
|
||||
|
||||
function M.setmap(maps)
|
||||
local v = maps.v or {}
|
||||
local n = maps.n or {}
|
||||
local vn = maps.vn or {}
|
||||
|
||||
for map, command in pairs(v) do
|
||||
if command.desc then
|
||||
set("v", map, command[1], { desc = command.desc, silent = true })
|
||||
else
|
||||
set("v", map, command[1], { silent = true })
|
||||
end
|
||||
end
|
||||
|
||||
for map, command in pairs(n) do
|
||||
if command.desc then
|
||||
set("n", map, command[1], { desc = command.desc, silent = true })
|
||||
else
|
||||
set("n", map, command[1], { silent = true })
|
||||
end
|
||||
end
|
||||
|
||||
for map, command in pairs(vn) do
|
||||
if command.desc then
|
||||
set({ "v", "n" }, map, command[1], { desc = command.desc, silent = true })
|
||||
else
|
||||
set({ "v", "n" }, map, command[1], { silent = true })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user