1
0

Refractored Plugin Config

This commit is contained in:
2025-08-07 19:12:45 +02:00
parent 060fe95fc5
commit 4c68d97cda
4 changed files with 1 additions and 37 deletions

View File

@@ -3,7 +3,7 @@ vim.api.nvim_exec2('language POSIX', {})
-- }}}
-- Source plugins if they exist {{{
pcall(require, 'plugins')
pcall(require, 'treesitter')
-- }}}
-- General Editor Settings {{{
@@ -15,8 +15,6 @@ vim.opt.shiftwidth = 4
vim.opt.expandtab = false
vim.opt.list = true
vim.opt.listchars:append 'space:·'
vim.opt.path:append '**'
vim.opt.path:append '.'
vim.opt.wildmenu = true
vim.opt.wrap = false
vim.opt.clipboard = 'unnamedplus'
@@ -50,34 +48,6 @@ end, { nargs = 1 })
vim.opt.statusline = ' #%n %f %h%w%m%r %= %y %l:%c %p%% '
-- }}}
-- FilePicker Script {{{
local function get_list_completion(arg_lead, cmdline, cur_pos)
local cmdout = ''
if (arg_lead == '') then
cmdout = vim.trim(io.popen('rg --files'):read('*a'))
else
local tmp = arg_lead:gsub('\\', '\\\\')
cmdout = vim.trim(io.popen('rg --files | rg ' .. tmp):read('*a'))
end
return vim.split(cmdout, '\n')
end
local function cmd_handler(opts)
if vim.tbl_count(opts.fargs) == 0 then
return
end
for _, arg in ipairs(opts.fargs) do
vim.cmd.edit({args = {arg}})
end
end
vim.api.nvim_create_user_command(
'FilePick',
cmd_handler,
{ complete = get_list_completion, nargs = 1, force = true }
)
-- }}}
-- Toggle Terminal Script {{{
local term_buf = nil
local term_winid = nil