From 1ae887ab06b34144495af5a9e36b0c6628bcab2c Mon Sep 17 00:00:00 2001 From: kkard2 Date: Sun, 10 Mar 2024 13:05:23 +0100 Subject: try not to make most illegible config challenge (impossible) --- nvim/init.lua | 44 ++++++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 12 deletions(-) (limited to 'nvim') diff --git a/nvim/init.lua b/nvim/init.lua index 1286014..be70bd4 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -18,7 +18,7 @@ vim.opt.undofile = true vim.opt.hlsearch = true vim.opt.incsearch = true -vim.opt.scrolloff = 8 +vim.opt.scrolloff = 2 vim.opt.colorcolumn = "80,100,120" @@ -77,7 +77,16 @@ vim.keymap.set("n", "", function() end) vim.keymap.set("n", "tt", function() - vim.opt.expandtab = not vim.opt.expandtab + -- idk it works + ---@diagnostic disable-next-line: undefined-field + if vim.opt.expandtab:get() then + vim.opt.expandtab = false + else + vim.opt.expandtab = true + end + + -- this is idiotic + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true)) end) -- what not using lualine does to a mf @@ -86,16 +95,27 @@ vim.cmd([[set statusline+=\ ft=%{&filetype}]]) vim.cmd([[set statusline+=\ ff=%{&fileformat}]]) vim.cmd([[set statusline+=\ spaces=%{&expandtab}]]) --- vim.opt.statusline.append(function() --- return "test" --- end) --- vim.keymap.set("n", "ptt", function() --- if vim.opt.expandtab then --- vim.print("TABS") --- else --- vim.print("SPACES") --- end --- end) +-- closing "code blocks" +vim.keymap.set("i", "", function() + if vim.bo.filetype == "html" or vim.bo.filetype == "xml" then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes( + [[mx?<[^/].\{-}>"zyi<`xa"zpa>O]], + true, true, true + )) + vim.schedule(function() + vim.cmd("noh") + end) + elseif vim.bo.filetype == "lua" then + vim.fn.feedkeys(vim.api.nvim_replace_termcodes( + [[endO]], true, true, true + )) + else -- reasonable default + vim.fn.feedkeys(vim.api.nvim_replace_termcodes( + [[}O]], true, true, true + )) + end +end) + -- colorscheme -- cgit v1.3.1