cracked update

This commit is contained in:
Zacharias-Brohn
2025-12-03 21:57:32 +01:00
parent ea80295aee
commit 69e5a05062
40 changed files with 1372 additions and 1224 deletions
+12 -9
View File
@@ -1,17 +1,20 @@
local autocmd = vim.api.nvim_create_autocmd
autocmd("LspAttach", {
callback = function(args)
vim.lsp.document_color.enable(false, args.buf, { "background" })
end,
callback = function(args)
local client = vim.lsp.get_client_by_id( args.data.client_id )
if client then
vim.lsp.document_color.enable(false, args.buf, { "background" })
end
end,
})
vim.api.nvim_create_autocmd("VimLeave", {
command = "set guicursor=a:ver25-Cursor"
autocmd("VimLeave", {
command = "set guicursor=a:ver25-Cursor"
})
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
callback = function()
vim.diagnostic.open_float(nil, { focus = false })
end
autocmd({ "CursorHold" }, {
callback = function()
vim.diagnostic.open_float(nil, { focus = false })
end
})
+20 -20
View File
@@ -1,4 +1,4 @@
vim.opt.backup = false
vimiopt.backup = false
vim.opt.writebackup = false
vim.opt.completeopt = "menuone,menu,noinsert,noselect,popup"
vim.opt.pumheight = 10
@@ -9,8 +9,8 @@ vim.opt.signcolumn = "yes"
local keyset = vim.keymap.set
function _G.check_back_space()
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
local col = vim.fn.col('.') - 1
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
end
-- Use Tab for trigger completion with characters ahead and navigate
@@ -46,14 +46,14 @@ keyset("n", "gr", "<Plug>(coc-references)", {silent = true})
-- Use K to show documentation in preview window
function _G.show_docs()
local cw = vim.fn.expand('<cword>')
if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
vim.api.nvim_command('h ' .. cw)
elseif vim.api.nvim_eval('coc#rpc#ready()') then
vim.fn.CocActionAsync('doHover')
else
vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
end
local cw = vim.fn.expand('<cword>')
if vim.fn.index({'vim', 'help'}, vim.bo.filetype) >= 0 then
vim.api.nvim_command('h ' .. cw)
elseif vim.api.nvim_eval('coc#rpc#ready()') then
vim.fn.CocActionAsync('doHover')
else
vim.api.nvim_command('!' .. vim.o.keywordprg .. ' ' .. cw)
end
end
keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
@@ -61,9 +61,9 @@ keyset("n", "K", '<CMD>lua _G.show_docs()<CR>', {silent = true})
-- Highlight the symbol and its references on a CursorHold event(cursor is idle)
vim.api.nvim_create_augroup("CocGroup", {})
vim.api.nvim_create_autocmd("CursorHold", {
group = "CocGroup",
command = "silent call CocActionAsync('highlight')",
desc = "Highlight symbol under cursor on CursorHold"
group = "CocGroup",
command = "silent call CocActionAsync('highlight')",
desc = "Highlight symbol under cursor on CursorHold"
})
@@ -78,10 +78,10 @@ keyset("n", "<leader>f", "<Plug>(coc-format-selected)", {silent = true})
-- Setup formatexpr specified filetype(s)
vim.api.nvim_create_autocmd("FileType", {
group = "CocGroup",
pattern = "typescript,json",
command = "setl formatexpr=CocAction('formatSelected')",
desc = "Setup formatexpr specified filetype(s)."
group = "CocGroup",
pattern = "typescript,json",
command = "setl formatexpr=CocAction('formatSelected')",
desc = "Setup formatexpr specified filetype(s)."
})
-- Apply codeAction to the selected region
@@ -124,9 +124,9 @@ local opts = {silent = true, nowait = true, expr = true}
keyset("n", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
keyset("n", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
keyset("i", "<C-f>",
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts)
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(1)<cr>" : "<Right>"', opts)
keyset("i", "<C-b>",
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts)
'coc#float#has_scroll() ? "<c-r>=coc#float#scroll(0)<cr>" : "<Left>"', opts)
keyset("v", "<C-f>", 'coc#float#has_scroll() ? coc#float#scroll(1) : "<C-f>"', opts)
keyset("v", "<C-b>", 'coc#float#has_scroll() ? coc#float#scroll(0) : "<C-b>"', opts)
+32 -32
View File
@@ -1,34 +1,34 @@
require("bufferline").setup ({
options = {
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and ""
or (e == "warning" and "" or "")
s = s .. n .. sym
end
return s
end,
show_close_icon = false,
show_buffer_close_icons = false,
always_show_bufferline = true,
offsets = {
{
filetype = "NvimTree",
text = "Explorer",
text_align = "center",
},
{
filetype = "snacks_layout_box",
},
},
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
})
},
options = {
diagnostics = "nvim_lsp",
diagnostics_indicator = function(count, level, diagnostics_dict, context)
local s = " "
for e, n in pairs(diagnostics_dict) do
local sym = e == "error" and ""
or (e == "warning" and "" or "")
s = s .. n .. sym
end
return s
end,
show_close_icon = false,
show_buffer_close_icons = false,
always_show_bufferline = true,
offsets = {
{
filetype = "NvimTree",
text = "Explorer",
text_align = "center",
},
{
filetype = "snacks_layout_box",
},
},
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
callback = function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end,
})
},
})
+36 -36
View File
@@ -1,38 +1,38 @@
require("chatgpt").setup({
api_host_cmd = "echo http://localhost:5000",
api_key_cmd = "echo ''",
openai_params = {
model = "Selene-1-Mini-Llama-3.1-8B-EXL3",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 1024,
temperature = 0.1,
top_p = 1,
n = 1,
},
keymaps = {
close = "<C-c>",
close_n = "<Esc>",
yank_last = "<C-y>",
yank_last_code = "<C-k>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
new_session = "<C-l>",
cycle_windows = "<Tab>",
cycle_modes = "<C-f>",
next_message = "<C-j>",
prev_message = "<C-k>",
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
draft_message = "<C-r>",
edit_message = "e",
delete_message = "d",
toggle_settings = "<C-o>",
toggle_sessions = "<C-p>",
toggle_help = "<C-h>",
toggle_message_role = "<C-r>",
toggle_system_role_open = "<C-s>",
stop_generating = "<C-x>",
},
api_host_cmd = "echo http://localhost:5000",
api_key_cmd = "echo ''",
openai_params = {
model = "Selene-1-Mini-Llama-3.1-8B-EXL3",
frequency_penalty = 0,
presence_penalty = 0,
max_tokens = 1024,
temperature = 0.1,
top_p = 1,
n = 1,
},
keymaps = {
close = "<C-c>",
close_n = "<Esc>",
yank_last = "<C-y>",
yank_last_code = "<C-k>",
scroll_up = "<C-u>",
scroll_down = "<C-d>",
new_session = "<C-l>",
cycle_windows = "<Tab>",
cycle_modes = "<C-f>",
next_message = "<C-j>",
prev_message = "<C-k>",
select_session = "<Space>",
rename_session = "r",
delete_session = "d",
draft_message = "<C-r>",
edit_message = "e",
delete_message = "d",
toggle_settings = "<C-o>",
toggle_sessions = "<C-p>",
toggle_help = "<C-h>",
toggle_message_role = "<C-r>",
toggle_system_role_open = "<C-s>",
stop_generating = "<C-x>",
},
})
+33 -33
View File
@@ -1,40 +1,40 @@
local cmp_kinds = {
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
local cmp = require('cmp')
cmp.setup({
preselect = 'None',
formatting = {
fields = { 'kind', 'abbr' },
format = function(_, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ''
return vim_item
end,
}
preselect = 'None',
formatting = {
fields = { 'kind', 'abbr' },
format = function(_, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ''
return vim_item
end,
}
})
+9 -8
View File
@@ -1,10 +1,11 @@
require("colorizer").setup({
user_default_options = {
mode = "virtualtext",
virtualtext = "",
css = true,
tailwind = true,
sass = { enable = true, parsers = { "css" }},
virtualtext_inline = 'before',
},
user_default_options = {
mode = "virtualtext",
virtualtext = "",
css = true,
tailwind = true,
sass = { enable = true, parsers = { "css" }},
virtualtext_inline = 'before',
AARRGGBB = true,
},
})
+57 -62
View File
@@ -1,64 +1,59 @@
require("copilot").setup({
panel = {
enabled = true,
auto_refresh = true,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>"
},
layout = {
position = "bottom", -- | top | left | right | horizontal | vertical
ratio = 0.4
},
},
suggestion = {
enabled = true,
auto_trigger = true,
hide_during_completion = true,
debounce = 75,
keymap = {
accept = "<A-tab>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
-- yaml = false,
-- markdown = false,
-- help = false,
-- gitcommit = false,
-- gitrebase = false,
-- hgcommit = false,
-- svn = false,
-- cvs = false,
-- python = false,
-- html = false,
-- css = false,
-- sh = false,
-- tex = false,
-- typescript = false,
-- java = false,
-- swift = false,
-- cpp = false,
-- hypr = false,
-- ["."] = false,
},
copilot_node_command = 'node', -- Node.js version must be > 18.x
server_opts_overrides = {},
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
callback = function()
vim.cmd( "CopilotChatSave AutoSave" )
end,
}),
vim.api.nvim_create_autocmd( "VimEnter", {
callback = function()
vim.cmd( "CopilotChatLoad AutoSave" )
end,
}),
panel = {
enabled = true,
auto_refresh = true,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<CR>",
refresh = "gr",
open = "<M-CR>"
},
layout = {
position = "bottom", -- | top | left | right | horizontal | vertical
ratio = 0.4
},
},
suggestion = {
enabled = true,
auto_trigger = true,
hide_during_completion = true,
debounce = 75,
keymap = {
accept = "<A-tab>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
filetypes = {
-- yaml = false,
-- markdown = false,
-- help = false,
-- gitcommit = false,
-- gitrebase = false,
-- hgcommit = false,
-- svn = false,
-- cvs = false,
-- python = false,
-- html = false,
-- css = false,
-- sh = false,
-- tex = false,
-- typescript = false,
-- java = false,
-- swift = false,
-- cpp = false,
-- hypr = false,
-- ["."] = false,
},
copilot_node_command = 'node',
server_opts_overrides = {},
vim.api.nvim_create_autocmd({ "VimLeavePre" }, {
callback = function()
vim.cmd( "CopilotChatSave AutoSave" )
end,
}),
})
+33 -32
View File
@@ -1,41 +1,42 @@
require("CopilotChat").setup {
prompts = {
},
-- system_prompt = "You are an assistant helping the user with whatever they need, but you are also a bit of an asshole.",
prompts = {
},
sticky = "#glob:**/*",
headers = {
user = ' You: ',
assistant = ' Copilot: ',
tool = '󰖷 Tool: ',
},
headers = {
user = ' You: ',
assistant = ' Copilot: ',
tool = '󰖷 Tool: ',
},
temperature = 0.2,
providers = {
tabby = {
prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
providers = {
tabby = {
prepare_input = require('CopilotChat.config.providers').copilot.prepare_input,
prepare_output = require('CopilotChat.config.providers').copilot.prepare_output,
get_models = function(headers)
local response, err = require('CopilotChat.utils').curl_get('http://localhost:5000/v1/models', {
headers = headers,
json_response = true
})
get_models = function(headers)
local response, err = require('CopilotChat.utils').curl_get('http://localhost:5000/v1/models', {
headers = headers,
json_response = true
})
if err then
error(err)
end
if err then
error(err)
end
return vim.tbl_map(function(model)
return {
id = model.id,
name = model.id,
}
end, response.body.data)
end,
return vim.tbl_map(function(model)
return {
id = model.id,
name = model.id,
}
end, response.body.data)
end,
get_url = function()
return 'http://localhost:5000/v1/chat/completions'
end,
}
}
get_url = function()
return 'http://localhost:5000/v1/chat/completions'
end,
}
}
}
+85 -85
View File
@@ -1,106 +1,106 @@
local dap = require('dap')
dap.adapters.python = function(cb, config)
if config.request == 'attach' then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = {
source_filetype = 'python',
},
})
else
cb({
type = 'executable',
command = 'path/to/virtualenvs/debugpy/bin/python',
args = { '-m', 'debugpy.adapter' },
options = {
source_filetype = 'python',
},
})
end
if config.request == 'attach' then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = {
source_filetype = 'python',
},
})
else
cb({
type = 'executable',
command = 'path/to/virtualenvs/debugpy/bin/python',
args = { '-m', 'debugpy.adapter' },
options = {
source_filetype = 'python',
},
})
end
end
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`
request = 'launch';
name = "Launch file";
{
-- The first three options are required by nvim-dap
type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python`
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()
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/home/zach/miniconda3/bin/python'
end
end;
},
program = "${file}"; -- This configuration will launch the current file if used.
pythonPath = function()
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/home/zach/miniconda3/bin/python'
end
end;
},
}
dap.adapters.lldb = {
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
name = 'lldb'
type = 'executable',
command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path
name = 'lldb'
}
dap.configurations.cpp = {
{
name = 'Launch',
type = 'lldb',
request = 'launch',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
{
name = 'Launch',
type = 'lldb',
request = 'launch',
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
args = {},
-- 💀
-- 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
--
-- Otherwise you might get the following error:
--
-- 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
-- runInTerminal = false,
},
-- 💀
-- 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
--
-- Otherwise you might get the following error:
--
-- 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
-- runInTerminal = false,
},
}
dap.adapters["pwa-node"] = {
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js", "${port}"},
}
type = "server",
host = "localhost",
port = "${port}",
executable = {
command = "node",
-- 💀 Make sure to update this path to point to your installation
args = {"/home/zach/.config/nvim/java-dap/js-debug/src/dapDebugServer.js", "${port}"},
}
}
dap.configurations.javascript = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
}
+42 -42
View File
@@ -1,50 +1,50 @@
require("gruvbox").setup({
variant = "hard",
dark_variant = "medium",
dim_inactive_windows = false,
extend_background_behind_borders = false,
variant = "hard",
dark_variant = "medium",
dim_inactive_windows = false,
extend_background_behind_borders = false,
enable = {
terminal = true,
legacy_highlights = true,
migrations = true,
},
enable = {
terminal = true,
legacy_highlights = true,
migrations = true,
},
styles = {
bold = true,
italic = true,
transparency = false,
},
styles = {
bold = true,
italic = true,
transparency = false,
},
groups = {
border = "gray",
link = "purple_lite",
panel = "bg_second",
groups = {
border = "gray",
link = "purple_lite",
panel = "bg_second",
error = "red_lite",
hint = "aqua_lite",
info = "blue_lite",
ok = "green_lite",
warn = "yellow_lite",
note = "yellow_dark",
todo = "aqua_dark",
error = "red_lite",
hint = "aqua_lite",
info = "blue_lite",
ok = "green_lite",
warn = "yellow_lite",
note = "yellow_dark",
todo = "aqua_dark",
git_add = "green_dark",
git_change = "yellow_dark",
git_delete = "red_dark",
git_dirty = "orange_dark",
git_ignore = "gray",
git_merge = "purple_dark",
git_rename = "blue_dark",
git_stage = "purple_dark",
git_text = "yellow_lite",
git_untracked = "bg2",
git_add = "green_dark",
git_change = "yellow_dark",
git_delete = "red_dark",
git_dirty = "orange_dark",
git_ignore = "gray",
git_merge = "purple_dark",
git_rename = "blue_dark",
git_stage = "purple_dark",
git_text = "yellow_lite",
git_untracked = "bg2",
h1 = "red_dark",
h2 = "yellow_dark",
h3 = "green_dark",
h4 = "aqua_dark",
h5 = "blue_dark",
h6 = "purple_dark",
},
h1 = "red_dark",
h2 = "yellow_dark",
h3 = "green_dark",
h4 = "aqua_dark",
h5 = "blue_dark",
h6 = "purple_dark",
},
})
+13 -13
View File
@@ -4,23 +4,23 @@ harpoon:setup()
local conf = require("telescope.config").values
local function toggle_telescope(harpoon_files)
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
local file_paths = {}
for _, item in ipairs(harpoon_files.items) do
table.insert(file_paths, item.value)
end
require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
require("telescope.pickers").new({}, {
prompt_title = "Harpoon",
finder = require("telescope.finders").new_table({
results = file_paths,
}),
previewer = conf.file_previewer({}),
sorter = conf.generic_sorter({}),
}):find()
end
vim.keymap.set("n", "<C-e>", function() toggle_telescope(harpoon:list()) end,
{ desc = "Open harpoon window" })
{ desc = "Open harpoon window" })
vim.keymap.set("n", "<leader>a", function() harpoon:list():add() end)
vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
+16 -16
View File
@@ -1,29 +1,29 @@
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
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()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
vim.g.rainbow_delimiters = { highlight = highlight }
require("ibl").setup {
indent = { char = "" },
scope = { highlight = highlight }
indent = { char = "" },
scope = { highlight = highlight }
}
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
+20 -20
View File
@@ -1,17 +1,17 @@
-- Bootstrap lazy.nvim
-- bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
@@ -19,12 +19,12 @@ vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("lazy").setup({
spec = {
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "onedark" } },
-- automatically check for plugin updates
checker = { enabled = true },
spec = {
{ import = "plugins" },
},
-- Configure any other settings here. See the documentation for more details.
-- colorscheme that will be used when installing plugins.
install = { colorscheme = { "onedark" } },
-- automatically check for plugin updates
checker = { enabled = true },
})
+7 -7
View File
@@ -1,9 +1,9 @@
require("lazydev").setup({
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" }},
"LazyVim",
},
enabled = function(root_dir)
return vim.g.lazydev_enabled == nil and true or vim.g.lazydev_enabled
end,
library = {
{ path = "${3rd}/luv/library", words = { "vim%.uv" }},
"LazyVim",
},
enabled = function(root_dir)
return vim.g.lazydev_enabled == nil and true or vim.g.lazydev_enabled
end,
})
+197 -192
View File
@@ -1,231 +1,236 @@
local cmp = require("cmp")
local cmp_lsp = require("cmp_nvim_lsp")
local capabilities = vim.tbl_deep_extend(
"force",
{},
vim.lsp.protocol.make_client_capabilities(),
cmp_lsp.default_capabilities()
"force",
{},
vim.lsp.protocol.make_client_capabilities(),
cmp_lsp.default_capabilities()
)
local cmp_kinds = {
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
Text = '',
Method = '',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
require("fidget").setup({})
require("mason").setup()
require("mason-lspconfig").setup({
automatic_enable = true,
ensure_installed = {
"lua_ls",
"rust_analyzer",
"gopls",
},
handlers = {
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
capabilities = capabilities,
}
end,
automatic_enable = true,
ensure_installed = {
"lua_ls",
"rust_analyzer",
"gopls",
},
handlers = {
function(server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
capabilities = capabilities,
}
end,
-- lemminx = function()
-- local lspconfig = vim.lsp.config
-- local lspenable = vim.lsp.enable
-- end,
["tailwindcss"] = function()
local lspconfig = require("lspconfig")
lspconfig.tailwindcss.setup {
capabilities = capabilities,
}
end,
["css-lsp"] = function()
local lspconfig = require("lspconfig")
lspconfig.cssls.setup {
capabilities = capabilities,
}
end,
["css-lsp"] = function()
local lspconfig = require("lspconfig")
lspconfig.cssls.setup {
capabilities = capabilities,
}
end,
zls = function()
local lspconfig = require("lspconfig")
lspconfig.zls.setup({
capabilities = capabilities,
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
settings = {
zls = {
enable_inlay_hints = true,
enable_snippets = true,
warn_style = true,
},
},
})
vim.g.zig_fmt_parse_errors = 0
vim.g.zig_fmt_autosave = 0
zls = function()
local lspconfig = require("lspconfig")
lspconfig.zls.setup({
capabilities = capabilities,
root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"),
settings = {
zls = {
enable_inlay_hints = true,
enable_snippets = true,
warn_style = true,
},
},
})
vim.g.zig_fmt_parse_errors = 0
vim.g.zig_fmt_autosave = 0
end,
["lua_ls"] = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
capabilities = capabilities,
settings = {
Lua = {
runtime = { version = "Lua 5.1" },
diagnostics = {
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
}
}
}
}
end,
}
end,
["lua_ls"] = function()
local lspconfig = require("lspconfig")
lspconfig.lua_ls.setup {
capabilities = capabilities,
settings = {
Lua = {
runtime = { version = "Lua 5.1" },
diagnostics = {
globals = { "bit", "vim", "it", "describe", "before_each", "after_each" },
}
}
}
}
end,
}
})
cmp.setup {
preselect = 'None',
formatting = {
fields = { 'kind', 'abbr' },
format = function(entry, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ''
if entry.completion_item.detail then
vim_item.menu = entry.completion_item.detail
end
return vim_item
end,
},
completion = { completeopt = "menu,menuone" },
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
preselect = 'None',
formatting = {
fields = { 'kind', 'abbr' },
format = function(entry, vim_item)
vim_item.kind = cmp_kinds[vim_item.kind] or ''
if entry.completion_item.detail then
vim_item.menu = entry.completion_item.detail
end
return vim_item
end,
},
completion = { completeopt = "menu,menuone" },
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
mapping = {
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true,
},
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = "path" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
}),
sources = cmp.config.sources({
{ name = "path" },
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "nvim_lua" },
}),
}
vim.diagnostic.config({
-- update_in_insert = true,
virtual_text = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
-- update_in_insert = true,
virtual_text = false,
virtual_lines = false,
signs = true,
underline = true,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = true,
header = "",
prefix = "",
},
})
local lspconfig = vim.lsp.config
lspconfig("texlab", {
cmd = { "texlab" },
filetypes = { "tex", "bib", "plaintex" },
root_markers = { ".git", ".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
settings = {
texlab = {
rootDirectory = nil,
build = {
executable = "latexmk",
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
onSave = true,
forwardSearchAfter = true,
},
forwardSearch = {
executable = "zathura",
args = {
"--synctex-editor-command",
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername,
"--synctex-forward",
"%l:1:%f",
"%p",
},
},
chktex = {
onEdit = false,
onOpenAndSave = true,
},
diagnosticsDelay = 300,
latexFormatter = "latexindent",
latexindent = {
['local'] = nil,
modifyLineBreaks = false,
},
bibtexFormatter = "texlab",
formatterLineLength = 80,
},
},
cmd = { "texlab" },
filetypes = { "tex", "bib", "plaintex" },
root_markers = { ".git", ".latexmkrc", "latexmkrc", ".texlabroot", "texlabroot", "Tectonic.toml" },
settings = {
texlab = {
rootDirectory = nil,
build = {
executable = "latexmk",
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
onSave = true,
forwardSearchAfter = true,
},
forwardSearch = {
executable = "zathura",
args = {
"--synctex-editor-command",
[[ nvim-texlabconfig -file '%%%{input}' -line %%%{line} -server ]] .. vim.v.servername,
"--synctex-forward",
"%l:1:%f",
"%p",
},
},
chktex = {
onEdit = false,
onOpenAndSave = true,
},
diagnosticsDelay = 300,
latexFormatter = "latexindent",
latexindent = {
['local'] = nil,
modifyLineBreaks = false,
},
bibtexFormatter = "texlab",
formatterLineLength = 80,
},
},
})
lspconfig("qmlls", {
cmd = { "qmlls6" },
cmd = { "qmlls6" },
})
local lspenable = vim.lsp.enable
local servers = {
"html",
"bashls",
"pyright",
"ts_ls",
"texlab",
-- "jdtls",
"sourcekit",
"qmlls",
"html",
"bashls",
"pyright",
"ts_ls",
"texlab",
"sourcekit",
"qmlls",
"tailwindcss",
}
for _, server in ipairs(servers) do
lspenable(server)
lspenable(server)
end
+144 -144
View File
@@ -1,171 +1,171 @@
local fn = vim.fn
local get_active_lsp = function()
local msg = "🚫"
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
local clients = vim.lsp.get_clients { bufnr = 0 }
if next(clients) == nil then
return msg
end
local msg = ""
local buf_ft = vim.api.nvim_get_option_value("filetype", {})
local clients = vim.lsp.get_clients { bufnr = 0 }
if next(clients) == nil then
return msg
end
for _, client in ipairs(clients) do
---@diagnostic disable-next-line: undefined-field
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
for _, client in ipairs(clients) do
---@diagnostic disable-next-line: undefined-field
local filetypes = client.config.filetypes
if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
return client.name
end
end
return msg
end
local function spell()
if vim.o.spell then
return string.format("[SPELL]")
end
if vim.o.spell then
return string.format("[SPELL]")
end
return ""
return ""
end
--- show indicator for Chinese IME
local function ime_state()
if vim.g.is_mac then
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
if res ~= -1 then
return "[CN]"
end
end
if vim.g.is_mac then
local layout = fn.libcall(vim.g.XkbSwitchLib, "Xkb_Switch_getXkbLayout", "")
local res = fn.match(layout, [[\v(Squirrel\.Rime|SCIM.ITABC)]])
if res ~= -1 then
return "[CN]"
end
end
return ""
return ""
end
local diff = function()
local git_status = vim.b.gitsigns_status_dict
if git_status == nil then
return
end
local git_status = vim.b.gitsigns_status_dict
if git_status == nil then
return
end
local modify_num = git_status.changed
local remove_num = git_status.removed
local add_num = git_status.added
local modify_num = git_status.changed
local remove_num = git_status.removed
local add_num = git_status.added
local info = { added = add_num, modified = modify_num, removed = remove_num }
-- vim.print(info)
return info
local info = { added = add_num, modified = modify_num, removed = remove_num }
-- vim.print(info)
return info
end
local virtual_env = function()
-- only show virtual env for Python
if vim.bo.filetype ~= "python" then
return ""
end
-- only show virtual env for Python
if vim.bo.filetype ~= "python" then
return ""
end
local conda_env = os.getenv("CONDA_DEFAULT_ENV")
local venv_path = os.getenv("VIRTUAL_ENV")
local conda_env = os.getenv("CONDA_DEFAULT_ENV")
local venv_path = os.getenv("VIRTUAL_ENV")
if venv_path == nil then
if conda_env == nil then
return ""
else
return string.format(" %s (conda)", conda_env)
end
else
local venv_name = vim.fn.fnamemodify(venv_path, ":t")
return string.format(" %s (venv)", venv_name)
end
if venv_path == nil then
if conda_env == nil then
return ""
else
return string.format(" %s (conda)", conda_env)
end
else
local venv_name = vim.fn.fnamemodify(venv_path, ":t")
return string.format(" %s (venv)", venv_name)
end
end
require("lualine").setup {
laststatus = 0,
options = {
icons_enabled = true,
theme = "auto",
globalstatus = true,
component_separators = '',
section_separators = { left = '', right = '' },
disabled_filetypes = {},
always_divide_middle = true,
},
sections = {
lualine_a = {
{
"mode",
},
},
lualine_b = {
{
"branch",
fmt = function(name, _)
-- truncate branch name in case the name is too long
return string.sub(name, 1, 20)
end,
color = { gui = "italic,bold" },
separator = { right = "" },
},
{
virtual_env,
color = { fg = "black", bg = "#F1CA81" },
},
},
lualine_c = {
{
"filename",
symbols = {
readonly = "[🔒]",
},
},
{
"diff",
source = diff,
},
{
"%S",
color = { gui = "bold", fg = "cyan" },
},
{
spell,
color = { fg = "black", bg = "#a7c080" },
},
},
lualine_x = {
{
ime_state,
color = { fg = "black", bg = "#f46868" },
},
{
get_active_lsp,
icon = " LSP:",
},
{
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = "🆇 ", warn = "⚠️ ", info = " ", hint = "" },
},
},
lualine_y = {
{ "encoding", fmt = string.upper },
{
"fileformat",
symbols = {
unix = "",
dos = "",
mac = "",
},
},
"filetype",
},
lualine_z = {
"progress",
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { "quickfix", "fugitive", "nvim-tree" },
laststatus = 0,
options = {
icons_enabled = true,
theme = "auto",
globalstatus = true,
component_separators = '',
section_separators = { left = '', right = '' },
disabled_filetypes = {},
always_divide_middle = true,
},
sections = {
lualine_a = {
{
"mode",
},
},
lualine_b = {
{
"branch",
fmt = function(name, _)
-- truncate branch name in case the name is too long
return string.sub(name, 1, 20)
end,
color = { gui = "italic,bold" },
separator = { right = "" },
},
{
virtual_env,
color = { fg = "black", bg = "#F1CA81" },
},
},
lualine_c = {
{
"filename",
symbols = {
readonly = "[󰌾]",
},
},
{
"diff",
source = diff,
},
{
"%S",
color = { gui = "bold", fg = "cyan" },
},
{
spell,
color = { fg = "black", bg = "#a7c080" },
},
},
lualine_x = {
{
ime_state,
color = { fg = "black", bg = "#f46868" },
},
{
get_active_lsp,
icon = " LSP:",
},
{
"diagnostics",
sources = { "nvim_diagnostic" },
symbols = { error = " ", warn = " ", info = " ", hint = "" },
},
},
lualine_y = {
{ "encoding", fmt = string.upper },
{
"fileformat",
symbols = {
unix = "",
dos = "",
mac = "",
},
},
"filetype",
},
lualine_z = {
"progress",
},
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { "filename" },
lualine_x = { "location" },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { "quickfix", "fugitive", "nvim-tree" },
}
+5 -5
View File
@@ -1,7 +1,7 @@
return {
content = {
active = nil,
inactive = nil,
},
use_icons = true,
content = {
active = nil,
inactive = nil,
},
use_icons = true,
}
+15 -15
View File
@@ -1,17 +1,17 @@
require("modicator").setup({
show_warnings = true,
highlights = {
defaults = {
bold = false,
italic = false,
},
use_cursorline_background = true,
},
integration = {
lualine = {
enabled = true,
mode_section = nil,
highlight = 'bg',
}
}
show_warnings = true,
highlights = {
defaults = {
bold = false,
italic = false,
},
use_cursorline_background = true,
},
integration = {
lualine = {
enabled = true,
mode_section = nil,
highlight = 'bg',
}
}
})
+11
View File
@@ -0,0 +1,11 @@
require("mini.splitjoin").setup({
mappings = {
toggle = "gS",
},
detect = {
brackets = { '%b()', '%b{}', '%b[]' },
separator = '[,;]',
},
})
+27 -27
View File
@@ -1,29 +1,29 @@
require("noice").setup({
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = false,
},
views = {
popupmenu = {
enabled = true,
backend = "nui",
win_options = {
winblend = 0.5,
},
border = {
style = "shadow",
padding = { 1, 2 },
},
},
},
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = false,
lsp_doc_border = false,
},
views = {
popupmenu = {
enabled = true,
backend = "nui",
win_options = {
winblend = 0.5,
},
border = {
style = "shadow",
padding = { 1, 2 },
},
},
},
})
+5 -5
View File
@@ -2,7 +2,7 @@ vim.notify = require('notify')
local dap = require('dap')
require('notify').setup({
render = "wrapped-default",
render = "wrapped-default",
timeout = 6000,
max_width = 50,
minimum_width = 50,
@@ -15,10 +15,10 @@ require('notify').setup({
DEBUG = "",
TRACE = "",
},
on_open = function(win)
-- vim.api.nvim_win_set_option(win, 'wrap', true)
vim.api.nvim_win_set_option(win, 'breakat', ' ')
end,
on_open = function(win)
-- vim.api.nvim_win_set_option(win, 'wrap', true)
vim.api.nvim_win_set_option(win, 'breakat', ' ')
end,
})
-- Utility functions shared between progress reports for LSP and DAP
+3 -3
View File
@@ -1,7 +1,7 @@
local popup = require('nui.popup')
local Popup = popup({
border = {
style = "shadow",
}
border = {
style = "shadow",
}
})
+22 -22
View File
@@ -1,26 +1,26 @@
require('refactoring').setup({
prompt_func_return_type = {
go = true,
java = true,
prompt_func_return_type = {
go = true,
java = true,
cpp = true,
c = true,
h = true,
hpp = true,
cxx = true,
},
prompt_func_param_type = {
go = true,
java = true,
cpp = true,
c = true,
h = true,
hpp = true,
cxx = true,
},
prompt_func_param_type = {
go = true,
java = true,
cpp = true,
c = true,
h = true,
hpp = true,
cxx = true,
},
printf_statements = {},
print_var_statements = {},
show_success_message = true, -- shows a message with information about the refactor on success
-- i.e. [Refactor] Inlined 3 variable occurrences
cpp = true,
c = true,
h = true,
hpp = true,
cxx = true,
},
printf_statements = {},
print_var_statements = {},
show_success_message = true, -- shows a message with information about the refactor on success
-- i.e. [Refactor] Inlined 3 variable occurrences
})
+2 -2
View File
@@ -1,4 +1,4 @@
require("region-folding").setup({
region_text = { start = "<think>", ending = "</think>" },
fold_indicator = "",
region_text = { start = "<think>", ending = "</think>" },
fold_indicator = "",
})
+88
View File
@@ -0,0 +1,88 @@
return {
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true },
indent = {
enabled = true,
scope = {
enabled = true,
underline = true,
},
chunk = {
enabled = false,
char = {
corner_top = "",
corner_bottom = "",
vertical = "",
arrow = "",
},
},
},
input = { enabled = true },
picker = {
enabled = true,
hidden = true,
ignored = true,
},
image = {
enabled = true,
formats = {
"png",
"jpg",
"jpeg",
"gif",
"bmp",
"webp",
"tiff",
"heic",
"avif",
"mp4",
"mov",
"avi",
"mkv",
"webm",
"pdf",
"icns",
},
doc = {
enabled = true,
inline = true,
float = true,
max_width = 80,
max_height = 80,
},
},
notifier = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = true },
statuscolumn = { enabled = true },
words = { enabled = true },
terminal = {
enabled = true,
win = { style = "terminal" },
},
styles = {
terminal = {
keys = {
term_normal = {
"<c-q>",
function()
Snacks.terminal.toggle()
end,
mode = "t"
}
}
}
},
gitbrowse = {
enabled = true,
notify = false,
},
},
}
+5 -5
View File
@@ -1,7 +1,7 @@
require("telescope").setup ({
pickers = {
colorscheme = {
enable_preview = true,
}
}
pickers = {
colorscheme = {
enable_preview = true,
}
}
})
+10 -10
View File
@@ -1,15 +1,15 @@
local M = {}
local i = {}
function M.foldexpr()
local lnum = vim.v.lnum
local line = vim.fn.getline( lnum )
if line:find( "<think>", 1, true ) then
return "a1"
elseif line:find( "</think>", 1, true ) then
return "s1"
else
return "="
end
local lnum = vim.v.lnum
local line = vim.fn.getline( lnum )
if line:find( "<think>", 1, true ) then
return "a1"
elseif line:find( "</think>", 1, true ) then
return "s1"
else
return "="
end
end
return M
+6 -6
View File
@@ -1,8 +1,8 @@
-- Lua
-- lua
require('onedarkpro').setup({
highlights = {
Comment = { italic = true },
Directory = { bold = false },
ErrorMsg = { italic = true },
},
highlights = {
Comment = { italic = true },
Directory = { bold = false },
ErrorMsg = { italic = true },
},
})
+19 -17
View File
@@ -1,19 +1,21 @@
require("tmux").setup({
copy_sync = {
enable = true,
redirect_to_clipboard = true,
sync_clipboard = true,
sync_registers = true,
},
navigation = {
cycle_navigation = true,
enable_default_keybindings = false,
},
resize = {
enable_default_keybindings = false,
},
swap = {
cycle_navigation = true,
enable_default_keybindings = false,
}
copy_sync = {
enable = true,
redirect_to_clipboard = true,
sync_clipboard = true,
sync_registers = true,
},
navigation = {
cycle_navigation = true,
enable_default_keybindings = false,
},
resize = {
enable_default_keybindings = false,
resize_step_x = 5,
resize_step_y = 5,
},
swap = {
cycle_navigation = false,
enable_default_keybindings = false,
}
})
+11 -10
View File
@@ -1,12 +1,13 @@
require'nvim-treesitter.configs'.setup {
ensure_installed = "all",
sync_install = true,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
ensure_installed = "all",
ignore_install = { "ipkg" },
sync_install = true,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = {
enable = true,
},
}
+17 -17
View File
@@ -1,19 +1,19 @@
require('undotree').setup({
float_diff = true,
layout = "left_bottom",
position = "left",
ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },
window = {
winblend = 30,
},
keymaps = {
['j'] = "move_next",
['k'] = "move_prev",
['gj'] = "move2parent",
['J'] = "move_change_next",
['K'] = "move_change_prev",
['<cr>'] = "action_enter",
['p'] = "enter_diffbuf",
['q'] = "quit",
},
float_diff = true,
layout = "left_bottom",
position = "left",
ignore_filetype = { 'undotree', 'undotreeDiff', 'qf', 'TelescopePrompt', 'spectre_panel', 'tsplayground' },
window = {
winblend = 30,
},
keymaps = {
['j'] = "move_next",
['k'] = "move_prev",
['gj'] = "move2parent",
['J'] = "move_change_next",
['K'] = "move_change_prev",
['<cr>'] = "action_enter",
['p'] = "enter_diffbuf",
['q'] = "quit",
},
})
+23 -5
View File
@@ -10,10 +10,20 @@ map("v", "<C-Up>", ":m '<-2<CR>gv=gv", { desc = "Move selected text up" })
map("v", "<C-Down>", ":m '>+1<CR>gv=gv", { desc = "Move selected text down" })
-- Alt + Arrow Key to change buffer
map("n", "<A-Left>", "<C-w>h", { desc = "Move to left split" })
map("n", "<A-Down>", "<C-w>j", { desc = "Move to bottom split" })
map("n", "<A-Up>", "<C-w>k", { desc = "Move to top split" })
map("n", "<A-Right>", "<C-w>l", { desc = "Move to right split" })
-- map("n", "<A-Left>", "<C-w>h", { desc = "Move to left split" })
-- map("n", "<A-Down>", "<C-w>j", { desc = "Move to bottom split" })
-- map("n", "<A-Up>", "<C-w>k", { desc = "Move to top split" })
-- map("n", "<A-Right>", "<C-w>l", { desc = "Move to right split" })
map("n", "<A-Left>", "<cmd>lua require('tmux').move_left()<CR>", { desc = "Move to left split" })
map("n", "<A-Down>", "<cmd>lua require('tmux').move_bottom()<CR>", { desc = "Move to bottom split" })
map("n", "<A-Up>", "<cmd>lua require('tmux').move_top()<CR>", { desc = "Move to top split" })
map("n", "<A-Right>", "<cmd>lua require('tmux').move_right()<CR>", { desc = "Move to right split" })
map("n", "<C-Left>", "<cmd>lua require('tmux').resize_left()<CR>", { desc = "Move to left split" })
map("n", "<C-Down>", "<cmd>lua require('tmux').resize_bottom()<CR>", { desc = "Move to bottom split" })
map("n", "<C-Up>", "<cmd>lua require('tmux').resize_top()<CR>", { desc = "Move to top split" })
map("n", "<C-Right>", "<cmd>lua require('tmux').resize_right()<CR>", { desc = "Move to right split" })
-- Copilot Chat buffer
map("n", "<A-c>", vim.cmd.CopilotChatToggle)
@@ -55,7 +65,15 @@ map("i", "<C-c>", "<Esc>")
map("n", "<leader>mr", "<cmd>CellularAutomaton make_it_rain<CR>");
map("n", "<leader><leader>", function()
vim.cmd("so")
vim.cmd("so")
end)
map("n", "<A-v>", "<cmd>ChatGPT<CR>")
map("n", "<leader>fm", "<cmd>TailwindConcealToggle<CR>", { desc = "Toggle Tailwind Conceal" })
-- Terminal
map("n", "<C-q>", function() Snacks.terminal.toggle() end, { desc = "Toggle Terminal" })
-- Gitbrowse
map("n", "<leader>gb", function() Snacks.gitbrowse.open() end )
+17
View File
@@ -0,0 +1,17 @@
local M = {}
function M.load_modules()
local modules_path = vim.fn.stdpath("config") .. "/lua/config/modules"
local modules = vim.fn.globpath(modules_path, "*.lua", false, true)
for _, module_file in ipairs(modules) do
local module_name = vim.fn.fnamemodify(module_file, ":t:r")
local ok, err = pcall(require, "config.modules." .. module_name)
if not ok then
vim.notify("Failed to load module: " .. module_name .. "\n" .. err, vim.log.levels.ERROR)
end
end
end
return M
+5 -6
View File
@@ -3,8 +3,12 @@ vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.expandtab = false
vim.opt.smartindent = false
vim.o.list = true
vim.opt.listchars = { tab = "··", trail = "·", nbsp = "_" }
vim.opt.wrap = true
vim.opt.linebreak = true
vim.opt.swapfile = false
@@ -21,11 +25,6 @@ vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
vim.opt.textwidth = 80
vim.opt.formatoptions = "rqnj"
-- vim.opt.foldmethod = "expr"
-- vim.opt.foldexpr = "v:lua.require('config.testfold').foldexpr()"
-- vim.opt.foldenable = true
-- vim.opt.foldlevel = 0
-- vim.opt.foldlevelstart = 0
vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
vim.o.clipboard = "unnamedplus"
vim.o.cursorline = true
+281 -309
View File
@@ -1,311 +1,283 @@
return {
{
"nvim-treesitter/nvim-treesitter",
config = function()
require("config.treesitter")
end,
},
{
"sainnhe/edge",
lazy = false,
priority = 1000,
config = function()
vim.g.edge_enable_italic = 1
vim.g.edge_style = "default"
vim.g.edge_menu_selection_background = "purple"
end,
},
{
"rmagatti/auto-session",
config = function()
require("config.autosession")
end,
},
{
"olimorris/onedarkpro.nvim",
priority = 1000,
config = function()
require("config.themelight")
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("config.telescope")
end,
},
{
"lambdalisue/vim-suda",
init = function()
vim.g.suda_smart_edit = 1
end,
},
{
"nvim-tree/nvim-web-devicons",
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
config = function()
require("config.barbar")
end,
},
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
config = function ()
if vim.env.TMUX then
vim.api.nvim_create_autocmd({ "FocusGained", "ColorScheme", "VimEnter" }, {
callback = function()
vim.defer_fn( function()
vim.opt.laststatus = 0
end, 100)
end,
})
vim.o.laststatus = 0
end
require("config.lualine")
end,
},
{
"mawkler/modicator.nvim",
config = function()
require("config.modicator")
end
},
{
"shinchu/lightline-gruvbox.vim",
},
{
"jiaoshijie/undotree",
config = function()
require("config.undotree")
end,
},
{
"hiphish/rainbow-delimiters.nvim",
enabled = true,
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("config.autopairs")
end,
},
{
"tpope/vim-fugitive",
},
{
"rcarriga/nvim-notify",
config = function()
require "config.notify"
end,
},
{
"zbirenbaum/copilot.lua",
lazy = true,
cmd = "Copilot",
event = "InsertEnter",
config = function()
require "config.copilot"
end,
},
{
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim", branch = "master" },
},
build = "make tiktoken",
config = function()
require "config.copilotchat"
end,
},
{
"mfussenegger/nvim-dap",
config = function()
require("config.dapconf")
end,
},
{
"folke/snacks.nvim",
priority = 1000,
lazy = false,
---@type snacks.Config
opts = {
bigfile = { enabled = true },
dashboard = { enabled = true },
explorer = { enabled = true },
indent = {
enabled = true,
scope = {
enabled = false,
underline = true,
animate = {
enabled = true,
fps = 144,
easing = "inExpo",
duration = 20,
},
},
chunk = {
enabled = true,
char = {
corner_top = "",
corner_bottom = "",
vertical = "",
arrow = "",
},
},
},
input = { enabled = true },
picker = {
enabled = true,
hidden = true,
ignored = true,
},
notifier = { enabled = true },
quickfile = { enabled = true },
scope = { enabled = true },
scroll = { enabled = false },
statuscolumn = { enabled = true },
words = { enabled = true },
},
},
{
"notken12/base46-colors",
},
-- {
-- "mason-org/mason-lspconfig.nvim",
-- opts = {},
-- dependencies = {
-- { "mason-org/mason.nvim", opts = {} },
-- "neovim/nvim-lspconfig",
-- },
-- },
{
"folke/lazydev.nvim",
ft = "lua",
opts = function()
require("config.lazydev")
end,
},
{
"neovim/nvim-lspconfig",
enabled = true,
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim",
},
config = function()
require("config.lspconfig")
end,
},
{
"smolck/command-completion.nvim",
opts = {
border = nil,
highlight_selection = true,
use_matchfuzzy = true,
tab_completion = true,
},
},
{
"andweeb/presence.nvim",
},
{
"mfussenegger/nvim-jdtls",
},
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("config.harpoon")
end,
},
{
"catgoose/nvim-colorizer.lua",
config = function()
require("config.colorizer")
end,
},
{
"ziglang/zig.vim",
},
{
"mg979/vim-visual-multi",
branch = "master",
},
{
"elkowar/yuck.vim",
},
{
"f3fora/nvim-texlabconfig",
config = function()
require("config.texlab")
end,
build = "go build",
},
{
"lancewilhelm/horizon-extended.nvim",
},
{
"vimpostor/vim-tpipeline",
},
{
"yazeed1s/minimal.nvim",
config = function()
vim.g.minimal_italic_comments = true
end,
},
{
"ThePrimeagen/refactoring.nvim",
config = function()
require("config.refactoring")
end,
},
{
"Yazeed1s/minimal.nvim",
config = function()
vim.g.minimal_italic_comments = true
vim.g.minimal_italic_functions = true
end,
},
{
"propet/colorscheme-persist.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
},
lazy = false,
config = true,
keys = {
{
"<leader>sp",
function()
require("colorscheme-persist").picker()
end,
mode = "n",
},
},
opts = {
picker_opts = require("telescope.themes").get_dropdown({
enable_preview = true,
}),
}
}
{
"nvim-mini/mini.nvim",
version = false,
modules = function()
require("config.mini-modules")
end,
},
{
"nvim-treesitter/nvim-treesitter",
config = function()
require("config.treesitter")
end,
},
{
"sainnhe/edge",
lazy = false,
priority = 1000,
config = function()
vim.g.edge_enable_italic = 1
vim.g.edge_style = "default"
vim.g.edge_menu_selection_background = "purple"
end,
},
{
"rmagatti/auto-session",
config = function()
require("config.autosession")
end,
},
{
"olimorris/onedarkpro.nvim",
priority = 1000,
config = function()
require("config.themelight")
end,
},
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("config.telescope")
end,
},
{
"lambdalisue/vim-suda",
init = function()
vim.g.suda_smart_edit = 1
end,
},
{
"nvim-tree/nvim-web-devicons",
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
config = function()
require("config.barbar")
end,
},
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
config = function ()
if vim.env.TMUX then
vim.api.nvim_create_autocmd({ "FocusGained", "ColorScheme", "VimEnter" }, {
callback = function()
vim.defer_fn( function()
vim.opt.laststatus = 0
end, 100)
end,
})
vim.o.laststatus = 0
end
require("config.lualine")
end,
},
{
"mawkler/modicator.nvim",
config = function()
require("config.modicator")
end
},
{
"shinchu/lightline-gruvbox.vim",
},
{
"jiaoshijie/undotree",
config = function()
require("config.undotree")
end,
},
{
"hiphish/rainbow-delimiters.nvim",
enabled = true,
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
require("config.autopairs")
end,
},
{
"tpope/vim-fugitive",
},
{
"rcarriga/nvim-notify",
config = function()
require "config.notify"
end,
},
{
"zbirenbaum/copilot.lua",
lazy = true,
cmd = "Copilot",
event = "InsertEnter",
config = function()
require "config.copilot"
end,
},
{
"CopilotC-Nvim/CopilotChat.nvim",
dependencies = {
{ "zbirenbaum/copilot.lua" },
{ "nvim-lua/plenary.nvim", branch = "master" },
},
build = "make tiktoken",
config = function()
require "config.copilotchat"
end,
},
{
"mfussenegger/nvim-dap",
config = function()
require("config.dapconf")
end,
},
{
require("config.snacks")
},
{
"notken12/base46-colors",
},
-- {
-- "mason-org/mason-lspconfig.nvim",
-- opts = {},
-- dependencies = {
-- { "mason-org/mason.nvim", opts = {} },
-- "neovim/nvim-lspconfig",
-- },
-- },
{
"folke/lazydev.nvim",
ft = "lua",
opts = function()
require("config.lazydev")
end,
},
{
"neovim/nvim-lspconfig",
enabled = true,
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/nvim-cmp",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"j-hui/fidget.nvim",
},
config = function()
require("config.lspconfig")
end,
},
{
"smolck/command-completion.nvim",
opts = {
border = nil,
highlight_selection = true,
use_matchfuzzy = true,
tab_completion = true,
},
},
{
"andweeb/presence.nvim",
},
{
"mfussenegger/nvim-jdtls",
},
{
"ThePrimeagen/harpoon",
branch = "harpoon2",
dependencies = {
"nvim-lua/plenary.nvim",
},
config = function()
require("config.harpoon")
end,
},
{
"catgoose/nvim-colorizer.lua",
config = function()
require("config.colorizer")
end,
},
{
"ziglang/zig.vim",
},
{
"mg979/vim-visual-multi",
branch = "master",
},
{
"elkowar/yuck.vim",
},
{
"f3fora/nvim-texlabconfig",
config = function()
require("config.texlab")
end,
build = "go build",
},
{
"lancewilhelm/horizon-extended.nvim",
},
{
"vimpostor/vim-tpipeline",
},
{
"yazeed1s/minimal.nvim",
config = function()
vim.g.minimal_italic_comments = true
end,
},
{
"ThePrimeagen/refactoring.nvim",
config = function()
require("config.refactoring")
end,
},
{
"Yazeed1s/minimal.nvim",
config = function()
vim.g.minimal_italic_comments = true
vim.g.minimal_italic_functions = true
end,
},
{
"propet/colorscheme-persist.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
},
lazy = false,
config = true,
keys = {
{
"<leader>sp",
function()
require("colorscheme-persist").picker()
end,
mode = "n",
},
},
opts = {
picker_opts = require("telescope.themes").get_dropdown({
enable_preview = true,
}),
}
},
{
"aserowy/tmux.nvim",
config = function()
require("config.tmux")
end,
},
}