Public Access
Compare commits
5
Commits
3ba2f15222
...
c71d6ae982
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c71d6ae982 | ||
|
|
7c24bf6c94 | ||
|
|
da7f9d0bdb | ||
|
|
83561baf1f | ||
|
|
5b7df5dfb4 |
@@ -45,12 +45,8 @@ Git shortcuts:
|
||||
- `<leader>lg` open LazyGit
|
||||
- `<leader>dv` open Diffview
|
||||
- `<leader>dc` close Diffview
|
||||
|
||||
Toggle shortcuts:
|
||||
|
||||
- `<leader>tw` toggle soft wrap
|
||||
- `<leader>ti` toggle inline diagnostics
|
||||
- `<leader>tv` toggle virtual diagnostics
|
||||
- `[h`, `]h`, `[H`, `]H` jump to hunks
|
||||
- `<leader>th` — toggle the expanded hunk view
|
||||
|
||||
Refresh shortcuts (oil and buffers):
|
||||
|
||||
@@ -66,6 +62,13 @@ Oil usage:
|
||||
- `<C-p>` previews the selected entry
|
||||
- `gx` opens the file in external viewer
|
||||
|
||||
Toggle shortcuts:
|
||||
|
||||
- `<leader>tw` toggle soft wrap
|
||||
- `<leader>ti` toggle inline diagnostics
|
||||
- `<leader>tv` toggle virtual diagnostics
|
||||
- `<leader>th` — toggle the expanded hunk view
|
||||
|
||||
## Terminal
|
||||
|
||||
Two options to leave terminal mode and return to normal mode:
|
||||
@@ -102,8 +105,7 @@ Diagnostics:
|
||||
- `g.` open diagnostic float
|
||||
- `gl` send diagnostics to the location list
|
||||
- `gld` display diagnostic information
|
||||
- `]g` jump to next warning or error
|
||||
- `[g` jump to previous warning or error
|
||||
- `]g`, `[g` jump to warning or error
|
||||
- `<leader>ti` toggle inline diagnostics
|
||||
- `<leader>tv` toggle virtual diagnostics
|
||||
- `<leader>xx` toggle project warnings and errors
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
local M = {}
|
||||
|
||||
--- Toggle wrapping, or force it to the provided state.
|
||||
--- This plugin is buggy, so it does nothing
|
||||
--- @param enabled? boolean
|
||||
function M.toggle(enabled)
|
||||
-- if enabled == nil then
|
||||
-- enabled = not vim.wo.wrap
|
||||
-- end
|
||||
--
|
||||
-- vim.wo.wrap = enabled
|
||||
-- vim.wo.linebreak = enabled
|
||||
-- vim.wo.breakindent = enabled
|
||||
-- vim.bo.textwidth = enabled and 80 or 0
|
||||
-- vim.bo.wrapmargin = 0
|
||||
if enabled == nil then
|
||||
enabled = not vim.wo.wrap
|
||||
end
|
||||
|
||||
vim.wo.wrap = enabled
|
||||
vim.wo.linebreak = enabled
|
||||
vim.wo.breakindent = enabled
|
||||
vim.wo.colorcolumn = enabled and "" or "80"
|
||||
vim.bo.textwidth = enabled and 0 or 80
|
||||
vim.bo.wrapmargin = 0
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
@@ -29,6 +29,9 @@ map("n", "<leader>lg", "<Cmd>LazyGit<CR>", { desc = "open lazygit" })
|
||||
map("n", "<leader>dv", "<Cmd>DiffviewOpen<CR>", { desc = "open diffview" })
|
||||
map("n", "<leader>dc", "<Cmd>DiffviewClose<CR>", { desc = "close diffview" })
|
||||
map("n", "<leader>tw", require("romanzy.custom.wrap").toggle, { desc = "toggle soft wrap" })
|
||||
map("n", "<leader>th", function()
|
||||
MiniDiff.toggle_overlay()
|
||||
end, { desc = "toggle hunk view" })
|
||||
|
||||
map("n", "<leader>sv", "<Cmd>vs<CR>", { desc = "split vertical" })
|
||||
map("n", "<leader>sh", "<Cmd>sp<CR>", { desc = "split horizontal" })
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
local g = vim.g
|
||||
local o = vim.opt
|
||||
|
||||
g.mapleader = " " -- Uses space as the global leader key.
|
||||
g.maplocalleader = " " -- Uses space as the local leader key.
|
||||
g.clipboard = "osc52" -- Routes the + and * registers through OSC52 in terminal Neovim.
|
||||
@@ -11,7 +10,8 @@ o.cursorline = true -- Highlights the line under the cursor.
|
||||
o.textwidth = 80 -- Wraps inserted text after 80 columns when formatting is active.
|
||||
o.scrolloff = 8 -- Keeps context lines visible around the cursor.
|
||||
o.signcolumn = "yes" -- Always reserves space for signs in the gutter.
|
||||
o.colorcolumn = "+1" -- Highlights the preferred maximum line width.
|
||||
o.colorcolumn = "80" -- Highlights the preferred maximum line width.
|
||||
o.wrap = false -- Prevents long lines from wrapping on screen.
|
||||
o.list = true -- Displays whitespace characters using listchars.
|
||||
o.listchars = {
|
||||
tab = "» ",
|
||||
@@ -29,7 +29,7 @@ o.expandtab = true -- Inserts spaces w
|
||||
o.smartindent = true -- Adds indentation automatically on new lines.
|
||||
o.swapfile = false -- Disables swapfile creation.
|
||||
o.incsearch = true -- Updates search matches as you type.
|
||||
o.completeopt = { "menuone", "noselect", "fuzzy", "nosort" } -- Enables fuzzy completion matching.
|
||||
o.completeopt = { "menuone", "noinsert", "fuzzy", "nosort" } -- Enables fuzzy completion matching.
|
||||
o.pumheight = 8 -- Limits the completion popup menu size.
|
||||
o.updatetime = 50 -- Reduces idle delay for swap and CursorHold events.
|
||||
o.spelllang = { "en_us" } -- Uses US English for spell checking.
|
||||
|
||||
@@ -12,6 +12,7 @@ local icons = require("mini.icons")
|
||||
local git = require("mini.git")
|
||||
local diff = require("mini.diff")
|
||||
local statusline = require("mini.statusline")
|
||||
local cmdline = require("mini.cmdline")
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
local pairs = require("mini.pairs")
|
||||
local ai = require("mini.ai")
|
||||
@@ -39,39 +40,65 @@ clue.setup({
|
||||
},
|
||||
})
|
||||
|
||||
completion.setup({})
|
||||
local function complete_accept_top()
|
||||
if vim.fn.pumvisible() == 0 then
|
||||
return "<C-y>"
|
||||
end
|
||||
|
||||
if vim.fn.complete_info({ "selected" }).selected == -1 then
|
||||
return "<C-n><C-y>"
|
||||
end
|
||||
|
||||
return "<C-y>"
|
||||
end
|
||||
vim.keymap.set("i", "<C-y>", complete_accept_top, { expr = true })
|
||||
|
||||
icons.setup({})
|
||||
|
||||
git.setup({})
|
||||
|
||||
diff.setup({})
|
||||
local function set_mini_diff_highlights()
|
||||
vim.api.nvim_set_hl(0, "MiniDiffSignAdd", { fg = "#9ccf8d" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffSignChange", { fg = "#f6c177" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffSignDelete", { fg = "#eb6f92" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverAdd", { fg = "#9ccf8d" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverChange", { fg = "#f6c177" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverDelete", { fg = "#eb6f92" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffSignAdd", { fg = "#9ccf8d", bold = true })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffSignChange", { fg = "#f6c177", bold = true })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffSignDelete", { fg = "#eb6f92", bold = true })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverAdd", { fg = "#9ccf8d", bg = "#333c48", bold = true })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverChange", { fg = "#eb6f92", bg = "#43293a", bold = true })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverChangeBuf", { fg = "#9ccf8d", bg = "#333c48", bold = true })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverContext", { fg = "#908caa", bg = "#26233a" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverContextBuf", { fg = "#e0def4", bg = "#1f1d2e" })
|
||||
vim.api.nvim_set_hl(0, "MiniDiffOverDelete", { fg = "#eb6f92", bg = "#43293a", bold = true })
|
||||
end
|
||||
set_mini_diff_highlights()
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
callback = set_mini_diff_highlights,
|
||||
})
|
||||
|
||||
statusline.setup({ use_icons = true })
|
||||
local function statusline_filetype()
|
||||
local filetype = vim.bo.filetype
|
||||
if filetype == "" then
|
||||
return ""
|
||||
end
|
||||
|
||||
local icon = MiniIcons.get("filetype", filetype)
|
||||
return icon .. " " .. filetype
|
||||
end
|
||||
|
||||
-- Custom de-cluttered status line output. The default was waaay to noisy
|
||||
local function statusline_active()
|
||||
local mode, mode_hl = statusline.section_mode({ trunc_width = 120 })
|
||||
local git_info = statusline.section_git({ trunc_width = 40 })
|
||||
-- local diff_info = statusline.section_diff({ trunc_width = 75 })
|
||||
-- local diagnostics = statusline.section_diagnostics({ trunc_width = 75 })
|
||||
local lsp = statusline.section_lsp({ trunc_width = 75 })
|
||||
local filename = statusline.section_filename({ trunc_width = 140 })
|
||||
local fileinfo = statusline_filetype()
|
||||
local search = statusline.section_searchcount({ trunc_width = 75 })
|
||||
|
||||
return statusline.combine_groups({
|
||||
{ hl = mode_hl, strings = { mode } },
|
||||
{ hl = "MiniStatuslineDevinfo", strings = { git_info, lsp } },
|
||||
"%<",
|
||||
{ hl = "MiniStatuslineFilename", strings = { filename } },
|
||||
"%=",
|
||||
{ hl = "MiniStatuslineFileinfo", strings = { fileinfo } },
|
||||
{ hl = mode_hl, strings = { search } },
|
||||
})
|
||||
end
|
||||
|
||||
statusline.setup({
|
||||
use_icons = true,
|
||||
content = { active = statusline_active },
|
||||
})
|
||||
|
||||
cmdline.setup({})
|
||||
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
@@ -87,6 +114,15 @@ pairs.setup({
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
})
|
||||
|
||||
completion.setup({})
|
||||
vim.keymap.set("i", "<CR>", function()
|
||||
if vim.fn.complete_info({ "selected" }).selected ~= -1 then
|
||||
return "\25"
|
||||
end
|
||||
|
||||
return MiniPairs.cr()
|
||||
end, { expr = true })
|
||||
|
||||
ai.setup({})
|
||||
|
||||
notify.setup({
|
||||
|
||||
Reference in New Issue
Block a user