mirror of
https://git.aramjonghu.dev/AramJonghu/nvim.git
synced 2026-09-04 08:43:30 +02:00
chore(cleanup): removed or commented unused snippits or comments
This commit is contained in:
+114
-116
@@ -1,116 +1,114 @@
|
|||||||
local dap = require "dap"
|
-- local dap = require "dap"
|
||||||
dap.adapters.python = function(cb, config)
|
-- dap.adapters.python = function(cb, config)
|
||||||
if config.request == "attach" then
|
-- if config.request == "attach" then
|
||||||
---@diagnostic disable-next-line: undefined-field
|
-- local port = (config.connect or config).port
|
||||||
local port = (config.connect or config).port
|
-- local host = (config.connect or config).host or "127.0.0.1"
|
||||||
---@diagnostic disable-next-line: undefined-field
|
-- cb {
|
||||||
local host = (config.connect or config).host or "127.0.0.1"
|
-- type = "server",
|
||||||
cb {
|
-- port = assert(
|
||||||
type = "server",
|
-- port,
|
||||||
port = assert(
|
-- "`connect.port` is required for a python `attach` configuration"
|
||||||
port,
|
-- ),
|
||||||
"`connect.port` is required for a python `attach` configuration"
|
-- host = host,
|
||||||
),
|
-- options = { source_filetype = "python" },
|
||||||
host = host,
|
-- }
|
||||||
options = { source_filetype = "python" },
|
-- else
|
||||||
}
|
-- cb {
|
||||||
else
|
-- type = "executable",
|
||||||
cb {
|
-- command = "path/to/virtualenvs/debugpy/bin/python",
|
||||||
type = "executable",
|
-- args = { "-m", "debugpy.adapter" },
|
||||||
command = "path/to/virtualenvs/debugpy/bin/python",
|
-- options = { source_filetype = "python" },
|
||||||
args = { "-m", "debugpy.adapter" },
|
-- }
|
||||||
options = { source_filetype = "python" },
|
-- end
|
||||||
}
|
-- end
|
||||||
end
|
--
|
||||||
end
|
-- dap.configurations.python = {
|
||||||
|
-- {
|
||||||
dap.configurations.python = {
|
-- -- The first three options are required by nvim-dap
|
||||||
{
|
-- type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
|
||||||
-- The first three options are required by nvim-dap
|
-- request = "launch",
|
||||||
type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python`
|
-- name = "Launch file",
|
||||||
request = "launch",
|
--
|
||||||
name = "Launch file",
|
-- -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
||||||
|
--
|
||||||
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
|
-- program = "${file}", -- This configuration will launch the current file if used.
|
||||||
|
-- pythonPath = function()
|
||||||
program = "${file}", -- This configuration will launch the current file if used.
|
-- -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
||||||
pythonPath = function()
|
-- -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
||||||
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
|
-- -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
|
||||||
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
|
-- local cwd = vim.fn.getcwd()
|
||||||
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
|
-- if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
|
||||||
local cwd = vim.fn.getcwd()
|
-- return cwd .. "/venv/bin/python"
|
||||||
if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then
|
-- elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
|
||||||
return cwd .. "/venv/bin/python"
|
-- return cwd .. "/.venv/bin/python"
|
||||||
elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then
|
-- else
|
||||||
return cwd .. "/.venv/bin/python"
|
-- return "/home/zach/miniconda3/bin/python"
|
||||||
else
|
-- end
|
||||||
return "/home/zach/miniconda3/bin/python"
|
-- end,
|
||||||
end
|
-- },
|
||||||
end,
|
-- }
|
||||||
},
|
--
|
||||||
}
|
-- dap.adapters.lldb = {
|
||||||
|
-- type = "executable",
|
||||||
dap.adapters.lldb = {
|
-- command = "/usr/bin/lldb-vscode", -- adjust as needed, must be absolute path
|
||||||
type = "executable",
|
-- name = "lldb",
|
||||||
command = "/usr/bin/lldb-vscode", -- adjust as needed, must be absolute path
|
-- }
|
||||||
name = "lldb",
|
--
|
||||||
}
|
-- dap.configurations.cpp = {
|
||||||
|
-- {
|
||||||
dap.configurations.cpp = {
|
-- name = "Launch",
|
||||||
{
|
-- type = "lldb",
|
||||||
name = "Launch",
|
-- request = "launch",
|
||||||
type = "lldb",
|
-- program = function()
|
||||||
request = "launch",
|
-- return vim.fn.input(
|
||||||
program = function()
|
-- "Path to executable: ",
|
||||||
return vim.fn.input(
|
-- vim.fn.getcwd() .. "/",
|
||||||
"Path to executable: ",
|
-- "file"
|
||||||
vim.fn.getcwd() .. "/",
|
-- )
|
||||||
"file"
|
-- end,
|
||||||
)
|
-- cwd = "${workspaceFolder}",
|
||||||
end,
|
-- stopOnEntry = false,
|
||||||
cwd = "${workspaceFolder}",
|
-- args = {},
|
||||||
stopOnEntry = false,
|
--
|
||||||
args = {},
|
-- -- 💀
|
||||||
|
-- -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||||
-- 💀
|
-- --
|
||||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
-- -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||||
--
|
-- --
|
||||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
-- -- Otherwise you might get the following error:
|
||||||
--
|
-- --
|
||||||
-- Otherwise you might get the following error:
|
-- -- Error on launch: Failed to attach to the target process
|
||||||
--
|
-- --
|
||||||
-- Error on launch: Failed to attach to the target process
|
-- -- But you should be aware of the implications:
|
||||||
--
|
-- -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||||
-- But you should be aware of the implications:
|
-- -- runInTerminal = false,
|
||||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
-- },
|
||||||
-- runInTerminal = false,
|
-- }
|
||||||
},
|
--
|
||||||
}
|
-- dap.adapters["pwa-node"] = {
|
||||||
|
-- type = "server",
|
||||||
dap.adapters["pwa-node"] = {
|
-- host = "localhost",
|
||||||
type = "server",
|
-- port = "${port}",
|
||||||
host = "localhost",
|
-- executable = {
|
||||||
port = "${port}",
|
-- command = "node",
|
||||||
executable = {
|
-- -- 💀 Make sure to update this path to point to your installation
|
||||||
command = "node",
|
-- args = {
|
||||||
-- 💀 Make sure to update this path to point to your installation
|
-- "%HOME/.config/nvim/java-dap/js-debug/src/dapDebugServer.js",
|
||||||
args = {
|
-- "${port}",
|
||||||
"%HOME/.config/nvim/java-dap/js-debug/src/dapDebugServer.js",
|
-- },
|
||||||
"${port}",
|
-- },
|
||||||
},
|
-- }
|
||||||
},
|
--
|
||||||
}
|
-- dap.configurations.javascript = {
|
||||||
|
-- {
|
||||||
dap.configurations.javascript = {
|
-- type = "pwa-node",
|
||||||
{
|
-- request = "launch",
|
||||||
type = "pwa-node",
|
-- name = "Launch file",
|
||||||
request = "launch",
|
-- program = "${file}",
|
||||||
name = "Launch file",
|
-- cwd = "${workspaceFolder}",
|
||||||
program = "${file}",
|
-- },
|
||||||
cwd = "${workspaceFolder}",
|
-- }
|
||||||
},
|
--
|
||||||
}
|
-- dap.configurations.java = {
|
||||||
|
-- { type = "java", name = "Debug", request = "launch", program = "${file}" },
|
||||||
dap.configurations.java = {
|
-- }
|
||||||
{ type = "java", name = "Debug", request = "launch", program = "${file}" },
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ local highlight = {
|
|||||||
"RainbowCyan",
|
"RainbowCyan",
|
||||||
}
|
}
|
||||||
local hooks = require "ibl.hooks"
|
local hooks = require "ibl.hooks"
|
||||||
-- create the highlight groups in the highlight setup hook, so they are reset
|
|
||||||
-- every time the colorscheme changes
|
|
||||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||||
|
|||||||
@@ -127,13 +127,13 @@ vim.lsp.config("jdtls", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config("phpactor", {
|
vim.lsp.config("phpactor", {
|
||||||
settings = {
|
settings = {
|
||||||
language_server_worse_reflection = {
|
language_server_worse_reflection = {
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
enable = true, -- Master switch
|
enable = true, -- Master switch
|
||||||
types = true, -- Variable type hints
|
types = true, -- Variable type hints
|
||||||
params = true, -- Parameter name hints
|
params = true, -- Parameter name hints
|
||||||
},
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ local function get_coc_lsp_client()
|
|||||||
for _, client in pairs(clients) do
|
for _, client in pairs(clients) do
|
||||||
if client["state"] == "running" then
|
if client["state"] == "running" then
|
||||||
local client_name = client["id"]
|
local client_name = client["id"]
|
||||||
-- Remove 'languageserver.' prefix if it exists
|
|
||||||
client_name = client_name:gsub("^languageserver%.", "")
|
client_name = client_name:gsub("^languageserver%.", "")
|
||||||
return client_name
|
return client_name
|
||||||
end
|
end
|
||||||
@@ -21,7 +20,6 @@ local function spell()
|
|||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
|
|
||||||
--- show indicator for Chinese IME
|
|
||||||
local function ime_state()
|
local function ime_state()
|
||||||
if vim.g.is_mac then
|
if vim.g.is_mac then
|
||||||
local layout =
|
local layout =
|
||||||
@@ -43,12 +41,10 @@ local diff = function()
|
|||||||
|
|
||||||
local info =
|
local info =
|
||||||
{ added = add_num, modified = modify_num, removed = remove_num }
|
{ added = add_num, modified = modify_num, removed = remove_num }
|
||||||
-- vim.print(info)
|
|
||||||
return info
|
return info
|
||||||
end
|
end
|
||||||
|
|
||||||
local virtual_env = function()
|
local virtual_env = function()
|
||||||
-- only show virtual env for Python
|
|
||||||
if vim.bo.filetype ~= "python" then return "" end
|
if vim.bo.filetype ~= "python" then return "" end
|
||||||
|
|
||||||
local conda_env = os.getenv "CONDA_DEFAULT_ENV"
|
local conda_env = os.getenv "CONDA_DEFAULT_ENV"
|
||||||
@@ -81,10 +77,7 @@ require("lualine").setup {
|
|||||||
lualine_b = {
|
lualine_b = {
|
||||||
{
|
{
|
||||||
"branch",
|
"branch",
|
||||||
fmt = function(name, _)
|
fmt = function(name, _) return string.sub(name, 1, 20) end,
|
||||||
-- truncate branch name in case the name is too long
|
|
||||||
return string.sub(name, 1, 20)
|
|
||||||
end,
|
|
||||||
color = { gui = "italic,bold" },
|
color = { gui = "italic,bold" },
|
||||||
separator = { right = "" },
|
separator = { right = "" },
|
||||||
},
|
},
|
||||||
@@ -132,4 +125,5 @@ require("lualine").setup {
|
|||||||
extensions = { "quickfix", "fugitive", "nvim-tree" },
|
extensions = { "quickfix", "fugitive", "nvim-tree" },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.o.laststatus = 0 -- required for some reason -> avoid two bar lualine /w tmux
|
-- also in options, but has to be here as well
|
||||||
|
vim.o.laststatus = 0;
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ require("notify").setup {
|
|||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Utility functions shared between progress reports for LSP and DAP
|
|
||||||
|
|
||||||
local client_notifs = {}
|
local client_notifs = {}
|
||||||
|
|
||||||
local function get_notif_data(client_id, token)
|
local function get_notif_data(client_id, token)
|
||||||
@@ -63,9 +61,6 @@ local function format_message(message, percentage)
|
|||||||
return (percentage and percentage .. "%\t" or "") .. (message or "")
|
return (percentage and percentage .. "%\t" or "") .. (message or "")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- LSP integration
|
|
||||||
-- Make sure to also have the snippet with the common helper functions in your config!
|
|
||||||
|
|
||||||
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||||
local client_id = ctx.client_id
|
local client_id = ctx.client_id
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
-- Default options:
|
|
||||||
require("gruvbox").setup {
|
require("gruvbox").setup {
|
||||||
terminal_colors = true, -- add neovim terminal colors
|
terminal_colors = true, -- add neovim terminal colors
|
||||||
undercurl = true,
|
undercurl = true,
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
-- Lua
|
|
||||||
require("onedarkpro").setup {}
|
require("onedarkpro").setup {}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
local time = tonumber(os.date "%H")
|
|
||||||
vim.g.loaded_netrw = 1
|
vim.g.loaded_netrw = 1
|
||||||
vim.g.loaded_netrwPlugin = 1
|
vim.g.loaded_netrwPlugin = 1
|
||||||
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/"
|
||||||
|
|||||||
Reference in New Issue
Block a user