feat: use different .dtfiles config setup

This commit is contained in:
2023-10-11 15:52:30 +02:00
parent 6b431704de
commit b755d66571
175 changed files with 268 additions and 3596 deletions

View File

@ -0,0 +1,91 @@
local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local config_group = augroup("Config", {})
autocmd({ "TextYankPost" }, {
group = config_group,
callback = function()
vim.highlight.on_yank()
end,
})
autocmd({ "BufReadPost" }, {
group = config_group,
callback = function()
vim.cmd("filetype detect")
end,
})
autocmd('FileType', {
callback = function(tbl)
local set_offset = require('bufferline.api').set_offset
local bufwinid
local last_width
local _autocmd = vim.api.nvim_create_autocmd('WinScrolled', {
callback = function()
bufwinid = bufwinid or vim.fn.bufwinid(tbl.buf)
local width = vim.api.nvim_win_get_width(bufwinid)
if width ~= last_width then
set_offset(width, '')
last_width = width
end
end,
})
vim.api.nvim_create_autocmd('BufWipeout', {
buffer = tbl.buf,
callback = function()
vim.api.nvim_del_autocmd(_autocmd)
set_offset(0)
end,
once = true,
})
end,
pattern = 'neo-tree', -- or any other filetree's `ft`
})
local save_fold = augroup("Persistent Folds", { clear = true })
autocmd({ "BufWinLeave" }, {
pattern = "*.*",
callback = function()
vim.cmd.mkview()
end,
group = save_fold,
})
autocmd({ "BufReadPost" }, {
pattern = "*.http",
callback = function()
vim.bo.filetype = "http"
end,
group = save_fold,
})
autocmd({ "BufWinEnter" }, {
pattern = "*.*",
callback = function()
vim.cmd.loadview({ mods = { emsg_silent = true } })
end,
group = save_fold,
})
vim.cmd([[
augroup filetypedetect
au BufNewFile,BufRead *.frag setl ft=glsl
au BufNewFile,BufRead *.vert setl ft=glsl
au BufNewFile,BufRead tsconfig.json setl ft=jsonc
augroup END
]])
autocmd("BufReadPost", {
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})

View File

@ -0,0 +1,12 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)

View File

@ -0,0 +1,145 @@
local map = vim.keymap.set
local opts = { noremap = true, silent = true }
-- Set Leader key
vim.g.mapleader = " "
-- Telescope
map("n", "<C-o>", ":Telescope find_files preview={timeout=1000}<CR>", opts)
map("n", "<C-f>", ":Telescope live_grep<CR>", opts)
map("n", "<leader>o", ":Telescope buffers<CR>", opts)
map("n", "<Leader><leader>", "za", opts)
local function zenMode()
vim.cmd("Neotree close");
vim.cmd("NoNeckPain");
end
map("n", "<Leader>z", zenMode, opts);
map("n", "<Leader>a", ":Alpha<CR>", opts);
-- LSP Functionality
map("n", "<Leader>n", ":lua vim.diagnostic.goto_next()<CR>", opts)
map("n", "<Leader>p", ":lua vim.diagnostic.goto_prev()<CR>", opts)
map("n", "<Leader>e", ":lua vim.diagnostic.open_float()<CR>", opts)
map("n", "gD", ":lua vim.lsp.buf.declaration()<CR>", opts)
map("n", "gd", ":lua vim.lsp.buf.definition()<CR>", opts)
map("n", "gi", ":lua vim.lsp.buf.implementation()<CR>", opts)
map("n", "K", ":lua vim.lsp.buf.hover()<CR>", opts)
map("n", "<Leader>rn", ":lua vim.lsp.buf.rename()<CR>", opts)
map({ "n", "v" }, "<Leader>c", ":Lspsaga code_action<CR>", { silent = true })
map({ "n", "v" }, "gr", ":Lspsaga lsp_finder<CR>", opts)
map("n", "<Leader>u", ":UndotreeToggle<CR>", opts)
map("n", "<Leader>wq", ":wqall!<CR>", opts)
map("n", "<Leader>li", ":LspInfo<CR>", opts)
map("n", "<Leader>lr", ":LspRestart<CR>", opts)
-- barbar.nvim
map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', opts)
map('n', '<A-.>', '<Cmd>BufferNext<CR>', opts)
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', opts)
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', opts)
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', opts)
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', opts)
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', opts)
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', opts)
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', opts)
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', opts)
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', opts)
map('n', '<A-0>', '<Cmd>BufferLast<CR>', opts)
map('n', '<A-w>', '<Cmd>BufferClose<CR>', opts)
-- This is my [i]nspect section,
map("n", "<Leader>is", ":SymbolsOutline<cr>", opts) -- [i]nspect [s]ymbols
map("n", "<Leader>ic", ":ColorizerToggle<CR>", opts) -- [i]nspect [c]olors
map("n", "<Leader>io", ":Lspsaga outline<CR>", opts) -- [i]nspect [o]utline
map("n", "<Leader>in", ":Telescope notify<CR>", opts) -- [i]nspect [n]otifications
map("n", "<Leader>ip", ":TroubleToggle<CR>", opts) -- [i]nspect [p]roblems
map("n", "<Leader>ii", ":Lspsaga incomming_calls<CR>", opts) -- [i]nspect [i]ncomming_calls
map("n", "<Leader>io", ":Lspsaga outgoing_calls<CR>", opts) -- [i]nspect [o]utgoing_calls
map("n", "<Leader>ic", ":Copilot panel<CR>", opts) -- [i]nspect [c]opilot suggestions
map("v", "<Leader>ai", ":'<,'>NeoAIContext<CR>")
map("n", "<Leader>ai", ":NeoAI<CR>")
map({ "n", "v" }, "<Leader>t", require("max.functions.translate"), opts)
-- DAP Functionality
map("n", "<Leader>b", ":lua require('dap').toggle_breakpoint()<CR>", opts)
-- Test Functionality
map("n", "tt", ":lua require('neotest').run.run()<CR>", opts)
map("n", "to", ":lua require('neotest').summary.open()<CR>", opts)
-- Navigate Buffers
map("n", "<C-h>", "<C-w>h", opts)
map("n", "<C-j>", "<C-w>j", opts)
map("n", "<C-k>", "<C-w>k", opts)
map("n", "<C-l>", "<C-w>l", opts)
map("n", "<Leader>1", "1gt", opts)
map("n", "<Leader>2", "2gt", opts)
map("n", "<Leader>3", "3gt", opts)
map("n", "<Leader>4", "4gt", opts)
map("n", "<Leader>0", ":tablast<CR>", opts)
-- Browser like next/previous for navigating the jumplist
map("n", "<A-Left>", "<C-O>", opts)
map("n", "<A-Right>", "<C-I>", opts)
-- Copy visual selection to keyboard
map("v", "Y", '"+y', opts)
map("n", "<Leader-k>", "{", opts)
map("n", "<Leader-j>", "}", opts)
-- Move lines vscode style
map("n", "<A-j>", ":move +1<CR>", opts)
map("n", "<A-k>", ":move -2<CR>", opts)
map("i", "<A-j>", ":move +1<CR>", opts)
map("i", "<A-k>", ":move -2<CR>", opts)
map("v", "<A-j>", ":m '>+1<CR>gv=gv", opts)
map("v", "<A-k>", ":m '<-2<CR>gv=gv", opts)
map("n", "<A-S-K>", "yyP", opts)
map("n", "<A-S-J>", "yyp", opts)
map("v", ">", ">gv", opts)
map("v", "<", "<gv", opts)
-- resize
map("n", "<C-Up>", ":resize -4<CR>", opts)
map("n", "<C-Down>", ":resize +4<CR>", opts)
map("n", "<C-Left>", ":vertical resize -4<CR>", opts)
map("n", "<C-Right>", ":vertical resize +4<CR>", opts)
-- If i paste with p, the replaced content doesnt replace my clipboard
map("v", "p", '"_dP', opts)
-- clear highlights after search
map("n", "<leader>cl", ":noh<CR>", opts);
map("n", "<leader>m", ":Mason<CR>", opts);
map("n", "<leader>l", ":Lazy<CR>", opts);
-- Find file in NeoTree
map("n", "<Leader>j", ":Neotree toggle<CR>", opts)
map("n", "<Leader>f", ":Neotree action=focus reveal=true<CR>", opts)
-- I aint no weak boy
map("n", "<Left>", ":echo 'No Left for you'<CR><i><dw>", opts)
map("n", "<Right>", ":echo 'No Right for you'<CR><dw>", opts)
map("n", "<Up>", ":echo 'No Up for you'<CR><dw>", opts)
map("n", "<Down>", ":echo 'No Down for you'<CR><dw>", opts)
-- Run Scripts
map("n", "<Leader>r", ":SnipRun<CR>", opts)
map("v", "<Leader>r", ":'<,'>SnipRun<CR>", opts)
map("n", "<Leader>q", ":q<CR>", opts)
map("n", "<Leader><C-q>", ":qall<CR>", opts)
-- Make ctrl+s work
map("n", "<C-s>", ":w<CR>", opts)
map("i", "<C-s>", "<Esc>:w<CR>i", opts)

View File

@ -0,0 +1,60 @@
local g = vim.g
local opt = vim.opt
g.mapleader = " "
g.maplocalleader = " "
g.loaded_netrwPlugin = 1
g.loaded_netrw = 1
g.loaded_netrwSettings = 1
g.loaded_netrwFileHandlers = 1
g.loaded_netrw_gitignore = 1
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.laststatus = 3 -- laststatus=3 enables global statusline
opt.list = false -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append { W = true, I = true, c = true }
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "no" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spelllang = { "en" }
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = 300
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap
opt.foldenable = false;
opt.foldmethod = "expr"
opt.foldexpr = "nvim_treesitter#foldexpr()"
-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0

View File

@ -0,0 +1,15 @@
local opts = {
defaults = { lazy = true },
install = { colorscheme = { require("max.plugins.theme").name } },
change_detection = {
enabled = true, -- automatically check for config file changes and reload the ui
notify = true, -- get a notification when changes are found
},
performance = {
rtp = {
reset = true,
},
}
}
require("lazy").setup("max.plugins", opts)

View File

@ -0,0 +1,60 @@
local languages = require("max.functions.translate.languages")
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local conf = require("telescope.config").values
return function()
-- This active_buf and active selection because telescope clears everything (i think)
local active_buf = vim.api.nvim_get_current_buf()
local mode = vim.api.nvim_get_mode().mode
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<Esc>", true, false, true), "x!", true)
local start_mark = vim.api.nvim_buf_get_mark(active_buf, "<")
local end_mark = vim.api.nvim_buf_get_mark(active_buf, ">")
pickers
.new({}, {
prompt_title = "Translate",
finder = finders.new_table({
results = languages,
entry_maker = function(entry)
return {
value = entry[2],
ordinal = entry[1] .. " " .. entry[2],
display = entry[3] .. entry[1],
}
end,
}),
sorter = conf.generic_sorter({}),
attach_mappings = function(prompt_bufnr)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
vim.api.nvim_set_current_buf(active_buf)
vim.api.nvim_win_set_cursor(0, start_mark)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(mode, true, false, true), "x!", true)
vim.api.nvim_win_set_cursor(0, end_mark)
local timer = vim.loop.new_timer()
timer:start(
500,
0,
vim.schedule_wrap(function()
if mode == "v" or mode == "V" then
vim.cmd("'<,'>Translate " .. selection.value)
else
vim.cmd("Translate " .. selection.value)
end
end)
)
end)
return true
end,
previewer = nil,
})
:find()
end

View File

@ -0,0 +1,39 @@
local na = "🌐 "
return { { "Afrikaans", "af", "🇦🇫" }, { "Albanian", "sq", "🇦🇱" }, { "Amharic", "am", "🇦🇲" },
{ "Arabic", "ar", "🇸🇦" }, { "Armenian", "hy", "🇦🇲" }, { "Azerbaijani", "az", "🇦🇿" },
{ "Basque", "eu", na }, { "Belarusian", "be", "🇧🇾" }, { "Bengali", "bn", "🇧🇳" },
{ "Bosnian", "bs", "🇧🇦" }, { "Bulgarian", "bg", "🇧🇬" }, { "Catalan", "ca", "🇪🇸" },
{ "Cebuano", "ceb", "🇵🇭" }, { "Chinese (Simplified)", "zh-CN", "🇨🇳" },
{ "Chinese (Traditional)", "zh-TW", "🇨🇳" }, { "Corsican", "co", "🇨🇴" },
{ "Croatian", "hr", "🇭🇷" }, { "Czech", "cs", "🇨🇿" }, { "Danish", "da", "🇩🇰" },
{ "Dutch", "nl", "🇳🇱" },
{ "English", "en", "🇬🇧" }, { "Esperanto", "eo", "🇪🇺" }, { "Estonian", "et", "🇪🇪" },
{ "Finnish", "fi", "🇫🇮" }, { "French", "fr", "🇫🇷" }, { "Frisian", "fy", na },
{ "Galician", "gl", "🇬🇱" }, { "Georgian", "ka", "🇬🇪" }, { "German", "de", "🇩🇪" },
{ "Greek", "el", "🇬🇷" }, { "Gujarati", "gu", "🇬🇺" }, { "Haitian Creole", "ht", "🇭🇹" },
{ "Hausa", "ha", na }, { "Hawaiian", "haw", na }, { "Hebrew", "iw", "🇮🇱" },
{ "Hindi", "hi", "🇮🇳" }, { "Hmong", "hmn", "🇨🇳" }, { "Hungarian", "hu", "🇭🇺" },
{ "Icelandic", "is", "🇮🇸" }, { "Igbo", "ig", na }, { "Indonesian", "id", "🇮🇩" },
{ "Irish", "ga", "🇮🇪" }, { "Italian", "it", "🇮🇹" }, { "Japanese", "ja", "🇯🇵" },
{ "Javanese", "jw", na }, { "Kannada", "kn", "🇰🇳" }, { "Kazakh", "kk", "🇰🇿" },
{ "Khmer", "km", "🇰🇲" }, { "Korean", "ko", "🇰🇷" }, { "Kurdish", "ku", "🏴 󠁩󠁲󠀱󠀶󠁿" },
{ "Kyrgyz", "ky", "🇰🇬" },
{ "Lao", "lo", "🇱🇦" }, { "Latin", "la", na }, { "Latvian", "lv", "🇱🇻" }, { "Lithuanian", "lt", "🇱🇹" },
{ "Luxembourgish", "lb", "🇱🇺" }, { "Macedonian", "mk", "🇲🇰" }, { "Malagasy", "mg", "🇲🇬" },
{ "Malay", "ms", "🇲🇸" }, { "Malayalam", "ml", "🇲🇱" }, { "Maltese", "mt", "🇲🇹" },
{ "Maori", "mi", "🇳🇿" }, { "Marathi", "mr", "🇲🇷" }, { "Mongolian", "mn", "🇲🇳" },
{ "Myanmar (Burmese)", "my", "🇲🇲" }, { "Nepali", "ne", "🇳🇵" }, { "Norwegian", "no", "🇳🇴" },
{ "Nyanja (Chichewa)", "ny", na }, { "Pashto", "ps", "🇵🇸" }, { "Persian", "fa", "🇫🇦" },
{ "Polish", "pl", "🇵🇱" }, { "Portuguese (Portugal, Brazil)", "pt", "🇵🇹" }, { "Punjabi", "pa", "🇮🇳" },
{ "Romanian", "ro", "🇷🇴" }, { "Russian", "ru", "🇷🇺" }, { "Samoan", "sm", "🇼🇸" },
{ "Scots Gaelic", "gd", "🏴 󠁧󠁢󠁳󠁣󠁴󠁿󠁧󠁢󠁳󠁣󠁴󠁿" }, { "Serbian", "sr", "🇸🇷" },
{ "Sesotho", "st", "🇸🇹" },
{ "Shona", "sn", "🇸🇳" }, { "Sindhi", "sd", "🇸🇩" }, { "Sinhala (Sinhalese)", "si", "🇸🇮" },
{ "Slovak", "sk", "🇸🇰" }, { "Slovenian", "sl", "🇸🇱" }, { "Somali", "so", "🇸🇴" },
{ "Spanish", "es", "🇪🇸" }, { "Sundanese", "su", na }, { "Swahili", "sw", na },
{ "Swedish", "sv", "🇸🇻" }, { "Tagalog (Filipino)", "tl", "🇹🇱" }, { "Tajik", "tg", "🇹🇬" },
{ "Tamil", "ta", "🇹🇦" }, { "Telugu", "te", na }, { "Thai", "th", "🇹🇭" }, { "Turkish", "tr", "🇹🇷" },
{ "Ukrainian", "uk", "🇺🇦" }, { "Urdu", "ur", na }, { "Uzbek", "uz", "🇺🇿" },
{ "Vietnamese", "vi", "🇻🇳" }, { "Welsh", "cy", "🇨🇾" }, { "Xhosa", "xh", na },
{ "Yiddish", "yi", na }, { "Yoruba", "yo", "🇿🇦" }, { "Zulu", "zu", na } }

View File

@ -0,0 +1,10 @@
return {
"vlelo/arduino-helper.nvim",
lazy = false,
setup = function()
vim.notify("Setup")
require("arduino-helper").setup {
ui = "telescope",
}
end
}

View File

@ -0,0 +1,132 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-emoji",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-nvim-lua",
"zbirenbaum/copilot.lua",
"zbirenbaum/copilot-cmp",
"L3MON4D3/LuaSnip",
"rafamadriz/friendly-snippets",
},
config = function()
local luasnip = require("luasnip")
luasnip.config.set_config {
enable_autosnippets = true,
}
require("max.plugins.autocomplete.snippets")
local lspkind = require("lspkind")
local cmp = require("cmp")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("lspconfig").html.setup({
capabilities = capabilities,
})
require("copilot").setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
require("copilot_cmp").setup {
method = "getCompletionsCycling",
}
local check_backspace = function()
local col = vim.fn.col(".") - 1
return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end
cmp.setup({
window = {
documentation = cmp.config.window.bordered(),
},
experimental = {
ghost_text = true,
},
completion = {
completeopt = "menuone,noselect",
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
["<C-Leader>"] = cmp.mapping.complete({}),
["<C-Space>"] = cmp.mapping(cmp.mapping.complete(), { "i", "c" }),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
["<CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}),
},
formatting = {
format = lspkind.cmp_format({
mode = "symbol_text",
max_width = 50,
symbol_map = { Copilot = "" },
}),
},
sources = {
{ name = "copilot" },
{ name = "vim-dadbod-completion", filetype = "sql" },
{ name = "nvim_lua" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "emoji" },
{ name = "path" },
{ name = "buffer" },
{ name = "calc" },
},
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline("/", {
sources = {
{ name = "buffer" },
},
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
})
end,
}

View File

@ -0,0 +1,148 @@
local ls = require("luasnip")
-- some shorthands...
local s = ls.snippet
local sn = ls.snippet_node
local t = ls.text_node
local i = ls.insert_node
local f = ls.function_node
local d = ls.dynamic_node
local fmt = require("luasnip.extras.fmt").fmt
local types = require("luasnip.util.types")
require("luasnip.loaders.from_vscode").load()
-- Every unspecified option will be set to the default.
ls.config.set_config({
history = true,
-- Update more often, :h events for more info.
updateevents = "TextChanged,TextChangedI",
ext_opts = {
[types.choiceNode] = {
active = {
virt_text = { { "choiceNode", "Comment" } },
},
},
},
-- treesitter-hl has 100, use something higher (default is 200).
ext_base_prio = 300,
-- minimal increase in priority.
ext_prio_increase = 1,
enable_autosnippets = true,
})
ls.add_snippets("all", {
s({ trig = "b(%d)", regTrig = true, wordTrig = true }, {
f(function(args)
return { "Captured Text: " .. args[1].captures[1] .. "." }
end, {}),
i(0),
}),
})
local debugJSON = s("pcs", {
t("<pre><code>{JSON.stringify("),
i(0),
t("null, 2)}</code></pre>"),
})
local function simple_restore(args, _)
return sn(nil, { i(1, args[1]) })
end
ls.add_snippets('lua', {
s(
{
trig = 'if',
condition = function()
local ignored_nodes = { 'string', 'comment' }
local pos = vim.api.nvim_win_get_cursor(0)
-- Use one column to the left of the cursor to avoid a "chunk" node
-- type. Not sure what it is, but it seems to be at the end of lines in
-- some cases.
local row, col = pos[1] - 1, pos[2] - 1
local node_type = vim.treesitter
.get_node({
pos = { row, col },
})
:type()
return not vim.tbl_contains(ignored_nodes, node_type)
end,
},
fmt(
[[
if {} then
{}
end
]],
{ i(1), i(2) }
)
),
}, {
type = 'autosnippets',
})
ls.add_snippets("svelte", {
s("slt", {
t({ '<script lang="ts">', "" }),
i(0),
t({ "", "</script>" }),
}),
s("sch", {
t({
'<script lang="ts">',
' import type { Hst } from "@histoire/plugin-svelte";',
' export let Hst: Hst;',
''
}),
t(" import "), i(1, "Component"), t(" from './"), d(2, simple_restore, 1), t({ ".svelte';", "" }),
t({
"</script>",
"",
"",
"<Hst.Story>",
""
}),
t({ " <" }),
d(3, simple_restore, 1),
t({ " />", "" }),
t({ ' <svelte:fragment slot="controls">', " </svelte:fragment>", "</Hst.Story>" }),
}),
s("sc", {
t({ '<script context="module" lang="ts">', "" }),
i(0),
t({ "", "</script>" }),
}),
debugJSON,
})
ls.add_snippets("typescriptreact", {
debugJSON,
})
ls.add_snippets("typescript", {
debugJSON,
s("sget", {
t('export const GET: import("./$types").RequestHandler = async function get({'),
i(1, "params"),
t("}) {"),
i(2),
t("}"),
}),
s("spost", {
t('export const POST: import("./$types").RequestHandler = async function get({'),
i(1, "params"),
t("}) {"),
i(2),
t("}"),
}),
s("ssess", {
t({ "const {userId} = locals.session.data", "if(!userId) throw redirect(307, '/login')" }),
}),
})

View File

@ -0,0 +1,5 @@
return {
"gaoDean/autolist.nvim",
event = "InsertEnter",
config = true,
}

View File

@ -0,0 +1,14 @@
return {
"nat-418/boole.nvim",
event = "InsertEnter",
opts = {
mappings = {
increment = '+',
decrement = '-'
},
additions = {
{ "const", "let", "var" },
{ "absolute", "relative", "fixed", "sticky" }
}
}
}

View File

@ -0,0 +1,5 @@
return {
"norcalli/nvim-colorizer.lua",
config = true,
event = "BufReadPost",
}

View File

@ -0,0 +1,8 @@
return {
"tpope/vim-dadbod",
dependencies = {
"kristijanhusak/vim-dadbod-completion",
"kristijanhusak/vim-dadbod-ui",
},
cmd = "DBUI"
}

View File

@ -0,0 +1,61 @@
return {
'mfussenegger/nvim-dap',
keys = {
{ '<F5>', ':DapContinue<CR>', desc = 'Debug continue' },
{
'<leader>db',
':DapToggleBreakpoint<CR>',
desc = 'Debug toggle breakpoint',
},
{ '<leader>do', ':DapStepOut<CR>', desc = 'Debug step out' },
{ '<leader>dv', ':DapStepOver<CR>', desc = 'Debug step over' },
{ '<leader>di', ':DapStepInto<CR>', desc = 'Debug step into' },
{ '<leader>dt', ':DapTerminate<CR>', desc = 'Debug terminate' },
},
dependencies = { 'rcarriga/nvim-dap-ui' },
config = function()
local dap = require('dap')
local dapui = require('dapui')
local utils = require('dap.utils')
-- Add listeners to automatically open and close dapui
dapui.setup()
dap.listeners.after.event_initialized['dapui_config'] = function()
dapui.open({})
end
dap.listeners.before.event_terminated['dapui_config'] = function()
dapui.close({})
end
dap.listeners.before.event_exited['dapui_config'] = function()
dapui.close({})
end
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
args = { "/home/max/.local/bin/js-debug/src/dapDebugServer.js", "${port}" },
}
}
dap.configurations.typescript = {
{
type = 'pwa-node',
request = 'launch',
name = "Launch debug task",
runtimeExecutable = "deno",
runtimeArgs = {
"task",
"debug",
},
cwd = "${workspaceFolder}",
attachSimplePort = 9229,
},
}
vim.keymap.set('n', '<leader>dc', dapui.close, { desc = 'Dapui close' })
end,
}

View File

@ -0,0 +1,88 @@
return {
"goolord/alpha-nvim",
lazy = false,
config = function()
-----------------------------------
-- Welcome Screen Configuration --
-----------------------------------
-- Call Alpha With A pcall
local status_ok, alpha = pcall(require, "alpha")
if not status_ok then
return
end
-- Enable Alpha Dashboard
local dashboard = require("alpha.themes.dashboard")
-- Remove These ~ ~ ~
vim.opt.fillchars:append({ eob = " " })
-- Disable Status Line so that alpha dashboard look nice
-- vim.cmd [[ au User AlphaReady if winnr('$') == 1 | set laststatus=1 ]]
-- Custom Footer
dashboard.section.footer.val = {
"Write Programs That Do One Thing And Do It Well.",
}
-- Custom Section
dashboard.section.buttons.val = {
dashboard.button("n", " Create New file", ":set laststatus=3 | :ene <BAR> startinsert <CR>"),
dashboard.button("e", " Open File Manager", ":set laststatus=3 | :Neotree toggle <CR>"),
dashboard.button("s", "Δ Search Sessions", ":Telescope persisted<CR>"),
dashboard.button("v", " Neovim Settings ", ":set laststatus=3 | e ~/.config/nvim/init.lua <CR>"),
dashboard.button("b", "⟳ Recent Files", ":Telescope oldfiles<CR>"),
-- dashboard.button("s", " Shell Configuration", ":set laststatus=3 | e ~/.config/zsh/.zshrc <CR>"),
dashboard.button("u", " Update Nvim Plugins", ":Lazy update <CR>"),
dashboard.button("q", " Quit Neovim", ":qa<CR>"),
}
-- LuaVim Ascii Art
dashboard.section.header.val = {
[[███╗ ███╗ █████╗ ██╗ ██╗ ███╗ ██╗ ██╗ ██╗██╗███╗ ███╗]],
[[████╗ ████║██╔══██╗╚██╗██╔╝ ████╗ ██║ ██║ ██║██║████╗ ████║]],
[[██╔████╔██║███████║ ╚███╔╝ ██╔██╗ ██║ ██║ ██║██║██╔████╔██║]],
[[██║╚██╔╝██║██╔══██║ ██╔██╗ ██║╚██╗██║ ╚██╗ ██╔╝██║██║╚██╔╝██║]],
[[██║ ╚═╝ ██║██║ ██║██╔╝ ██╗ ██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║]],
[[╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝]],
}
dashboard.section.header.val = {
[[ __ ]],
[[ /\ \ ]],
[[ / /\ \ ]],
[[/ /__\ \ ]],
[[\/____\/ ]],
}
-- dashboard.section.header.val = {
-- [[ ____]],
-- [[ /\ \]],
-- [[ / \ \]],
-- [[ / \ \]],
-- [[ / \ \]],
-- [[ / /\ \ \]],
-- [[ / / \ \ \]],
-- [[ / / \ \ \]],
-- [[ / / / \ \ \]],
-- [[ / / / \ \ \]],
-- [[ / / /---------' \]],
-- [[/ / /_______________\]],
-- [[\ / /]],
-- [[ \/_____________________/ ]],
-- }
-- Layout For Luavim ascii art
dashboard.config.layout = {
{ type = "padding", val = 5 },
dashboard.section.header,
{ type = "padding", val = 2 },
dashboard.section.buttons,
{ type = "padding", val = 1 },
dashboard.section.footer,
}
alpha.setup(dashboard.opts)
end,
}

View File

@ -0,0 +1,6 @@
return {
"akinsho/git-conflict.nvim",
version = "*",
event = "BufReadPost",
config = true,
}

View File

@ -0,0 +1,5 @@
return {
"lewis6991/gitsigns.nvim",
event = "BufReadPost",
config = true,
}

View File

@ -0,0 +1,8 @@
return {
"ggandor/flit.nvim",
dependencies = {
"ggandor/leap.nvim",
},
event = "VeryLazy",
config = true,
}

View File

@ -0,0 +1,248 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
"arkav/lualine-lsp-progress",
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
"williamboman/mason-lspconfig.nvim",
"onsails/lspkind.nvim",
"lukas-reineke/lsp-format.nvim"
},
event = "BufReadPost",
config = function()
local mason = require("mason")
local mason_lsp = require("mason-lspconfig")
local lsp = require("lspconfig")
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
vim.lsp.handlers.hover,
{ border = 'single' }
)
vim.diagnostic.config({
float = {
border = 'single',
},
})
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.diagnostics.eslint_d,
},
should_attach = function()
return lsp.util.root_pattern(".eslintrc", ".eslintrc.js", ".eslintrc.cjs", ".eslintrc.yaml", ".eslintrc.json")(
vim.fn.expand("%:p")) ~= nil;
end,
})
mason.setup()
mason_lsp.setup({
ensure_installed = { "lua_ls", "jsonls", "svelte", "cssls", "prismals" },
})
local function on_attach(client)
local active_clients = vim.lsp.get_active_clients()
if client.name == 'denols' then
for _, client_ in pairs(active_clients) do
-- stop tsserver if denols is already active
if client_.name == 'tsserver' or client_.name == "typescript-tools" then
client_.stop()
end
end
elseif client.name == 'tsserver' or client.name == "typescript-tools" then
for _, client_ in pairs(active_clients) do
-- prevent tsserver from starting if denols is already active
if client_.name == 'denols' then
client.stop()
end
end
end
require("lsp-format").on_attach(client)
end
local capabilities = require("cmp_nvim_lsp").default_capabilities()
-- capabilities.textDocument.foldingRange = {
-- dynamicRegistration = false,
-- lineFoldingOnly = true,
-- }
--
capabilities.textDocument.completion.completionItem.snippetSupport = true
local custom_lsp = {}
custom_lsp.tsserver = {
root_dir = lsp.util.root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git"),
}
custom_lsp.denols = {
root_dir = lsp.util.root_pattern("deno.json", "deno.jsonc"),
}
local runtime_path = vim.split(package.path, ";")
table.insert(runtime_path, "lua/?.lua")
table.insert(runtime_path, "lua/?/init.lua")
custom_lsp.lua_ls = {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
-- Setup your lua path
path = runtime_path,
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
checkThirdParty = false
},
-- Do not send telemetry data containing a randomized but unique identifier
telemetry = {
enable = false,
},
},
},
}
custom_lsp.jsonls = {
settings = {
provideFormatter = false,
json = {
schemas = {
{
description = "TypeScript compiler configuration file",
fileMatch = { "tsconfig.json", "tsconfig.*.json" },
url = "http://json.schemastore.org/tsconfig",
},
{
description = "ESLint config",
fileMatch = { ".eslintrc.json", ".eslintrc" },
url = "http://json.schemastore.org/eslintrc",
},
{
description = "Prettier config",
fileMatch = { ".prettierrc", ".prettierrc.json", "prettier.config.json" },
url = "http://json.schemastore.org/prettierrc",
},
{
description = "JSON schema for Import Maps files",
fileMatch = { "importmap.json", "import_map.json", "import-map.json" },
name = "importmap.json",
url = "https://json.schemastore.org/importmap.json",
},
{
description = "NPM configuration file",
fileMatch = { "package.json" },
name = "package.json",
url = "https://json.schemastore.org/package.json",
},
},
},
},
}
custom_lsp.intelephense = {
settings = {
intelephense = {
stubs = {
"wordpress",
"woocommerce",
"wordpress-globals",
"wp-cli",
},
environment = {
includePaths = "/home/max/.composer/vendor/php-stubs/", -- this line forces the composer path for the stubs in case inteliphense don't find it...
},
files = {
maxSize = 5000000,
},
},
},
}
-- custom_lsp['arduino_language_server'] = {
-- on_new_config = require("arduino").on_new_config,
-- }
-- custom_lsp.clangd = {
-- cmd = { "clangd",
-- "--query-driver=/home/max/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/**/bin/xtensa-esp32-elf-*" },
-- root_dir = lsp.util.root_pattern('build/compile_commands.json', '.git'),
-- }
custom_lsp.rust_analyzer = {
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true,
},
},
},
}
custom_lsp.yamlls = {
settings = {
yaml = {
schemas = {
["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*",
["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*",
["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2-file-provider.json"] = "rules.yml",
["https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/traefik-v2.json"] = "traefik.yml",
},
},
},
}
-- custom_lsp.glslls = require("max.plugins.lsp.glsl");
lsp.glslls.setup {}
custom_lsp.ltex = {
settings = {
ltex = {
language = "de",
disabledRules = { ["en-US"] = { "PROFANITY" } },
dictionary = {
["en-US"] = { "perf", "ci", "neovim" },
},
hiddenFalsePositives = {
"neovim",
"Neovim",
"waybar",
},
},
},
}
mason_lsp.setup_handlers({
function(server_name)
local config = {
on_attach = on_attach,
capabilities = capabilities,
}
if custom_lsp[server_name] ~= nil then
for k, v in pairs(custom_lsp[server_name]) do
config[k] = v
end
end
lsp[server_name].setup(config)
end,
})
end,
}

View File

@ -0,0 +1,28 @@
local status_ok, util = pcall(require, "lspconfig.util")
if not status_ok then
return
end
local default_capabilities = vim.lsp.protocol.make_client_capabilities()
default_capabilities.textDocument.completion = false
default_capabilities.textDocument.synchronization.didSave = false;
local default_config = {
cmd = { 'glslls' }, -- GLSL lsp executable from (https://github.com/svenstaro/glsl-language-server
filetypes = { 'glsl', 'vs', 'fs' },
root_dir = util.root_pattern('compile_commands.json', '.git'),
single_file_support = true,
capabilities = default_capabilities,
}
return {
capabilities = default_capabilities,
default_configs = default_config,
commands = {},
docs = {
description = [[
Basic LSP support for GLSL using glslls --stdio
]]
},
}

View File

@ -0,0 +1,13 @@
return {
"glepnir/lspsaga.nvim",
event = "BufRead",
enable = false,
opts = {
lightbulb = {
enable = false,
},
symbol_in_winbar = {
enable = false,
},
},
}

View File

@ -0,0 +1,245 @@
return {
"nvim-lualine/lualine.nvim",
dependencies = {
"chrisgrieser/nvim-recorder",
},
lazy = false,
config = function()
-----------------
-- Status Line --
-----------------
-- Eviline / Vimline config for lualine
-- Author: shadmansaleh
-- Credit: glepnir
-- Credit: Elai
local lualine = require("lualine")
-- Color table for highlights
-- stylua: ignore
local colors = {
bg = '#00000000',
fg = '#bbc2cf',
yellow = '#ECBE7B',
cyan = '#008080',
darkblue = '#081633',
green = '#B7BD82',
orange = '#8d6141',
violet = '#B294BB',
magenta = '#AE84BB',
blue = '#81A2BE',
red = '#CC8282',
}
local conditions = {
buffer_not_empty = function()
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
end,
hide_in_width = function()
return vim.fn.winwidth(0) > 80
end,
check_git_workspace = function()
local filepath = vim.fn.expand("%:p:h")
local gitdir = vim.fn.finddir(".git", filepath .. ";")
return gitdir and #gitdir > 0 and #gitdir < #filepath
end,
}
-- Config
local config = {
options = {
-- Disable sections and component separators
component_separators = "",
section_separators = "",
globalstatus = true,
-- theme = require("max.plugins.theme").name,
},
-- These are to remove the defaults
sections = {
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
-- These will be filled later
lualine_c = {},
lualine_x = {},
},
inactive_sections = {
-- these are to remove the defaults
lualine_a = {},
lualine_b = {},
lualine_y = {},
lualine_z = {},
lualine_c = {},
lualine_x = {},
},
}
-- Inserts a component in lualine_c at left section
local function ins_left(component)
table.insert(config.sections.lualine_c, component)
end
-- Inserts a component in lualine_x ot right section
local function ins_right(component)
table.insert(config.sections.lualine_x, component)
end
-- Icon Of Diffrent Mode: -- normal -- | -- insert -- | -- visual --
ins_left({
-- mode component
function()
return ""
end,
color = function()
-- auto change color according to neovims mode
local mode_color = {
n = colors.green,
i = colors.blue,
v = colors.magenta,
[""] = colors.blue,
V = colors.blue,
c = colors.red,
no = colors.red,
s = colors.orange,
S = colors.orange,
[""] = colors.orange,
ic = colors.yellow,
R = colors.violet,
Rv = colors.violet,
cv = colors.red,
ce = colors.red,
r = colors.cyan,
rm = colors.cyan,
["r?"] = colors.cyan,
["!"] = colors.red,
t = colors.red,
}
return { fg = mode_color[vim.fn.mode()] }
end,
padding = { right = 1 },
})
-- File Name
ins_left({
"filename",
file_status = true, -- Displays file status (readonly status, modified status)
path = 2, -- 0: Just the filename
-- 1: Relative path
-- 2: Absolute path
shorting_target = 100, -- Shortens path to leave 40 spaces in the window
-- for other components. (terrible name, any suggestions?)
symbols = {
modified = "", -- Text to show when the file is modified.
readonly = "", -- Text to show when the file is non-modifiable or readonly.
unnamed = "[No Name]", -- Text to show for unnamed buffers.
},
})
ins_left {
require("recorder").recordingStatus
}
ins_left {
'lsp_progress',
display_components = { 'lsp_client_name', { 'title', 'percentage', 'message' } },
-- With spinner
-- display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' }},
colors = {
percentage = colors.cyan,
title = colors.cyan,
message = colors.cyan,
spinner = colors.cyan,
lsp_client_name = colors.magenta,
use = true,
},
separators = {
component = ' ',
progress = ' | ',
message = { pre = '(', post = ')' },
percentage = { pre = '', post = '%% ' },
title = { pre = '', post = ': ' },
lsp_client_name = { pre = '[', post = ']' },
spinner = { pre = '', post = '' },
},
timer = { progress_enddelay = 500, spinner = 1000, lsp_client_name_enddelay = 1000 },
spinner_symbols = { '🌑 ', '🌒 ', '🌓 ', '🌔 ', '🌕 ', '🌖 ', '🌗 ', '🌘 ' },
}
-- Git Diff
local function diff_source()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end
ins_right({ "diff", source = diff_source })
-- Git Branch
ins_right({
"branch",
icon = "",
-- icon = '',
-- color = { fg = colors.green },
-- padding = { right = 1 },
-- padding = { left = 1 },
})
-- File Type
ins_right({
"filetype",
icon_only = true,
padding = { right = 2, left = 1 },
})
-- File Encoding
ins_right({
"o:encoding", -- option component same as &encoding in viml
fmt = string.upper, -- I'm not sure why it's upper case either ;)
cond = conditions.hide_in_width,
padding = { right = 2 },
-- color = { fg = colors.green, gui = 'bold' },
-- Add components to right sections
})
-- File Size
ins_right({
-- filesize component
"filesize",
padding = { right = 2 },
cond = conditions.buffer_not_empty,
})
-- File Location
ins_right({
"location",
padding = { right = 0 },
})
-- Insert mid section. You can make any number of sections in neovim :)
-- for lualine it's any number greater then 2
ins_left({
function()
return "%="
end,
})
-- End Of The Status Bar
ins_right {
function()
return ''
end,
color = { fg = colors.blue }, -- Sets highlighting of component
padding = { left = 1, right = 0 }, -- We don't need space before this
}
-- Now don't forget to initialize lualine
lualine.setup(config)
end
}

View File

@ -0,0 +1,21 @@
return {
'echasnovski/mini.nvim',
version = false,
event = "VeryLazy",
config = function()
require("mini.comment").setup({
})
require("mini.pairs").setup({
})
require("mini.surround").setup({
})
require("mini.animate").setup({
cursor = {
enable = false,
}
})
end
}

View File

@ -0,0 +1,28 @@
return {
"Bryley/neoai.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
},
cmd = {
"NeoAI",
"NeoAIOpen",
"NeoAIClose",
"NeoAIToggle",
"NeoAIContext",
"NeoAIContextOpen",
"NeoAIContextClose",
"NeoAIInject",
"NeoAIInjectCode",
"NeoAIInjectContext",
"NeoAIInjectContextCode",
},
keys = {
{ "<leader>as", desc = "summarize text" },
{ "<leader>ag", desc = "generate git message" },
},
config = function()
require("neoai").setup({
-- Options go here
})
end,
}

View File

@ -0,0 +1,15 @@
return {
"nvim-neotest/neotest",
cmd = "NeoTest",
config = function()
require("neotest").setup({
adapters = {
require("neotest-vitest")({}),
},
})
end,
dependencies = {
"haydenmeade/neotest-jest",
"KaiSpencer/neotest-vitest",
},
}

View File

@ -0,0 +1,15 @@
return {
"nvim-neo-tree/neo-tree.nvim",
cmd = "Neotree",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim"
},
init = function()
vim.g.neo_tree_remove_legacy_commands = 1
require("neo-tree").setup({
hide_root_node = true,
})
end,
}

View File

@ -0,0 +1,45 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
enabled = true,
opts = {
lsp = {
progress = {
enabled = false
},
hover = {
enabled = false
}
},
views = {
cmdline_popup = {
border = {
style = "single",
padding = { 0, 1 },
},
filter_options = {},
win_options = {
winhighlight = "NormalFloat:NormalFloat,FloatBorder:FloatBorder",
},
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
lsp_doc_border = true
},
},
keys = {
{
"<S-Enter>",
function() require("noice").redirect(vim.fn.getcmdline()) end,
mode = "c",
desc =
"Redirect Cmdline"
},
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
},
}

View File

@ -0,0 +1,23 @@
return {
"rcarriga/nvim-notify",
config = function()
local notify = require("notify")
notify.setup(
{
stages = "fade_in_slide_out",
max_width = 50,
render = "minimal",
background_colour = "#000000",
icons = {
ERROR = "",
WARN = "",
INFO = "",
DEBUG = "",
TRACE = ""
}
}
)
vim.notify = notify;
end,
event = "VimEnter",
}

View File

@ -0,0 +1,7 @@
return {
"stevearc/oil.nvim",
cmd = {
"Oil"
},
config = true
}

View File

@ -0,0 +1,7 @@
return {
"chrisgrieser/nvim-recorder",
event = "VeryLazy",
opts = {
logLevel = vim.log.levels.OFF,
},
}

View File

@ -0,0 +1,6 @@
return {
"rest-nvim/rest.nvim",
ft = { "http" },
dependencies = { "nvim-lua/plenary.nvim" },
config = true,
}

View File

@ -0,0 +1,22 @@
return {
"petertriho/nvim-scrollbar",
event = "VeryLazy",
config = function()
require("scrollbar").setup({
handlers = {
cursor = true,
diagnostic = true,
gitsigns = true, -- Requires gitsigns
handle = true,
search = false, -- Requires hlslens
},
excluded_filetypes = {
"prompt",
"TelescopePrompt",
"noice",
"NvimTree",
"neo-tree"
},
})
end,
}

View File

@ -0,0 +1,7 @@
return {
"olimorris/persisted.nvim",
lazy = false,
opts = {
autoload = true,
},
}

View File

@ -0,0 +1,9 @@
return {
"michaelb/sniprun",
event = "BufRead",
opts = {
selected_interpreters = { "JS_TS_deno" },
repl_enable = { "JS_TS_deno" }
},
build = "bash ./install.sh",
}

View File

@ -0,0 +1,23 @@
return {
"luukvbaal/statuscol.nvim",
lazy = false,
config = function()
local builtin = require("statuscol.builtin")
require("statuscol").setup({
--configuration goes here, for example:
relculright = false,
segments = {
-- { text = { builtin.foldfunc }, click = "v:lua.ScFa" },
{
sign = { name = { "Diagnostic" }, maxwidth = 2, auto = true },
click = "v:lua.ScSa"
},
{ text = { builtin.lnumfunc }, click = "v:lua.ScLa", },
{
sign = { name = { ".*" }, maxwidth = 2, colwidth = 1, auto = true, wrap = true },
click = "v:lua.ScSa"
},
}
})
end,
}

View File

@ -0,0 +1,9 @@
return {
dir = "~/Projects/sudoku.nvim",
cmd = "Sudoku",
opts = {
custom_highlights = {
square = { fg = "red" }
}
}
}

View File

@ -0,0 +1,13 @@
return {
"romgrk/barbar.nvim",
dependencies = 'nvim-tree/nvim-web-devicons',
event = "VeryLazy",
config = function()
require("bufferline").setup({
auto_hide = true,
icons = {
seperator = { left = "", right = "" }
}
})
end,
}

View File

@ -0,0 +1,82 @@
return {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/popup.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope-fzf-native.nvim",
},
event = "VeryLazy",
config = function()
local telescope = require("telescope")
telescope.setup({
defaults = {},
})
local function open_with_trouble()
require("trouble.providers.telescope").open_with_trouble()
end
local default = {
extensions = {
sessions_picker = {
sessions_dir = vim.fn.stdpath("data") .. "/sessions/",
},
},
defaults = {
vimgrep_arguments = {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
"--ignore-file",
".gitignore",
},
prompt_prefix = "",
selection_caret = " ",
entry_prefix = " ",
initial_mode = "insert",
selection_strategy = "reset",
sorting_strategy = "ascending",
layout_strategy = "horizontal",
layout_config = {
horizontal = {
prompt_position = "top",
preview_width = 0.55,
results_width = 0.8,
},
vertical = {
mirror = false,
},
width = 0.87,
height = 0.80,
preview_cutoff = 120,
},
file_sorter = require("telescope.sorters").get_fuzzy_file,
file_ignore_patterns = { "node_modules", "*pnpm-lock*" },
generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter,
path_display = { "truncate" },
winblend = 0,
border = {},
mappings = {
i = { ["<c-t>"] = open_with_trouble },
n = { ["<c-t>"] = open_with_trouble },
},
borderchars = { "", "", "", "", "", "", "", "" },
color_devicons = true,
use_less = true,
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
file_previewer = require("telescope.previewers").vim_buffer_cat.new,
grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new,
qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new,
},
}
telescope.setup(default)
telescope.load_extension("notify")
-- telescope.load_extension("persisted") -- To load the telescope extension
--
end,
}

View File

@ -0,0 +1 @@
return require("max.plugins.theme.catpuccin");

View File

@ -0,0 +1,16 @@
return {
"Shatur/neovim-ayu",
lazy = false,
name = "ayu",
config = function()
require('ayu').setup({
mirage = false, -- Set to `true` to use `mirage` variant instead of `dark` for dark background.
overrides = {
normal = { bg = "NONE" },
}
})
vim.cmd("hi Normal guibg=none")
vim.cmd("colorscheme ayu")
vim.cmd("hi Normal guibg=none")
end
}

View File

@ -0,0 +1,47 @@
return {
"catppuccin/nvim",
name = "catppuccin",
lazy = false,
opts = {
transparent_background = true,
flavour = "mocha", -- latte, frappe, macchiato, mocha
term_colors = true,
compile = {
enabled = true,
path = vim.fn.stdpath("cache") .. "/catppuccin",
},
styles = {
comments = { "italic" },
strings = { "italic" },
},
custom_highlights = function()
return {
Folded = { bg = "#1d1e27" }
}
end,
integrations = {
gitsigns = true,
telescope = true,
-- treesitter = true,
cmp = true,
lsp_saga = true,
notify = true,
neotree = {
enabled = false,
show_root = false,
},
dap = {
enabled = true,
enable_ui = true,
},
native_lsp = {
enabled = true,
},
ts_rainbow = true,
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
},
}
} -- Enable Theming / Syntax

View File

@ -0,0 +1,7 @@
return {
'Everblush/nvim',
name = 'everblush',
opts = {
transparent_background = true,
}
}

View File

@ -0,0 +1,4 @@
return {
'stevedylandev/flexoki-nvim',
name = 'flexoki'
}

View File

@ -0,0 +1,43 @@
return {
"folke/tokyonight.nvim",
name = "tokyonight",
config = function()
require("tokyonight").setup({
-- your configuration comes here
-- or leave it empty to use the default settings
style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
light_style = "day", -- The theme is used when the background is set to light
transparent = true, -- Enable this to disable setting the background color
-- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
styles = {
-- Style to be applied to different syntax groups
-- Value is any valid attr-list value for `:help nvim_set_hl`
comments = { italic = true },
keywords = { italic = true },
functions = {},
variables = {},
-- Background styles. Can be "dark", "transparent" or "normal"
-- sidebars = "dark", -- style for sidebars, see below
-- floats = "dark", -- style for floating windows
},
-- sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
day_brightness = 0.3, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
dim_inactive = true, -- dims inactive windows
lualine_bold = true, -- When `true`, section headers in the lualine theme will be bold
--- You can override specific color groups to use other groups or a hex color
--- function will be called with a ColorScheme table
---@param colors ColorScheme
on_colors = function(colors) end,
--- You can override specific highlights to use other groups or a hex color
--- function will be called with a Highlights and ColorScheme table
---@param highlights Highlights
---@param colors ColorScheme
on_highlights = function(highlights, colors) end,
})
vim.cmd("colorscheme tokyonight")
end
}

View File

@ -0,0 +1,21 @@
return {
"sam4llis/nvim-tundra",
name = "tundra",
config = function()
require("nvim-tundra").setup({
transparent_background = true,
plugins = {
lsp = true,
treesitter = true,
telescope = true,
nvimtree = true,
cmp = true,
dbui = true,
gitsigns = true,
}
})
vim.opt.background = 'dark'
vim.cmd('colorscheme tundra')
end
}

View File

@ -0,0 +1,5 @@
return {
"folke/todo-comments.nvim",
config = true,
event = "VeryLazy",
}

View File

@ -0,0 +1,95 @@
return {
"akinsho/nvim-toggleterm.lua",
event = "VeryLazy",
config = function()
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({
cmd = "lazygit",
dir = "git_dir",
direction = "float",
float_opts = {
winblend = 0,
border = "shadow",
},
on_close = function()
Terminal:close()
end,
})
function _Lazygit_toggle()
lazygit:toggle()
end
vim.api.nvim_set_keymap("n", "<C-g>", "<cmd>lua _Lazygit_toggle()<CR>", { noremap = true, silent = true })
local arduinoMonitor = Terminal:new({
cmd = "arduino-cli monitor -p /dev/ttyUSB0",
direction = "horizontal",
float_opts = {
winblend = 0,
padding = 10,
border = "single",
},
on_close = function()
Terminal:close()
end,
})
vim.api.nvim_create_user_command("ArduinoMonitor", function()
arduinoMonitor:toggle()
end, {})
local arduinoCompileUploadMonitor = Terminal:new({
cmd = "arduino-cli compile --upload && arduino-cli monitor -p /dev/ttyUSB0",
direction = "horizontal",
float_opts = {
winblend = 0,
padding = 10,
border = "single",
},
on_close = function()
Terminal:close()
end,
})
vim.api.nvim_create_user_command("ArduinoUploadMonitor", function()
arduinoCompileUploadMonitor:toggle()
end, {})
local arduinoUpload = Terminal:new({
cmd = "arduino-cli compile --upload",
direction = "horizontal",
float_opts = {
winblend = 0,
padding = 10,
border = "single",
},
on_close = function()
Terminal:close()
end,
})
vim.api.nvim_create_user_command("ArduinoUpload", function()
arduinoUpload:toggle()
end, {})
local pnpm = Terminal:new({
dir = "git_dir",
direction = "float",
float_opts = {
winblend = 0,
padding = 10,
border = "single",
},
on_close = function()
Terminal:close()
end,
})
function _Pnpm_toggle()
pnpm:toggle()
end
vim.api.nvim_set_keymap("n", "<C-t>", "<cmd>lua _Pnpm_toggle()<CR>", { noremap = true, silent = true })
end,
}

View File

@ -0,0 +1,7 @@
return {
"uga-rosa/translate.nvim",
event = "InsertEnter",
config = function()
require("translate").setup({ default = { output = "replace" } })
end,
}

View File

@ -0,0 +1,95 @@
return {
"nvim-treesitter/nvim-treesitter",
event = "VeryLazy",
enable = false,
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"JoosepAlviste/nvim-ts-context-commentstring",
"windwp/nvim-ts-autotag",
},
config = function()
require("nvim-treesitter.configs").setup({
context_commentstring = {
enable = true
},
ignore_install = {},
sync_install = false,
auto_install = true,
modules = {},
autotag = {
enable = true,
},
indent = {
enable = true,
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = '<CR>',
scope_incremental = '<CR>',
node_incremental = '<TAB>',
node_decremental = '<S-TAB>',
},
},
ensure_installed = {
"bash",
"yaml",
"http",
"svelte",
"css",
"svelte",
"typescript",
"javascript",
"tsx",
"go",
"lua",
"json",
"yaml",
"prisma",
},
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
textobjects = {
select = {
enable = true,
-- Automatically jump forward to textobj, similar to targets.vim
lookahead = true,
keymaps = {
["af"] = "@function.outer",
["if"] = "@function.inner",
["ac"] = "@class.outer",
["ic"] = "@class.inner",
},
-- You can choose the select mode (default is charwise 'v')
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * method: eg 'v' or 'o'
-- and should return the mode ('v', 'V', or '<c-v>') or a table
-- mapping query_strings to modes.
selection_modes = {
["@parameter.outer"] = "v", -- charwise
["@function.outer"] = "V", -- linewise
["@class.outer"] = "<c-v>", -- blockwise
},
-- If you set this to `true` (default is `false`) then any textobject is
-- extended to include preceding or succeeding whitespace. Succeeding
-- whitespace has priority in order to act similarly to eg the built-in
-- `ap`.
--
-- Can also be a function which gets passed a table with the keys
-- * query_string: eg '@function.inner'
-- * selection_mode: eg 'v'
-- and should return true of false
include_surrounding_whitespace = true,
},
},
})
vim.opt.foldenable = false;
vim.opt.foldmethod = "expr";
vim.opt.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
end,
build = ":TSUpdate",
}

View File

@ -0,0 +1,6 @@
return {
"folke/trouble.nvim",
cmd = "TroubleToggle",
dependencies = "nvim-tree/nvim-web-devicons",
config = true,
}

View File

@ -0,0 +1,6 @@
return {
"pmizio/typescript-tools.nvim",
ft = { "typescript", "typescriptreact" },
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
opts = {},
}

View File

@ -0,0 +1,4 @@
return {
"mbbill/undotree",
cmd = { "Undotree", "UndotreeToggle" }
}

View File

@ -0,0 +1,7 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
config = function()
require("which-key").setup({})
end,
}