pull/1661/merge
Lootboxer 2 days ago committed by GitHub
commit 0aa64b6bb3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -84,14 +84,17 @@ I hope you enjoy your Neovim journey,
P.S. You can delete this when you're done too. It's your config now! :)
--]]
-- Custom config.
require 'custom.keybindings'
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
vim.g.mapleader = ';'
vim.g.maplocalleader = ';'
-- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false
vim.g.have_nerd_font = true
-- [[ Setting options ]]
-- See `:help vim.o`
@ -110,6 +113,9 @@ vim.o.mouse = 'a'
-- Don't show the mode, since it's already in the status line
vim.o.showmode = false
-- Disable swapfiles
vim.opt.swapfile = false -- Disable .swp files
-- Sync clipboard between OS and Neovim.
-- Schedule the setting after `UiEnter` because it can increase startup-time.
-- Remove this option if you want your OS clipboard to remain independent.
@ -200,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' })
-- 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-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-k>", "<C-w>K", { desc = "Move window to the upper" })
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-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' })
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
@ -672,9 +678,9 @@ require('lazy').setup({
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = {
-- clangd = {},
-- gopls = {},
gopls = {},
-- pyright = {},
-- rust_analyzer = {},
rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful:
@ -683,7 +689,46 @@ require('lazy').setup({
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
--
-- Vue 3
--
vuels = {
filetypes = { 'vue', 'javascript', 'typescript' },
init_options = {
config = {
vetur = { -- For Vue 2 compatibility (optional)
validation = { template = true, script = true, style = true },
format = { enable = false }, -- Disable if using Prettier
},
},
},
},
-- TypeScript
ts_ls = {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server',
languages = { 'vue' },
},
},
},
settings = {
typescript = {
inlayHints = {
includeInlayParameterNameHints = 'all',
includeInlayParameterNameHintsWhenArgumentMatchesName = true,
includeInlayFunctionParameterTypeHints = true,
includeInlayVariableTypeHints = true,
includeInlayVariableTypeHintsWhenTypeMatchesName = true,
includeInlayPropertyDeclarationTypeHints = true,
includeInlayFunctionLikeReturnTypeHints = true,
includeInlayEnumMemberValueHints = true,
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
},
lua_ls = {
-- cmd = { ... },
-- filetypes = { ... },
@ -698,6 +743,13 @@ require('lazy').setup({
},
},
},
-- python lsp
pyright = {},
-- CSS/SCSS LSP
cssls = {
filetypes = { 'css', 'scss', 'sass' },
},
}
-- Ensure the servers and tools above are installed
@ -717,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)
@ -772,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 },
},
},
},
@ -809,6 +867,8 @@ require('lazy').setup({
opts = {},
},
'folke/lazydev.nvim',
-- custom deps
'Kaiser-Yang/blink-cmp-avante',
},
--- @module 'blink.cmp'
--- @type blink.cmp.Config
@ -837,6 +897,19 @@ require('lazy').setup({
-- See :h blink-cmp-config-keymap for defining your own keymap
preset = 'default',
['<Tab>'] = {
function(cmp)
if cmp.snippet_active() then
return cmp.accept()
else
return cmp.select_and_accept()
end
vim.api.nvim_command '<Esc>'
end,
'snippet_forward',
'fallback',
},
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
@ -851,12 +924,22 @@ require('lazy').setup({
-- By default, you may press `<c-space>` to show the documentation.
-- Optionally, set `auto_show = true` to show the documentation after a delay.
documentation = { auto_show = false, auto_show_delay_ms = 500 },
ghost_text = {
enabled = true,
},
},
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
},
},
},
},
@ -917,7 +1000,19 @@ require('lazy').setup({
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()
require('mini.surround').setup {
custom_surroundings = {
[')'] = { output = { left = '( ', right = ' )' } },
['('] = { output = { left = '(', right = ')' } },
['{'] = { output = { left = '{\n', right = '\n}' } },
['['] = { output = { left = '[', right = ']' } },
},
}
-- // 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,
@ -944,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 = {
@ -955,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:
@ -974,17 +1089,17 @@ require('lazy').setup({
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
--
-- 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.indent_line',
require 'kickstart.plugins.lint',
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.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!

@ -0,0 +1,14 @@
-- Custom Keybinds.
vim.keymap.set('i', 'jk', '<Esc>', { desc = 'escape' })
vim.keymap.set('i', 'kj', '<Esc>', { desc = 'escape' })
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('n', '<C-q>', '<Cmd>bdelete<CR>')
-- Change buffer by number (example Alt+1, Alt+2...)
for i = 1, 9 do
vim.keymap.set('n', '<M-' .. i .. '>', '<Cmd>BufferLineGoToBuffer ' .. i .. '<CR>')
end

@ -1,5 +1,122 @@
-- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
{
'akinsho/bufferline.nvim',
dependencies = 'nvim-tree/nvim-web-devicons',
event = 'VeryLazy',
keys = {
{ '<S-h>', '<cmd>BufferLineCyclePrev<cr>', desc = 'Prev Buffer' },
{ '<S-l>', '<cmd>BufferLineCycleNext<cr>', desc = 'Next Buffer' },
{ '<S-C-j>', '<cmd>BufferLineMovePrev<cr>', desc = 'Move buffer prev' },
{ '<S-C-k>', '<cmd>BufferLineMoveNext<cr>', desc = 'Move buffer next' },
},
opts = {
options = {
diagnostics = 'nvim_lsp',
always_show_bufferline = true,
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local icon = level:match 'error' and '' or ''
return ' ' .. icon .. count
end,
offsets = {
{
filetype = 'neo-tree',
text = 'Neo-tree',
highlight = 'Directory',
text_align = 'left',
},
{
filetype = 'snacks_layout_box',
},
},
show_buffer_icons = true,
color_icons = true,
},
},
},
{
'mattn/emmet-vim',
},
{
'yetone/avante.nvim',
event = 'VeryLazy',
version = false, -- Never set this value to "*"! Never!
opts = {
provider = 'deepseek',
providers = {
deepseek = {
__inherited_from = 'openai',
api_key_name = 'DEEPSEEK_API_KEY',
endpoint = 'https://api.deepseek.com',
model = 'deepseek-coder',
},
},
},
-- if you want to build from source then do `make BUILD_FROM_SOURCE=true`
build = 'make',
-- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows
dependencies = {
'nvim-treesitter/nvim-treesitter',
'stevearc/dressing.nvim',
'nvim-lua/plenary.nvim',
'MunifTanjim/nui.nvim',
--- The below dependencies are optional,
'echasnovski/mini.pick', -- for file_selector provider mini.pick
'nvim-telescope/telescope.nvim', -- for file_selector provider telescope
'hrsh7th/nvim-cmp', -- autocompletion for avante commands and mentions
-- 'ibhagwan/fzf-lua', -- for file_selector provider fzf
-- 'nvim-tree/nvim-web-devicons', -- or echasnovski/mini.icons
'echasnovski/mini.icons', -- or echasnovski/mini.icons
-- 'zbirenbaum/copilot.lua', -- for providers='copilot'
-- {
-- -- support for image pasting
-- 'HakonHarnes/img-clip.nvim',
-- event = 'VeryLazy',
-- opts = {
-- -- recommended settings
-- default = {
-- embed_image_as_base64 = false,
-- prompt_for_file_name = false,
-- drag_and_drop = {
-- insert_mode = true,
-- },
-- -- required for Windows users
-- use_absolute_path = true,
-- },
-- },
-- },
{
-- Make sure to set this up properly if you have lazy=true
'MeanderingProgrammer/render-markdown.nvim',
opts = {
file_types = { 'markdown', 'Avante' },
},
ft = { 'markdown', 'Avante' },
},
},
},
{ '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 = {},
}

@ -11,13 +11,44 @@ return {
},
lazy = false,
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
{ '<leader>e', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
},
opts = {
filesystem = {
bind_to_cwd = true,
commands = {
avante_add_files = function(state)
local node = state.tree:get_node()
local filepath = node:get_id()
local relative_path = require('avante.utils').relative_path(filepath)
local sidebar = require('avante').get()
local open = sidebar:is_open()
-- ensure avante sidebar is open
if not open then
require('avante.api').ask()
sidebar = require('avante').get()
end
sidebar.file_selector:add_selected_file(relative_path)
-- remove neo tree buffer
if not open then
sidebar.file_selector:remove_selected_file 'neo-tree filesystem [1]'
end
end,
},
window = {
mappings = {
['\\'] = 'close_window',
['<leader>e'] = 'close_window',
['<C-cr>'] = {
'open',
config = {
open_command = 'tabnew',
},
},
['oa'] = 'avante_add_files',
},
},
},

@ -0,0 +1,5 @@
return {
'windwp/nvim-ts-autotag',
event = 'InsertEnter',
opts = {},
}
Loading…
Cancel
Save