Public Access
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1714279ff | ||
|
|
94972506c2 | ||
|
|
0ac228d0c3 | ||
|
|
e8027c8c7f | ||
|
|
a0e45a6dec | ||
|
|
18931930a2 | ||
|
|
dda48dc457 | ||
|
|
cbe9447671 |
@@ -57,6 +57,7 @@ Git shortcuts:
|
|||||||
Toggle shortcuts:
|
Toggle shortcuts:
|
||||||
|
|
||||||
- `<leader>tw` toggle soft wrap
|
- `<leader>tw` toggle soft wrap
|
||||||
|
- `<leader>ts` toggle spell checking
|
||||||
- `<leader>ti` toggle inline diagnostics
|
- `<leader>ti` toggle inline diagnostics
|
||||||
- `<leader>tv` toggle virtual diagnostics
|
- `<leader>tv` toggle virtual diagnostics
|
||||||
- `<leader>th` — toggle the expanded hunk view
|
- `<leader>th` — toggle the expanded hunk view
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ local M = {}
|
|||||||
|
|
||||||
function M.close_hidden()
|
function M.close_hidden()
|
||||||
local visible_buffers = {}
|
local visible_buffers = {}
|
||||||
|
local closed_count = 0
|
||||||
|
|
||||||
for _, tabpage in ipairs(vim.api.nvim_list_tabpages()) do
|
for _, tabpage in ipairs(vim.api.nvim_list_tabpages()) do
|
||||||
for _, window in ipairs(vim.api.nvim_tabpage_list_wins(tabpage)) do
|
for _, window in ipairs(vim.api.nvim_tabpage_list_wins(tabpage)) do
|
||||||
@@ -12,8 +13,17 @@ function M.close_hidden()
|
|||||||
for _, buffer in ipairs(vim.api.nvim_list_bufs()) do
|
for _, buffer in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
if vim.bo[buffer].buflisted and not visible_buffers[buffer] then
|
if vim.bo[buffer].buflisted and not visible_buffers[buffer] then
|
||||||
vim.api.nvim_buf_delete(buffer, { force = true })
|
vim.api.nvim_buf_delete(buffer, { force = true })
|
||||||
end
|
closed_count = closed_count + 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if closed_count == 0 then
|
||||||
|
vim.notify("No hidden buffers to close", vim.log.levels.INFO)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local buffer_label = closed_count == 1 and "buffer" or "buffers"
|
||||||
|
vim.notify(string.format("Closed %d hidden %s", closed_count, buffer_label), vim.log.levels.INFO)
|
||||||
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|||||||
@@ -390,6 +390,11 @@ function M.setup()
|
|||||||
buffer = args.data.buf_id,
|
buffer = args.data.buf_id,
|
||||||
desc = "open mini.files entry externally",
|
desc = "open mini.files entry externally",
|
||||||
})
|
})
|
||||||
|
vim.keymap.set("n", "<CR>", "L", {
|
||||||
|
buffer = args.data.buf_id,
|
||||||
|
remap = true,
|
||||||
|
desc = "go in entry plus (extra)",
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained", "TermClose" }, {
|
vim.api.nvim_create_autocmd({ "BufWritePost", "FocusGained", "TermClose" }, {
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
--- Toggle spell checking for the current window.
|
||||||
|
function M.toggle()
|
||||||
|
if vim.bo.buftype == "terminal" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt_local.spell = not vim.wo.spell
|
||||||
|
vim.cmd("redrawstatus")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
vim.opt.spelllang = { "en_us" }
|
||||||
|
vim.opt.spell = true
|
||||||
|
|
||||||
|
local group = vim.api.nvim_create_augroup("RomanzySpell", { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
|
group = group,
|
||||||
|
pattern = "terminal",
|
||||||
|
callback = function()
|
||||||
|
vim.opt_local.spell = false
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("TermOpen", {
|
||||||
|
group = group,
|
||||||
|
callback = function()
|
||||||
|
vim.cmd("setfiletype terminal")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -18,11 +18,18 @@ local function telescope_picker(picker)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function open_mini_files_at_current_buffer()
|
||||||
|
local current_path = vim.api.nvim_buf_get_name(0)
|
||||||
|
if vim.bo.buftype ~= "" or current_path == "" then
|
||||||
|
current_path = nil
|
||||||
|
end
|
||||||
|
|
||||||
|
MiniFiles.open(current_path)
|
||||||
|
end
|
||||||
|
|
||||||
map("n", "<leader><leader>r", ":source ~/.config/nvim/init.lua<CR>", { desc = "reload init.lua" })
|
map("n", "<leader><leader>r", ":source ~/.config/nvim/init.lua<CR>", { desc = "reload init.lua" })
|
||||||
map("n", "<leader><leader>h", telescope_picker("keymaps"), { desc = "show keymaps" })
|
map("n", "<leader><leader>h", telescope_picker("keymaps"), { desc = "show keymaps" })
|
||||||
map("n", "<leader>e", function()
|
map("n", "<leader>e", open_mini_files_at_current_buffer, { desc = "open mini.files" })
|
||||||
MiniFiles.open()
|
|
||||||
end, { desc = "open mini.files" })
|
|
||||||
map("n", "<leader>ff", telescope_picker("find_files"), { desc = "find files" })
|
map("n", "<leader>ff", telescope_picker("find_files"), { desc = "find files" })
|
||||||
map("n", "<leader>fg", telescope_picker("live_grep"), { desc = "live grep" })
|
map("n", "<leader>fg", telescope_picker("live_grep"), { desc = "live grep" })
|
||||||
map("n", "<leader>fb", telescope_picker("buffers"), { desc = "find buffers" })
|
map("n", "<leader>fb", telescope_picker("buffers"), { desc = "find buffers" })
|
||||||
@@ -31,6 +38,7 @@ map("n", "<leader>lg", "<Cmd>LazyGit<CR>", { desc = "open lazygit" })
|
|||||||
map("n", "<leader>dv", "<Cmd>DiffviewOpen<CR>", { desc = "open diffview" })
|
map("n", "<leader>dv", "<Cmd>DiffviewOpen<CR>", { desc = "open diffview" })
|
||||||
map("n", "<leader>dc", "<Cmd>DiffviewClose<CR>", { desc = "close 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>tw", require("romanzy.custom.wrap").toggle, { desc = "toggle soft wrap" })
|
||||||
|
map("n", "<leader>ts", require("romanzy.custom.spell").toggle, { desc = "toggle spell checking" })
|
||||||
map("n", "<leader>th", function()
|
map("n", "<leader>th", function()
|
||||||
MiniDiff.toggle_overlay()
|
MiniDiff.toggle_overlay()
|
||||||
end, { desc = "toggle hunk view" })
|
end, { desc = "toggle hunk view" })
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ o.incsearch = true -- Updates search m
|
|||||||
o.completeopt = { "menuone", "noinsert", "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.pumheight = 8 -- Limits the completion popup menu size.
|
||||||
o.updatetime = 50 -- Reduces idle delay for swap and CursorHold events.
|
o.updatetime = 50 -- Reduces idle delay for swap and CursorHold events.
|
||||||
o.spelllang = { "en_us" } -- Uses US English for spell checking.
|
|
||||||
o.shell = "bash" -- Runs shell commands through bash.
|
o.shell = "bash" -- Runs shell commands through bash.
|
||||||
|
|
||||||
-- Only show the invisible characters inside the code editing buffers
|
-- Only show the invisible characters inside the code editing buffers
|
||||||
|
|||||||
@@ -9,4 +9,5 @@ require("romanzy.plugins.nvim-treesitter")
|
|||||||
require("romanzy.plugins.conform")
|
require("romanzy.plugins.conform")
|
||||||
require("romanzy.plugins.lsp")
|
require("romanzy.plugins.lsp")
|
||||||
require("romanzy.plugins.codamheader")
|
require("romanzy.plugins.codamheader")
|
||||||
require("romanzy.plugins.romanzy")
|
require("romanzy.custom.spell").setup()
|
||||||
|
require("romanzy.custom.tabline").setup()
|
||||||
|
|||||||
@@ -6,9 +6,10 @@ vim.pack.add({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
local icons = require("mini.icons")
|
||||||
|
local input = require("mini.input")
|
||||||
local clue = require("mini.clue")
|
local clue = require("mini.clue")
|
||||||
local completion = require("mini.completion")
|
local completion = require("mini.completion")
|
||||||
local icons = require("mini.icons")
|
|
||||||
local files = require("mini.files")
|
local files = require("mini.files")
|
||||||
local git = require("mini.git")
|
local git = require("mini.git")
|
||||||
local diff = require("mini.diff")
|
local diff = require("mini.diff")
|
||||||
@@ -20,6 +21,20 @@ local ai = require("mini.ai")
|
|||||||
local notify = require("mini.notify")
|
local notify = require("mini.notify")
|
||||||
local surround = require("mini.surround")
|
local surround = require("mini.surround")
|
||||||
|
|
||||||
|
icons.setup({})
|
||||||
|
|
||||||
|
local input_view = input.gen_view.floatwin({
|
||||||
|
-- other interesting symbols for the caret `▏` `⎕` `░` `▒` `▓`
|
||||||
|
to_chunks = function(state, max_width)
|
||||||
|
return input.state_to_chunks(state, max_width, {
|
||||||
|
include_prompt = false,
|
||||||
|
include_hint = false,
|
||||||
|
symbol_caret = "█",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
input.setup({ handlers = { view = input_view } })
|
||||||
|
|
||||||
clue.setup({
|
clue.setup({
|
||||||
triggers = {
|
triggers = {
|
||||||
{ mode = "n", keys = "<leader>" },
|
{ mode = "n", keys = "<leader>" },
|
||||||
@@ -41,8 +56,6 @@ clue.setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
icons.setup({})
|
|
||||||
|
|
||||||
files.setup(require("romanzy.custom.mini_files").setup())
|
files.setup(require("romanzy.custom.mini_files").setup())
|
||||||
|
|
||||||
git.setup({})
|
git.setup({})
|
||||||
@@ -64,6 +77,8 @@ vim.api.nvim_create_autocmd("ColorScheme", {
|
|||||||
callback = set_mini_diff_highlights,
|
callback = set_mini_diff_highlights,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Custom de-cluttered status line output. The default was waaay to noisy
|
||||||
|
local function statusline_active()
|
||||||
local function statusline_filetype()
|
local function statusline_filetype()
|
||||||
local filetype = vim.bo.filetype
|
local filetype = vim.bo.filetype
|
||||||
if filetype == "" then
|
if filetype == "" then
|
||||||
@@ -74,14 +89,17 @@ local function statusline_filetype()
|
|||||||
return icon .. " " .. filetype
|
return icon .. " " .. filetype
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Custom de-cluttered status line output. The default was waaay to noisy
|
local function statusline_spell()
|
||||||
local function statusline_active()
|
return vim.wo.spell and "spell" or ""
|
||||||
|
end
|
||||||
|
|
||||||
local mode, mode_hl = statusline.section_mode({ trunc_width = 120 })
|
local mode, mode_hl = statusline.section_mode({ trunc_width = 120 })
|
||||||
local git_info = statusline.section_git({ trunc_width = 40 })
|
local git_info = statusline.section_git({ trunc_width = 40 })
|
||||||
-- local diff_info = statusline.section_diff({ trunc_width = 75 })
|
-- local diff_info = statusline.section_diff({ trunc_width = 75 })
|
||||||
-- local diagnostics = statusline.section_diagnostics({ trunc_width = 75 })
|
-- local diagnostics = statusline.section_diagnostics({ trunc_width = 75 })
|
||||||
local lsp = statusline.section_lsp({ trunc_width = 75 })
|
local lsp = statusline.section_lsp({ trunc_width = 75 })
|
||||||
local filename = statusline.section_filename({ trunc_width = 140 })
|
local filename = statusline.section_filename({ trunc_width = 140 })
|
||||||
|
local spell = statusline_spell()
|
||||||
local fileinfo = statusline_filetype()
|
local fileinfo = statusline_filetype()
|
||||||
local search = statusline.section_searchcount({ trunc_width = 75 })
|
local search = statusline.section_searchcount({ trunc_width = 75 })
|
||||||
|
|
||||||
@@ -91,7 +109,7 @@ local function statusline_active()
|
|||||||
"%<",
|
"%<",
|
||||||
{ hl = "MiniStatuslineFilename", strings = { filename } },
|
{ hl = "MiniStatuslineFilename", strings = { filename } },
|
||||||
"%=",
|
"%=",
|
||||||
{ hl = "MiniStatuslineFileinfo", strings = { fileinfo } },
|
{ hl = "MiniStatuslineFileinfo", strings = { spell, fileinfo } },
|
||||||
{ hl = mode_hl, strings = { search } },
|
{ hl = mode_hl, strings = { search } },
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
@@ -132,7 +150,7 @@ notify.setup({
|
|||||||
lsp_progress = {
|
lsp_progress = {
|
||||||
-- the message "lua_ls: processing completion..." and
|
-- the message "lua_ls: processing completion..." and
|
||||||
-- "lua_ls: Diagnosing" is very annoying
|
-- "lua_ls: Diagnosing" is very annoying
|
||||||
enable = true,
|
-- enable = true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
vim.notify = notify.make_notify()
|
vim.notify = notify.make_notify()
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
require("romanzy.custom.tabline").setup()
|
|
||||||
Reference in New Issue
Block a user