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