Compare commits

...

3 Commits

Author SHA1 Message Date
684c0dbeaf enhancement: some vim enhancements
- mapleader moved to bindings file
- vim number + relative number
- signcolumn number
- load everything after theme
- remove tildas after buffer end
2025-01-20 12:48:23 +03:00
57b8649527 feat: zen-mode width 80% 2025-01-20 12:47:36 +03:00
77aaeef71c feat: neozoom settings adjusted
- fullscreen
- no border
- allow terminal
- opacity on unfocus
2025-01-20 12:42:42 +03:00
5 changed files with 41 additions and 14 deletions

View File

@ -11,18 +11,18 @@ return {
-- exclude_filetypes = {}, -- exclude_filetypes = {},
-- exclude_buftypes = {}, -- exclude_buftypes = {},
-- }, -- },
exclude_buftypes = { "terminal" }, -- exclude_buftypes = { "terminal" },
-- exclude_filetypes = { 'lspinfo', 'mason', 'lazy', 'fzf', 'qf' }, -- exclude_filetypes = { 'lspinfo', 'mason', 'lazy', 'fzf', 'qf' },
winopts = { winopts = {
offset = { offset = {
-- NOTE: omit `top`/`left` to center the floating window vertically/horizontally. -- NOTE: omit `top`/`left` to center the floating window vertically/horizontally.
-- top = 0, -- top = 0,
-- left = 0.17, -- left = 0.17,
width = 150, width = 1.0,
height = 0.85, height = 1.0,
}, },
-- NOTE: check :help nvim_open_win() for possible border values. -- NOTE: check :help nvim_open_win() for possible border values.
border = "thicc", -- this is a preset, try it :) border = "none", -- this is a preset, try it :)
}, },
presets = { presets = {
{ {
@ -41,9 +41,32 @@ return {
}, },
}, },
}, },
callbacks = {
function()
if vim.wo.winhl == "" then
vim.wo.winhl = "Normal:"
end
end,
},
}) })
vim.keymap.set("n", "<CR>", function() vim.keymap.set("n", "<leader>F", function()
vim.cmd("NeoZoomToggle") vim.cmd("NeoZoomToggle")
end, { silent = true, nowait = true }) end, { silent = true, nowait = true })
vim.api.nvim_create_autocmd({ "WinEnter" }, {
group = curfile_augroup,
callback = function()
local did_zoom = require("neo-zoom").did_zoom()
if not did_zoom[1] then
return
end
-- wait for upstream: https://github.com/neovim/neovim/issues/23542.
if vim.api.nvim_get_current_win() == did_zoom[2] then
vim.api.nvim_win_set_option(did_zoom[2], "winbl", 0)
else
vim.api.nvim_win_set_option(did_zoom[2], "winbl", 25)
end
end,
})
end, end,
} }

View File

@ -8,7 +8,7 @@ return -- Lua
-- * an absolute number of cells when > 1 -- * an absolute number of cells when > 1
-- * a percentage of the width / height of the editor when <= 1 -- * a percentage of the width / height of the editor when <= 1
-- * a function that returns the width or the height -- * a function that returns the width or the height
width = 120, -- width of the Zen window width = 0.8, -- width of the Zen window
height = 1, -- height of the Zen window height = 1, -- height of the Zen window
-- by default, no options are changed for the Zen window -- by default, no options are changed for the Zen window
-- uncomment any of the options below, or add other vim.wo options you want to apply -- uncomment any of the options below, or add other vim.wo options you want to apply

View File

@ -1,3 +1,8 @@
-- Set <space> as the leader key
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- ───────────────────── disable highlight on search ───────────────────── -- ───────────────────── disable highlight on search ─────────────────────
vim.keymap.set({ "n", "i" }, "<C-H>", "<C-W>", { noremap = true, desc = "Delete word" }) vim.keymap.set({ "n", "i" }, "<C-H>", "<C-W>", { noremap = true, desc = "Delete word" })

View File

@ -1,8 +1,3 @@
-- Set <space> as the leader key
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Set the number of spaces to use for each step of (auto)indent -- Set the number of spaces to use for each step of (auto)indent
vim.opt.tabstop = 2 -- Number of spaces that a <Tab> counts for vim.opt.tabstop = 2 -- Number of spaces that a <Tab> counts for
vim.opt.shiftwidth = 2 -- Number of spaces to use for each step of (auto)indent vim.opt.shiftwidth = 2 -- Number of spaces to use for each step of (auto)indent
@ -20,6 +15,7 @@ vim.g.have_nerd_font = true
-- For more options, you can see `:help option-list` -- For more options, you can see `:help option-list`
-- Make line numbers default -- Make line numbers default
vim.opt.number = true
vim.opt.relativenumber = true vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example! -- Enable mouse mode, can be useful for resizing splits for example!
@ -42,7 +38,10 @@ vim.opt.ignorecase = true
vim.opt.smartcase = true vim.opt.smartcase = true
-- Keep signcolumn on by default -- Keep signcolumn on by default
vim.opt.signcolumn = "yes" vim.opt.signcolumn = "number"
-- Removes ~ after file end
vim.opt.fillchars:append({ eob = " " })
-- Decrease update time -- Decrease update time
vim.opt.updatetime = 250 vim.opt.updatetime = 250

View File

@ -1,6 +1,6 @@
require("goodhumored.common-vim-settings")
require("goodhumored.common-bindings") require("goodhumored.common-bindings")
require("goodhumored.autocommands")
require("goodhumored.lazy") require("goodhumored.lazy")
require("goodhumored.common-vim-settings")
require("goodhumored.autocommands")
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et