aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/alpha/laravel-tinker.lua67
-rw-r--r--lua/alpha/status-line.lua6
-rw-r--r--lua/plugins.lua15
3 files changed, 74 insertions, 14 deletions
diff --git a/lua/alpha/laravel-tinker.lua b/lua/alpha/laravel-tinker.lua
new file mode 100644
index 0000000..fa23346
--- /dev/null
+++ b/lua/alpha/laravel-tinker.lua
@@ -0,0 +1,67 @@
+local M = {}
+
+
+M.runCode = function ()
+ local curBuff = vim.api.nvim_get_current_buf()
+
+ local stats = vim.api.nvim_list_uis()[1]
+
+ local width = stats.width
+ local height = stats.height
+
+ local bufh = vim.api.nvim_create_buf(false, true)
+ local winId = vim.api.nvim_open_win(bufh, true, {
+ relative = "editor",
+ width = width * 0.75,
+ height = height * 0.75,
+ col = 2,
+ row = 2,
+ style = "minimal",
+ border = "rounded",
+ })
+
+ -- get the start and end lines of selection
+ local startLine = vim.api.nvim_buf_get_mark(curBuff, "<")[1] -1
+ local endLine = vim.api.nvim_buf_get_mark(curBuff, ">")[1]
+ -- print("range: ", startLine, endLine)
+
+ local code = vim.api.nvim_buf_get_lines(curBuff, startLine, endLine, false);
+
+ -- print (vim.inspect(code))
+
+ local codeText = vim.fn.shellescape(table.concat(code, " "))
+ -- print(codeText)
+
+
+ local result = vim.fn.systemlist('php artisan tinker --execute=' .. codeText)
+
+ vim.api.nvim_buf_set_text(bufh, 0, 0, 0, 0, result)
+end
+
+M.backTerminal = function ()
+ local bufh = vim.api.nvim_create_buf(false, true)
+ local term = vim.api.nvim_open_term(bufh, {})
+
+ local winId = vim.api.nvim_open_win(bufh, true, {
+ relative = "editor",
+ width = 80,
+ height = 80,
+ col = 2,
+ row = 2,
+ style = "minimal",
+ border = "rounded",
+ })
+
+ local jobId = vim.fn.jobstart("php artisan tinker", {
+ on_stdout = function (err, data)
+ print(err, vim.inspect(data))
+ vim.api.nvim_chan_send(term, table.concat(data, "\n"))
+ end
+ })
+
+ vim.api.nvim_chan_send(jobId, "$ub = UploadBatch::find(1);\n")
+ vim.api.nvim_chan_send(jobId, "dump($ub);\n")
+end
+
+
+return M
diff --git a/lua/alpha/status-line.lua b/lua/alpha/status-line.lua
index dde94b9..c882c2c 100644
--- a/lua/alpha/status-line.lua
+++ b/lua/alpha/status-line.lua
@@ -1,11 +1,9 @@
require('lualine').setup{
options = {
- theme = 'aquarium',
- section_separators = { '', '' },
- component_separators = { '', '' },
+ theme = 'dracula',
icons_enabled = true,
},
- extensions = {'quickfix'},
+ extensions = {'quickfix', 'fugitive'},
sections = {
lualine_a = { { 'mode', upper = true } },
lualine_b = { { 'branch', icon = '' } },
diff --git a/lua/plugins.lua b/lua/plugins.lua
index d781e0c..fa901b0 100644
--- a/lua/plugins.lua
+++ b/lua/plugins.lua
@@ -79,7 +79,10 @@ return require('packer').startup(function(use)
}
}
- use 'hoob3rt/lualine.nvim'
+ use {
+ 'nvim-lualine/lualine.nvim',
+ requires = {'kyazdani42/nvim-web-devicons', opt = true}
+ }
use {
'puremourning/vimspector',
@@ -104,14 +107,8 @@ return require('packer').startup(function(use)
}
use 'jwalton512/vim-blade'
- use 'fladson/vim-kitty'
-
- use 'gruvbox-community/gruvbox'
- use 'EdenEast/nightfox.nvim'
- use {
- 'frenzyexists/aquarium-vim', branch = 'develop'
- }
+ use 'dracula/vim'
use 'Raimondi/delimitMate'
use 'tpope/vim-surround'
@@ -124,10 +121,8 @@ return require('packer').startup(function(use)
use 'tpope/vim-tbone'
use 'tpope/vim-dadbod'
use 'airblade/vim-gitgutter'
- use 'hashivim/vim-terraform'
use { 'nicwest/vim-http', opt = true, cmd = {'Http'}}
-
use { 'vimwiki/vimwiki', opt = true, cmd = {'VimwikiIndex'}}
end)