Added some configs and plugins
This commit is contained in:
parent
b784632fff
commit
48c85c077c
106
init.lua
106
init.lua
|
@ -206,10 +206,10 @@ vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower win
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||||
|
|
||||||
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||||
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
vim.keymap.set('n', '<C-S-h>', '<C-w>H', { desc = 'Move window to the left' })
|
||||||
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
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' })
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See `:help lua-guide-autocommands`
|
-- See `:help lua-guide-autocommands`
|
||||||
|
@ -690,31 +690,14 @@ require('lazy').setup({
|
||||||
-- ts_ls = {},
|
-- ts_ls = {},
|
||||||
--
|
--
|
||||||
-- Vue 3
|
-- Vue 3
|
||||||
volar = {
|
--
|
||||||
|
vuels = {
|
||||||
|
filetypes = { 'vue', 'javascript', 'typescript' },
|
||||||
init_options = {
|
init_options = {
|
||||||
vue = {
|
config = {
|
||||||
hybridMode = false,
|
vetur = { -- For Vue 2 compatibility (optional)
|
||||||
},
|
validation = { template = true, script = true, style = true },
|
||||||
},
|
format = { enable = false }, -- Disable if using Prettier
|
||||||
settings = {
|
|
||||||
typescript = {
|
|
||||||
inlayHints = {
|
|
||||||
enumMemberValues = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
functionLikeReturnTypes = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
propertyDeclarationTypes = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
parameterTypes = {
|
|
||||||
enabled = true,
|
|
||||||
suppressWhenArgumentMatchesName = true,
|
|
||||||
},
|
|
||||||
variableTypes = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -732,9 +715,6 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
settings = {
|
settings = {
|
||||||
typescript = {
|
typescript = {
|
||||||
tsserver = {
|
|
||||||
useSyntaxServer = false,
|
|
||||||
},
|
|
||||||
inlayHints = {
|
inlayHints = {
|
||||||
includeInlayParameterNameHints = 'all',
|
includeInlayParameterNameHints = 'all',
|
||||||
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
|
||||||
|
@ -747,6 +727,7 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||||
},
|
},
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = { ... },
|
-- cmd = { ... },
|
||||||
|
@ -765,6 +746,10 @@ require('lazy').setup({
|
||||||
|
|
||||||
-- python lsp
|
-- python lsp
|
||||||
pyright = {},
|
pyright = {},
|
||||||
|
-- CSS/SCSS LSP
|
||||||
|
cssls = {
|
||||||
|
filetypes = { 'css', 'scss', 'sass' },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Ensure the servers and tools above are installed
|
-- Ensure the servers and tools above are installed
|
||||||
|
@ -784,10 +769,16 @@ require('lazy').setup({
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'stylua', -- Used to format Lua code
|
'stylua', -- Used to format Lua code
|
||||||
})
|
})
|
||||||
|
vim.filetype.add {
|
||||||
|
extension = {
|
||||||
|
vue = 'vue',
|
||||||
|
},
|
||||||
|
}
|
||||||
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
||||||
|
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
ensure_installed = { 'vuels', 'lua_ls' }, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
|
||||||
|
automatic_enable = true,
|
||||||
automatic_installation = false,
|
automatic_installation = false,
|
||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
|
@ -839,7 +830,7 @@ require('lazy').setup({
|
||||||
-- python = { "isort", "black" },
|
-- python = { "isort", "black" },
|
||||||
--
|
--
|
||||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
-- javascript = { 'prettierd', 'prettier', stop_after_first = true },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -866,16 +857,18 @@ require('lazy').setup({
|
||||||
-- `friendly-snippets` contains a variety of premade snippets.
|
-- `friendly-snippets` contains a variety of premade snippets.
|
||||||
-- See the README about individual language/framework/plugin snippets:
|
-- See the README about individual language/framework/plugin snippets:
|
||||||
-- https://github.com/rafamadriz/friendly-snippets
|
-- https://github.com/rafamadriz/friendly-snippets
|
||||||
{
|
-- {
|
||||||
'rafamadriz/friendly-snippets',
|
-- 'rafamadriz/friendly-snippets',
|
||||||
config = function()
|
-- config = function()
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
-- require('luasnip.loaders.from_vscode').lazy_load()
|
||||||
end,
|
-- end,
|
||||||
},
|
-- },
|
||||||
},
|
},
|
||||||
opts = {},
|
opts = {},
|
||||||
},
|
},
|
||||||
'folke/lazydev.nvim',
|
'folke/lazydev.nvim',
|
||||||
|
-- custom deps
|
||||||
|
'Kaiser-Yang/blink-cmp-avante',
|
||||||
},
|
},
|
||||||
--- @module 'blink.cmp'
|
--- @module 'blink.cmp'
|
||||||
--- @type blink.cmp.Config
|
--- @type blink.cmp.Config
|
||||||
|
@ -911,6 +904,7 @@ require('lazy').setup({
|
||||||
else
|
else
|
||||||
return cmp.select_and_accept()
|
return cmp.select_and_accept()
|
||||||
end
|
end
|
||||||
|
vim.api.nvim_command '<Esc>'
|
||||||
end,
|
end,
|
||||||
'snippet_forward',
|
'snippet_forward',
|
||||||
'fallback',
|
'fallback',
|
||||||
|
@ -936,9 +930,16 @@ require('lazy').setup({
|
||||||
},
|
},
|
||||||
|
|
||||||
sources = {
|
sources = {
|
||||||
default = { 'lsp', 'path', 'snippets', 'lazydev' },
|
default = { 'lsp', 'path', 'snippets', 'lazydev', 'avante' },
|
||||||
providers = {
|
providers = {
|
||||||
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
lazydev = { module = 'lazydev.integrations.blink', score_offset = 100 },
|
||||||
|
avante = {
|
||||||
|
module = 'blink-cmp-avante',
|
||||||
|
name = 'Avante',
|
||||||
|
opts = {
|
||||||
|
-- options for blink-cmp-avante
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1011,6 +1012,7 @@ require('lazy').setup({
|
||||||
-- // custom mini plugins
|
-- // custom mini plugins
|
||||||
--
|
--
|
||||||
require('mini.starter').setup()
|
require('mini.starter').setup()
|
||||||
|
-- require('mini.bufremove').setup()
|
||||||
|
|
||||||
-- Simple and easy statusline.
|
-- Simple and easy statusline.
|
||||||
-- You could remove this setup call if you don't like it,
|
-- You could remove this setup call if you don't like it,
|
||||||
|
@ -1037,7 +1039,24 @@ require('lazy').setup({
|
||||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
ensure_installed = {
|
||||||
|
'bash',
|
||||||
|
'c',
|
||||||
|
'diff',
|
||||||
|
'html',
|
||||||
|
'lua',
|
||||||
|
'luadoc',
|
||||||
|
'markdown',
|
||||||
|
'markdown_inline',
|
||||||
|
'query',
|
||||||
|
'vim',
|
||||||
|
'vimdoc',
|
||||||
|
'html',
|
||||||
|
'javascript',
|
||||||
|
'typescript',
|
||||||
|
'tsx',
|
||||||
|
'vue',
|
||||||
|
},
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
@ -1048,6 +1067,9 @@ require('lazy').setup({
|
||||||
additional_vim_regex_highlighting = { 'ruby' },
|
additional_vim_regex_highlighting = { 'ruby' },
|
||||||
},
|
},
|
||||||
indent = { enable = true, disable = { 'ruby' } },
|
indent = { enable = true, disable = { 'ruby' } },
|
||||||
|
autotag = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
-- There are additional nvim-treesitter modules that you can use to interact
|
-- There are additional nvim-treesitter modules that you can use to interact
|
||||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||||
|
@ -1069,9 +1091,9 @@ require('lazy').setup({
|
||||||
-- require 'kickstart.plugins.debug',
|
-- require 'kickstart.plugins.debug',
|
||||||
require 'kickstart.plugins.indent_line',
|
require 'kickstart.plugins.indent_line',
|
||||||
require 'kickstart.plugins.lint',
|
require 'kickstart.plugins.lint',
|
||||||
require 'kickstart.plugins.autopairs',
|
|
||||||
require 'kickstart.plugins.neo-tree',
|
require 'kickstart.plugins.neo-tree',
|
||||||
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||||
|
require 'kickstart.plugins.nvim-ts-autotag', -- adds nvim-ts-autotag
|
||||||
|
|
||||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||||
-- This is the easiest way to modularize your config.
|
-- This is the easiest way to modularize your config.
|
||||||
|
|
|
@ -3,17 +3,12 @@
|
||||||
vim.keymap.set('i', 'jk', '<Esc>', { desc = 'escape' })
|
vim.keymap.set('i', 'jk', '<Esc>', { desc = 'escape' })
|
||||||
vim.keymap.set('i', 'kj', '<Esc>', { desc = 'escape' })
|
vim.keymap.set('i', 'kj', '<Esc>', { desc = 'escape' })
|
||||||
|
|
||||||
-- Перемещение между буферами
|
|
||||||
vim.keymap.set('n', '<Tab>', '<Cmd>BufferLineCycleNext<CR>')
|
|
||||||
vim.keymap.set('n', '<S-Tab>', '<Cmd>BufferLineCyclePrev<CR>')
|
|
||||||
|
|
||||||
vim.keymap.set('n', ',,', '<Cmd>ToggleTerm<CR>', { desc = 'Open terminal in horizontal split' })
|
vim.keymap.set('n', ',,', '<Cmd>ToggleTerm<CR>', { desc = 'Open terminal in horizontal split' })
|
||||||
vim.keymap.set('t', ',,', '<Cmd>ToggleTerm<CR>', { desc = 'Open terminal in horizontal split' })
|
vim.keymap.set('t', ',,', '<Cmd>ToggleTerm<CR>', { desc = 'Open terminal in horizontal split' })
|
||||||
|
|
||||||
-- Закрыть буфер
|
-- vim.keymap.set('n', '<C-q>', '<Cmd>bdelete<CR>')
|
||||||
vim.keymap.set('n', '<C-q>', '<Cmd>bdelete<CR>')
|
|
||||||
|
|
||||||
-- Переход к буферу по номеру (например, Alt+1, Alt+2...)
|
-- Change buffer by number (example Alt+1, Alt+2...)
|
||||||
for i = 1, 9 do
|
for i = 1, 9 do
|
||||||
vim.keymap.set('n', '<M-' .. i .. '>', '<Cmd>BufferLineGoToBuffer ' .. i .. '<CR>')
|
vim.keymap.set('n', '<M-' .. i .. '>', '<Cmd>BufferLineGoToBuffer ' .. i .. '<CR>')
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,27 +7,15 @@ return {
|
||||||
|
|
||||||
event = 'VeryLazy',
|
event = 'VeryLazy',
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>bp', '<Cmd>BufferLineTogglePin<CR>', desc = 'Toggle Pin' },
|
{ '<S-h>', '<cmd>BufferLineCyclePrev<cr>', desc = 'Prev Buffer' },
|
||||||
{ '<leader>bP', '<Cmd>BufferLineGroupClose ungrouped<CR>', desc = 'Delete Non-Pinned Buffers' },
|
{ '<S-l>', '<cmd>BufferLineCycleNext<cr>', desc = 'Next Buffer' },
|
||||||
{ '<leader>br', '<Cmd>BufferLineCloseRight<CR>', desc = 'Delete Buffers to the Right' },
|
|
||||||
{ '<leader>bl', '<Cmd>BufferLineCloseLeft<CR>', desc = 'Delete Buffers to the Left' },
|
|
||||||
{ '<S-j>', '<cmd>BufferLineCyclePrev<cr>', desc = 'Prev Buffer' },
|
|
||||||
{ '<S-k>', '<cmd>BufferLineCycleNext<cr>', desc = 'Next Buffer' },
|
|
||||||
{ '<S-C-j>', '<cmd>BufferLineMovePrev<cr>', desc = 'Move buffer prev' },
|
{ '<S-C-j>', '<cmd>BufferLineMovePrev<cr>', desc = 'Move buffer prev' },
|
||||||
{ '<S-C-k>', '<cmd>BufferLineMoveNext<cr>', desc = 'Move buffer next' },
|
{ '<S-C-k>', '<cmd>BufferLineMoveNext<cr>', desc = 'Move buffer next' },
|
||||||
{ '[b', '<cmd>BufferLineCyclePrev<cr>', desc = 'Prev Buffer' },
|
|
||||||
{ ']b', '<cmd>BufferLineCycleNext<cr>', desc = 'Next Buffer' },
|
|
||||||
{ '[B', '<cmd>BufferLineMovePrev<cr>', desc = 'Move buffer prev' },
|
|
||||||
{ ']B', '<cmd>BufferLineMoveNext<cr>', desc = 'Move buffer next' },
|
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
-- stylua: ignore
|
|
||||||
-- // close_command = require('bufdelete').bufdelete,
|
|
||||||
-- stylua: ignore
|
|
||||||
-- // right_mouse_command = require('bufdelete').bufdelete,
|
|
||||||
diagnostics = 'nvim_lsp',
|
diagnostics = 'nvim_lsp',
|
||||||
always_show_bufferline = false,
|
always_show_bufferline = true,
|
||||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||||
local icon = level:match 'error' and ' ' or ' '
|
local icon = level:match 'error' and ' ' or ' '
|
||||||
return ' ' .. icon .. count
|
return ' ' .. icon .. count
|
||||||
|
@ -47,17 +35,6 @@ return {
|
||||||
color_icons = true,
|
color_icons = true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
|
||||||
require('bufferline').setup(opts)
|
|
||||||
-- Fix bufferline when restoring a session
|
|
||||||
vim.api.nvim_create_autocmd({ 'BufAdd', 'BufDelete' }, {
|
|
||||||
callback = function()
|
|
||||||
vim.schedule(function()
|
|
||||||
pcall(nvim_bufferline)
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'mattn/emmet-vim',
|
'mattn/emmet-vim',
|
||||||
|
@ -67,28 +44,13 @@ return {
|
||||||
event = 'VeryLazy',
|
event = 'VeryLazy',
|
||||||
version = false, -- Never set this value to "*"! Never!
|
version = false, -- Never set this value to "*"! Never!
|
||||||
opts = {
|
opts = {
|
||||||
provider = 'openrouter',
|
provider = 'deepseek',
|
||||||
vendors = {
|
providers = {
|
||||||
openai = {
|
|
||||||
endpoint = 'https://api.openai.com/v1',
|
|
||||||
model = 'gpt-4o', -- your desired model (or use gpt-4o, etc.)
|
|
||||||
timeout = 30000, -- Timeout in milliseconds, increase this for reasoning models
|
|
||||||
temperature = 0,
|
|
||||||
max_completion_tokens = 8192, -- Increase this to include reasoning tokens (for reasoning models)
|
|
||||||
--reasoning_effort = "medium", -- low|medium|high, only used for reasoning models
|
|
||||||
},
|
|
||||||
deepseek = {
|
deepseek = {
|
||||||
__inherited_from = 'openai',
|
__inherited_from = 'openai',
|
||||||
api_key_name = 'DEEPSEEK_API_KEY',
|
api_key_name = 'DEEPSEEK_API_KEY',
|
||||||
api_endpoint = 'https://api.deepseek.com',
|
endpoint = 'https://api.deepseek.com',
|
||||||
model = 'deepseek-coder',
|
model = 'deepseek-coder',
|
||||||
max_tokens = 200,
|
|
||||||
},
|
|
||||||
openrouter = {
|
|
||||||
__inherited_from = 'openai',
|
|
||||||
endpoint = 'https://openrouter.ai/api/v1',
|
|
||||||
api_key_name = 'OPENROUTER_API_KEY',
|
|
||||||
model = 'mistralai/mistral-7b-instruct:free',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -136,4 +98,25 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ 'akinsho/toggleterm.nvim', version = '*', opts = {} },
|
{ 'akinsho/toggleterm.nvim', version = '*', opts = {} },
|
||||||
|
{
|
||||||
|
'antosha417/nvim-lsp-file-operations',
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
-- Uncomment whichever supported plugin(s) you use
|
||||||
|
-- "nvim-tree/nvim-tree.lua",
|
||||||
|
'nvim-neo-tree/neo-tree.nvim',
|
||||||
|
-- "simonmclean/triptych.nvim"
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('lsp-file-operations').setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
dependencies = {
|
||||||
|
-- Add nvim-ts-autotag
|
||||||
|
{ 'windwp/nvim-ts-autotag' },
|
||||||
|
},
|
||||||
|
opts = {},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
-- autopairs
|
|
||||||
-- https://github.com/windwp/nvim-autopairs
|
|
||||||
|
|
||||||
return {
|
|
||||||
'windwp/nvim-autopairs',
|
|
||||||
event = 'InsertEnter',
|
|
||||||
opts = {},
|
|
||||||
}
|
|
|
@ -45,7 +45,7 @@ return {
|
||||||
['<C-cr>'] = {
|
['<C-cr>'] = {
|
||||||
'open',
|
'open',
|
||||||
config = {
|
config = {
|
||||||
open_command = 'tabnew', -- Альтернативный вариант параметра
|
open_command = 'tabnew',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
['oa'] = 'avante_add_files',
|
['oa'] = 'avante_add_files',
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
|
event = 'InsertEnter',
|
||||||
|
opts = {},
|
||||||
|
}
|
Loading…
Reference in New Issue