From 48c85c077cc0efd07c36ef1c5aa53dc01c54e8cf Mon Sep 17 00:00:00 2001 From: lootboxer <> Date: Tue, 22 Jul 2025 03:09:47 +0300 Subject: [PATCH] Added some configs and plugins --- init.lua | 106 +++++++++++++--------- lua/custom/keybindings.lua | 9 +- lua/custom/plugins/init.lua | 71 ++++++--------- lua/kickstart/plugins/autopairs.lua | 8 -- lua/kickstart/plugins/neo-tree.lua | 2 +- lua/kickstart/plugins/nvim-ts-autotag.lua | 5 + 6 files changed, 99 insertions(+), 102 deletions(-) delete mode 100644 lua/kickstart/plugins/autopairs.lua create mode 100644 lua/kickstart/plugins/nvim-ts-autotag.lua diff --git a/init.lua b/init.lua index 08a63a5c..04c183f1 100644 --- a/init.lua +++ b/init.lua @@ -206,10 +206,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the lower win vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes --- vim.keymap.set("n", "", "H", { desc = "Move window to the left" }) --- vim.keymap.set("n", "", "L", { desc = "Move window to the right" }) --- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) --- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +vim.keymap.set('n', '', 'H', { desc = 'Move window to the left' }) +vim.keymap.set('n', '', 'L', { desc = 'Move window to the right' }) +vim.keymap.set('n', '', 'J', { desc = 'Move window to the lower' }) +vim.keymap.set('n', '', 'K', { desc = 'Move window to the upper' }) -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -690,31 +690,14 @@ require('lazy').setup({ -- ts_ls = {}, -- -- Vue 3 - volar = { + -- + vuels = { + filetypes = { 'vue', 'javascript', 'typescript' }, init_options = { - vue = { - hybridMode = false, - }, - }, - settings = { - typescript = { - inlayHints = { - enumMemberValues = { - enabled = true, - }, - functionLikeReturnTypes = { - enabled = true, - }, - propertyDeclarationTypes = { - enabled = true, - }, - parameterTypes = { - enabled = true, - suppressWhenArgumentMatchesName = true, - }, - variableTypes = { - enabled = true, - }, + config = { + vetur = { -- For Vue 2 compatibility (optional) + validation = { template = true, script = true, style = true }, + format = { enable = false }, -- Disable if using Prettier }, }, }, @@ -732,9 +715,6 @@ require('lazy').setup({ }, settings = { typescript = { - tsserver = { - useSyntaxServer = false, - }, inlayHints = { includeInlayParameterNameHints = 'all', includeInlayParameterNameHintsWhenArgumentMatchesName = true, @@ -747,6 +727,7 @@ require('lazy').setup({ }, }, }, + filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, }, lua_ls = { -- cmd = { ... }, @@ -765,6 +746,10 @@ require('lazy').setup({ -- python lsp pyright = {}, + -- CSS/SCSS LSP + cssls = { + filetypes = { 'css', 'scss', 'sass' }, + }, } -- Ensure the servers and tools above are installed @@ -784,10 +769,16 @@ require('lazy').setup({ vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code }) + vim.filetype.add { + extension = { + vue = 'vue', + }, + } require('mason-tool-installer').setup { ensure_installed = ensure_installed } 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, handlers = { function(server_name) @@ -839,7 +830,7 @@ require('lazy').setup({ -- python = { "isort", "black" }, -- -- 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. -- See the README about individual language/framework/plugin snippets: -- https://github.com/rafamadriz/friendly-snippets - { - 'rafamadriz/friendly-snippets', - config = function() - require('luasnip.loaders.from_vscode').lazy_load() - end, - }, + -- { + -- 'rafamadriz/friendly-snippets', + -- config = function() + -- require('luasnip.loaders.from_vscode').lazy_load() + -- end, + -- }, }, opts = {}, }, 'folke/lazydev.nvim', + -- custom deps + 'Kaiser-Yang/blink-cmp-avante', }, --- @module 'blink.cmp' --- @type blink.cmp.Config @@ -911,6 +904,7 @@ require('lazy').setup({ else return cmp.select_and_accept() end + vim.api.nvim_command '' end, 'snippet_forward', 'fallback', @@ -936,9 +930,16 @@ require('lazy').setup({ }, sources = { - default = { 'lsp', 'path', 'snippets', 'lazydev' }, + default = { 'lsp', 'path', 'snippets', 'lazydev', 'avante' }, providers = { 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 -- require('mini.starter').setup() + -- require('mini.bufremove').setup() -- Simple and easy statusline. -- 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 -- [[ Configure Treesitter ]] See `:help nvim-treesitter` 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 auto_install = true, highlight = { @@ -1048,6 +1067,9 @@ require('lazy').setup({ additional_vim_regex_highlighting = { 'ruby' }, }, indent = { enable = true, disable = { 'ruby' } }, + autotag = { + enabled = true, + }, }, -- 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: @@ -1069,9 +1091,9 @@ require('lazy').setup({ -- require 'kickstart.plugins.debug', require 'kickstart.plugins.indent_line', require 'kickstart.plugins.lint', - require 'kickstart.plugins.autopairs', require 'kickstart.plugins.neo-tree', 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` -- This is the easiest way to modularize your config. diff --git a/lua/custom/keybindings.lua b/lua/custom/keybindings.lua index ebefc21f..e5be4a4f 100644 --- a/lua/custom/keybindings.lua +++ b/lua/custom/keybindings.lua @@ -3,17 +3,12 @@ vim.keymap.set('i', 'jk', '', { desc = 'escape' }) vim.keymap.set('i', 'kj', '', { desc = 'escape' }) --- Перемещение между буферами -vim.keymap.set('n', '', 'BufferLineCycleNext') -vim.keymap.set('n', '', 'BufferLineCyclePrev') - vim.keymap.set('n', ',,', 'ToggleTerm', { desc = 'Open terminal in horizontal split' }) vim.keymap.set('t', ',,', 'ToggleTerm', { desc = 'Open terminal in horizontal split' }) --- Закрыть буфер -vim.keymap.set('n', '', 'bdelete') +-- vim.keymap.set('n', '', 'bdelete') --- Переход к буферу по номеру (например, Alt+1, Alt+2...) +-- Change buffer by number (example Alt+1, Alt+2...) for i = 1, 9 do vim.keymap.set('n', '', 'BufferLineGoToBuffer ' .. i .. '') end diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 158dd1cc..26d81232 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -7,27 +7,15 @@ return { event = 'VeryLazy', keys = { - { 'bp', 'BufferLineTogglePin', desc = 'Toggle Pin' }, - { 'bP', 'BufferLineGroupClose ungrouped', desc = 'Delete Non-Pinned Buffers' }, - { 'br', 'BufferLineCloseRight', desc = 'Delete Buffers to the Right' }, - { 'bl', 'BufferLineCloseLeft', desc = 'Delete Buffers to the Left' }, - { '', 'BufferLineCyclePrev', desc = 'Prev Buffer' }, - { '', 'BufferLineCycleNext', desc = 'Next Buffer' }, + { '', 'BufferLineCyclePrev', desc = 'Prev Buffer' }, + { '', 'BufferLineCycleNext', desc = 'Next Buffer' }, { '', 'BufferLineMovePrev', desc = 'Move buffer prev' }, { '', 'BufferLineMoveNext', desc = 'Move buffer next' }, - { '[b', 'BufferLineCyclePrev', desc = 'Prev Buffer' }, - { ']b', 'BufferLineCycleNext', desc = 'Next Buffer' }, - { '[B', 'BufferLineMovePrev', desc = 'Move buffer prev' }, - { ']B', 'BufferLineMoveNext', desc = 'Move buffer next' }, }, opts = { options = { - -- stylua: ignore - -- // close_command = require('bufdelete').bufdelete, - -- stylua: ignore - -- // right_mouse_command = require('bufdelete').bufdelete, diagnostics = 'nvim_lsp', - always_show_bufferline = false, + always_show_bufferline = true, diagnostics_indicator = function(count, level, diagnostics_dict, context) local icon = level:match 'error' and ' ' or ' ' return ' ' .. icon .. count @@ -47,17 +35,6 @@ return { 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', @@ -67,28 +44,13 @@ return { event = 'VeryLazy', version = false, -- Never set this value to "*"! Never! opts = { - provider = 'openrouter', - vendors = { - 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 - }, + provider = 'deepseek', + providers = { deepseek = { __inherited_from = 'openai', api_key_name = 'DEEPSEEK_API_KEY', - api_endpoint = 'https://api.deepseek.com', + endpoint = 'https://api.deepseek.com', 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 = {} }, + { + '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 = {}, + }, } diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua deleted file mode 100644 index 386d392e..00000000 --- a/lua/kickstart/plugins/autopairs.lua +++ /dev/null @@ -1,8 +0,0 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - -return { - 'windwp/nvim-autopairs', - event = 'InsertEnter', - opts = {}, -} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index b4d2a10b..34ce6c5a 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -45,7 +45,7 @@ return { [''] = { 'open', config = { - open_command = 'tabnew', -- Альтернативный вариант параметра + open_command = 'tabnew', }, }, ['oa'] = 'avante_add_files', diff --git a/lua/kickstart/plugins/nvim-ts-autotag.lua b/lua/kickstart/plugins/nvim-ts-autotag.lua new file mode 100644 index 00000000..3272de25 --- /dev/null +++ b/lua/kickstart/plugins/nvim-ts-autotag.lua @@ -0,0 +1,5 @@ +return { + 'windwp/nvim-ts-autotag', + event = 'InsertEnter', + opts = {}, +}