diff --git a/lua/after/ftplugin/python.lua b/after/ftplugin/python.lua similarity index 100% rename from lua/after/ftplugin/python.lua rename to after/ftplugin/python.lua diff --git a/lazy-lock.json b/lazy-lock.json index 040aeadc..51084ede 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -10,6 +10,7 @@ "gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, diff --git a/lua/custom/plugins/indent-blankline.lua b/lua/custom/plugins/indent-blankline.lua new file mode 100644 index 00000000..15695315 --- /dev/null +++ b/lua/custom/plugins/indent-blankline.lua @@ -0,0 +1,7 @@ +return { + 'lukas-reineke/indent-blankline.nvim', + main = 'ibl', + ---@module "ibl" + ---@type ibl.config + opts = {}, +} diff --git a/lua/kickstart/plugins/mini.lua b/lua/kickstart/plugins/mini.lua index 52ba9e1d..61b8158d 100644 --- a/lua/kickstart/plugins/mini.lua +++ b/lua/kickstart/plugins/mini.lua @@ -37,6 +37,7 @@ return { require('mini.bufremove').setup() require('mini.jump').setup() require('mini.jump2d').setup() + require('mini.pairs').setup() -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index e4b79bdb..46cc1c4a 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -62,6 +62,7 @@ require('lazy').setup({ require 'custom/plugins/lualine', require 'custom/plugins/noice', require 'custom/plugins/theme', + require 'custom/plugins/indent-blankline', -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/plugin/float-terminal.lua b/plugin/float-terminal.lua new file mode 100644 index 00000000..3270351b --- /dev/null +++ b/plugin/float-terminal.lua @@ -0,0 +1,57 @@ +vim.keymap.set('t', '', '') + +local state = { + floating = { + buf = -1, + win = -1, + }, +} + +local function create_floating_window(opts) + opts = opts or {} + local width = opts.width or math.floor(vim.o.columns * 0.8) + local height = opts.height or math.floor(vim.o.lines * 0.8) + + -- Calculate the position to center the window + local col = math.floor((vim.o.columns - width) / 2) + local row = math.floor((vim.o.lines - height) / 2) + + -- Create a buffer + local buf = nil + if vim.api.nvim_buf_is_valid(opts.buf) then + buf = opts.buf + else + buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer + end + + -- Define window configuration + local win_config = { + relative = 'editor', + width = width, + height = height, + col = col, + row = row, + style = 'minimal', -- No borders or extra UI elements + border = 'rounded', + } + + -- Create the floating window + local win = vim.api.nvim_open_win(buf, true, win_config) + + return { buf = buf, win = win } +end + +local toggle_terminal = function() + if not vim.api.nvim_win_is_valid(state.floating.win) then + state.floating = create_floating_window { buf = state.floating.buf } + if vim.bo[state.floating.buf].buftype ~= 'terminal' then + vim.cmd.terminal() + end + else + vim.api.nvim_win_hide(state.floating.win) + end +end + +-- Example usage: +-- Create a floating window with default dimensions +vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {})