Merge branch 'main' of labs.scarif.space:chris/nvim
This commit is contained in:
+7
-9
@@ -14,17 +14,16 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||||||
|
|
||||||
local autosave_group = vim.api.nvim_create_augroup('autosaving', { clear = true })
|
local autosave_group = vim.api.nvim_create_augroup('autosaving', { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FocusLost', {
|
vim.api.nvim_create_autocmd({ 'FocusLost', 'BufLeave' }, {
|
||||||
group = autosave_group,
|
group = autosave_group,
|
||||||
pattern = '*',
|
pattern = '*',
|
||||||
command = 'silent! wa', -- Save all files when moving away from the window
|
callback = function(args)
|
||||||
nested = true, -- Allow other autocommands to run after this one
|
if vim.bo[args.buf].filetype == 'oil' then
|
||||||
})
|
return
|
||||||
|
end
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('BufLeave', {
|
vim.cmd 'silent! wa'
|
||||||
group = autosave_group,
|
end,
|
||||||
pattern = '*',
|
|
||||||
command = 'silent! wa', -- Save all files when switching buffers
|
|
||||||
nested = true, -- Allow other autocommands to run after this one
|
nested = true, -- Allow other autocommands to run after this one
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -212,4 +211,3 @@ vim.api.nvim_create_autocmd('VimLeavePre', {
|
|||||||
})
|
})
|
||||||
|
|
||||||
require('helpers').edit_cf('a', '/lua/autocmd.lua')
|
require('helpers').edit_cf('a', '/lua/autocmd.lua')
|
||||||
|
|
||||||
|
|||||||
@@ -346,6 +346,7 @@ local test_maps = {
|
|||||||
{
|
{
|
||||||
keys = { '<Leader>tn' },
|
keys = { '<Leader>tn' },
|
||||||
action = function()
|
action = function()
|
||||||
|
vim.cmd 'write'
|
||||||
require('neotest').run.run()
|
require('neotest').run.run()
|
||||||
open_test()
|
open_test()
|
||||||
end,
|
end,
|
||||||
@@ -354,6 +355,7 @@ local test_maps = {
|
|||||||
{
|
{
|
||||||
keys = { '<Leader>ta' },
|
keys = { '<Leader>ta' },
|
||||||
action = function()
|
action = function()
|
||||||
|
vim.cmd 'write'
|
||||||
require('neotest').run.run { suite = true }
|
require('neotest').run.run { suite = true }
|
||||||
open_test()
|
open_test()
|
||||||
end,
|
end,
|
||||||
@@ -362,6 +364,7 @@ local test_maps = {
|
|||||||
{
|
{
|
||||||
keys = { '<Leader>tp' },
|
keys = { '<Leader>tp' },
|
||||||
action = function()
|
action = function()
|
||||||
|
vim.cmd 'write'
|
||||||
require('neotest').run.run_last()
|
require('neotest').run.run_last()
|
||||||
open_test()
|
open_test()
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ local function make_laravel_file(dir, cmd)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local output = vim.system({ 'vendor/bin/sail', 'artisan', 'make:' .. cmd, input }):wait().stdout
|
local output = vim.system({ 'php', 'artisan', 'make:' .. cmd, input }):wait().stdout
|
||||||
local new_file = output:match '%[([%w%./]+)%]'
|
local new_file = output:match '%[([%w%./]+)%]'
|
||||||
if new_file ~= nil then
|
if new_file ~= nil then
|
||||||
vim.cmd('edit ' .. new_file)
|
vim.cmd('edit ' .. new_file)
|
||||||
|
|||||||
+17
-15
@@ -29,6 +29,8 @@ return function(dir)
|
|||||||
vim.notify('Compiling typescript types', vim.log.levels.INFO, { title = 'hylark.lua' })
|
vim.notify('Compiling typescript types', vim.log.levels.INFO, { title = 'hylark.lua' })
|
||||||
end
|
end
|
||||||
|
|
||||||
|
switch_to_root()
|
||||||
|
|
||||||
map('<leader>pl', ':cexpr system("vendor/bin/phpstan analyse --no-progress --error-format=raw --memory-limit=2G -vv") <CR>', { desc = 'Run lint' })
|
map('<leader>pl', ':cexpr system("vendor/bin/phpstan analyse --no-progress --error-format=raw --memory-limit=2G -vv") <CR>', { desc = 'Run lint' })
|
||||||
map('<leader>T', function()
|
map('<leader>T', function()
|
||||||
helpers.open_term { cmd = 'lazysql pgsql://homestead:password@localhost:5432/homestead' }
|
helpers.open_term { cmd = 'lazysql pgsql://homestead:password@localhost:5432/homestead' }
|
||||||
@@ -83,22 +85,22 @@ return function(dir)
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ 'BufEnter' }, {
|
-- vim.api.nvim_create_autocmd({ 'BufEnter' }, {
|
||||||
pattern = { dir .. '**' },
|
-- pattern = { dir .. '**' },
|
||||||
callback = function()
|
-- callback = function()
|
||||||
if vim.fn.expand('%:p'):match(dir .. '/server/') then
|
-- if vim.fn.expand('%:p'):match(dir .. '/server/') then
|
||||||
switch_to_server()
|
-- switch_to_server()
|
||||||
elseif vim.fn.expand('%:p'):match(dir .. '/frontend2/') then
|
-- elseif vim.fn.expand('%:p'):match(dir .. '/frontend2/') then
|
||||||
switch_to_frontend()
|
-- switch_to_frontend()
|
||||||
else
|
-- else
|
||||||
switch_to_root()
|
-- switch_to_root()
|
||||||
end
|
-- end
|
||||||
end,
|
-- end,
|
||||||
})
|
-- })
|
||||||
|
|
||||||
laravel_utils.laravel_keymaps 'server/'
|
laravel_utils.laravel_keymaps(dir .. '/server/')
|
||||||
laravel_utils.laravel_makes 'server/'
|
laravel_utils.laravel_makes(dir .. '/server/')
|
||||||
laravel_utils.laravel_utils 'server/'
|
laravel_utils.laravel_utils(dir .. '/server/')
|
||||||
laravel_utils.laravel_bookmarks(dir .. '/server/')
|
laravel_utils.laravel_bookmarks(dir .. '/server/')
|
||||||
|
|
||||||
create_bookmark('s', dir .. '/frontend2/src/types/api/server-types.d.ts')
|
create_bookmark('s', dir .. '/frontend2/src/types/api/server-types.d.ts')
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ return function(dir)
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
laravel_utils.laravel_keymaps 'server/'
|
laravel_utils.laravel_keymaps(dir .. '/server/')
|
||||||
laravel_utils.laravel_makes 'server/'
|
laravel_utils.laravel_makes(dir .. '/server/')
|
||||||
laravel_utils.laravel_utils 'server/'
|
laravel_utils.laravel_utils(dir .. '/server/')
|
||||||
laravel_utils.laravel_bookmarks 'server/'
|
laravel_utils.laravel_bookmark(dir .. '/server/')
|
||||||
|
|
||||||
create_bookmark('E', dir .. '/client/src/types/api/endpointMap.d.ts')
|
create_bookmark('E', dir .. '/client/src/types/api/endpointMap.d.ts')
|
||||||
create_bookmark('q', dir .. '/client/quasar.config.ts')
|
create_bookmark('q', dir .. '/client/quasar.config.ts')
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ return {
|
|||||||
*/
|
*/
|
||||||
public function #~(): HasMany
|
public function #~(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasOne(#~::class);
|
return $this->hasMany(#~::class);
|
||||||
}
|
}
|
||||||
]],
|
]],
|
||||||
{ rep(1), i(2), i(1) }
|
{ rep(1), i(2), i(1) }
|
||||||
@@ -448,7 +448,7 @@ return {
|
|||||||
*/
|
*/
|
||||||
public function #~(): HasMany
|
public function #~(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasOne(#~::class, #~);
|
return $this->hasMany(#~::class, #~);
|
||||||
}
|
}
|
||||||
]],
|
]],
|
||||||
{ rep(1), i(2), i(1), i(3) }
|
{ rep(1), i(2), i(1), i(3) }
|
||||||
|
|||||||
Reference in New Issue
Block a user