initial commit

This commit is contained in:
2025-10-14 12:29:46 +02:00
parent 0439bb0ff7
commit 903704e4d7
99 changed files with 8495 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
return {
"NStefan002/2048.nvim",
cmd = "Play2048",
enabled = false,
config = true,
}

View File

@@ -0,0 +1,4 @@
return {
"brenoprata10/nvim-highlight-colors",
opts = {}
}

View File

@@ -0,0 +1,5 @@
return {
'numToStr/Comment.nvim',
lazy = false,
opts = {}
}

View File

@@ -0,0 +1,105 @@
local function setup()
-- Set up nvim-cmp
local cmp = require 'cmp'
local lspkind = require('lspkind')
local cmp_select = { behavior = cmp.SelectBehavior.Select }
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
local luasnip = require("luasnip")
if not luasnip then
return
end
luasnip.lsp_expand(args.body)
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }),
['<C-n>'] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }),
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' }, -- For luasnip users.
-- { name = 'emoji' }
}, {
{ name = 'buffer' },
}),
formatting = {
format = lspkind.cmp_format({
mode = 'symbol',
maxwidth = 50,
ellipsis_char = 'b',
before = function(entry, vim_item)
return vim_item
end
})
}
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- auto pairs
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
cmp.event:on(
'confirm_done',
cmp_autopairs.on_confirm_done()
)
end
return {
'hrsh7th/nvim-cmp',
event = { "InsertEnter", "CmdlineEnter" },
config = function()
setup()
end,
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-cmdline',
'hrsh7th/nvim-cmp',
'onsails/lspkind.nvim',
'saadparwaiz1/cmp_luasnip',
'hrsh7th/cmp-emoji',
{ 'windwp/nvim-autopairs', opts = {} },
require('plugins.spec.snippets'),
require('plugins.spec.lsp'),
require('plugins.spec.jdtls')
}
}

View File

@@ -0,0 +1,23 @@
return {
"tpope/vim-dadbod",
config = function()
local augroup = vim.api.nvim_create_augroup("SqlCompletion", {})
vim.api.nvim_create_autocmd({ "FileType" }, {
group = augroup,
pattern = { "sql", "mysql", "plsql" },
callback = function()
require('cmp').setup.buffer({
sources = {
{ name = 'vim-dadbod-completion' }
}
})
end
})
end,
dependencies = {
"kristijanhusak/vim-dadbod-ui",
"pbogut/vim-dadbod-ssh",
"kristijanhusak/vim-dadbod-completion"
}
}

View File

@@ -0,0 +1,13 @@
return {
'tpope/vim-fugitive',
keys = {
{ '<leader>gg', ':Git<cr>', 'Git Status' },
{ '<leader>gc', function()
if vim.bo.filetype == 'fugitive' then
vim.cmd.close()
end
vim.cmd("Git commit")
end, '(g)it (c)ommit' }
},
cmd = 'Git'
}

View File

@@ -0,0 +1,28 @@
return {
"David-Kunz/gen.nvim",
opts = {
model = "deepseek-r1:14b", -- The default model to use.
host = "localhost", -- The host running the Ollama service.
port = "11434", -- The port on which the Ollama service is listening.
quit_map = "q", -- set keymap for close the response window
retry_map = "<c-r>", -- set keymap to re-send the current prompt
init = function(options) pcall(io.popen, "ollama serve > /dev/null 2>&1 &") end,
-- Function to initialize Ollama
command = function(options)
local body = { model = options.model, stream = true }
return "curl --silent --no-buffer -X POST http://" ..
options.host .. ":" .. options.port .. "/api/chat -d $body"
end,
-- The command for the Ollama service. You can use placeholders $prompt, $model and $body (shellescaped).
-- This can also be a command string.
-- The executed command must return a JSON object with { response, context }
-- (context property is optional).
-- list_models = '<omitted lua function>', -- Retrieves a list of model names
display_mode = "split", -- The display mode. Can be "float" or "split".
show_prompt = true, -- Shows the prompt submitted to Ollama.
show_model = true, -- Displays which model you are using at the beginning of your chat session.
no_auto_close = true, -- Never closes the window automatically.
debug = false -- Prints errors and the command which is run.
}
}

View File

@@ -0,0 +1,8 @@
return {
'edluffy/hologram.nvim',
event = 'VeryLazy',
enabled = false,
opts = {
auto_display = true
}
}

View File

@@ -0,0 +1,5 @@
local plugins = {
'mfussenegger/nvim-jdtls',
}
return plugins

View File

@@ -0,0 +1,15 @@
return {
enabled = false,
"mfussenegger/nvim-jdtls",
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities()
require("jdtls").start_or_attach({
cmd = { "jdtls" },
root_dir = vim.fs.dirname(vim.fs.find({ 'gradlew', '.git', 'mvnw', 'pom.xml' }, { upward = true })[1]),
capabilities = capabilities
})
end,
dependencies = {
require("plugins.spec.lsp")
}
}

View File

@@ -0,0 +1,188 @@
local function keymap(args)
-- get client
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
if not client then
return
end
-- loading workspace diagnostics
require('workspace-diagnostics').populate_workspace_diagnostics(client, bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
vim.keymap.set('n', '<A-k>', function()
vim.diagnostic.open_float({ focusable = false, border = "rounded" })
end, bufopts)
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, bufopts)
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
-- autoformat
if client.supports_method('textDocument/formatting') then
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('LspFormatting', { clear = true }),
buffer = args.buf,
callback = function()
if vim.fn.exists(":LspEslintFixAll") == 1 then
vim.cmd(":LspEslintFixAll")
else
vim.lsp.buf.format { bufnr = args.buf, id = client.id }
end
end
})
end
-- vim.lsp.inlay_hint.enable(true, { bufnr })
end
local function diagnostic_icons()
local signs = {
Error = "",
Warn = "",
Hint = "",
Info = ""
}
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
end
local function configToHandler(server, config)
return function()
require("lspconfig")[server].setup(config)
end
end
local function lsp_setup()
local lspconfig = require("lspconfig")
-- adding edge cases for workspace diagnostics
require('workspace-diagnostics').setup {
workspace_files = function()
local gitPath = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
local workspace_files = vim.fn.split(vim.fn.system("git ls-files " .. gitPath), "\n")
-- this makes nuxt laod the nuxt typescript definition
table.insert(workspace_files, '.nuxt/nuxt.d.ts')
return workspace_files
end
}
vim.api.nvim_create_autocmd("LspAttach", {
desc = "LSP actions",
callback = keymap
})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
local with_defaults = function(config)
config.capabilities = capabilities
return config
end
require('mason').setup({})
require('mason-lspconfig').setup { ensure_installed = {} }
vim.lsp.enable({
'vue_ls',
'nil_ls',
'nixd',
'rust_analyzer',
'lua_ls',
'gdscript',
'jsonls',
'r_language_server',
'tailwindcss',
'html',
'taplo',
'protols',
'yamlls',
'clangd',
'eslint',
'nushell',
'tinymist'
-- 'jdtls'
})
-- not collision between deno lsp and ts lsp
if require("lib.lsp").has_file("deno.json") then
vim.lsp.enable("denols")
else
vim.lsp.enable("vtsls")
-- vim.lsp.enable("ts_ls") this is disabled vtsls for vue required
end
vim.lsp.config('*', with_defaults({}))
vim.lsp.config('vue_ls', with_defaults(require("plugins.spec.server_configurations.vue")))
vim.lsp.config('nil_ls', with_defaults(require("plugins.spec.server_configurations.nix")['nil']))
vim.lsp.config('nixd', with_defaults(require("plugins.spec.server_configurations.nix")['nixd']))
vim.lsp.config('rust_analyzer', with_defaults(require("plugins.spec.server_configurations.rust")))
vim.lsp.config('lua_ls', with_defaults(require("plugins.spec.server_configurations.lua")))
vim.lsp.config('gdscript', with_defaults(require("plugins.spec.server_configurations.gdscript")))
vim.lsp.config('ts_ls', with_defaults(require("plugins.spec.server_configurations.typescript").config()))
vim.lsp.config('jsonls', with_defaults(require("plugins.spec.server_configurations.json")))
vim.lsp.config('yamlls', with_defaults(require("plugins.spec.server_configurations.yaml")))
vim.lsp.config('denols', with_defaults(require("plugins.spec.server_configurations.deno").config()))
vim.lsp.config('r_language_server', with_defaults({
cmd = { "R", "--no-echo", "-e", "languageserver::run()" }
}))
vim.lsp.config('jdtls', with_defaults(require("plugins.spec.server_configurations.java")))
vim.lsp.config('tailwindcss', with_defaults(require("plugins.spec.server_configurations.tailwindcss")))
vim.lsp.config('html', with_defaults(require("plugins.spec.server_configurations.html")))
vim.lsp.config('taplo', with_defaults(require("plugins.spec.server_configurations.taplo")))
vim.lsp.config('protols', with_defaults(require("plugins.spec.server_configurations.proto")))
vim.lsp.config('clangd', with_defaults(require("plugins.spec.server_configurations.clang")))
vim.lsp.config('vtsls', with_defaults(require("plugins.spec.server_configurations.vtsls").config()))
vim.lsp.config('eslint', with_defaults(require("plugins.spec.server_configurations.eslint")))
vim.lsp.config('tinymist', with_defaults({
cmd = { "tinymist" }
}))
vim.diagnostic.config({
virtual_text = {
prefix = '', -- or '■', '▎', 'x', '' whatever you want
spacing = 2,
},
underline = true,
update_in_insert = false, -- set to true if you want real-time errors while typing
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "",
[vim.diagnostic.severity.WARN] = "",
[vim.diagnostic.severity.INFO] = "",
[vim.diagnostic.severity.HINT] = "",
}
}
})
end
return {
'neovim/nvim-lspconfig',
event = { "BufReadPost", "BufNewFile" },
config = function()
lsp_setup()
end,
dependencies = {
{ 'williamboman/mason.nvim' },
{ 'williamboman/mason-lspconfig.nvim' },
'artemave/workspace-diagnostics.nvim',
}
}

View File

@@ -0,0 +1,11 @@
return {
'nvim-lualine/lualine.nvim',
event = "VeryLazy",
lazy = false,
config = function()
require('plugins.config.lualine')
end,
dependencies = {
require("plugins.spec.theme")
}
}

View File

@@ -0,0 +1,20 @@
function preview()
if vim.bo.filetype ~= "markdown" then
return nil
end
vim.cmd("MarkdownPreview")
end
return {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = "cd app && yarn install",
keys = {
{ "<leader>p", preview, desc = "Markdown Preview" },
},
init = function()
vim.g.mkdp_filetypes = { "markdown" }
end,
ft = { "markdown" },
}

View File

@@ -0,0 +1,4 @@
return {
"echasnovski/mini.bracketed",
opts = {},
}

View File

@@ -0,0 +1,39 @@
return {
'folke/noice.nvim',
event = "UIEnter",
enabled = true,
opts = {
messages = {
enabled = false,
view = "mini",
view_warn = "mini",
view_error = "mini"
},
lsp = {
-- override makdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
hover = {
enabled = false,
},
signature = {
enabled = false
}
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
},
dependencies = {
'MunifTanjim/nui.nvim',
require("plugins.spec.notify")
}
}

View File

@@ -0,0 +1,12 @@
return {
'rcarriga/nvim-notify',
event = "UIEnter",
lazy = false,
config = function()
require('notify').setup {
background_colour = "#000000",
}
vim.notify = require('notify')
end
}

View File

@@ -0,0 +1,20 @@
return {
'mfussenegger/nvim-dap',
dependencies = {
{'jay-babu/mason-nvim-dap.nvim', opts = {
handlers = {
function (config)
require('mason-nvim-dap').default_setup(config)
end,
cppdbg = function (config)
config.adapters.lldb = {
type = 'executable',
command = 'lldb-vscode',
name = 'lldb'
}
require('mason-nvim-dap').default_setup(config)
end
}
}}
}
}

View File

@@ -0,0 +1,20 @@
local function oil()
require("oil").open()
end
return {
'stevearc/oil.nvim',
opts = {
view_options = {
show_hidden = true
}
},
lazy = false,
cmd = 'Oil',
keys = {
{"<leader>ft", oil, ""}
},
dependencies = {
'kyazdani42/nvim-web-devicons',
}
}

View File

@@ -0,0 +1,6 @@
return {
'windwp/nvim-projectconfig',
enabled = true,
opts = {},
lazy = false
}

View File

@@ -0,0 +1,4 @@
return {
cmd = { "clangd" },
filetypes = { "c", "cpp", "objc", "objcpp" },
}

View File

@@ -0,0 +1,6 @@
return {
config = function()
return {}
end
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "vscode-eslint-language-server", "--stdio" }
}

View File

@@ -0,0 +1,3 @@
return {
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "vscode-html-language-server", "--stdio" },
}

View File

@@ -0,0 +1,18 @@
return {
cmd = { "jdtls", "-configuration", "/home/quirinecker/.cache/jdtls/config", "-data", "/home/quirinecker/.cache/jdtls/workspace" },
java = {
contentProvider = { preferred = 'fernflower' },
configuration = {
updateBuildConfiguration = 'interactive',
},
},
{
jvm_args = {},
workspace = "/home/quirinecker/.cache/jdtls/workspace"
},
init_options = {
jvm_args = {
"--enable-preview"
}
}
}

View File

@@ -0,0 +1,17 @@
return {
cmd = { "vscode-json-language-server", "--stdio" },
settings = {
json = {
schemas = {
{
fileMatch = { 'package.json' },
url = 'https://json.schemastore.org/package.json',
},
{
fileMatch = { 'tsconfig.json', 'tsconfig.*.json' },
url = 'https://json.schemastore.org/tsconfig.json'
}
},
},
}
}

View File

@@ -0,0 +1,46 @@
function should_load_nvim_workspace()
return true
end
return {
on_init = function(client)
if not should_load_nvim_workspace() then
return
end
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
runtime = {
-- Tell the language server which version of Lua you're using (most
-- likely LuaJIT in the case of Neovim)
version = 'LuaJIT',
-- Tell the language server how to find Lua modules same way as Neovim
-- (see `:h lua-module-load`)
path = {
'lua/?.lua',
'lua/?/init.lua',
},
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME
-- Depending on the usage, you might want to add additional paths
-- here.
-- '${3rd}/luv/library'
-- '${3rd}/busted/library'
}
-- Or pull in all of 'runtimepath'.
-- NOTE: this is a lot slower and will cause issues when working on
-- your own configuration.
-- See https://github.com/neovim/nvim-lspconfig/issues/3189
-- library = {
-- vim.api.nvim_get_runtime_file('', true),
-- }
}
})
end,
settings = {
Lua = {}
}
}

View File

@@ -0,0 +1,16 @@
return {
['nil'] = {
cmd = { "nil" },
settings = {
["nil"] = {
formatting = {
command = { "nixfmt" },
},
},
},
},
['nixd'] = {
cmd = { "nixd" },
}
}

View File

@@ -0,0 +1,3 @@
return {
cmd = {"protols"}
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "pyright" },
}

View File

@@ -0,0 +1,10 @@
return {
cmd = { "rust-analyzer" },
settings = {
["rust-analyzer"] = {
rustfmt = {
overrideCommand = { "rustfmt" },
}
}
}
}

View File

@@ -0,0 +1,4 @@
return {
cmd = { "tailwindcss-language-server", "--stdio" },
root_markers = { "package.json" },
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "taplo", "lsp", "stdio" }
}

View File

@@ -0,0 +1,27 @@
return {
config = function()
local vuePluginPath = vim.fn.expand(
"~/.config/dotfiles/homes/quirinecker/.npm_global/node_modules/@vue/typescript-plugin/")
return {
cmd = { "typescript-language-server", "--stdio" },
single_file_support = true,
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = vuePluginPath,
languages = { "javascript", "typescript", "vue" },
},
},
},
filetypes = {
"javascript",
"typescript",
-- currently disabled because no attribute completions
-- "vue",
}
}
end
}

View File

@@ -0,0 +1,25 @@
return {
config = function()
local vuePluginPath = vim.fn.expand(
"~/.config/dotfiles/homes/quirinecker/.npm_global/node_modules/@vue/typescript-plugin/")
local vue_plugin = {
name = '@vue/typescript-plugin',
location = vuePluginPath,
languages = { 'vue' },
configNamespace = 'typescript',
}
return {
settings = {
vtsls = {
tsserver = {
globalPlugins = {
vue_plugin,
},
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
end
}

View File

@@ -0,0 +1,3 @@
return {
cmd = { "vue-language-server", "--stdio" },
}

View File

@@ -0,0 +1,14 @@
return {
cmd = { "yaml-language-server", "--stdio" },
settings = {
yaml = {
schemas = {
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] =
"compose.yaml",
["https://raw.githubusercontent.com/SchemaStore/schemastore/refs/heads/master/src/schemas/json/github-workflow.json"] = "**/.github/workflows/*"
}
}
}
}

View File

@@ -0,0 +1,9 @@
return {
"L3MON4D3/LuaSnip",
version = "v2.*",
run = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
dependencies = { 'rafamadriz/friendly-snippets' }
}

View File

@@ -0,0 +1,6 @@
return {
enabled = true,
"supermaven-inc/supermaven-nvim",
-- lazy = false,
opts = {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,24 @@
local M = {}
M.find_directories = function()
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
pickers.new({}, {
prompt_title = "Finde Directories",
__locations_input = true,
finder = finders.new_oneshot_job({ "find", "-type", "d" }, {
entry_maker = function(entry)
return {
value = entry,
display = '' .. entry,
ordinal = entry,
}
end
}),
sorter = conf.file_sorter()
}):find()
end
return M

View File

@@ -0,0 +1,101 @@
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
local actions = require("telescope.actions")
local action_state = require("telescope.actions.state")
local M = {}
local function trim(s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
local function parse_emoji_line(line)
if not line or vim.startswith(line, "#") then
return nil
end
local id_element_split = vim.split(line, ";")
local element = id_element_split[2]
if not element then
return nil
end
local state_emoji_split = vim.split(element, "#")
local qualified = state_emoji_split[1]
local emoji = state_emoji_split[2]
if not qualified or trim(qualified) ~= "fully-qualified" then
return nil
end
if not emoji then
return nil
end
local icon_description_split = vim.split(emoji, " ")
local icon = icon_description_split[2]
local description = icon_description_split[4]
if not description then
return nil
end
return {
display = trim(icon) .. " " .. trim(description),
value = trim(icon)
}
end
function M.find_emojis()
local path = vim.fn.stdpath("config") .. "/lua/plugins/spec/telescope-picker/emojis.txt"
print(path)
local file = io.open(path, "r")
if not file then
print("Emoji File not found")
return nil
end
local t = {}
for line in file:lines() do
local parsed_line = parse_emoji_line(line)
if parsed_line then
table.insert(t, parsed_line)
end
end
file:close()
local finder = finders.new_table({
results = t,
entry_maker = function(entry)
return {
value = entry.value,
display = entry.display,
ordinal = entry.display,
}
end
})
pickers.new(conf, {
prompt_title = "Find Emojis",
finder = finder,
sorter = conf.generic_sorter(t),
attach_mappings = function(prompt_bufnr, _)
actions.select_default:replace(function()
actions.close(prompt_bufnr)
local selection = action_state.get_selected_entry()
local buf = vim.api.nvim_get_current_buf()
local cursor = vim.api.nvim_win_get_cursor(0)
vim.api.nvim_buf_set_text(buf, cursor[1] - 1, cursor[2], cursor[1] - 1, cursor[2], { selection.value })
vim.api.nvim_win_set_cursor(0, { cursor[1], cursor[2] + 1 })
end)
return true
end,
}):find()
end
return M

View File

@@ -0,0 +1,50 @@
local M = {}
M.multi_grep = function(opts)
local pickers = require("telescope.pickers")
local finders = require("telescope.finders")
local conf = require("telescope.config").values
local make_entry = require "telescope.make_entry"
opts = opts or {}
opts.cwd = opts.cwd or vim.fn.getcwd()
local finder = finders.new_async_job {
command_generator = function(prompt)
if not prompt or prompt == "" then
return nil
end
local segments = vim.split(prompt, " ")
local args = { "rg" }
if segments[1] then
table.insert(args, "-e")
table.insert(args, segments[1])
end
if segments[2] then
table.insert(args, "-g")
table.insert(args, segments[2])
end
return vim.tbl_flatten {
args,
{ "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--smart-case" },
}
end,
entry_maker = make_entry.gen_from_vimgrep(opts),
cwd = opts.cwd,
}
pickers.new({}, {
debounce = 100,
prompt_title = "Multi Grep",
finder = finder,
previewer = conf.grep_previewer(opts),
sorter = require("telescope.sorters").empty(),
}):find()
end
M.multi_grep()
return M

View File

@@ -0,0 +1,86 @@
local dropdown_configs = {
layout_strategy = 'horizontal',
layout_config = {
prompt_position = 'bottom',
horizontal = {
width = 0.8,
height = 100,
},
},
}
local function find_files()
require("telescope.builtin").find_files()
end
local function find_references()
require('telescope.builtin').lsp_references()
end
local function find_buffers()
require('telescope.builtin').buffers()
end
local function find_helptags()
require('telescope.builtin').help_tags()
end
local function find_text()
require('telescope.builtin').live_grep()
end
local function find_directories()
require('plugins.spec.telescope-picker.find_directories').find_directories()
end
local function find_grep()
require('plugins.spec.telescope-picker.multi_grep').multi_grep()
end
local function find_emojis()
require('plugins.spec.telescope-picker.find_emojis').find_emojis()
end
return {
'nvim-telescope/telescope.nvim',
config = function()
require('telescope').setup({
extensions = {
['ui-select'] = {
require('telescope.themes').get_dropdown(dropdown_configs),
},
},
pickers = {
find_files = {
hidden = true,
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
}
},
})
require('telescope').load_extension('ui-select')
vim.api.nvim_create_user_command("FindPluginFiles", function()
require('telescope.builtin').find_files({
cwd = vim.fs.joinpath(vim.fn.stdpath('data'), 'lazy'),
})
end, {})
vim.api.nvim_create_user_command("FindEmojis", function()
find_emojis()
end, {})
end,
keys = {
{ '<leader>ff', find_files, desc = "(f)ind (f)iles" },
{ '<leader>gr', find_references, desc = "(g)o to (r)eferences" },
{ '<leader>fg', find_grep, desc = "(f)ind (g)rep" },
{ '<leader>fb', find_buffers, desc = "(f)ind (b)uffers" },
{ '<leader>fht', find_helptags, desc = "(f)ind (b)elp tags" },
{ '<leader>fd', find_directories, desc = "(f)ind (d)irectories" },
},
cmd = { "Telescope", "FindPluginFiles", "FindEmojis" },
dependencies = {
'nvim-telescope/telescope-ui-select.nvim',
'nvim-lua/plenary.nvim',
'kyazdani42/nvim-web-devicons',
}
}

View File

@@ -0,0 +1,43 @@
return {
{
'catppuccin/nvim',
as = 'catppuccin',
config = function()
require("catppuccin").setup {
flavour = "mocha",
transparent_background = true
}
-- vim.cmd [[ colorscheme catppuccin ]]
end
},
{
'EdenEast/nightfox.nvim',
config = function()
require('nightfox').setup {
options = { transparent = true }
}
-- vim.cmd [[ colorscheme nightfox ]]
end,
},
{
'navarasu/onedark.nvim',
config = function()
require('onedark').setup {
transparent = true,
lualine = {
transparent = true
}
}
-- vim.cmd [[ colorscheme onedark ]]
end
},
{
'shaunsingh/nord.nvim',
config = function()
vim.g.nord_disable_background = true
vim.cmd [[colorscheme nord]]
end
}
}

View File

@@ -0,0 +1,78 @@
return {
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
event = { "BufReadPost", "BufNewFile" },
config = function()
require("nvim-treesitter.configs").setup {
ensure_installed = {
"lua",
"typescript",
"javascript",
"css",
"html",
"json",
"markdown",
"markdown_inline",
"yaml",
"rust",
"python",
"gdscript",
"vue",
"toml",
},
highlight = {
enable = true
},
indent = {
enable = true
}
}
end,
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
config = function()
require("nvim-treesitter.configs").setup {
textobjects = {
select = {
enable = true,
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = {
-- You can use the capture groups defined in textobjects.scm
["afn"] = "@function.outer",
["ifn"] = "@function.inner",
["acl"] = "@class.outer",
["icl"] = "@class.inner",
["icm"] = "@comment.inner",
["acm"] = "@comment.outer",
["ib"] = "@block.inner",
["ab"] = "@block.outer",
["la"] = "@assignment.lhs",
["ra"] = "@assignment.lhs"
},
}
}
}
end
},
}
},
{
'nvim-treesitter/nvim-treesitter-context',
event = { "BufReadPost", "BufNewFile" },
opts = {
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
line_numbers = true,
multiline_threshold = 20, -- Maximum number of lines to collapse for a single context line
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
-- Separator between context and content. Should be a single character string, like '-'.
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
separator = nil,
zindex = 20, -- The Z-index of the context window
}
},
}

View File

@@ -0,0 +1,25 @@
return {
"folke/trouble.nvim",
dependencies = "nvim-tree/nvim-web-devicons",
config = function()
require("trouble").setup {}
end,
init = function()
vim.api.nvim_create_autocmd("BufRead", {
callback = function(ev)
if vim.bo[ev.buf].buftype == "quickfix" then
vim.schedule(function()
vim.cmd([[cclose]])
vim.cmd([[Trouble qflist open]])
end)
end
end,
})
end,
cmd = { "Trouble" },
keys = {
{ "<leader>dl", vim.diagnostic.setqflist, "(d)iagnostic (l)ist" },
{ "<leader>qn", vim.cmd.cnext, "(q)uickfix (n)ext" },
{ "<leader>qp", vim.cmd.cprev, "(q)uickfix (p)revious" },
}
}

View File

@@ -0,0 +1,21 @@
function preview()
if vim.bo.filetype ~= "tex" then
return
end
print("Previewing " .. vim.fn.expand("%:p"))
vim.cmd("VimtexCompile")
end
return {
'lervag/vimtex',
-- event = "InsertEnter",
config = function()
vim.g.vimtex_view_method = "zathura"
vim.keymap.set("n", "<leader>p", preview)
end,
lazy = false,
enabled = true,
dependencies = {}
}