aboutsummaryrefslogtreecommitdiffstats
path: root/lua/alpha/scratchs
diff options
context:
space:
mode:
Diffstat (limited to 'lua/alpha/scratchs')
-rw-r--r--lua/alpha/scratchs/laravel.lua3
-rw-r--r--lua/alpha/scratchs/sample.lua22
2 files changed, 15 insertions, 10 deletions
diff --git a/lua/alpha/scratchs/laravel.lua b/lua/alpha/scratchs/laravel.lua
index f3ab843..3da2c69 100644
--- a/lua/alpha/scratchs/laravel.lua
+++ b/lua/alpha/scratchs/laravel.lua
@@ -14,3 +14,6 @@
--
-- Problem when I switch project sail is runnin in another one
--
+local artisan = R("laravel.artisan")
+
+P(artisan.commands(true))
diff --git a/lua/alpha/scratchs/sample.lua b/lua/alpha/scratchs/sample.lua
index a2d783e..80b0b77 100644
--- a/lua/alpha/scratchs/sample.lua
+++ b/lua/alpha/scratchs/sample.lua
@@ -1,12 +1,14 @@
-local scandir = require("plenary.scandir")
-
-
+function reverse_current_word()
+ local line = vim.fn.getline('.')
+ local current_word = vim.fn.expand('<cword>')
+ local start_index = vim.fn.col('.') - #current_word + 1
+ local reversed_word = current_word:reverse()
+
+ local reversed_line = line:sub(1, start_index -1)..reversed_word..line:sub(start_index+#current_word)
+ P(reversed_line)
+ vim.fn.setline('.', reversed_line)
+end
-local dirs = scandir.scan_dir(
- { "/home/alpha/code/php" },
- { depth = 1, only_dirs = true }
-)
+vim.api.nvim_command('command! -range=% ReverseWord :<line1>,<line2>lua reverse_current_word()')
-for _, dir in ipairs(dirs) do
- P(vim.fs.basename(dir))
-end
+-- testing