better markdown defaults

This commit is contained in:
2026-07-10 20:32:07 +02:00
parent 17c19d3452
commit 0ef267297e
3 changed files with 28 additions and 10 deletions

View File

@@ -44,6 +44,12 @@ Git shortcuts:
- `:Git` to run commands directly (`:Git status`, `:Git log --oneline`)
- `<leader>lg` open LazyGit
Toggle shortcuts:
- `<leader>tw` toggle soft wrap
- `<leader>ti` toggle inline diagnostics
- `<leader>tv` toggle virtual diagnostics
Oil usage:
- `<leader>dl` opens the file browser
@@ -104,8 +110,8 @@ Diagnostics:
- `g.` open diagnostic float
- `gl` send diagnostics to the location list
- `gld` display diagnostic information
- `gid` toggle inline diagnostics
- `gvd` toggle virtual line diagnostics
- `<leader>ti` toggle inline diagnostics
- `<leader>tv` toggle virtual diagnostics
- `]g` jump to next warning or error
- `[g` jump to previous warning or error

View File

@@ -0,0 +1,8 @@
local o = vim.opt_local
o.wrap = true
o.linebreak = true
o.breakindent = true
o.textwidth = 0
o.colorcolumn = ""
o.formatoptions:remove({ "t" })

View File

@@ -26,12 +26,18 @@ map("n", "<leader>fg", telescope_picker("live_grep"), { desc = "live grep" })
map("n", "<leader>fb", telescope_picker("buffers"), { desc = "find buffers" })
map("n", "<leader>fh", telescope_picker("help_tags"), { desc = "help tags" })
map("n", "<leader>lg", "<Cmd>LazyGit<CR>", { desc = "open lazygit" })
map("n", "<leader>tw", function()
local wrap = not vim.wo.wrap
vim.wo.wrap = wrap
vim.wo.linebreak = wrap
vim.wo.breakindent = wrap
end, { desc = "toggle soft wrap" })
-- map("n", "<leader>s", ":set spell!<CR>", { desc = "toggle spell" })
map("n", "<leader>sv", "<Cmd>vs<CR>", { desc = "split vertical" })
map("n", "<leader>sh", "<Cmd>sp<CR>", { desc = "split horizontal" })
map("n", "<leader>se", "<C-w>=", { desc = "equalize splits" })
map("n", "<leader>sc", "<C-w>c", { desc = "close split" })
map("n", "<leader>rh", "<Cmd>vertical resize -10<CR>", { desc = "make buffer narrower" })
map("n", "<leader>rl", "<Cmd>vertical resize +10<CR>", { desc = "make buffer wider" })
map("n", "<leader>rj", "<Cmd>resize -5<CR>", { desc = "make buffer shorter" })
@@ -47,10 +53,8 @@ map("n", "<leader>Y", '"+Y', { desc = "yank line to system clipboard" })
map("n", "<leader>p", '"+p', { desc = "paste from system clipboard" })
map("n", "<leader>P", '"+P', { desc = "paste before from system clipboard" })
map("t", "\\\\", "<C-\\><C-n>", { desc = "exit terminal" })
map("t", "<C-\\><C-\\>", "<C-\\><C-n>", { desc = "exit terminal" })
map("t", "<C-Esc>", "<C-\\><C-n>", { desc = "exit terminal" })
map("t", "\\<Esc>", "<C-\\><C-n>", { desc = "exit terminal" })
-- experimenting
map("t", { "\\\\", "<C-\\><C-\\>", "<C-Esc>", "\\<Esc>" }, "<C-\\><C-n>", { desc = "exit terminal" })
map("n", "<C-h>", "<C-w>h", { desc = "window left" })
map("n", "<C-j>", "<C-w>j", { desc = "window down" })
@@ -145,9 +149,9 @@ map("n", "[g", function()
end, { desc = "prev warning/error" })
map("n", "gld", vim.diagnostic.setloclist, { desc = "display diagnostic information" })
map("n", "gid", function()
map("n", "<leader>ti", function()
vim.diagnostic.config({ virtual_text = not vim.diagnostic.config().virtual_text })
end, { desc = "toggle inline diagnostics" })
map("n", "gvd", function()
map("n", "<leader>tv", function()
vim.diagnostic.config({ virtual_lines = not vim.diagnostic.config().virtual_lines })
end, { desc = "toggle virtual line diagnostics" })
end, { desc = "toggle virtual diagnostics" })