diff --git a/roles/neovim/files/lua/plugins/telescope.lua b/roles/neovim/files/lua/plugins/telescope.lua index 4fb0a9bc..00258297 100644 --- a/roles/neovim/files/lua/plugins/telescope.lua +++ b/roles/neovim/files/lua/plugins/telescope.lua @@ -3,7 +3,7 @@ local techdufus = require_on_exported_call('techdufus.telescope.pickers') return { "nvim-telescope/telescope.nvim", cmd = 'Telescope', - version = false, + tag = '0.1.8', lazy = true, dependencies = { "nvim-lua/plenary.nvim", @@ -238,7 +238,6 @@ return { }, }) }, - telescope.load_extension('makefile_targets'), }, } -- local M = {} diff --git a/roles/neovim/files/lua/telescope/_extensions/makefile_targets.lua b/roles/neovim/files/lua/telescope/_extensions/makefile_targets.lua deleted file mode 100644 index e0efd8a2..00000000 --- a/roles/neovim/files/lua/telescope/_extensions/makefile_targets.lua +++ /dev/null @@ -1,63 +0,0 @@ -local pickers = require("telescope.pickers") -local finders = require("telescope.finders") -local conf = require("telescope.config").values -local actions = require("telescope.actions") -local action_state = require("telescope.actions.state") - -local function extract_makefile_targets(makefile_path) - local targets = {} - for line in io.lines(makefile_path) do - local target = line:match("^([%w-]+):") - if target then - table.insert(targets, target) - end - end - return targets -end - -local function run_make_command(target) - local command = "make " .. target - local output = vim.fn.system(command) - - -- Open a new split window and show the output - vim.cmd("new") - local buf = vim.api.nvim_get_current_buf() - vim.api.nvim_buf_set_lines(buf, 0, -1, false, vim.split(output, "\n")) - vim.api.nvim_buf_set_option(buf, "modifiable", false) - vim.api.nvim_buf_set_name(buf, "Make Output: " .. target) -end - -local makefile_targets = function(opts) - opts = opts or {} - local makefile_path = vim.fn.findfile("Makefile", ".;") - - if makefile_path == "" then - print("No Makefile found in the current directory or its parents") - return - end - - local targets = extract_makefile_targets(makefile_path) - - pickers.new(opts, { - prompt_title = "Makefile Targets", - finder = finders.new_table { - results = targets - }, - sorter = conf.generic_sorter(opts), - attach_mappings = function(prompt_bufnr, map) - actions.select_default:replace(function() - actions.close(prompt_bufnr) - local selection = action_state.get_selected_entry() - run_make_command(selection[1]) - end) - return true - end, - }):find() -end - -vim.api.nvim_create_user_command("MakefileTargets", makefile_targets, {}) -return require("telescope").register_extension({ - exports = { - makefile_targets = makefile_targets - }, -}) diff --git a/roles/neovim/tasks/Ubuntu.yml b/roles/neovim/tasks/Ubuntu.yml index 6c161706..a7bdc7ef 100644 --- a/roles/neovim/tasks/Ubuntu.yml +++ b/roles/neovim/tasks/Ubuntu.yml @@ -12,9 +12,14 @@ state: present become: true -- name: "Neovim | {{ ansible_distribution }} | Install" +- name: "Neovim | {{ ansible_distribution }} | Add APT Repository" ansible.builtin.apt_repository: repo: ppa:neovim-ppa/unstable state: present mode: "0644" become: true + +- name: "Neovim | {{ ansible_distribution }} | Install" + ansible.builtin.apt: + update_cache: yes + become: true