mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
chore(nvim):
- Spell check autocommand moved to filetype-based-keymaps.lua - Remove quickfix traversal keybindings - Lualine organized better: Git, debug on left; key, file type, location on right
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
if not vim.g.vscode then
|
|
||||||
-- Auto reload existing session
|
-- Auto reload existing session
|
||||||
|
if not vim.g.vscode then
|
||||||
vim.api.nvim_create_autocmd("VimEnter", {
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
group = vim.api.nvim_create_augroup("restore_session", { clear = true }),
|
group = vim.api.nvim_create_augroup("restore_session", { clear = true }),
|
||||||
callback = function()
|
callback = function()
|
||||||
@@ -12,13 +12,3 @@ if not vim.g.vscode then
|
|||||||
nested = true,
|
nested = true,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Enable spell check on markdown and text files
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
group = vim.api.nvim_create_augroup("spell_check_text_files", { clear = true }),
|
|
||||||
pattern = { "markdown", "gitcommit", "text" },
|
|
||||||
callback = function()
|
|
||||||
vim.opt.spell = true
|
|
||||||
end,
|
|
||||||
nested = true,
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -25,3 +25,13 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
end,
|
end,
|
||||||
nested = true,
|
nested = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Enable spell check on markdown and text files
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
group = vim.api.nvim_create_augroup("spell_check_text_files", { clear = true }),
|
||||||
|
pattern = { "markdown", "gitcommit", "text" },
|
||||||
|
callback = function()
|
||||||
|
vim.opt.spell = true
|
||||||
|
end,
|
||||||
|
nested = true,
|
||||||
|
})
|
||||||
|
|||||||
@@ -60,9 +60,8 @@ vim.keymap.set({ "n", "v" }, "<leader>xb", function()
|
|||||||
end, { desc = "Save and close current buffer" })
|
end, { desc = "Save and close current buffer" })
|
||||||
|
|
||||||
-- Traverse quickfix
|
-- Traverse quickfix
|
||||||
-- TODO: Friendly message when no quickfix
|
-- vim.keymap.set("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||||
vim.keymap.set("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
-- vim.keymap.set("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||||
vim.keymap.set("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
|
||||||
|
|
||||||
-- Clear searches
|
-- Clear searches
|
||||||
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||||
|
|||||||
@@ -282,8 +282,27 @@ return {
|
|||||||
extensions = { "neo-tree", "lazy" },
|
extensions = { "neo-tree", "lazy" },
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { "mode" },
|
lualine_a = { "mode" },
|
||||||
lualine_b = { "branch" },
|
lualine_b = {
|
||||||
|
"branch",
|
||||||
|
{
|
||||||
|
"diff",
|
||||||
|
symbols = {
|
||||||
|
added = config.icons.git.added,
|
||||||
|
modified = config.icons.git.modified,
|
||||||
|
removed = config.icons.git.removed,
|
||||||
|
},
|
||||||
|
source = function()
|
||||||
|
local gitsigns = vim.b.gitsigns_status_dict
|
||||||
|
if gitsigns then
|
||||||
|
return {
|
||||||
|
added = gitsigns.added,
|
||||||
|
modified = gitsigns.changed,
|
||||||
|
removed = gitsigns.removed,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
{
|
{
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
@@ -294,11 +313,14 @@ return {
|
|||||||
hint = config.icons.diagnostics.Hint,
|
hint = config.icons.diagnostics.Hint,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ "filetype", padding = { left = 1, right = 1 } },
|
|
||||||
{
|
{
|
||||||
"filename",
|
function()
|
||||||
file_status = true,
|
return " " .. require("dap").status()
|
||||||
path = 1,
|
end,
|
||||||
|
cond = function()
|
||||||
|
return package.loaded["dap"] and require("dap").status() ~= ""
|
||||||
|
end,
|
||||||
|
color = config.fg("Debug"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -321,36 +343,16 @@ return {
|
|||||||
end,
|
end,
|
||||||
color = config.fg("Constant"),
|
color = config.fg("Constant"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
function()
|
|
||||||
return " " .. require("dap").status()
|
|
||||||
end,
|
|
||||||
cond = function()
|
|
||||||
return package.loaded["dap"] and require("dap").status() ~= ""
|
|
||||||
end,
|
|
||||||
color = config.fg("Debug"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"diff",
|
|
||||||
symbols = {
|
|
||||||
added = config.icons.git.added,
|
|
||||||
modified = config.icons.git.modified,
|
|
||||||
removed = config.icons.git.removed,
|
|
||||||
},
|
|
||||||
source = function()
|
|
||||||
local gitsigns = vim.b.gitsigns_status_dict
|
|
||||||
if gitsigns then
|
|
||||||
return {
|
|
||||||
added = gitsigns.added,
|
|
||||||
modified = gitsigns.changed,
|
|
||||||
removed = gitsigns.removed,
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
lualine_y = {},
|
lualine_y = {
|
||||||
|
{
|
||||||
|
"filename",
|
||||||
|
file_status = true,
|
||||||
|
path = 1,
|
||||||
|
},
|
||||||
|
{ "filetype", padding = { left = 1, right = 1 } },
|
||||||
|
},
|
||||||
lualine_z = {
|
lualine_z = {
|
||||||
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
|
||||||
{ "location", padding = { left = 0, right = 1 } },
|
{ "location", padding = { left = 0, right = 1 } },
|
||||||
|
|||||||
Reference in New Issue
Block a user