diff options
author | Squibid <me@zacharyscheiman.com> | 2024-08-09 02:45:31 -0400 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2024-08-09 02:45:31 -0400 |
commit | c489d393695e90d424f9ae51e35c4d42358e6a71 (patch) | |
tree | 12ea97ec4684fd82cd6b73dd127d0137b115837b /lua/core/conf.lua | |
parent | ad76983d969c318e6e234bc82384b4b025d70447 (diff) | |
download | nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.gz nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.tar.bz2 nvim-c489d393695e90d424f9ae51e35c4d42358e6a71.zip |
yes there's a bit of java in my nvim config why do you ask?
Diffstat (limited to 'lua/core/conf.lua')
-rw-r--r-- | lua/core/conf.lua | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/lua/core/conf.lua b/lua/core/conf.lua deleted file mode 100644 index fe24b8d..0000000 --- a/lua/core/conf.lua +++ /dev/null @@ -1,81 +0,0 @@ -local pickers = require("telescope.pickers") -local finders = require("telescope.finders") -local previewers = require("telescope.previewers") -local conf = require("telescope.config").values -local actions = require("telescope.actions") -local action_state = require("telescope.actions.state") - -local M = {} - -local function genmenu() - local list = {} - local function add(name, plug) - if not plug then - table.insert(list, name) - elseif package.loaded[plug] then - table.insert(list, name) - end - end - - add('Edit Config', nil) - add('Update Plugins', 'dep') - add('Keybinds', 'telescope') - add('Colorscheme', 'telescope') - - return list -end - -function M.configmenu() - pickers.new({ - prompt_title = "Nvim Config Menu", - finder = finders.new_table { results = genmenu() }, - sorter = conf.generic_sorter(), - previewer = previewers.new_buffer_previewer { - define_preview = function(self, entry) - local lines = { - 'a' - } - if entry.value == "Edit Config" then - lines = misc.readf(vim.fn.stdpath('config')..'/init.lua') - local ft = vim.filetype.match({ - filename = os.getenv('XDG_CONFIG_HOME')..'/nvim/init.lua' }) - require("telescope.previewers.utils").highlighter(self.state.bufnr, ft) - elseif entry.value == "Colorscheme" then - lines = vim.fn.getcompletion('', 'color') - for k, v in pairs(lines) do - if v.find(v, '.ext') then - table.remove(lines, k) - break - end - end - end - vim.api.nvim_buf_set_lines(self.state.bufnr, 0, -1, false, lines) - end - }, - - attach_mappings = function(bufnr, map) - actions.select_default:replace(function() - actions.close(bufnr) - local selection = action_state.get_selected_entry() - if selection[1] == 'Edit Config' then - vim.cmd('e '..vim.fn.stdpath('config')..'/init.lua') - elseif selection[1] == 'Update Plugins' then - require('dep').sync() - if package.loaded['nvim-treesitter'] then - vim.cmd('TSUpdate') - end - if package.loaded['mason'] then - require('mason.api.command').MasonUpdate() - end - elseif selection[1] == 'Keybinds' then - require('telescope.builtin').keymaps() - elseif selection[1] == 'Colorscheme' then - require('core.theme').switcher() - end - end) - return true - end, - }):find() -end - -return M |