This commit is contained in:
davidon-top 2023-08-02 16:39:49 +02:00
commit 9d3d05066f
80 changed files with 7776 additions and 0 deletions

View file

@ -0,0 +1,14 @@
local npairs = require("nvim-autopairs")
local Rule = require("nvim-autopairs.rule")
npairs.setup({
check_ts = true,
ts_config = {
lua = {"string"},
javascript = {"template_string"},
},
enable_check_bracket_line = false,
ignored_next_char = "[%w%.]",
})
local ts_conds = require("nvim-autopairs.ts-conds")

30
.backup/after/plugin/dash.lua Executable file
View file

@ -0,0 +1,30 @@
local home = os.getenv('HOME')
local db = require('dashboard')
db.custom_header = {"",
" /$$$$$$ /$$ /$$ ",
" /$$__ $$ | $$ | $$ ",
" /$$$$$$$ /$$$$$$ /$$$$$$ | $$ \\__//$$$$$$ /$$$$$$ /$$$$$$$| $$$$$$$ ",
"| $$__ $$ /$$__ $$ /$$__ $$| $$$$ /$$__ $$|_ $$_/ /$$_____/| $$__ $$",
"| $$ \\ $$| $$$$$$$$| $$ \\ $$| $$_/ | $$$$$$$$ | $$ | $$ | $$ \\ $$",
"| $$ | $$| $$_____/| $$ | $$| $$ | $$_____/ | $$ /$$| $$ | $$ | $$",
"| $$ | $$| $$$$$$$| $$$$$$/| $$ | $$$$$$$ | $$$$/| $$$$$$$| $$ | $$",
"|__/ |__/ \\_______/ \\______/ |__/ \\_______/ \\___/ \\_______/|__/ |__/",
"",
"",
"",
"",
"",
"",
"",
}
db.custom_center = {
{
icon = '',
desc ='File Browser ',
action = 'Telescope file_browser',
shortcut = 'SPC e e'
},
}

9
.backup/after/plugin/git.lua Executable file
View file

@ -0,0 +1,9 @@
require('gitsigns').setup {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
}

214
.backup/after/plugin/lsp.lua Executable file
View file

@ -0,0 +1,214 @@
require('neodev').setup()
-- vim.lsp.ensure_installed({
-- "clangd",
-- "gopls",
-- "jdtls",
-- "eslint",
-- "tailwindcss",
-- "tsserver",
-- "cssmodules_ls",
-- "rome",
-- "jsonls",
-- "sumneko_lua",
-- "pylsp",
-- "rust_analyzer",
-- "stylelint_lsp",
-- })
local navic = require("nvim-navic")
navic.setup {
icons = {
File = "",
Module = "",
Namespace = "",
Package = "",
Class = "",
Method = "",
Property = "",
Field = "",
Constructor = "",
Enum = "",
Interface = "",
Function = "",
Variable = "",
Constant = "",
String = "",
Number = "",
Boolean = "",
Array = "",
Object = "",
Key = "",
Null = "",
EnumMember = "",
Struct = "",
Event = "",
Operator = "",
TypeParameter = "",
},
highlight = false,
separator = " > ",
depth_limit = 0,
depth_limit_indicator = "..",
safe_output = true
}
local on_attach = function(client, bufnr)
local nmap = function(keys, func, desc)
if desc then
desc = 'LSP: ' .. desc
end
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
end
if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr)
end
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
nmap('<leader>vt', vim.lsp.buf.type_definition, 'Type [D]efinition')
nmap('<leader>vs', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
-- Lesser used LSP functionality
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
nmap('<leader>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, '[W]orkspace [L]ist Folders')
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
vim.lsp.buf.format()
end, { desc = 'Format current buffer with LSP' })
end
local servers = {
clangd = {},
gopls = {},
pyright = {},
rust_analyzer = {},
tsserver = {},
sumneko_lua = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
}
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
require('mason').setup()
local mason_lspconfig = require 'mason-lspconfig'
mason_lspconfig.setup {
ensure_installed = vim.tbl_keys(servers),
}
mason_lspconfig.setup_handlers {
function(server_name)
require('lspconfig')[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
}
end,
}
-- lspinfo
require('fidget').setup()
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require 'cmp'
local luasnip = require 'luasnip'
-- local tabnine = require('cmp_tabnine.config')
--
-- tabnine:setup({
-- max_lines = 1000,
-- max_num_results = 20,
-- sort = true,
-- run_on_every_keystroke = true,
-- snippet_placeholder = '..',
-- ignored_file_types = {
-- -- default is not to ignore
-- -- uncomment to ignore in lua:
-- -- lua = true
-- },
-- show_prediction_strength = false
-- })
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert {
["<C-y>"] = cmp.mapping.confirm({ slelect = true}),
["<C-Space>"] = cmp.mapping.complete(),
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select = true,
},
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
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' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = "crates" },
-- { name = "cmp_tabnine" },
},
}
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
vim.diagnostic.config({
signs = true,
underline = true,
update_in_insert = true,
virtual_text = true,
})
require("cmp").config.formatting = {
format = require("tailwindcss-colorizer-cmp").formatter,
behavior = cmp.SelectBehavior.Select,
}
-- require('tabnine').setup({
-- disable_auto_comment=true,
-- accept_keymap="<Tab>",
-- dismiss_keymap = "<C-]>",
-- debounce_ms = 300,
-- suggestion_color = {gui = "#808080", cterm = 244},
-- execlude_filetypes = {"TelescopePrompt"}
-- })

View file

@ -0,0 +1,22 @@
require("presence"):setup({
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
neovim_image_text = "The best PDE, Personalized Development Enviroment", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 15, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = false, -- Displays the current line number instead of the current project
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
-- Rich Presence text options
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
})

166
.backup/after/plugin/rust.lua Executable file
View file

@ -0,0 +1,166 @@
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<leader>rh", function ()
rt.hover_actions.hover_actions()
end, { buffer = bufnr , desc = "Hover actions rust"})
-- Code action groups
vim.keymap.set("n", "<leader>ra", function ()
rt.code_action_group.code_action_group()
end, { buffer = bufnr , desc = "code actions group"})
end,
},
})
rt.inlay_hints.enable()
rt.runnables.runnables()
rt.hover_actions.hover_actions()
rt.hover_range.hover_range()
rt.open_cargo_toml.open_cargo_toml()
rt.parent_module.parent_module()
rt.join_lines.join_lines()
rt.crate_graph.view_crate_graph(backend, output)
require("crates").setup {
smart_insert = true,
insert_closing_quote = true,
avoid_prerelease = true,
autoload = true,
autoupdate = true,
loading_indicator = true,
date_format = "%Y-%m-%d",
thousands_separator = ".",
notification_title = "Crates",
--curl_args = { "-sL", "--retry", "1" },
disable_invalid_feature_diagnostic = false,
text = {
loading = "  Loading",
version = "  %s",
prerelease = "  %s",
yanked = "  %s",
nomatch = "  No match",
upgrade = "  %s",
error = "  Error fetching crate",
},
highlight = {
loading = "CratesNvimLoading",
version = "CratesNvimVersion",
prerelease = "CratesNvimPreRelease",
yanked = "CratesNvimYanked",
nomatch = "CratesNvimNoMatch",
upgrade = "CratesNvimUpgrade",
error = "CratesNvimError",
},
popup = {
autofocus = false,
copy_register = '"',
style = "minimal",
border = "none",
show_version_date = false,
show_dependency_version = true,
max_height = 30,
min_width = 20,
padding = 1,
text = {
title = " %s",
pill_left = "",
pill_right = "",
description = "%s",
created_label = " created ",
created = "%s",
updated_label = " updated ",
updated = "%s",
downloads_label = " downloads ",
downloads = "%s",
homepage_label = " homepage ",
homepage = "%s",
repository_label = " repository ",
repository = "%s",
documentation_label = " documentation ",
documentation = "%s",
crates_io_label = " crates.io ",
crates_io = "%s",
categories_label = " categories ",
keywords_label = " keywords ",
version = " %s",
prerelease = " %s",
yanked = " %s",
version_date = " %s",
feature = " %s",
enabled = " %s",
transitive = " %s",
normal_dependencies_title = " Dependencies",
build_dependencies_title = " Build dependencies",
dev_dependencies_title = " Dev dependencies",
dependency = " %s",
optional = " %s",
dependency_version = " %s",
loading = "",
},
highlight = {
title = "CratesNvimPopupTitle",
pill_text = "CratesNvimPopupPillText",
pill_border = "CratesNvimPopupPillBorder",
description = "CratesNvimPopupDescription",
created_label = "CratesNvimPopupLabel",
created = "CratesNvimPopupValue",
updated_label = "CratesNvimPopupLabel",
updated = "CratesNvimPopupValue",
downloads_label = "CratesNvimPopupLabel",
downloads = "CratesNvimPopupValue",
homepage_label = "CratesNvimPopupLabel",
homepage = "CratesNvimPopupUrl",
repository_label = "CratesNvimPopupLabel",
repository = "CratesNvimPopupUrl",
documentation_label = "CratesNvimPopupLabel",
documentation = "CratesNvimPopupUrl",
crates_io_label = "CratesNvimPopupLabel",
crates_io = "CratesNvimPopupUrl",
categories_label = "CratesNvimPopupLabel",
keywords_label = "CratesNvimPopupLabel",
version = "CratesNvimPopupVersion",
prerelease = "CratesNvimPopupPreRelease",
yanked = "CratesNvimPopupYanked",
version_date = "CratesNvimPopupVersionDate",
feature = "CratesNvimPopupFeature",
enabled = "CratesNvimPopupEnabled",
transitive = "CratesNvimPopupTransitive",
normal_dependencies_title = "CratesNvimPopupNormalDependenciesTitle",
build_dependencies_title = "CratesNvimPopupBuildDependenciesTitle",
dev_dependencies_title = "CratesNvimPopupDevDependenciesTitle",
dependency = "CratesNvimPopupDependency",
optional = "CratesNvimPopupOptional",
dependency_version = "CratesNvimPopupDependencyVersion",
loading = "CratesNvimPopupLoading",
},
keys = {
hide = { "q", "<esc>" },
open_url = { "<cr>" },
select = { "<cr>" },
select_alt = { "s" },
toggle_feature = { "<cr>" },
copy_value = { "yy" },
goto_item = { "gd", "K", "<C-LeftMouse>" },
jump_forward = { "<c-i>" },
jump_back = { "<c-o>", "<C-RightMouse>" },
},
},
src = {
insert_closing_quote = true,
text = {
prerelease = "  pre-release ",
yanked = "  yanked ",
},
coq = {
enabled = false,
name = "Crates",
},
},
null_ls = {
enabled = false,
name = "Crates",
},
}

View file

@ -0,0 +1,41 @@
require("lualine").setup {
options = {
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = ""},
section_separators = { left = "", right = ""},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {"mode"},
lualine_b = {"diff"},
lualine_c = {"branch"},
lualine_x = {"location"},
lualine_y = {"progress"},
lualine_z = {"filename"}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {"filename"},
lualine_x = {"location"},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View file

@ -0,0 +1,34 @@
require("bufferline").setup {
animation = true,
auto_hide = true,
tabpages = true,
closable = true,
clickable = true,
icon_separator_active = "",
icon_separator_inactive = "",
icon_close_tab = "",
icon_close_tab_modified = "",
icon_pinned = "",
separator_style = "slant",
numbers = "buffer_id",
}
-- file sidebars
local nvim_tree_events = require("nvim-tree.events")
local bufferline_api = require("bufferline.api")
local function get_tree_size()
return require"nvim-tree.view".View.width
end
nvim_tree_events.subscribe("TreeOpen", function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe("Resize", function()
bufferline_api.set_offset(get_tree_size())
end)
nvim_tree_events.subscribe("TreeClose", function()
bufferline_api.set_offset(0)
end)

View file

@ -0,0 +1,32 @@
require "telescope".setup {
pickers = {
colorscheme = {
enable_preview = true
}
}
}
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<leader>f/", function ()
require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown {
winblend = 10,
previewer = false,
})
end, {desc = "fuzzy find"})
vim.keymap.set('n', '<leader>f?', require('telescope.builtin').oldfiles, { desc = 'Find recently opened files' })
vim.keymap.set("n", "<leader>fc", builtin.colorscheme, {desc = "Find Colorscheme"})
vim.keymap.set('n', '<leader>fd', require('telescope.builtin').diagnostics, { desc = 'Find Diagnostics' })
vim.keymap.set('n', '<leader>fw', require('telescope.builtin').grep_string, { desc = 'Find current Word' })
vim.keymap.set("n", "<leader>ff", builtin.find_files, {desc = "telescope find files"})
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
vim.keymap.set("n", "<leader>fb", builtin.buffers, {desc = "buffers"})
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
vim.keymap.set("n", "<leader>fs", function()
builtin.grep_string({ search = vim.fn.input("Grep > ")});
vim.keymap.set("n", "<leader>fp", "<cmd>:Telescope projects<cr>")
end, {desc = "grep search through files"})
pcall(require("telescope").load_extension, "fzf")
require("telescope").load_extension("projects")
require("telescope").load_extension("dap")

View file

@ -0,0 +1,11 @@
require"nvim-treesitter.configs".setup {
ensure_installed = { "bash", "cmake", "cpp", "dockerfile", "gitignore", "glsl", "go", "graphql", "html", "java", "javascript", "json5", "kotlin", "markdown", "python", "rasi", "regex", "c", "lua", "rust", "scss", "sql", "sxhkdrc", "toml", "tsx", "typescript", "yaml" },
sync_install = false,
auto_install = true,
indent = { enable = true, disable = { 'python' } },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}