Align Lazygit configuration
This commit is contained in:
@@ -15,6 +15,7 @@ autocmd({ "BufWinLeave", "BufWritePost", "WinLeave" }, {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
autocmd("BufWinEnter", {
|
||||
desc = "Try to load file view if available and enable view saving for real files",
|
||||
group = view_group,
|
||||
|
||||
@@ -17,3 +17,29 @@ map("n", "<leader>p", [["+p]], { noremap = true, silent = true, desc = "Paste fr
|
||||
|
||||
-- Markdown menu
|
||||
map("n", "<leader>M", [["+M]], { noremap = true, silent = true, desc = "Markdown" })
|
||||
|
||||
vim.keymap.set("n", "<leader>cc", function()
|
||||
local file1 = vim.fn.expand("%")
|
||||
|
||||
local project_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
||||
if project_root == "" then
|
||||
project_root = vim.fn.getcwd()
|
||||
end
|
||||
|
||||
require("telescope.builtin").find_files({
|
||||
prompt_title = "Compare with...",
|
||||
cwd = project_root,
|
||||
hidden = true,
|
||||
follow = true,
|
||||
attach_mappings = function(_, map)
|
||||
map("i", "<CR>", function(prompt_bufnr)
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
local file2 = action_state.get_selected_entry().path
|
||||
actions.close(prompt_bufnr)
|
||||
require("user.utils").meld_diff(file1, file2)
|
||||
end)
|
||||
return true
|
||||
end,
|
||||
})
|
||||
end, { desc = "Compare with" })
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Encoding
|
||||
opt.encoding = "utf-8"
|
||||
opt.fileencoding = "utf-8"
|
||||
|
||||
-- Line numbers
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"go",
|
||||
"gomod",
|
||||
@@ -9,6 +10,7 @@ require("nvim-treesitter.configs").setup({
|
||||
"lua",
|
||||
"markdown",
|
||||
"python",
|
||||
"org",
|
||||
"zig",
|
||||
},
|
||||
highlight = {
|
||||
|
||||
Reference in New Issue
Block a user