Upgrade config
This commit is contained in:
@@ -59,7 +59,7 @@ vim.api.nvim_create_autocmd({ 'User' }, {
|
|||||||
group = fidget_group,
|
group = fidget_group,
|
||||||
callback = function(event)
|
callback = function(event)
|
||||||
local FidgetHelper = require 'utils.fidget_helper'
|
local FidgetHelper = require 'utils.fidget_helper'
|
||||||
local handle = FidgetHelper:pop_progress_handle(event.data.id)
|
local handle = FidgetHelper:pop_progress_handle(event.data.id)
|
||||||
if handle then
|
if handle then
|
||||||
FidgetHelper:report_exit_status(handle, event)
|
FidgetHelper:report_exit_status(handle, event)
|
||||||
handle:finish()
|
handle:finish()
|
||||||
@@ -67,22 +67,22 @@ vim.api.nvim_create_autocmd({ 'User' }, {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('BufEnter', {
|
-- vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
callback = function(event)
|
-- callback = function(event)
|
||||||
local windows = vim.api.nvim_list_wins()
|
-- local windows = vim.api.nvim_list_wins()
|
||||||
|
--
|
||||||
for _, window in ipairs(windows) do
|
-- for _, window in ipairs(windows) do
|
||||||
local bufnr = vim.api.nvim_win_get_buf(window)
|
-- local bufnr = vim.api.nvim_win_get_buf(window)
|
||||||
local ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr })
|
-- local ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr })
|
||||||
if vim.api.nvim_get_option_value('buflisted', { buf = bufnr })
|
-- if vim.api.nvim_get_option_value('buflisted', { buf = bufnr })
|
||||||
or ft == 'oil'
|
-- or ft == 'oil'
|
||||||
or ft == 'snacks_dashboard' then
|
-- or ft == 'snacks_dashboard' then
|
||||||
return
|
-- return
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
vim.cmd 'qa'
|
-- vim.cmd 'qa'
|
||||||
end,
|
-- end,
|
||||||
})
|
-- })
|
||||||
|
|
||||||
local modes_group = vim.api.nvim_create_augroup('modes', { clear = true })
|
local modes_group = vim.api.nvim_create_augroup('modes', { clear = true })
|
||||||
vim.api.nvim_create_autocmd('FocusLost', {
|
vim.api.nvim_create_autocmd('FocusLost', {
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ vim.keymap.set('n', '<C-S-l>', '<C-w>L', { desc = 'Move window to the right' })
|
|||||||
vim.keymap.set('n', '<C-S-j>', '<C-w>J', { desc = 'Move window to the lower' })
|
vim.keymap.set('n', '<C-S-j>', '<C-w>J', { desc = 'Move window to the lower' })
|
||||||
vim.keymap.set('n', '<C-S-k>', '<C-w>K', { desc = 'Move window to the upper' })
|
vim.keymap.set('n', '<C-S-k>', '<C-w>K', { desc = 'Move window to the upper' })
|
||||||
|
|
||||||
vim.keymap.set('c', 'tn', 'tabnext<CR>', { desc = 'Next tab' })
|
vim.keymap.set('n', '<Leader>.', '<Cmd>tabnext<CR>', { desc = 'Next tab' })
|
||||||
vim.keymap.set('c', 'tp', 'tabprevious<CR>', { desc = 'Previous tab' })
|
vim.keymap.set('n', '<Leader>,', '<Cmd>tabprevious<CR>', { desc = 'Previous tab' })
|
||||||
|
|
||||||
-- Overriding CTRL mappings because some of them are stupid
|
-- Overriding CTRL mappings because some of them are stupid
|
||||||
vim.keymap.set({ 'n', 'v', 'c', 'i' }, '<C-S-B>', '<CMD>Git blame<CR>', { desc = 'Git blame' })
|
vim.keymap.set({ 'n', 'v', 'c', 'i' }, '<C-S-B>', '<CMD>Git blame<CR>', { desc = 'Git blame' })
|
||||||
@@ -98,6 +98,7 @@ vim.keymap.set('n', '<Leader>gp', '<CMD>Git push<CR>', { desc = 'Git push' })
|
|||||||
vim.keymap.set('n', '<Leader>gup', '<CMD>Git pull --rebase<CR>', { desc = 'Git pull --rebase' })
|
vim.keymap.set('n', '<Leader>gup', '<CMD>Git pull --rebase<CR>', { desc = 'Git pull --rebase' })
|
||||||
vim.keymap.set('n', '<Leader>gsb', '<CMD>Git status<CR>', { desc = 'Git status' })
|
vim.keymap.set('n', '<Leader>gsb', '<CMD>Git status<CR>', { desc = 'Git status' })
|
||||||
vim.keymap.set('n', '<Leader>gd', '<CMD>Git diff<CR>', { desc = 'Git diff' })
|
vim.keymap.set('n', '<Leader>gd', '<CMD>Git diff<CR>', { desc = 'Git diff' })
|
||||||
|
vim.keymap.set('n', '<Leader>gf', '<CMD>Git fetch<CR>', { desc = 'Git fetch' })
|
||||||
vim.keymap.set('n', '<Leader>gdc', '<CMD>Git diff --cached<CR>', { desc = 'Git diff' })
|
vim.keymap.set('n', '<Leader>gdc', '<CMD>Git diff --cached<CR>', { desc = 'Git diff' })
|
||||||
vim.keymap.set('n', '<Leader>gl', '<CMD>Git log<CR>', { desc = 'Git log' })
|
vim.keymap.set('n', '<Leader>gl', '<CMD>Git log<CR>', { desc = 'Git log' })
|
||||||
vim.keymap.set('n', '<Leader>gun', '<CMD>Git reset -- %<CR>', { desc = 'Git unstage file' })
|
vim.keymap.set('n', '<Leader>gun', '<CMD>Git reset -- %<CR>', { desc = 'Git unstage file' })
|
||||||
@@ -122,14 +123,18 @@ vim.api.nvim_create_autocmd('BufEnter', {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-- AI mappings
|
-- AI mappings
|
||||||
vim.keymap.set('v', '<Leader>ae', '<CMD>CodeCompanion<CR>', { desc = 'Edit selection with AI' })
|
vim.keymap.set('v', '<Leader>ae', '<CMD>CodeCompanion<CR>', { desc = 'Edit selection with AI' })
|
||||||
vim.keymap.set('n', '<Leader>ac', '<CMD>CodeCompanionCmd<CR>', { desc = 'Run Neovim commands with AI' })
|
vim.keymap.set('n', '<Leader>ac', '<CMD>CodeCompanionCmd<CR>', { desc = 'Run Neovim commands with AI' })
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = 'codecompanion',
|
pattern = 'codecompanion',
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.keymap.set('i', '<S-Enter>', '<CR>', { desc = 'Use shift enter to start a new line' })
|
vim.keymap.set('i', '<Enter>', function ()
|
||||||
vim.keymap.set('n', '<Enter>', 'G', { desc = 'Use enter in normal mode to go to the end of the chat' })
|
require('codecompanion').last_chat():submit()
|
||||||
|
end, { buffer = true, desc = 'Use shift enter to start a new line' })
|
||||||
|
vim.keymap.set('i', '<S-Enter>', '<Enter>', { buffer = true, desc = 'Use shift enter to start a new line' })
|
||||||
|
vim.keymap.set('n', '<Enter>', 'G', { buffer = true, desc = 'Use enter in normal mode to go to the end of the chat' })
|
||||||
|
|
||||||
local models = { 'gpt-4o', 'gemini-2.5-pro', 'gemini-2.0-flash', 'claude-3.7-sonnet-thinking', 'o3-mini' }
|
local models = { 'gpt-4o', 'gemini-2.5-pro', 'gemini-2.0-flash', 'claude-3.7-sonnet-thinking', 'o3-mini' }
|
||||||
-- Loop through models and create keymaps for each
|
-- Loop through models and create keymaps for each
|
||||||
|
|||||||
@@ -74,11 +74,6 @@ return {
|
|||||||
callback = require('vectorcode.integrations').codecompanion.chat.make_tool(),
|
callback = require('vectorcode.integrations').codecompanion.chat.make_tool(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
keymaps = {
|
|
||||||
send = {
|
|
||||||
modes = { i = '<Enter>' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
inline = {
|
inline = {
|
||||||
adapter = 'flash',
|
adapter = 'flash',
|
||||||
|
|||||||
@@ -87,7 +87,28 @@ return {
|
|||||||
|
|
||||||
-- You can provide additional configuration to the handlers,
|
-- You can provide additional configuration to the handlers,
|
||||||
-- see mason-nvim-dap README for more information
|
-- see mason-nvim-dap README for more information
|
||||||
handlers = {},
|
handlers = {
|
||||||
|
function(config)
|
||||||
|
require('mason-nvim-dap').default_setup(config)
|
||||||
|
end,
|
||||||
|
php = function(config)
|
||||||
|
config.configurations = {
|
||||||
|
{
|
||||||
|
type = 'php',
|
||||||
|
request = 'launch',
|
||||||
|
name = 'Listen for XDebug',
|
||||||
|
port = 9003,
|
||||||
|
log = true,
|
||||||
|
-- pathMappings = {
|
||||||
|
-- ['/var/www/html/'] = vim.fn.getcwd() .. '/',
|
||||||
|
-- },
|
||||||
|
hostname = '0.0.0.0',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
require('mason-nvim-dap').default_setup(config)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- You'll need to check that you have the required things installed
|
-- You'll need to check that you have the required things installed
|
||||||
-- online, please don't ask me how to install them :)
|
-- online, please don't ask me how to install them :)
|
||||||
@@ -110,9 +131,9 @@ return {
|
|||||||
name = 'Listen for XDebug',
|
name = 'Listen for XDebug',
|
||||||
port = 9003,
|
port = 9003,
|
||||||
log = true,
|
log = true,
|
||||||
pathMappings = {
|
-- pathMappings = {
|
||||||
['/var/www/html/'] = vim.fn.getcwd() .. '/',
|
-- ['/var/www/html/'] = vim.fn.getcwd() .. '/',
|
||||||
},
|
-- },
|
||||||
hostname = '0.0.0.0',
|
hostname = '0.0.0.0',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,6 +236,10 @@ return {
|
|||||||
languages = { 'vue' },
|
languages = { 'vue' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
preferences = {
|
||||||
|
importModuleSpecifierEnding = 'js',
|
||||||
|
importModuleSpecifierPreference = 'project-relative',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
},
|
},
|
||||||
@@ -250,6 +254,12 @@ return {
|
|||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
end,
|
end,
|
||||||
|
init_options = {
|
||||||
|
['language_server_phpstan.enabled'] = false,
|
||||||
|
['language_server_psalm.enabled'] = false,
|
||||||
|
['language_server_php_cs_fixer.enabled'] = true,
|
||||||
|
['language_server_php_cs_fixer.bin'] = '~/.composer/vendor/bin/php-cs-fixer',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
require('helpers').edit_cf('pt', '/lua/plugins/neotest.lua')
|
||||||
return {
|
return {
|
||||||
'nvim-neotest/neotest',
|
'nvim-neotest/neotest',
|
||||||
lazy = true,
|
lazy = true,
|
||||||
|
|||||||
@@ -1,12 +1,4 @@
|
|||||||
{
|
{
|
||||||
"Create doc block": {
|
|
||||||
"prefix": "/**",
|
|
||||||
"body": [
|
|
||||||
"/**",
|
|
||||||
" * $0",
|
|
||||||
" */"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"Dump function": {
|
"Dump function": {
|
||||||
"prefix": "du",
|
"prefix": "du",
|
||||||
"body": [
|
"body": [
|
||||||
@@ -20,5 +12,67 @@
|
|||||||
"\\PhpStan\\dumpType($0);"
|
"\\PhpStan\\dumpType($0);"
|
||||||
],
|
],
|
||||||
"description": "Dump PHPStan type"
|
"description": "Dump PHPStan type"
|
||||||
|
},
|
||||||
|
"Test case": {
|
||||||
|
"prefix": "test",
|
||||||
|
"body": [
|
||||||
|
"test($1, function () {",
|
||||||
|
" $0",
|
||||||
|
"});"
|
||||||
|
],
|
||||||
|
"description": "Test case"
|
||||||
|
},
|
||||||
|
"Create doc block": {
|
||||||
|
"prefix": "/**",
|
||||||
|
"body": [
|
||||||
|
"/**",
|
||||||
|
" * $0",
|
||||||
|
" */"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"DocBlock property": {
|
||||||
|
"prefix": "@p",
|
||||||
|
"body": "@property $1 $$0",
|
||||||
|
"description": "DocBlock property"
|
||||||
|
},
|
||||||
|
"DocBlock boolean property": {
|
||||||
|
"prefix": "@pb",
|
||||||
|
"body": "@property bool $$0",
|
||||||
|
"description": "DocBlock boolean property"
|
||||||
|
},
|
||||||
|
"DocBlock string property": {
|
||||||
|
"prefix": "@ps",
|
||||||
|
"body": "@property string $$0",
|
||||||
|
"description": "DocBlock string property"
|
||||||
|
},
|
||||||
|
"DocBlock int property": {
|
||||||
|
"prefix": "@pi",
|
||||||
|
"body": "@property int $$0",
|
||||||
|
"description": "DocBlock int property"
|
||||||
|
},
|
||||||
|
"DocBlock Collection property": {
|
||||||
|
"prefix": "@pc",
|
||||||
|
"body": "@property \\Illuminate\\Support\\Collection<int, $1> $$0",
|
||||||
|
"description": "DocBlock int property"
|
||||||
|
},
|
||||||
|
"DocBlock date property": {
|
||||||
|
"prefix": "@pd",
|
||||||
|
"body": "@property \\Illuminate\\Support\\Carbon $$0",
|
||||||
|
"description": "DocBlock date property"
|
||||||
|
},
|
||||||
|
"DocBlock model properties": {
|
||||||
|
"prefix": "@pp",
|
||||||
|
"body": [
|
||||||
|
"/**",
|
||||||
|
" * @property int $$id",
|
||||||
|
" * $1",
|
||||||
|
" * @property \\Illuminate\\Support\\Carbon $$created_at",
|
||||||
|
" * @property \\Illuminate\\Support\\Carbon $$updated_at",
|
||||||
|
" *",
|
||||||
|
" * Relationships",
|
||||||
|
" * $2",
|
||||||
|
" */"
|
||||||
|
],
|
||||||
|
"description": "DocBlock model properties"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user