switched to dentritic pattern and cleaned up config
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
local function setup()
|
||||
local from_home = '/.cache/nvim-lsp/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/bin/jdtls'
|
||||
local home_dir = os.getenv('HOME')
|
||||
local path = home_dir .. from_home
|
||||
|
||||
|
||||
local config = {
|
||||
cmd = { path },
|
||||
root_dir = vim.fs.dirname(vim.fs.find({ '.gradlew', '.git', 'mvnw' }, { upward = true })[1]),
|
||||
settings = {
|
||||
java = {
|
||||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = "JavaSE-1.8",
|
||||
path = "/home/quirinecker/.sdkman/candidates/java/8.0.302-open"
|
||||
},
|
||||
{
|
||||
name = "JavaSE-11",
|
||||
path = "/home/quirinecker/.sdkman/candidates/java/11.0.2-open"
|
||||
},
|
||||
{
|
||||
name = "JavaSE-17",
|
||||
path = "/home/quirinecker/.sdkman/candidates/java/17-open"
|
||||
},
|
||||
{
|
||||
name = "JavaSE-18",
|
||||
path = "/home/quirinecker/.sdkman/candidates/java/18-open"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
require('jdtls').start_or_attach(config)
|
||||
|
||||
vim.cmd [[
|
||||
command! -buffer -nargs=? -complete=custom,v:lua.require'jdtls'._complete_compile JdtCompile lua require('jdtls').compile(<f-args>)
|
||||
command! -buffer -nargs=? -complete=custom,v:lua.require'jdtls'._complete_set_runtime JdtSetRuntime lua require('jdtls').set_runtime(<f-args>)
|
||||
command! -buffer JdtUpdateConfig lua require('jdtls').update_project_config()
|
||||
command! -buffer JdtJol lua require('jdtls').jol()
|
||||
command! -buffer JdtBytecode lua require('jdtls').javap()
|
||||
command! -buffer JdtJshell lua require('jdtls').jshell()
|
||||
]]
|
||||
end
|
||||
@@ -0,0 +1,2 @@
|
||||
vim.opt.wrap = true
|
||||
vim.opt.conceallevel = 2
|
||||
@@ -0,0 +1 @@
|
||||
require('config')
|
||||
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"gen.nvim": { "branch": "main", "commit": "b9721662daedd880ca0a0358cf6ffbff60617ab3" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "7c493713bc2cb392706866eeba53aaef6c8e9fc6" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"nightfox.nvim": { "branch": "main", "commit": "7557f26defd093c4e9bc17f28b08403f706f5a44" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7b1960c48078a8b2fb44a89db82f4fa637b2d7c8" },
|
||||
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
|
||||
"nvim": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" },
|
||||
"nvim-dap": { "branch": "master", "commit": "b08e05d7cff6024a9c29b64287d295db7c191450" },
|
||||
"nvim-jdtls": { "branch": "master", "commit": "ece818f909c6414cbad4e1fb240d87e003e10fda" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "5a812abc65d529ea7673059a348814c21d7f87ff" },
|
||||
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
|
||||
"nvim-projectconfig": { "branch": "master", "commit": "db11fd7d51f7180ede292a7584eb62bb48f91863" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "337b503688eccb3046547661e4c738e674548fcf" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "3288c5af7d3820d716272f1d05ab661cc540a5d6" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "e73d2774d12d0ecf9e05578d692ba1ea50508cf2" },
|
||||
"oil.nvim": { "branch": "master", "commit": "7a55ede5e745e31ea8e4cb5483221524922294bf" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||
"renamer.nvim": { "branch": "develop", "commit": "1614d466df53899f11dd5395eaac3c09a275c384" },
|
||||
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
|
||||
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "320b18fba2a4f2fe3c8225c778c687e0d2620384" },
|
||||
"vimtex": { "branch": "master", "commit": "3401dc81a14b7251bd813e2411eaf0d3b65bd2af" },
|
||||
"workspace-diagnostics.nvim": { "branch": "main", "commit": "573ff93c47898967efdfbc6587a1a39e3c2d365e" }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
vim.api.nvim_create_autocmd({ 'TextYankPost' }, {
|
||||
desc = "Highlight when yanking",
|
||||
group = vim.api.nvim_create_augroup("YankHighlight", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
@@ -0,0 +1,44 @@
|
||||
local lib = require('lib.window')
|
||||
|
||||
local command = function(name, callback)
|
||||
vim.api.nvim_create_user_command(name, callback, {})
|
||||
end
|
||||
|
||||
command('Settings', function()
|
||||
local path = vim.fn.expand('~/.config/dotfiles/homes/quirinecker/.config/nvim')
|
||||
lib.new_window(path, 'Settings')
|
||||
end)
|
||||
|
||||
command('TransparencyFix', function()
|
||||
require('lualine').setup(require('plugins.lualine').opts)
|
||||
end)
|
||||
|
||||
command('MavenStartCommand', function()
|
||||
local Path = require("plenary.path")
|
||||
local cwd = Path:new(vim.fn.getcwd()):absolute()
|
||||
local baseName = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(0), ":t")
|
||||
|
||||
if vim.fn.filereadable(cwd .. "/pom.xml") ~= 1 then
|
||||
vim.notify("No pom.xml found in current directory", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
if not baseName:match(".java$") then
|
||||
vim.notify("Current buffer is not a java file", vim.log.levels.ERROR)
|
||||
return
|
||||
end
|
||||
|
||||
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
|
||||
|
||||
local className = baseName:gsub(".java", "")
|
||||
local packageName = ""
|
||||
for _, line in ipairs(lines) do
|
||||
if line:match("^package ") then
|
||||
local value = vim.split(line, " ")[2]
|
||||
packageName = value:gsub(";", "")
|
||||
end
|
||||
end
|
||||
|
||||
vim.fn.setreg("+", "mvn exec:java -Dexec.mainClass=" .. packageName .. "." .. className)
|
||||
vim.notify("Copied Start Command to Clipboard", vim.log.levels.INFO)
|
||||
end)
|
||||
@@ -0,0 +1,6 @@
|
||||
require('config.settings')
|
||||
require('config.keymap')
|
||||
require('config.commands')
|
||||
require('config.setup')
|
||||
require('config.lazy')
|
||||
require('config.autocommands')
|
||||
@@ -0,0 +1,44 @@
|
||||
local keymap = vim.keymap.set
|
||||
keymap({ 'v', 'n' }, ' ', '', {})
|
||||
|
||||
local function vn_map(map, action)
|
||||
keymap({ 'v', 'n' }, map, action)
|
||||
end
|
||||
|
||||
-- splitting
|
||||
|
||||
|
||||
-- Clipboard
|
||||
vn_map('<leader>y', [["+y]])
|
||||
keymap('n', '<leader>yy', [["+yy]])
|
||||
vn_map('<leader>op', [[o<Esc>"+p]])
|
||||
vn_map('<leader>p', [["+p]])
|
||||
|
||||
vn_map('<leader>cl', ':bd <cr>')
|
||||
vn_map('<leader>ss', ':w <cr>')
|
||||
vn_map('<leader>sq', ':wq <cr>')
|
||||
vn_map('<leader>sc', ':w <cr> :bd <cr>')
|
||||
|
||||
-- Quickfix List
|
||||
|
||||
vim.keymap.set('n', '<alt>n', ':cnext<cr>')
|
||||
vim.keymap.set('n', '<alt>p', ':cprevious<cr>')
|
||||
|
||||
-- Terminal
|
||||
vim.keymap.set('n', '<leader>tt', function()
|
||||
os.execute("kitty")
|
||||
end)
|
||||
|
||||
-- Copy Path to clipboard
|
||||
vim.keymap.set('n', '<leader>yrp', function()
|
||||
local path = vim.fn.expand("%:p")
|
||||
local relative_path = vim.fn.fnamemodify(path, ":~:.")
|
||||
vim.fn.setreg("+", relative_path)
|
||||
vim.notify('Copied "' .. relative_path .. '" to the clipboard!')
|
||||
end)
|
||||
|
||||
vim.keymap.set('n', '<leader>yap', function()
|
||||
local path = vim.fn.expand("%:p")
|
||||
vim.fn.setreg("+", path)
|
||||
vim.notify('Copied "' .. path .. '" to the clipboard!')
|
||||
end)
|
||||
@@ -0,0 +1,9 @@
|
||||
-- require('lazy').setup("plugins")
|
||||
require('lazy').setup({
|
||||
ui = {
|
||||
border = "rounded"
|
||||
},
|
||||
spec = {
|
||||
{ import = "plugins.spec" },
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,40 @@
|
||||
-- Mapleader
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
-- Colors
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- tabsize
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
-- Line Wrap
|
||||
vim.opt.wrap = false
|
||||
|
||||
-- Searching
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
|
||||
-- Line Numbering
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Other
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.colorcolumn = "120"
|
||||
vim.opt.smartindent = true
|
||||
|
||||
-- Disabling Netrw
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- Tabline
|
||||
vim.opt.showtabline = 1
|
||||
|
||||
-- remove indicators above statusline
|
||||
vim.opt.showmode = false
|
||||
|
||||
vim.opt.diffopt = "vertical"
|
||||
@@ -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",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
@@ -0,0 +1 @@
|
||||
package com.example.demo;
|
||||
@@ -0,0 +1,7 @@
|
||||
M = {}
|
||||
|
||||
function M.has_file(filename)
|
||||
return vim.fn.filereadable(filename) == 1
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,15 @@
|
||||
return {
|
||||
new_window = function(o_path, o_title)
|
||||
if o_path == nil then
|
||||
o_path = vim.fn.getcwd()
|
||||
end
|
||||
|
||||
if o_title == nil then
|
||||
o_title = "neovim"
|
||||
end
|
||||
|
||||
print(string.format("ghostty --working-directory='%s' --title='%s' -e nvim .", o_path, o_title))
|
||||
return vim.fn.jobstart(string.format("ghostty --working-directory='%s' --title='%s' -e nvim .", o_path, o_title),
|
||||
{ detach = true })
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
local conditions = require("heirline.conditions")
|
||||
local utils = require("heirline.utils")
|
||||
local devicons = require("nvim-web-devicons")
|
||||
|
||||
local branch = vim.fn.system("git branch --show-current 2>/dev/null")
|
||||
branch = branch:gsub("\n", "")
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
vim.defer_fn(function()
|
||||
vim.cmd("redrawstatus")
|
||||
end, 100)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
local mode_names = {
|
||||
n = "NORMAL",
|
||||
no = "OP-PENDING",
|
||||
nov = "OP-PENDING",
|
||||
noV = "OP-PENDING",
|
||||
["no\22"] = "OP-PENDING",
|
||||
|
||||
niI = "NORMAL",
|
||||
niR = "NORMAL",
|
||||
niV = "NORMAL",
|
||||
|
||||
v = "VISUAL",
|
||||
V = "V-LINE",
|
||||
["\22"] = "V-BLOCK", -- CTRL-V
|
||||
|
||||
s = "SELECT",
|
||||
S = "S-LINE",
|
||||
["\19"] = "S-BLOCK", -- CTRL-S
|
||||
|
||||
i = "INSERT",
|
||||
ic = "INSERT",
|
||||
ix = "INSERT",
|
||||
|
||||
R = "REPLACE",
|
||||
Rc = "REPLACE",
|
||||
Rx = "REPLACE",
|
||||
Rv = "V-REPLACE",
|
||||
Rvc = "V-REPLACE",
|
||||
Rvx = "V-REPLACE",
|
||||
|
||||
c = "COMMAND",
|
||||
cv = "EX",
|
||||
ce = "EX",
|
||||
|
||||
r = "ENTER",
|
||||
rm = "MORE",
|
||||
["r?"] = "CONFIRM",
|
||||
|
||||
["!"] = "SHELL",
|
||||
t = "TERMINAL",
|
||||
}
|
||||
|
||||
|
||||
local colors = {
|
||||
bg = "#3B4252", -- Polar Night
|
||||
fg = "#ECEFF4", -- Snow Storm
|
||||
red = "#BF616A", -- Aurora
|
||||
orange = "#D08770",
|
||||
yellow = "#EBCB8B",
|
||||
green = "#A3BE8C",
|
||||
cyan = "#88C0D0",
|
||||
blue = "#81A1C1",
|
||||
blue_dark = "#5E81AC",
|
||||
magenta = "#B48EAD",
|
||||
}
|
||||
|
||||
local mode_colors = {
|
||||
n = colors.blue_dark, -- NORMAL
|
||||
i = colors.green, -- INSERT
|
||||
v = colors.magenta, -- VISUAL
|
||||
V = colors.magenta,
|
||||
["\22"] = colors.magenta, -- V-BLOCK
|
||||
|
||||
c = colors.yellow, -- COMMAND
|
||||
s = colors.orange, -- SELECT
|
||||
S = colors.orange,
|
||||
R = colors.red, -- REPLACE
|
||||
r = colors.red,
|
||||
|
||||
t = colors.cyan, -- TERMINAL
|
||||
}
|
||||
|
||||
local function BorderLeft(color, background)
|
||||
return {
|
||||
provider = "",
|
||||
hl = function()
|
||||
return { fg = color, bg = background }
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local function BorderRight(color, background)
|
||||
return {
|
||||
provider = "",
|
||||
hl = function()
|
||||
return { fg = color, bg = background }
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local function Mode(color)
|
||||
return {
|
||||
provider = function()
|
||||
return " " .. mode_names[vim.fn.mode()] .. " "
|
||||
end,
|
||||
hl = function()
|
||||
return { bg = color, fg = colors.fg, bold = true }
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
local FileName = {
|
||||
provider = function()
|
||||
local name = vim.fn.expand("%:t")
|
||||
if name == "" then name = "[No Name]" end
|
||||
return name
|
||||
end,
|
||||
hl = { fg = colors.fg, bg = colors.bg },
|
||||
}
|
||||
|
||||
local GitBranch = {
|
||||
-- condition = function(self)
|
||||
-- return vim.fn.system('git rev-parse --is-inside-work-tree 2>/dev/null') == "true\n"
|
||||
-- end,
|
||||
|
||||
provider = function(self)
|
||||
return " " .. branch .. " "
|
||||
end,
|
||||
|
||||
hl = { fg = colors.blue, bg = colors.bg },
|
||||
}
|
||||
|
||||
|
||||
|
||||
local FileIcon = {
|
||||
init = function(self)
|
||||
self.filename = vim.fn.expand("%:t")
|
||||
self.extension = vim.fn.expand("%:e")
|
||||
self.icon, self.icon_color = devicons.get_icon_color(self.filename, self.extension, { default = true })
|
||||
end,
|
||||
|
||||
provider = function(self)
|
||||
return " " .. self.icon .. " "
|
||||
end,
|
||||
|
||||
hl = function(self)
|
||||
return { fg = self.icon_color, bg = colors.bg }
|
||||
end,
|
||||
}
|
||||
|
||||
function SimpleSeperator(foreground, background)
|
||||
return {
|
||||
provider = function()
|
||||
return " | "
|
||||
end,
|
||||
hl = function()
|
||||
return { fg = foreground, bg = background }
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
-- local Lsp = {
|
||||
-- condition = function()
|
||||
-- return #vim.lsp.get_active_clients({ bufnr = 0 }) > 0
|
||||
-- end,
|
||||
-- provider = " LSP ",
|
||||
-- hl = { fg = colors.green },
|
||||
-- }
|
||||
--
|
||||
|
||||
local function Diagnostics(background)
|
||||
return {
|
||||
condition = function()
|
||||
return vim.diagnostic.is_enabled()
|
||||
end,
|
||||
|
||||
init = function(self)
|
||||
self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR })
|
||||
self.warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN })
|
||||
self.info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO })
|
||||
self.hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT })
|
||||
end,
|
||||
|
||||
{
|
||||
-- condition = function(self) return self.errors > 0 end,
|
||||
provider = function(self) return " " .. self.errors .. " " end,
|
||||
hl = { fg = colors.red, bg = background },
|
||||
},
|
||||
{
|
||||
-- condition = function(self) return self.warnings > 0 end,
|
||||
provider = function(self) return " " .. self.warnings .. " " end,
|
||||
hl = { fg = colors.yellow, bg = background },
|
||||
},
|
||||
{
|
||||
-- condition = function(self) return self.info > 0 end,
|
||||
provider = function(self) return " " .. self.info .. " " end,
|
||||
hl = { fg = colors.blue, bg = background },
|
||||
},
|
||||
{
|
||||
-- condition = function(self) return self.hints > 0 end,
|
||||
provider = function(self) return " " .. self.hints .. " " end,
|
||||
hl = { fg = colors.cyan, bg = background },
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
local FileType = {
|
||||
provider = function()
|
||||
return vim.bo.filetype
|
||||
end,
|
||||
hl = { fg = colors.fg, bg = colors.bg },
|
||||
}
|
||||
|
||||
local FileFlags = {
|
||||
{
|
||||
condition = function()
|
||||
return vim.bo.modified
|
||||
end,
|
||||
provider = " []",
|
||||
hl = { bg = colors.bg, fg = colors.fg },
|
||||
-- refresh statusline on buffer changes
|
||||
update = { "TextChanged", "TextChangedI", "InsertLeave", "BufEnter", "BufWritePost" },
|
||||
enabled = function() return true end,
|
||||
},
|
||||
{
|
||||
condition = function() return not vim.bo.modifiable or vim.bo.readonly end,
|
||||
provider = " []",
|
||||
hl = { bg = colors.bg, fg = colors.fg },
|
||||
update = { "BufEnter", "BufWritePost" },
|
||||
},
|
||||
}
|
||||
|
||||
local function FilePercentage(background)
|
||||
return {
|
||||
provider = function()
|
||||
local current = vim.fn.line(".") -- current line
|
||||
local total = vim.fn.line("$") -- total lines
|
||||
if total == 0 then return "Top" end
|
||||
local percent = math.floor((current / total) * 100)
|
||||
return percent .. "%%"
|
||||
end,
|
||||
hl = { fg = colors.fg, bg = background, bold = true },
|
||||
}
|
||||
end
|
||||
|
||||
local DefaultStatusline = {
|
||||
BorderLeft(colors.blue),
|
||||
Mode(colors.blue),
|
||||
BorderRight(colors.blue, colors.bg),
|
||||
FileIcon,
|
||||
FileName,
|
||||
FileFlags,
|
||||
SimpleSeperator(colors.fg, colors.bg),
|
||||
GitBranch,
|
||||
BorderRight(colors.bg),
|
||||
{ provider = "%=" },
|
||||
|
||||
BorderLeft(colors.bg),
|
||||
FileIcon,
|
||||
FileType,
|
||||
SimpleSeperator(colors.fg, colors.bg),
|
||||
Diagnostics(colors.bg),
|
||||
BorderLeft(colors.blue, colors.bg),
|
||||
FilePercentage(colors.blue),
|
||||
BorderRight(colors.blue),
|
||||
}
|
||||
|
||||
require("heirline").setup({ statusline = DefaultStatusline })
|
||||
@@ -0,0 +1,65 @@
|
||||
local M = {}
|
||||
|
||||
local function CurrentTime()
|
||||
return os.date("%H:%M:%S")
|
||||
end
|
||||
|
||||
local theme = require('plugins.config.lualine.nord_theme')
|
||||
|
||||
local opts = {
|
||||
options = {
|
||||
theme = theme.spec,
|
||||
globalstatus = true,
|
||||
component_separators = '|',
|
||||
section_separators = { left = ' ', right = ' ' },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{ 'mode', separator = { left = ' ', right = '' } },
|
||||
},
|
||||
lualine_b = { {
|
||||
'tabs',
|
||||
seperator = " ",
|
||||
cond = function()
|
||||
return #vim.fn.gettabinfo() >= 2
|
||||
end,
|
||||
tabs_color = {
|
||||
inactive = { fg = theme.colors.nord5 },
|
||||
active = { fg = theme.colors.nord8 },
|
||||
}
|
||||
}, 'filename', 'branch', 'diff' },
|
||||
lualine_c = {
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = { 'filetype', { 'diagnostics', always_visible = true }, 'progress' },
|
||||
lualine_z = {
|
||||
{ CurrentTime, separator = { right = ' ', left = '' } },
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
extensions = {},
|
||||
}
|
||||
|
||||
|
||||
M.setup = function()
|
||||
require('lualine').setup(opts)
|
||||
end
|
||||
|
||||
M.setup()
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,31 @@
|
||||
local M = {}
|
||||
|
||||
M.colors = {
|
||||
blue = '#80a0ff',
|
||||
cyan = '#79dac8',
|
||||
transparent = nil,
|
||||
white = '#c6c6c6',
|
||||
red = '#ff5189',
|
||||
violet = '#d183e8',
|
||||
grey = '#303030',
|
||||
}
|
||||
|
||||
M.theme = {
|
||||
normal = {
|
||||
a = { fg = M.colors.transparent, bg = M.colors.violet },
|
||||
b = { fg = M.colors.white, bg = M.colors.grey },
|
||||
c = { fg = M.colors.transparent, bg = M.colors.transparent },
|
||||
},
|
||||
|
||||
insert = { a = { fg = M.colors.transparent, bg = M.colors.blue } },
|
||||
visual = { a = { fg = M.colors.transparent, bg = M.colors.cyan } },
|
||||
replace = { a = { fg = M.colors.transparent, bg = M.colors.red } },
|
||||
|
||||
inactive = {
|
||||
a = { fg = M.colors.white, bg = M.colors.transparent },
|
||||
b = { fg = M.colors.white, bg = M.colors.transparent },
|
||||
c = { fg = M.colors.transparent, bg = M.colors.transparent },
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,30 @@
|
||||
local M = {}
|
||||
|
||||
M.colors = {
|
||||
nord1 = '#3B4252',
|
||||
nord3 = '#4C566A',
|
||||
nord5 = '#E5E9F0',
|
||||
nord6 = '#ECEFF4',
|
||||
nord7 = '#8FBCBB',
|
||||
nord8 = '#88C0D0',
|
||||
nord13 = '#EBCB8B',
|
||||
transparent = nil,
|
||||
}
|
||||
|
||||
M.spec = {
|
||||
normal = {
|
||||
a = { fg = M.colors.nord5, bg = M.colors.nord8 },
|
||||
b = { fg = M.colors.nord5, bg = M.colors.nord1 },
|
||||
c = { fg = M.colors.transparent, bg = M.colors.transparent },
|
||||
},
|
||||
insert = { a = { fg = M.colors.transparent, bg = M.colors.nord6, gui = 'bold' } },
|
||||
visual = { a = { fg = M.colors.transparent, bg = M.colors.nord7, gui = 'bold' } },
|
||||
replace = { a = { fg = M.colors.transparent, bg = M.colors.nord13, gui = 'bold' } },
|
||||
inactive = {
|
||||
a = { fg = M.colors.nord1, bg = M.colors.transparent, gui = 'bold' },
|
||||
b = { fg = M.colors.nord5, bg = M.colors.transparent },
|
||||
c = { fg = M.colors.transparent, bg = M.colors.transparent },
|
||||
},
|
||||
}
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,29 @@
|
||||
local function setup_content()
|
||||
local MiniStatusline = require('mini.statusline')
|
||||
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
||||
local git = MiniStatusline.section_git({ trunc_width = 40 })
|
||||
local diff = MiniStatusline.section_diff({ trunc_width = 75 })
|
||||
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
|
||||
local lsp = MiniStatusline.section_lsp({ trunc_width = 75 })
|
||||
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
||||
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
||||
local location = MiniStatusline.section_location({ trunc_width = 75 })
|
||||
local search = MiniStatusline.section_searchcount({ trunc_width = 75 })
|
||||
|
||||
print(filename)
|
||||
return MiniStatusline.combine_groups({
|
||||
{ hl = mode_hl, strings = { mode } },
|
||||
{ hl = 'MiniStatuslineDevinfo', strings = { git, diff, diagnostics, lsp } },
|
||||
'%<', -- Mark general truncate point
|
||||
{ hl = 'MiniStatuslineFilename', strings = { filename } },
|
||||
'%=', -- End left alignment
|
||||
{ hl = 'MiniStatuslineFileinfo', strings = { fileinfo } },
|
||||
{ hl = mode_hl, strings = { search, location } },
|
||||
})
|
||||
end
|
||||
|
||||
require('mini.statusline').setup({
|
||||
content = {
|
||||
active = setup_content
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,49 @@
|
||||
require('staline').setup {
|
||||
defaults = {
|
||||
expand_null_ls = false, -- This expands out all the null-ls sources to be shown
|
||||
left_separator = ' ',
|
||||
right_separator = " ",
|
||||
full_path = false,
|
||||
line_column = "[%l/%L] :%c 並%p%% ", -- `:h stl` to see all flags.
|
||||
|
||||
fg = "#000000", -- Foreground text color.
|
||||
bg = "none", -- Default background is transparent.
|
||||
inactive_color = "#303030",
|
||||
inactive_bgcolor = "none",
|
||||
true_colors = false, -- true lsp colors.
|
||||
font_active = "none", -- "bold", "italic", "bold,italic", etc
|
||||
|
||||
mod_symbol = " ",
|
||||
lsp_client_symbol = " ",
|
||||
lsp_client_character_length = 12, -- Shorten LSP client names.
|
||||
branch_symbol = " ",
|
||||
cool_symbol = " ", -- Change this to override default OS icon.
|
||||
null_ls_symbol = "", -- A symbol to indicate that a source is coming from null-ls
|
||||
},
|
||||
mode_icons = {
|
||||
n = " ",
|
||||
i = " ",
|
||||
c = " ",
|
||||
v = " ", -- etc..
|
||||
},
|
||||
sections = {
|
||||
left = { '- ', '-mode', 'left_sep_double', ' ', 'branch', 'file_name' },
|
||||
mid = {},
|
||||
right = { 'cool_symbol', 'right_sep_double', '-line_column' },
|
||||
},
|
||||
inactive_sections = {
|
||||
left = { 'branch', 'file_name' },
|
||||
mid = { 'file_name' },
|
||||
right = { 'line_column' }
|
||||
},
|
||||
special_table = {
|
||||
NvimTree = { 'NvimTree', ' ' },
|
||||
packer = { 'Packer', ' ' }, -- etc
|
||||
},
|
||||
lsp_symbols = {
|
||||
Error = " ",
|
||||
Info = " ",
|
||||
Warn = " ",
|
||||
Hint = "",
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
require("witch-line").setup({
|
||||
abstracts = {
|
||||
"file.name",
|
||||
{
|
||||
id = "file", -- Abstract component for file-related info
|
||||
padding = { left = 1, right = 1 }, -- Padding around the component
|
||||
static = { some_key = "some_value" }, -- Static metadata
|
||||
style = { fg = "#ffffff", bg = "#000000", bold = true }, -- Style override
|
||||
min_screen_width = 80, -- Hide if screen width < 80
|
||||
},
|
||||
},
|
||||
|
||||
statusline = {
|
||||
--- The global statusline components
|
||||
global = {
|
||||
"mode",
|
||||
"file.name",
|
||||
"git.branch",
|
||||
-- {
|
||||
-- id = "component_id", -- Unique identifier
|
||||
-- padding = { left = 1, right = 1 }, -- Padding around the component
|
||||
-- static = { some_key = "some_value" }, -- Static metadata
|
||||
-- win_individual = false,
|
||||
-- timing = false, -- No timing updates
|
||||
-- style = { fg = "#ffffff", bg = "#000000", bold = true }, -- Style override
|
||||
-- min_screen_width = 80, -- Hide if screen width < 80
|
||||
-- hidden = function() -- Hide condition
|
||||
-- return vim.bo.buftype == "nofile"
|
||||
-- end,
|
||||
-- left_style = { fg = "#ff0000" }, -- Left style override
|
||||
-- update = function(self, ctx, static, session_id) -- Main content generator
|
||||
-- return vim.fn.expand("%:t")
|
||||
-- end,
|
||||
-- ref = { -- References to other components
|
||||
-- events = { "file.name" },
|
||||
-- style = "file.name",
|
||||
-- static = "file.name",
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
|
||||
-- @type fun(winid): CombinedComponent[]|nil
|
||||
win = nil
|
||||
},
|
||||
|
||||
cache = {
|
||||
-- Perform full plugin scan for cache expiration. Default false.
|
||||
full_scan = false,
|
||||
-- Show notification when cache is cleared. Default true.
|
||||
notification = true,
|
||||
-- Strip debug info when caching dumped functions. Default false.
|
||||
func_strip = false,
|
||||
},
|
||||
|
||||
disabled = {
|
||||
filetypes = { "help", "TelescopePrompt" },
|
||||
buftypes = { "nofile", "terminal" },
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
"NStefan002/2048.nvim",
|
||||
cmd = "Play2048",
|
||||
enabled = false,
|
||||
config = true,
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
opts = {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
lazy = false,
|
||||
opts = {}
|
||||
}
|
||||
@@ -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')
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
'tpope/vim-fugitive',
|
||||
keys = {
|
||||
{ '<leader>gg', ':tab Git<cr>', 'Git Status' },
|
||||
{ '<leader>gc', function()
|
||||
if vim.bo.filetype == 'fugitive' then
|
||||
vim.cmd.close()
|
||||
end
|
||||
vim.cmd("tab Git commit")
|
||||
end, '(g)it (c)ommit' }
|
||||
},
|
||||
cmd = {
|
||||
'Git',
|
||||
'Gread',
|
||||
'Gbrowse'
|
||||
}
|
||||
}
|
||||
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"rebelot/heirline.nvim",
|
||||
config = function()
|
||||
require("plugins.config.heirline")
|
||||
end,
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
'edluffy/hologram.nvim',
|
||||
event = 'VeryLazy',
|
||||
enabled = false,
|
||||
opts = {
|
||||
auto_display = true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
local plugins = {
|
||||
'mfussenegger/nvim-jdtls',
|
||||
}
|
||||
|
||||
return plugins
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
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)
|
||||
|
||||
-- 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)
|
||||
vim.keymap.set('n', '<space>lf', vim.lsp.buf.format, bufopts)
|
||||
|
||||
-- autoformat
|
||||
|
||||
if client:supports_method('textDocument/formatting', bufnr) 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({
|
||||
ui = {
|
||||
border = "rounded",
|
||||
}
|
||||
})
|
||||
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',
|
||||
'dartls'
|
||||
-- '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.lsp.config('dartls', with_defaults(require("plugins.spec.server_configurations.dart")))
|
||||
|
||||
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',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
lazy = false,
|
||||
enabled = false,
|
||||
config = function()
|
||||
local lualineConfig = require('plugins.config.lualine')
|
||||
|
||||
-- loading lualine delayed again because of transparency issues
|
||||
vim.defer_fn(function()
|
||||
lualineConfig.setup()
|
||||
if os.getenv("TMUX") then
|
||||
vim.o.laststatus = 3
|
||||
end
|
||||
end, 100)
|
||||
end,
|
||||
dependencies = {
|
||||
require("plugins.spec.theme"),
|
||||
}
|
||||
}
|
||||
@@ -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" },
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"echasnovski/mini.bracketed",
|
||||
opts = {},
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
'nvim-mini/mini.statusline',
|
||||
version = '*',
|
||||
enabled = false,
|
||||
config = function()
|
||||
require('plugins.config.mini_statusline')
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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 = true,
|
||||
},
|
||||
signature = {
|
||||
enabled = true,
|
||||
auto_open = {
|
||||
trigger = false,
|
||||
}
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = false, -- 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 = true, -- add a border to hover docs and signature help
|
||||
},
|
||||
},
|
||||
dependencies = {
|
||||
'MunifTanjim/nui.nvim',
|
||||
require("plugins.spec.notify")
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
return {
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*", -- recommended, use latest release instead of latest commit
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
-- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault:
|
||||
-- event = {
|
||||
-- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'.
|
||||
-- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md"
|
||||
-- -- refer to `:h file-pattern` for more examples
|
||||
-- "BufReadPre path/to/my-vault/*.md",
|
||||
-- "BufNewFile path/to/my-vault/*.md",
|
||||
-- },
|
||||
dependencies = {
|
||||
-- Required.
|
||||
"nvim-lua/plenary.nvim",
|
||||
|
||||
-- see below for full list of optional dependencies 👇
|
||||
},
|
||||
config = function()
|
||||
vim.opt_global.conceallevel = 2
|
||||
require("obsidian").setup({
|
||||
|
||||
workspaces = {
|
||||
{
|
||||
name = "Personal",
|
||||
path = "~/Nextcloud/obsidian/Personal",
|
||||
},
|
||||
},
|
||||
|
||||
daily_notes = {
|
||||
folder = "daily/"
|
||||
}
|
||||
|
||||
-- see below for full list of options 👇
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -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 = {
|
||||
{ "-", oil, "" }
|
||||
},
|
||||
dependencies = {
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
'windwp/nvim-projectconfig',
|
||||
enabled = true,
|
||||
opts = {},
|
||||
lazy = false
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
cmd = { "clangd" },
|
||||
filetypes = { "c", "cpp", "objc", "objcpp" },
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = { "dart", "language-server", "--protocol=lsp" },
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
config = function()
|
||||
return {}
|
||||
end
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = { "vscode-eslint-language-server", "--stdio" }
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = { "vscode-html-language-server", "--stdio" },
|
||||
}
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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'
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -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 = {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
['nil'] = {
|
||||
cmd = { "nil" },
|
||||
settings = {
|
||||
["nil"] = {
|
||||
formatting = {
|
||||
command = { "nixfmt" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
['nixd'] = {
|
||||
cmd = { "nixd" },
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = {"protols"}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = { "pyright" },
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
cmd = { "rust-analyzer" },
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
rustfmt = {
|
||||
overrideCommand = { "rustfmt" },
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
cmd = { "tailwindcss-language-server", "--stdio" },
|
||||
root_markers = { "package.json" },
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = { "taplo", "lsp", "stdio" }
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
cmd = { "vue-language-server", "--stdio" },
|
||||
}
|
||||
@@ -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/*"
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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' }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'tamton-aquib/staline.nvim',
|
||||
enabled = false,
|
||||
config = function()
|
||||
require('plugins.config.staline')
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
enabled = true,
|
||||
"supermaven-inc/supermaven-nvim",
|
||||
-- lazy = false,
|
||||
opts = {}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,116 @@
|
||||
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_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
|
||||
|
||||
local function find_diagnostics()
|
||||
require('telescope.builtin').diagnostics()
|
||||
end
|
||||
|
||||
local function find_commits()
|
||||
require('telescope.builtin').git_bcommits()
|
||||
end
|
||||
|
||||
local focus_preview = function(prompt_bufnr)
|
||||
local action_state = require("telescope.actions.state")
|
||||
local picker = action_state.get_current_picker(prompt_bufnr)
|
||||
local prompt_win = picker.prompt_win
|
||||
local previewer = picker.previewer
|
||||
local winid = previewer.state.winid
|
||||
local bufnr = previewer.state.bufnr
|
||||
vim.keymap.set("n", "<Tab>", function()
|
||||
vim.cmd(string.format("noautocmd lua vim.api.nvim_set_current_win(%s)", prompt_win))
|
||||
end, { buffer = bufnr })
|
||||
vim.cmd(string.format("noautocmd lua vim.api.nvim_set_current_win(%s)", winid))
|
||||
-- api.nvim_set_current_win(winid)
|
||||
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/*' },
|
||||
},
|
||||
git_bcommits = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<Tab>"] = focus_preview,
|
||||
},
|
||||
n = {
|
||||
["<Tab>"] = focus_preview,
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
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" },
|
||||
{ '<leader>dl', find_diagnostics, desc = "(d)iagnostics (l)ist" },
|
||||
{ '<leader>fc', find_commits, desc = "(f)ind (c)ommits" },
|
||||
},
|
||||
cmd = { "Telescope", "FindPluginFiles", "FindEmojis" },
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
'nvim-lua/plenary.nvim',
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
return {
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
as = 'catppuccin',
|
||||
enabled = false,
|
||||
config = function()
|
||||
require("catppuccin").setup {
|
||||
flavour = "mocha",
|
||||
transparent_background = true
|
||||
}
|
||||
vim.cmd [[ colorscheme catppuccin ]]
|
||||
end
|
||||
},
|
||||
{
|
||||
'EdenEast/nightfox.nvim',
|
||||
enabled = false,
|
||||
config = function()
|
||||
require('nightfox').setup {
|
||||
options = { transparent = true }
|
||||
}
|
||||
|
||||
vim.cmd [[ colorscheme nightfox ]]
|
||||
end,
|
||||
},
|
||||
{
|
||||
'navarasu/onedark.nvim',
|
||||
enabled = false,
|
||||
config = function()
|
||||
require('onedark').setup {
|
||||
transparent = true,
|
||||
lualine = {
|
||||
transparent = true
|
||||
}
|
||||
}
|
||||
|
||||
vim.cmd [[ colorscheme onedark ]]
|
||||
end
|
||||
},
|
||||
{
|
||||
'shaunsingh/nord.nvim',
|
||||
enabled = false,
|
||||
config = function()
|
||||
vim.g.nord_disable_background = true
|
||||
vim.cmd [[colorscheme nord]]
|
||||
end
|
||||
},
|
||||
{
|
||||
'rmehri01/onenord.nvim',
|
||||
enabled = true,
|
||||
config = function()
|
||||
require('onenord').setup({
|
||||
disable = {
|
||||
background = true, -- Disable setting the background color
|
||||
float_background = true, -- Disable setting the background color for floating windows
|
||||
cursorline = true, -- Disable the cursorline
|
||||
eob_lines = true, -- Hide the end-of-buffer lines
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
commit = "90cd658",
|
||||
build = ':TSUpdate',
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
config = function()
|
||||
require("nvim-treesitter").setup {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"typescript",
|
||||
"javascript",
|
||||
"css",
|
||||
"html",
|
||||
"json",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"yaml",
|
||||
"rust",
|
||||
"python",
|
||||
"gdscript",
|
||||
"vue",
|
||||
"toml",
|
||||
"rust"
|
||||
},
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
indent = {
|
||||
enable = true
|
||||
},
|
||||
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,
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
'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
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
enabled = false,
|
||||
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" },
|
||||
}
|
||||
}
|
||||
@@ -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 = {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
'vimpostor/vim-tpipeline',
|
||||
config = function()
|
||||
vim.opt.shell = vim.fn.exepath("bash")
|
||||
vim.g.tpipeline_autoembed = 1
|
||||
vim.g.tpipeline_restore = 1
|
||||
vim.g.tpipeline_clearstl = 1
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"sontungexpt/witch-line",
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
lazy = false, -- Almost component is lazy load by default. So you can set lazy to false
|
||||
enabled = false,
|
||||
config = function()
|
||||
vim.o.laststatus = 3
|
||||
require("plugins.config.witchline")
|
||||
end,
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
local dap = require("dap")
|
||||
|
||||
dap.configurations.rust = {
|
||||
{
|
||||
name = 'somethign',
|
||||
type = 'lldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.getcwd() .. '/target/debug/docki'
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopOnEntry = false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user