treesitter doesn't install all, whichkey updated
This commit is contained in:
parent
1a984d2e0f
commit
3260b6dc80
@ -48,9 +48,6 @@ map("n", "<C-d>", "<C-d>zz", opts)
|
||||
-- Easy exit insert mode
|
||||
map("i", "jk", "<ESC>", opts)
|
||||
|
||||
-- Paste
|
||||
map("i", "<C-p>", '"+y', opts)
|
||||
|
||||
-- Save
|
||||
map("i", "<C-s>", "<ESC>:w<CR>a", opts)
|
||||
|
||||
@ -62,33 +59,4 @@ map("v", ">", ">gv", opts)
|
||||
map("v", "<C-j>", ":m .+1<CR>==<ESC>V", opts)
|
||||
map("v", "<C-k>", ":m .-2<CR>==<ESC>V", opts)
|
||||
|
||||
local util = require("lazyvim.functions")
|
||||
|
||||
-- lazygit
|
||||
vim.keymap.set("n", "<leader>gg", function()
|
||||
require("lazyvim.util").float_term({ "lazygit" })
|
||||
end, { desc = "Lazygit (cwd)" })
|
||||
vim.keymap.set("n", "<leader>gG", function()
|
||||
util.float_term({ "lazygit" }, { cwd = util.get_root() })
|
||||
end, { desc = "Lazygit (root dir)" })
|
||||
|
||||
-- toggle options
|
||||
vim.keymap.set("n", "<leader>of", require("lazyvim.plugins.lsp.format").toggle, { desc = "Toggle format on Save" })
|
||||
vim.keymap.set("n", "<leader>os", function()
|
||||
util.toggle("spell")
|
||||
end, { desc = "Toggle Spelling" })
|
||||
vim.keymap.set("n", "<leader>ow", function()
|
||||
util.toggle("wrap")
|
||||
end, { desc = "Toggle Word Wrap" })
|
||||
vim.keymap.set("n", "<leader>on", function()
|
||||
util.toggle("relativenumber", true)
|
||||
util.toggle("number")
|
||||
end, { desc = "Toggle Line Numbers" })
|
||||
vim.keymap.set("n", "<leader>od", util.toggle_diagnostics, { desc = "Toggle Diagnostics" })
|
||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||
vim.keymap.set("n", "<leader>oc", function()
|
||||
util.toggle("conceallevel", false, { 0, conceallevel })
|
||||
end, { desc = "Toggle Conceal" })
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", "<cmd>lopen<cr>", { desc = "Open Location List" })
|
||||
vim.keymap.set("n", "<leader>lq", "<cmd>copen<cr>", { desc = "Open Quickfix List" })
|
||||
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
|
||||
|
||||
@ -82,6 +82,17 @@ function M.toggle(option, silent, values)
|
||||
end
|
||||
end
|
||||
|
||||
-- FIXME: create a togglable termiminal
|
||||
-- Opens a floating terminal (interactive by default)
|
||||
---@param cmd? string[]|string
|
||||
---@param opts? LazyCmdOptions|{interactive?:boolean}
|
||||
function M.float_term(cmd, opts)
|
||||
opts = vim.tbl_deep_extend("force", {
|
||||
size = { width = 0.9, height = 0.9 },
|
||||
}, opts or {})
|
||||
require("lazy.util").float_term(cmd, opts)
|
||||
end
|
||||
|
||||
local enabled = true
|
||||
function M.toggle_diagnostics()
|
||||
enabled = not enabled
|
||||
|
||||
@ -18,7 +18,6 @@ return {
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true,
|
||||
remap = true,
|
||||
silent = true,
|
||||
mode = "i",
|
||||
},
|
||||
|
||||
@ -10,9 +10,21 @@ return {
|
||||
autopairs = { enable = true },
|
||||
indent = { enable = true },
|
||||
context_commentstring = { enable = true, enable_autocmd = false },
|
||||
ensure_installed = "all",
|
||||
ensure_installed = {
|
||||
"c_sharp",
|
||||
"lua",
|
||||
"c",
|
||||
"vim",
|
||||
"help",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"sql",
|
||||
"html",
|
||||
"jsonc",
|
||||
},
|
||||
auto_install = true,
|
||||
},
|
||||
config = function(plugin, opts)
|
||||
config = function(_, opts)
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
},
|
||||
|
||||
@ -24,22 +24,24 @@ return {
|
||||
scroll_down = "<C-d>", -- binding to scroll down inside the popup
|
||||
scroll_up = "<C-u>", -- binding to scroll up inside the popup
|
||||
},
|
||||
-- window = {
|
||||
-- border = "rounded", -- none, single, double, shadow
|
||||
-- position = "bottom", -- bottom, top
|
||||
-- margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
-- padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
-- winblend = 0,
|
||||
-- },
|
||||
-- layout = {
|
||||
-- height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
-- width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
-- spacing = 3, -- spacing between columns
|
||||
-- align = "center", -- align columns left, center or right
|
||||
-- },
|
||||
window = {
|
||||
border = "rounded", -- none, single, double, shadow
|
||||
position = "bottom", -- bottom, top
|
||||
margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
|
||||
padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
|
||||
winblend = 0,
|
||||
},
|
||||
layout = {
|
||||
height = { min = 4, max = 25 }, -- min and max height of the columns
|
||||
width = { min = 20, max = 50 }, -- min and max width of the columns
|
||||
spacing = 3, -- spacing between columns
|
||||
align = "center", -- align columns left, center or right
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
local whichkey = require("which-key")
|
||||
local Util = require("lazyvim.functions")
|
||||
|
||||
whichkey.setup(opts)
|
||||
|
||||
local leader_opts = {
|
||||
@ -60,16 +62,13 @@ return {
|
||||
})
|
||||
|
||||
local leader_mappings = {
|
||||
l = { name = "+lsp" },
|
||||
b = { name = "+buffer" },
|
||||
r = { name = "+replace" },
|
||||
f = { name = "+file" },
|
||||
s = { name = "+search" },
|
||||
h = { name = "+help" },
|
||||
g = { name = "+git" },
|
||||
gh = { name = "+hunks" },
|
||||
t = { name = "+todo" },
|
||||
N = { name = "+noice" },
|
||||
o = { name = "+option" },
|
||||
|
||||
H = { "<cmd>split<cr>", "Split" },
|
||||
V = { "<cmd>vsplit<cr>", "V Split" },
|
||||
@ -81,12 +80,93 @@ return {
|
||||
["'"] = { "<cmd>close<CR>", "Close split" },
|
||||
u = { "<cmd>UndotreeToggle<cr>", "Undo Tree" },
|
||||
|
||||
f = {
|
||||
name = "+file",
|
||||
n = { "<cmd>enew<cr>", "New File" },
|
||||
t = {
|
||||
function()
|
||||
Util.float_term(nil, { cwd = Util.get_root() })
|
||||
end,
|
||||
"Terminal (rood dir)",
|
||||
},
|
||||
T = {
|
||||
function()
|
||||
Util.float_term()
|
||||
end,
|
||||
"Terminal (cwd)",
|
||||
},
|
||||
},
|
||||
|
||||
l = {
|
||||
name = "+lsp",
|
||||
l = { "<cmd>lopen<cr>", "Open Location List" },
|
||||
q = { "<cmd>copen<cr>", "Open Quickfix List" },
|
||||
},
|
||||
|
||||
C = {
|
||||
name = "Compiler",
|
||||
c = { "<cmd>w! | !compiler %<cr>", "Compile File" },
|
||||
b = { "<cmd>w! | !pandoc % -t beamer -o presentation.pdf<cr>", "Beamer Presentation" },
|
||||
},
|
||||
|
||||
o = {
|
||||
name = "+option",
|
||||
f = {
|
||||
function()
|
||||
require("lazyvim.plugins.lsp.format").toggle()
|
||||
end,
|
||||
"Toggle format on save",
|
||||
},
|
||||
s = {
|
||||
function()
|
||||
Util.toggle("spell")
|
||||
end,
|
||||
"Toggle spelling",
|
||||
},
|
||||
w = {
|
||||
function()
|
||||
Util.toggle("wrap")
|
||||
end,
|
||||
"Toggle word wrap",
|
||||
},
|
||||
n = {
|
||||
function()
|
||||
Util.toggle("relativenumber", true)
|
||||
Util.toggle("number")
|
||||
end,
|
||||
"Toggle line numbers",
|
||||
},
|
||||
d = {
|
||||
function()
|
||||
Util.toggle_diagnostics()
|
||||
end,
|
||||
"Toggle Diagnostics",
|
||||
},
|
||||
c = {
|
||||
function()
|
||||
local conceallevel = vim.o.conceallevel > 0 and vim.o.conceallevel or 3
|
||||
Util.toggle("conceallevel", false, { 0, conceallevel })
|
||||
end,
|
||||
"Toggle conceal",
|
||||
},
|
||||
},
|
||||
|
||||
g = {
|
||||
name = "+git",
|
||||
g = {
|
||||
function()
|
||||
Util.float_term({ "lazygit" })
|
||||
end,
|
||||
"Lazygit (cwd)",
|
||||
},
|
||||
G = {
|
||||
function()
|
||||
Util.float_term({ "lazygit" }, { cwd = Util.get_root() })
|
||||
end,
|
||||
"Lazygit (root dir)",
|
||||
},
|
||||
},
|
||||
|
||||
-- o = {
|
||||
-- name = "Options",
|
||||
-- c = { "<cmd>lua vim.g.cmp_active=false<cr>", "Completion off" },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user