diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-02-03 19:32:51 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-02-03 19:32:51 +0100 |
| commit | 91154edc7f54d9a57a265fcaad1309c2e295ae63 (patch) | |
| tree | 2815717440a3bcd652247611c8401fb83c41b30d /lua | |
| parent | 870d3cfae760265c01403deb2b973e500fda06df (diff) | |
| download | nvim-conf-91154edc7f54d9a57a265fcaad1309c2e295ae63.tar.gz nvim-conf-91154edc7f54d9a57a265fcaad1309c2e295ae63.zip | |
fix: clean scratches from the repository
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/alpha/scratchs/behat-test.lua | 80 | ||||
| -rw-r--r-- | lua/alpha/scratchs/laravel.lua | 31 | ||||
| -rw-r--r-- | lua/alpha/scratchs/sample.lua | 29 | ||||
| -rw-r--r-- | lua/scratchs/.gitkeep | 0 |
4 files changed, 0 insertions, 140 deletions
diff --git a/lua/alpha/scratchs/behat-test.lua b/lua/alpha/scratchs/behat-test.lua deleted file mode 100644 index 805459f..0000000 --- a/lua/alpha/scratchs/behat-test.lua +++ /dev/null @@ -1,80 +0,0 @@ --- TODO --- vim.cmd("vsplit") --- winh = vim.api.nvim_get_current_win() --- bufh = vim.api.nvim_create_buf(true, true) --- vim.api.nvim_win_set_buf(winh, bufh) --- vim.api.nvim_set_current_win(winh) --- --- should get current window, switch for the buffer and get back to the buffer, that is just for the initial not all the time for every save --- - -local attach_to_buffer = function(output_bufnr, command) - vim.api.nvim_create_autocmd("BufWritePost", { - group = vim.api.nvim_create_augroup("behat-auto-test", { clear = true }), - pattern = { "*.php", "*.feature" }, - callback = function() - local append_data = function(_, data) - if data then - vim.api.nvim_buf_set_option(output_bufnr, "modifiable", true) - vim.api.nvim_buf_set_lines(output_bufnr, -1, -1, false, data) - vim.api.nvim_buf_set_option(output_bufnr, "modifiable", false) - end - end - - vim.api.nvim_buf_set_option(output_bufnr, "modifiable", true) - vim.api.nvim_buf_set_lines(output_bufnr, 0, -1, false, { "Behat test output" }) - vim.api.nvim_buf_set_option(output_bufnr, "modifiable", false) - vim.fn.jobstart(command, { - stdout_buffered = true, - on_stdout = append_data, - on_stderr = append_data, - }) - end, - }) -end - -vim.api.nvim_create_user_command("Behat", function() - local fname = vim.fn.expand "%" - local line = vim.api.nvim_win_get_cursor(0)[1] - local command = - vim.split(string.format("docker-compose exec -T -u 1000:1000 php-fpm bin/behat %s:%d", fname, line), " ") - -- TODO generate dinamically - -- local output_bufnr = 214 - - local current_win = vim.api.nvim_get_current_win() - vim.cmd "vsplit" - local winh = vim.api.nvim_get_current_win() - local bufh = vim.api.nvim_create_buf(true, true) - vim.api.nvim_win_set_buf(winh, bufh) - vim.api.nvim_set_current_win(current_win) - vim.api.nvim_buf_set_name(bufh, string.format("Behat %s:%s", fname, line)) - vim.api.nvim_buf_set_option(bufh, "modifiable", false) - vim.api.nvim_win_set_option(winh, "number", false) - vim.api.nvim_win_set_option(winh, "relativenumber", false) - - attach_to_buffer(bufh, command) -end, {}) - -vim.api.nvim_create_user_command("BehatFile", function() - local fname = vim.fn.expand "%" - local command = vim.split(string.format("docker-compose exec -T -u 1000:1000 php-fpm bin/behat %s", fname), " ") - -- TODO generate dinamically - -- local output_bufnr = 214 - - local current_win = vim.api.nvim_get_current_win() - vim.cmd "vsplit" - local winh = vim.api.nvim_get_current_win() - local bufh = vim.api.nvim_create_buf(true, true) - vim.api.nvim_win_set_buf(winh, bufh) - vim.api.nvim_set_current_win(current_win) - vim.api.nvim_buf_set_name(bufh, string.format "Behat Test") - vim.api.nvim_buf_set_option(bufh, "modifiable", false) - vim.api.nvim_win_set_option(winh, "number", false) - vim.api.nvim_win_set_option(winh, "relativenumber", false) - - attach_to_buffer(bufh, command) -end, {}) - -vim.api.nvim_create_user_command("BehatStop", function() - vim.api.nvim_del_augroup_by_name "behat-auto-test" -end, {}) diff --git a/lua/alpha/scratchs/laravel.lua b/lua/alpha/scratchs/laravel.lua deleted file mode 100644 index 753cc7b..0000000 --- a/lua/alpha/scratchs/laravel.lua +++ /dev/null @@ -1,31 +0,0 @@ --- I want to improve a quality of life on controllers --- Want to show the uri beside de controller --- Why just stetics --- --- Give a warning if the controller is missing some assigned routes --- - --- Snippet for creating relationships --- A select node for the type of relation on the return type --- base on that node which function should call --- base on the name and type create the name?? --- --- Want to have something to do with docker and projects --- --- Problem when I switch project sail is runnin in another one --- --- local artisan = R "laravel.artisan" --- --- P(artisan.commands(true)) - --- local keys = vim.api.nvim_replace_termcodes("<c-c>", true, false, true) --- vim.api.nvim_chan_send(63, keys) --- vim.cmd([[call chansend(23, "\<c-c>")]]) - --- P(require("laravel.app").jobs) - -local keys = vim.api.nvim_replace_termcodes("<c-c>", true, false, true) --- foreach open task do this -for _, job in ipairs(require("laravel.app").jobs) do - vim.api.nvim_chan_send(job, keys) -end diff --git a/lua/alpha/scratchs/sample.lua b/lua/alpha/scratchs/sample.lua deleted file mode 100644 index 68052f5..0000000 --- a/lua/alpha/scratchs/sample.lua +++ /dev/null @@ -1,29 +0,0 @@ -local M = {} - -local action_state = require "telescope.actions.state" -local actions = require "telescope.actions" - -M.find_config = function() - require("telescope.builtin").find_files { - prompt_title = "< Neovim >", - cwd = "$HOME/.config/nvim/", - } -end - -M.find_plugin = function() - require("telescope.builtin").find_files { - prompt_title = "< Plugins >", - cwd = "$HOME/.config/nvim/lua/alpha/plugins/", - attach_mappings = function(_, map) - map("i", "<C-t>", function(prompt_bufnr) - local new_plugin = action_state.get_current_line() - actions.close(prompt_bufnr) - vim.cmd(string.format("edit ~/.config/nvim/lua/alpha/plugins/%s.lua", new_plugin)) - end) - - return true - end, - } -end - -M.find_plugin() diff --git a/lua/scratchs/.gitkeep b/lua/scratchs/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/lua/scratchs/.gitkeep |