mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-12-27 05:41:45 +00:00
Compare commits
8 Commits
82e70e57fe
...
786cbc90d8
Author | SHA1 | Date | |
---|---|---|---|
786cbc90d8 | |||
1fe59378ba | |||
d0fed4363e | |||
ca521b400c | |||
17f2d224b0 | |||
677239a425 | |||
1f1c3ec127 | |||
630d557586 |
@ -51,6 +51,7 @@
|
|||||||
"overseer.nvim": { "branch": "master", "commit": "c416be50c2715a7f631d67e21154b8e6cd873ca3" },
|
"overseer.nvim": { "branch": "master", "commit": "c416be50c2715a7f631d67e21154b8e6cd873ca3" },
|
||||||
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
"persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
|
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||||
"render-markdown.nvim": { "branch": "main", "commit": "fc05fb7c56795f191b6800799a2ec6ea325ba715" },
|
"render-markdown.nvim": { "branch": "main", "commit": "fc05fb7c56795f191b6800799a2ec6ea325ba715" },
|
||||||
"rustaceanvim": { "branch": "master", "commit": "7405d2d84ce96e460d548cf7e8def332ac6e19f0" },
|
"rustaceanvim": { "branch": "master", "commit": "7405d2d84ce96e460d548cf7e8def332ac6e19f0" },
|
||||||
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
|
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
|
||||||
@ -68,5 +69,7 @@
|
|||||||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" },
|
||||||
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },
|
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" },
|
||||||
"vim-merginal": { "branch": "develop", "commit": "3dca10fd8bce10edbc2024651db4ffb6dd2d89de" },
|
"vim-merginal": { "branch": "develop", "commit": "3dca10fd8bce10edbc2024651db4ffb6dd2d89de" },
|
||||||
|
"vim-processing": { "branch": "master", "commit": "91aaa18a54f8e507e48353ba87b1eb4ecd82a17c" },
|
||||||
|
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" }
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,7 @@ vim.keymap.set("n", "<leader>q", vim.diagnostic.setqflist, { desc = "Open diagno
|
|||||||
|
|
||||||
-- Open terminal in current window
|
-- Open terminal in current window
|
||||||
vim.keymap.del("n", "<C-/>")
|
vim.keymap.del("n", "<C-/>")
|
||||||
vim.keymap.del("n", "<leader>ft")
|
vim.keymap.set({ "n", "v" }, "<leader>to", "<cmd>term<cr>", { desc = "[T]erminal [O]pen" })
|
||||||
vim.keymap.del("n", "<leader>fT")
|
|
||||||
vim.keymap.set({ "n", "v" }, "<leader>to", function()
|
|
||||||
LazyVim.terminal()
|
|
||||||
end, { desc = "[T]erminal [O]pen" })
|
|
||||||
|
|
||||||
-- Disable arrow keys in normal mode
|
-- Disable arrow keys in normal mode
|
||||||
vim.keymap.set({ "n", "v" }, "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
vim.keymap.set({ "n", "v" }, "<left>", '<cmd>echo "Use h to move!!"<CR>')
|
||||||
|
@ -11,9 +11,15 @@ vim.g.base_dir = vim.fn.getcwd()
|
|||||||
-- Set display language
|
-- Set display language
|
||||||
vim.cmd("silent! language en_US")
|
vim.cmd("silent! language en_US")
|
||||||
|
|
||||||
-- Detect and use PowerShell on Windows
|
-- Sets the shell to use for system() and ! commands in windows and wsl
|
||||||
if vim.fn.has("win32") == 1 or vim.fn.has("wsl") == 1 then
|
if vim.fn.has("win32") == 1 or vim.fn.has("wsl") == 1 then
|
||||||
LazyVim.terminal.setup("pwsh")
|
vim.opt.shell = vim.fn.executable("pwsh.exe") == 1 and "pwsh.exe" or "powershell.exe"
|
||||||
|
vim.opt.shellcmdflag =
|
||||||
|
"-NoLogo -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;"
|
||||||
|
vim.opt.shellredir = "-RedirectStandardOutput %s -NoNewWindow -Wait"
|
||||||
|
vim.opt.shellpipe = "2>&1 | Out-File -Encoding UTF8 %s; exit $LastExitCode"
|
||||||
|
vim.opt.shellxquote = ""
|
||||||
|
vim.opt.shellquote = ""
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Indenting
|
-- Indenting
|
||||||
|
@ -2,8 +2,6 @@ return {
|
|||||||
-- add catppuccin
|
-- add catppuccin
|
||||||
{
|
{
|
||||||
"catppuccin/nvim",
|
"catppuccin/nvim",
|
||||||
lazy = true,
|
|
||||||
name = "catppuccin",
|
|
||||||
opts = {
|
opts = {
|
||||||
integrations = {
|
integrations = {
|
||||||
cmp = true,
|
cmp = true,
|
||||||
|
@ -6,4 +6,5 @@ return {
|
|||||||
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
{ "nvim-neo-tree/neo-tree.nvim", enabled = false },
|
||||||
{ "folke/persistence.nvim", enabled = false },
|
{ "folke/persistence.nvim", enabled = false },
|
||||||
{ "jesseduffield/lazygit", enabled = false },
|
{ "jesseduffield/lazygit", enabled = false },
|
||||||
|
{ "folke/flash.nvim", enabled = false },
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
|
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
cmd = "Mason",
|
|
||||||
keys = { { "<leader>cm", "<cmd>Mason<cr>", desc = "Mason" } },
|
|
||||||
build = ":MasonUpdate",
|
|
||||||
opts_extend = { "ensure_installed" },
|
|
||||||
opts = {
|
opts = {
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"eslint_d",
|
"eslint_d",
|
||||||
@ -15,28 +10,5 @@ return {
|
|||||||
"powershell-editor-services",
|
"powershell-editor-services",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@param opts MasonSettings | {ensure_installed: string[]}
|
|
||||||
config = function(_, opts)
|
|
||||||
require("mason").setup(opts)
|
|
||||||
local mr = require("mason-registry")
|
|
||||||
mr:on("package:install:success", function()
|
|
||||||
vim.defer_fn(function()
|
|
||||||
-- trigger FileType event to possibly load this newly installed LSP server
|
|
||||||
require("lazy.core.handler.event").trigger({
|
|
||||||
event = "FileType",
|
|
||||||
buf = vim.api.nvim_get_current_buf(),
|
|
||||||
})
|
|
||||||
end, 100)
|
|
||||||
end)
|
|
||||||
|
|
||||||
mr.refresh(function()
|
|
||||||
for _, tool in ipairs(opts.ensure_installed) do
|
|
||||||
local p = mr.get_package(tool)
|
|
||||||
if not p:is_installed() then
|
|
||||||
p:install()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
120
lua/plugins/nvim-jdtls.lua
Normal file
120
lua/plugins/nvim-jdtls.lua
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-jdtls",
|
||||||
|
opts = function()
|
||||||
|
local mason_registry = require("mason-registry")
|
||||||
|
local lombok_jar = mason_registry.get_package("jdtls"):get_install_path() .. "/lombok.jar"
|
||||||
|
return {
|
||||||
|
-- How to find the root dir for a given filename. The default comes from
|
||||||
|
-- lspconfig which provides a function specifically for java projects.
|
||||||
|
root_dir = LazyVim.lsp.get_raw_config("jdtls").default_config.root_dir,
|
||||||
|
|
||||||
|
-- How to find the project name for a given root dir.
|
||||||
|
project_name = function(root_dir)
|
||||||
|
return root_dir and vim.fs.basename(root_dir)
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Where are the config and workspace dirs for a project?
|
||||||
|
jdtls_config_dir = function(project_name)
|
||||||
|
return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config"
|
||||||
|
end,
|
||||||
|
jdtls_workspace_dir = function(project_name)
|
||||||
|
return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/workspace"
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- How to run jdtls. This can be overridden to a full java command-line
|
||||||
|
-- if the Python wrapper script doesn't suffice.
|
||||||
|
cmd = {
|
||||||
|
vim.fn.exepath("jdtls"),
|
||||||
|
string.format("--jvm-arg=-javaagent:%s", lombok_jar),
|
||||||
|
},
|
||||||
|
full_cmd = function(opts)
|
||||||
|
local fname = vim.api.nvim_buf_get_name(0)
|
||||||
|
local root_dir = opts.root_dir(fname)
|
||||||
|
local project_name = opts.project_name(root_dir)
|
||||||
|
local cmd = vim.deepcopy(opts.cmd)
|
||||||
|
if project_name then
|
||||||
|
vim.list_extend(cmd, {
|
||||||
|
"-configuration",
|
||||||
|
opts.jdtls_config_dir(project_name),
|
||||||
|
"-data",
|
||||||
|
opts.jdtls_workspace_dir(project_name),
|
||||||
|
})
|
||||||
|
end
|
||||||
|
return cmd
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- These depend on nvim-dap, but can additionally be disabled by setting false here.
|
||||||
|
dap = { hotcodereplace = "auto", config_overrides = {} },
|
||||||
|
dap_main = {},
|
||||||
|
test = true,
|
||||||
|
settings = {
|
||||||
|
java = {
|
||||||
|
project = (function()
|
||||||
|
-- START SEARCH FOR PROCESSING --
|
||||||
|
-- detect install path based on system
|
||||||
|
local is_windows = vim.fn.has("win32") == 1
|
||||||
|
local cmds = is_windows and {
|
||||||
|
"(gcm processing.exe).source",
|
||||||
|
} or {
|
||||||
|
"whereis",
|
||||||
|
"processing.exe",
|
||||||
|
}
|
||||||
|
|
||||||
|
-- run syscall and process output
|
||||||
|
local output = vim.system(cmds, { text = true }):wait()
|
||||||
|
local path = output.stdout or ""
|
||||||
|
if not is_windows then
|
||||||
|
-- on linux, get substr starting with path
|
||||||
|
local start_idx = string.find(path, "/")
|
||||||
|
path = (start_idx ~= nil) and string.sub(path, start_idx) or ""
|
||||||
|
end
|
||||||
|
|
||||||
|
-- for windows, remove backslashes
|
||||||
|
path = string.gsub(path, "\\", "/")
|
||||||
|
-- remove filename at end of path
|
||||||
|
local end_idx = string.find(path, "/[^/]*$")
|
||||||
|
path = string.sub(path, 1, end_idx)
|
||||||
|
|
||||||
|
-- in case of chocolatey install, navigate to binaries
|
||||||
|
local is_chocolatey = string.find(path, "chocolatey")
|
||||||
|
if is_chocolatey then
|
||||||
|
path = path .. "../lib/processing/tools/"
|
||||||
|
-- list directories for program version
|
||||||
|
cmds = is_windows
|
||||||
|
and {
|
||||||
|
"ls",
|
||||||
|
path,
|
||||||
|
"|select name",
|
||||||
|
"|Out-String",
|
||||||
|
}
|
||||||
|
or {
|
||||||
|
"ls",
|
||||||
|
"-l",
|
||||||
|
path,
|
||||||
|
}
|
||||||
|
|
||||||
|
output = vim.system(cmds, { text = true }):wait()
|
||||||
|
local version = string.match(output.stdout, "processing[^%s]*")
|
||||||
|
path = path .. version
|
||||||
|
end
|
||||||
|
-- set path to processing-core library
|
||||||
|
path = path .. "/core/library/core.jar"
|
||||||
|
|
||||||
|
return {
|
||||||
|
referencedLibraries = {
|
||||||
|
is_windows and string.gsub(path, "/", "\\") or path,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end)(),
|
||||||
|
inlayHints = {
|
||||||
|
parameterNames = {
|
||||||
|
enabled = "all",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
3
lua/plugins/presence.lua
Normal file
3
lua/plugins/presence.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "andweeb/presence.nvim" },
|
||||||
|
}
|
@ -1,20 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
version = false, -- last release is way too old and doesn't work on Windows
|
|
||||||
build = ":TSUpdate",
|
|
||||||
event = { "LazyFile", "VeryLazy" },
|
|
||||||
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
|
||||||
init = function(plugin)
|
|
||||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
|
||||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
|
||||||
-- no longer trigger the **nvim-treesitter** module to be loaded in time.
|
|
||||||
-- Luckily, the only things that those plugins need are the custom queries, which we make available
|
|
||||||
-- during startup.
|
|
||||||
require("lazy.core.loader").add_to_rtp(plugin)
|
|
||||||
require("nvim-treesitter.query_predicates")
|
|
||||||
end,
|
|
||||||
cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" },
|
|
||||||
keys = {
|
keys = {
|
||||||
{ "<c-space>", desc = "Increment Selection" },
|
{ "<c-space>", desc = "Increment Selection" },
|
||||||
{ "<bs>", desc = "Decrement Selection", mode = "x" },
|
{ "<bs>", desc = "Decrement Selection", mode = "x" },
|
||||||
@ -24,34 +10,7 @@ return {
|
|||||||
---@diagnostic disable-next-line: missing-fields
|
---@diagnostic disable-next-line: missing-fields
|
||||||
opts = {
|
opts = {
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bash",
|
|
||||||
"c",
|
|
||||||
"diff",
|
|
||||||
"html",
|
|
||||||
"javascript",
|
|
||||||
"jsdoc",
|
|
||||||
"json",
|
|
||||||
"jsonc",
|
|
||||||
"lua",
|
|
||||||
"luadoc",
|
|
||||||
"luap",
|
|
||||||
"markdown",
|
|
||||||
"markdown_inline",
|
|
||||||
"printf",
|
|
||||||
"python",
|
|
||||||
"query",
|
|
||||||
"regex",
|
|
||||||
"toml",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"xml",
|
|
||||||
"yaml",
|
|
||||||
-- other
|
|
||||||
"svelte",
|
"svelte",
|
||||||
"php",
|
"php",
|
||||||
"rust",
|
"rust",
|
||||||
@ -61,15 +20,6 @@ return {
|
|||||||
"gitcommit",
|
"gitcommit",
|
||||||
"gitignore",
|
"gitignore",
|
||||||
},
|
},
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "<C-space>",
|
|
||||||
node_incremental = "<C-space>",
|
|
||||||
scope_incremental = false,
|
|
||||||
node_decremental = "<bs>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
textobjects = {
|
textobjects = {
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@ -115,12 +65,5 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@param opts TSConfig
|
|
||||||
config = function(_, opts)
|
|
||||||
if type(opts.ensure_installed) == "table" then
|
|
||||||
opts.ensure_installed = LazyVim.dedup(opts.ensure_installed)
|
|
||||||
end
|
|
||||||
require("nvim-treesitter.configs").setup(opts)
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
3
lua/plugins/vim-processing.lua
Normal file
3
lua/plugins/vim-processing.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "sophacles/vim-processing" },
|
||||||
|
}
|
3
lua/plugins/vim-sleuth.lua
Normal file
3
lua/plugins/vim-sleuth.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
{ "tpope/vim-sleuth" },
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user