feat: remove ow directory, keep ow in type annotations only

This commit is contained in:
2025-10-05 00:30:22 +02:00
parent a1ff822efb
commit 8b17ef2b6b
39 changed files with 103 additions and 112 deletions
+28
View File
@@ -0,0 +1,28 @@
---@type LazyPluginSpec
return {
"stevearc/aerial.nvim",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
keys = {
{
"<leader>ss",
function()
require("aerial").toggle({ focus = false, direction = "left" })
end,
},
{
"gs",
function()
require("aerial").focus()
end,
},
},
opts = {
layout = {
max_width = 60,
min_width = 60,
},
attach_mode = "global",
},
}
+11
View File
@@ -0,0 +1,11 @@
-- https://github.com/numToStr/Comment.nvim
---@type LazyPluginSpec
return {
"numToStr/Comment.nvim",
event = "VeryLazy",
opts = {
--ignore empty lines
ignore = "^$",
},
}
+9
View File
@@ -0,0 +1,9 @@
-- https://github.com/j-hui/fidget.nvim
---@type LazyPluginSpec
return {
"j-hui/fidget.nvim",
tag = "legacy",
event = "LspAttach",
config = true,
}
+10
View File
@@ -0,0 +1,10 @@
-- https://github.com/rbong/vim-flog
---@type LazyPluginSpec
return {
"rbong/vim-flog",
---@type LazyKeysSpec[]
keys = {
{ "<leader>gl", vim.cmd.Flog, mode = "n" },
},
}
+99
View File
@@ -0,0 +1,99 @@
-- https://github.com/tpope/vim-fugitive
local function open_git_status()
local previous_win = vim.api.nvim_get_current_win()
vim.cmd("leftabove vertical G")
vim.api.nvim_win_set_width(0, 50)
vim.api.nvim_set_option_value("winfixwidth", true, { scope = "local" })
vim.api.nvim_set_current_win(previous_win)
end
local function get_git_status_win()
local current_tabpage = vim.api.nvim_get_current_tabpage()
for _, win in ipairs(vim.api.nvim_tabpage_list_wins(current_tabpage)) do
local buf = vim.api.nvim_win_get_buf(win)
local buftype = vim.api.nvim_get_option_value("buftype", { buf = buf })
if
buftype == "nowrite"
and vim.api.nvim_buf_get_name(buf):match("^fugitive://.*%.git//$")
then
return win
end
end
end
local function toggle_git_status()
local win = get_git_status_win()
if win then
vim.api.nvim_win_close(win, false)
return
end
open_git_status()
end
---@type LazyPluginSpec
return {
"tpope/vim-fugitive",
event = "VeryLazy",
---@type LazyKeysSpec[]
keys = {
{
"<leader>gd",
vim.cmd.Gvdiffsplit,
mode = "n",
},
{
"<leader>gD",
function()
vim.cmd.Gvdiffsplit("HEAD")
end,
mode = "n",
},
{
"<leader>gh",
vim.cmd.Ghdiffsplit,
mode = "n",
},
{
"<leader>gH",
function()
vim.cmd.Ghdiffsplit("HEAD")
end,
mode = "n",
},
{
"<leader>gc",
function()
vim.cmd.G("commit")
end,
mode = "n",
},
{
"<leader>ga",
function()
vim.cmd.G("commit --amend")
end,
mode = "n",
},
{
"<leader>gp",
function()
vim.cmd.G("push")
end,
mode = "n",
},
{
"<leader>gg",
toggle_git_status,
mode = "n",
},
},
config = function()
vim.api.nvim_create_autocmd("BufWritePost", {
callback = function()
vim.fn["fugitive#ReloadStatus"]()
end,
})
end,
}
+65
View File
@@ -0,0 +1,65 @@
-- https://github.com/lewis6991/gitsigns.nvim
---@type LazyPluginSpec
return {
"lewis6991/gitsigns.nvim",
event = "VeryLazy",
opts = {
preview_config = {
border = "single",
},
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
vim.keymap.set(
"n",
"<leader>gv",
gs.select_hunk,
{ buffer = bufnr }
)
vim.keymap.set("n", "<leader>gs", gs.stage_hunk, { buffer = bufnr })
vim.keymap.set("x", "<leader>gs", function()
gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
end, { buffer = bufnr })
vim.keymap.set(
{ "n", "x" },
"<leader>gu",
gs.undo_stage_hunk,
{ buffer = bufnr }
)
vim.keymap.set("n", "<leader>gr", gs.reset_hunk, { buffer = bufnr })
vim.keymap.set(
"x",
"<leader>gr",
":Gitsigns reset_hunk<CR>",
{ buffer = bufnr }
)
vim.keymap.set(
"n",
"<leader>g?",
gs.preview_hunk,
{ buffer = bufnr }
)
vim.keymap.set("n", "<leader>gb", function()
gs.blame_line({ full = true, ignore_whitespace = true })
end, { buffer = bufnr })
vim.keymap.set({ "n", "x" }, "]g", function()
gs.next_hunk({
wrap = true,
navigation_message = true,
foldopen = true,
preview = true,
})
end)
vim.keymap.set({ "n", "x" }, "[g", function()
gs.prev_hunk({
wrap = true,
navigation_message = true,
foldopen = true,
preview = true,
})
end)
end,
attach_to_untracked = true,
sign_priority = 100,
},
}
+5
View File
@@ -0,0 +1,5 @@
---@type LazyPluginSpec
return {
"neovim/nvim-lspconfig",
config = require("lsp").setup,
}
+42
View File
@@ -0,0 +1,42 @@
---@type LazyPluginSpec
return {
"owallb/mason-auto-install.nvim",
dependencies = {
"neovim/nvim-lspconfig",
},
---@type MasonAutoInstall.Config
opts = {
packages = {
{
"bash-language-server",
dependencies = { "shellcheck", "shfmt" },
},
-- "clangd",
{
"cmake-language-server",
dependencies = { "golines" },
},
"gopls",
"hyprls",
{
"intelephense",
dependencies = { "phpcs" },
},
"jedi-language-server",
{
"lemminx",
dependencies = { "xmlformatter" },
},
{
"lua-language-server",
dependencies = { "stylua" },
},
"mesonlsp",
"ruff",
"pyright",
"pyrefly",
"rust-analyzer",
"zls",
},
},
}
+8
View File
@@ -0,0 +1,8 @@
-- https://github.com/williamboman/mason.nvim
---@type LazyPluginSpec
return {
"williamboman/mason.nvim",
event = "VeryLazy",
config = true,
}
+17
View File
@@ -0,0 +1,17 @@
-- https://github.com/rcarriga/nvim-notify
---@type LazyPluginSpec
return {
"rcarriga/nvim-notify",
priority = 900,
lazy = false,
opts = {
render = "default",
stages = "static",
},
config = function(_, opts)
---@type notify
vim.notify = require("notify")
vim.notify.setup(opts)
end,
}
+187
View File
@@ -0,0 +1,187 @@
-- https://github.com/hrsh7th/nvim-cmp
local word_pattern = "[%w_.]"
local function has_words_before()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0
and vim.api
.nvim_buf_get_lines(0, line - 1, line, true)[1]
:sub(col, col)
:match(word_pattern)
~= nil
end
local function has_words_after()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0
and vim.api
.nvim_buf_get_lines(0, line - 1, line, true)[1]
:sub(col + 1, col + 1)
:match(word_pattern)
~= nil
end
---@type LazyPluginSpec
return {
"hrsh7th/nvim-cmp",
dependencies = {
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-nvim-lsp",
{
"L3MON4D3/LuaSnip",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
build = (
require("util").os_name ~= "Windows_NT"
and "make install_jsregexp"
or nil
),
version = "2.*",
dependencies = { "rafamadriz/friendly-snippets" },
},
{
"onsails/lspkind.nvim",
config = function()
require("lspkind").init()
end,
},
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
local lspkind = require("lspkind")
---@type cmp.ConfigSchema
local opts = {
-- enabled = function()
-- return has_words_before()
-- end,
preselect = "None",
completion = {
autocomplete = { "InsertEnter", "TextChanged" },
keyword_length = 1,
},
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
---@diagnostic disable-next-line: missing-fields
formatting = {
format = function(entry, vim_item)
vim_item = lspkind.cmp_format({
mode = "symbol",
maxwidth = 50,
ellipsis_char = "...",
before = function(_, item)
item.dup = 0 -- remove duplicates, see nvim-cmp #511
return item
end,
})(entry, vim_item)
return vim_item
end,
},
mapping = {
["<tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item({
behavior = cmp.SelectBehavior.Select,
})
else
fallback()
end
end),
["<S-tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item({
behavior = cmp.SelectBehavior.Select,
})
else
fallback()
end
end),
["<C-n>"] = cmp.mapping.select_next_item({
behavior = cmp.SelectBehavior.Select,
}),
["<C-p>"] = cmp.mapping.select_prev_item({
behavior = cmp.SelectBehavior.Select,
}),
["<CR>"] = cmp.mapping(function(fallback)
if cmp.visible() and cmp.get_active_entry() then
cmp.confirm({
select = false,
behavior = cmp.ConfirmBehavior.Replace,
})
else
fallback()
end
end),
["<C-y>"] = cmp.mapping.confirm({
select = true,
behavior = cmp.ConfirmBehavior.Replace,
}),
["<C-x><C-o>"] = cmp.mapping.complete(),
["<C-l>"] = function(fallback)
if luasnip.locally_jumpable(1) then
luasnip.jump(1)
else
fallback()
end
end,
["<C-h>"] = function(fallback)
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end,
},
sources = {
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "orgmode" },
{ name = "path" },
},
window = {
completion = cmp.config.window.bordered({
border = "none",
winhighlight = "Normal:Pmenu,CursorLine:PmenuSel,Search:None",
zindex = 1001,
scrolloff = 0,
col_offset = 0,
side_padding = 1,
scrollbar = true,
}),
documentation = cmp.config.window.bordered({
border = "rounded",
winhighlight = "CursorLine:Visual,Search:None",
zindex = 1001,
max_height = 80,
}),
},
}
cmp.setup(opts)
cmp.setup.cmdline("/", {
mapping = cmp.mapping.preset.cmdline(),
sources = { { name = "buffer" } },
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ { name = "path" } }, {
{
name = "cmdline",
option = { ignore_cmds = { "!" } },
},
}),
})
end,
}
+18
View File
@@ -0,0 +1,18 @@
-- https://github.com/NvChad/nvim-colorizer.lua
---@type LazyPluginSpec
return {
"NvChad/nvim-colorizer.lua",
opts = {
user_default_options = {
names = false,
RGB = false,
RRGGBB = true,
RRGGBBAA = true,
AARRGGBB = true,
rgb_fn = true,
hsl_fn = true,
mode = "virtualtext",
},
},
}
+92
View File
@@ -0,0 +1,92 @@
-- https://github.com/igorlfs/nvim-dap-view
---@type LazyPluginSpec
return {
"rcarriga/nvim-dap-ui",
dependencies = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
keys = {
{
"<Leader>du",
function()
require("dapui").toggle()
end,
},
{
"<Leader>de",
function()
require("dapui").eval(nil, { context = "hover", enter = true })
end,
mode = { "x", "n" },
},
{
"<Leader>dw",
function()
require("dapui").elements.watches.add(vim.fn.expand("<cexpr>"))
end,
},
},
opts = {
controls = {
element = "repl",
enabled = false,
},
expand_lines = true,
floating = {
border = "single",
mappings = {
close = { "q", "<Esc>" },
},
},
force_buffers = true,
icons = {
collapsed = "+",
current_frame = "*",
expanded = "-",
},
layouts = {
{
elements = {
{
id = "scopes",
size = 0.25,
},
{
id = "breakpoints",
size = 0.25,
},
{
id = "stacks",
size = 0.25,
},
{
id = "watches",
size = 0.25,
},
},
position = "right",
size = 50,
},
{
elements = {
{
id = "repl",
},
},
position = "bottom",
size = 15,
},
},
mappings = {
edit = "e",
expand = { "<CR>", "<2-LeftMouse>", "<Tab>" },
open = "o",
remove = "d",
repl = "r",
toggle = "t",
},
render = {
indent = 1,
max_value_lines = 100,
},
},
}
+217
View File
@@ -0,0 +1,217 @@
-- https://github.com/mfussenegger/nvim-dap
local hover = require("dap.hover")
local log = require("log")
---@type LazyPluginSpec
return {
"mfussenegger/nvim-dap",
lazy = false,
keys = {
{
"<Leader>db",
function()
require("dap").toggle_breakpoint()
end,
},
{
"<Leader>df",
function()
require("dap").focus_frame()
end,
},
{
"<C-S-i>",
function()
require("dap").up()
end,
},
{
"<C-S-o>",
function()
require("dap").down()
end,
},
{
"<Leader>dk",
hover,
mode = { "n", "x" },
},
{
"<Leader>dr",
function()
require("dap").repl.toggle()
end,
mode = { "n", "x" },
},
{
"<F2>",
function()
require("dap").step_into()
end,
},
{
"<F3>",
function()
require("dap").step_over()
end,
},
{
"<F4>",
function()
require("dap").step_out()
end,
},
{
"<F5>",
function()
require("dap").continue()
end,
},
{
"<F9>",
function()
require("dap").terminate()
end,
},
},
config = function()
local dap = require("dap")
vim.api.nvim_set_hl(0, "DebugPC", {
bg = "NONE",
fg = "NONE",
})
vim.api.nvim_create_user_command(
"Debug",
---@param opts vim.api.keyset.create_user_command.command_args
function(opts)
local cfgs = dap.configurations[vim.bo.filetype]
if not cfgs then
log.error(
"No configurations available for filetype %s",
vim.bo.filetype
)
return
end
local function run_config(cfg)
local all_args = vim.fn.split(opts.args)
cfg.program = all_args[1]
local args = {}
for i = 2, #all_args do
table.insert(args, all_args[i])
end
cfg.args = args
dap.run(cfg)
end
if #cfgs == 1 then
run_config(cfgs[1])
return
end
local names = {}
for _, c in ipairs(cfgs) do
table.insert(names, c.name)
end
vim.ui.select(names, {
prompt = "Select DAP configuration to use:",
}, function(choice, idx)
if choice and idx then
run_config(cfgs[idx])
end
end)
end,
{
nargs = "+",
---@param ArgLead string
---@param CmdLine string
complete = function(ArgLead, CmdLine, CursorPos)
local _, spaces = CmdLine:sub(1, CursorPos):gsub("%s+", "")
if spaces == 1 then
return vim.fn.getcompletion(ArgLead, "file")
end
end,
}
)
-- https://sourceware.org/gdb/current/onlinedocs/gdb#Debugger-Adapter-Protocol
dap.adapters.gdb = {
type = "executable",
command = "gdb",
args = { "--interpreter=dap" },
}
dap.adapters.lldb = {
type = "executable",
command = "lldb-dap",
}
dap.adapters.python = {
type = "executable",
command = "python",
args = { "-m", "debugpy.adapter" },
}
dap.configurations.c = {
{
type = "gdb",
request = "launch",
name = "Launch",
program = function()
local path = vim.fn.input({
prompt = "Path to executable: ",
default = vim.fn.getcwd() .. "/",
completion = "file",
})
return (path and path ~= "") and path or dap.ABORT
end,
cwd = "${workspaceFolder}",
stopAtBeginningOfMainSubprogram = false,
},
}
-- dap.configurations.c = {
-- {
-- type = "lldb",
-- request = "launch",
-- name = "Launch",
-- program = function()
-- local path = vim.fn.input({
-- prompt = "Path to executable: ",
-- default = vim.fn.getcwd() .. "/",
-- completion = "file",
-- })
-- return (path and path ~= "") and path or dap.ABORT
-- end,
-- cwd = "${workspaceFolder}",
-- stopAtBeginningOfMainSubprogram = false,
-- console = "internalConsole",
-- },
-- }
dap.configurations.cpp = dap.configurations.c
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch",
program = function()
local path = vim.fn.input({
prompt = "Path to executable: ",
default = vim.fn.getcwd() .. "/",
completion = "file",
})
return (path and path ~= "") and path or dap.ABORT
end,
cwd = "${workspaceFolder}",
},
}
end,
}
+271
View File
@@ -0,0 +1,271 @@
local util = require("util")
local function override_highlights()
-- File Icon
local hl = util.get_hl_source("NvimTreeFileIcon")
vim.api.nvim_set_hl(0, "NvimTreeFileIcon", { fg = hl.fg, bg = nil })
-- Symlink Icon
hl = util.get_hl_source("NvimTreeSymlinkIcon")
vim.api.nvim_set_hl(0, "NvimTreeSymlinkIcon", { fg = hl.fg, bg = nil })
end
local function disable_highlights()
-- File types
vim.cmd.highlight({ "clear NvimTreeExecFile" })
vim.cmd.highlight({
"link NvimTreeExecFile NONE",
bang = true,
})
vim.cmd.highlight({ "clear NvimTreeImageFile" })
vim.cmd.highlight({
"link NvimTreeImageFile NONE",
bang = true,
})
vim.cmd.highlight({ "clear NvimTreeSpecialFile" })
vim.cmd.highlight({
"link NvimTreeSpecialFile NONE",
bang = true,
})
vim.cmd.highlight({ "clear NvimTreeSymlink" })
vim.cmd.highlight({
"link NvimTreeSymlink NONE",
bang = true,
})
end
---@type LazyPluginSpec
return {
"nvim-tree/nvim-tree.lua",
dependencies = {
"tpope/vim-fugitive",
"nvim-tree/nvim-web-devicons",
},
event = "VimEnter",
keys = {
{
"<leader>tt",
function()
require("nvim-tree.api").tree.toggle({
find_file = true,
focus = false,
})
end,
},
{
"ga",
function()
require("nvim-tree.api").tree.open()
end,
},
},
config = function()
---@class nvim_tree.api.decorator.UserDecorator
local UserDecorator = require("nvim-tree.api").decorator.UserDecorator
---@class GitIgnoreDecorator: nvim_tree.api.decorator.UserDecorator
local GitIgnoreDecorator = UserDecorator:extend()
function GitIgnoreDecorator:new()
self.enabled = true
self.highlight_range = "name"
self.icon_placement = "none"
self.file_hl = "NvimTreeGitFileIgnoredHL"
self.folder_hl = "NvimTreeGitFolderIgnoredHL"
end
---@param node Node
---@return string? highlight_group
function GitIgnoreDecorator:highlight_group(node)
local status = node.git_status
if not status then
return
end
if status.file == "!!" then
return self.file_hl
elseif status.dir and status.dir.direct == "!!" then
return self.folder_hl
end
end
local signs = require("lsp").diagnostic_signs
require("nvim-tree").setup({
on_attach = function(bufnr)
local function opts(desc)
return {
desc = "nvim-tree: " .. desc,
buffer = bufnr,
noremap = true,
silent = true,
nowait = true,
}
end
local api = require("nvim-tree.api")
api.config.mappings.default_on_attach(bufnr)
vim.keymap.del("n", "D", { buffer = bufnr })
vim.keymap.del("n", "bt", { buffer = bufnr })
vim.keymap.set("n", "d", api.fs.trash, opts("Trash"))
vim.keymap.set(
"n",
"bd",
api.marks.bulk.trash,
opts("Trash Bookmarked")
)
vim.keymap.set("n", "<C-l>", api.node.open.edit, opts("Open"))
vim.keymap.set(
"n",
"<C-h>",
api.node.navigate.parent_close,
opts("Close Directory")
)
end,
hijack_cursor = true,
hijack_netrw = false,
view = {
width = 50,
preserve_window_proportions = true,
},
renderer = {
full_name = true,
root_folder_label = function(path)
local label = vim.fn.fnamemodify(path, ":~")
local git_head = vim.fn.FugitiveHead()
if git_head ~= "" then
label = label .. ("  %s"):format(git_head)
end
return label
end,
special_files = {},
decorators = {
"Git",
GitIgnoreDecorator,
"Open",
"Modified",
"Bookmark",
"Diagnostics",
"Copied",
"Cut",
},
highlight_modified = "icon",
highlight_bookmarks = "name",
highlight_clipboard = "all",
indent_markers = {
enable = true,
icons = {
corner = "",
none = "",
},
},
icons = {
git_placement = "after",
diagnostics_placement = "signcolumn",
bookmarks_placement = "after",
symlink_arrow = " -> ",
show = {
file = true,
folder = true,
folder_arrow = false,
bookmarks = false,
},
web_devicons = {
file = {
color = false,
},
},
glyphs = {
modified = "*",
git = {
unstaged = "M",
staged = "M",
unmerged = "!",
renamed = "R",
untracked = "?",
deleted = "D",
ignored = " ",
},
},
},
},
update_focused_file = {
enable = true,
},
diagnostics = {
enable = true,
show_on_dirs = true,
icons = {
hint = signs.text[vim.diagnostic.severity.HINT],
info = signs.text[vim.diagnostic.severity.INFO],
warning = signs.text[vim.diagnostic.severity.WARN],
error = signs.text[vim.diagnostic.severity.ERROR],
},
},
modified = {
enable = true,
},
filters = {
git_ignored = false,
custom = { "^\\.git$" },
},
live_filter = {
prefix = "Filter: ",
always_show_folders = false,
},
filesystem_watchers = {
enable = true,
},
actions = {
use_system_clipboard = false,
change_dir = {
enable = false,
},
expand_all = {
exclude = { ".venv", "build" },
},
open_file = {
window_picker = {
enable = false,
},
},
},
notify = {
threshold = vim.log.levels.WARN,
absolute_path = false,
},
help = {
sort_by = "desc",
},
sync_root_with_cwd = true,
})
override_highlights()
disable_highlights()
vim.api.nvim_create_autocmd("QuitPre", {
callback = function()
local tree_wins = {}
local floating_wins = {}
local wins = vim.api.nvim_list_wins()
for _, w in ipairs(wins) do
local bufname =
vim.api.nvim_buf_get_name(vim.api.nvim_win_get_buf(w))
if bufname:match("NvimTree_") ~= nil then
table.insert(tree_wins, w)
end
if vim.api.nvim_win_get_config(w).relative ~= "" then
table.insert(floating_wins, w)
end
end
if 1 == #wins - #floating_wins - #tree_wins then
-- Should quit, so we close all invalid windows.
for _, w in ipairs(tree_wins) do
vim.api.nvim_win_close(w, true)
end
end
end,
})
end,
}
+10
View File
@@ -0,0 +1,10 @@
---@type LazyPluginSpec
return {
"nvim-treesitter/nvim-treesitter-context",
opts = {
mode = "topline",
max_lines = 3,
multiline_threshold = 1,
multiwindow = true,
},
}
+52
View File
@@ -0,0 +1,52 @@
-- https://github.com/nvim-treesitter/nvim-treesitter
---@type LazyPluginSpec
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = "VeryLazy",
dependencies = {
{
"LiadOz/nvim-dap-repl-highlights",
config = true,
},
},
opts = {
ensure_installed = {
"c", -- recommended default
"lua", -- recommended default
"vim", -- recommended default
"vimdoc", -- recommended default
"query", -- recommended default
"luadoc",
"phpdoc",
"comment",
"dap_repl",
},
auto_install = true,
highlight = {
enable = true,
disable = { "dockerfile" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = { "org", "php", "python" },
},
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
-- Disable LSP semantic highlighting for lua comments because it will
-- otherwise override highlights from `comment`.
vim.api.nvim_set_hl(0, "@lsp.type.comment.lua", {})
-- To set the priority of semantic highlighting lower than treesitter (100),
-- uncomment the line below:
-- vim.hl.priorities.semantic_tokens = 99
end,
}
+45
View File
@@ -0,0 +1,45 @@
---@type LazyPluginSpec
return {
"stevearc/oil.nvim",
keys = {
{
"<leader>fe",
function()
vim.cmd.Oil("--float")
end,
mode = "n",
},
},
---@type oil.SetupOpts
opts = {
default_file_explorer = true,
columns = {
-- "icon",
"permissions",
"size",
"mtime",
},
delete_to_trash = true,
float = {
max_width = 80,
max_height = 20,
},
skip_confirm_for_simple_edits = true,
watch_for_changes = false,
keymaps = {
["<Esc>"] = "actions.close",
["q"] = "actions.close",
["<C-s>"] = false,
["<C-h>"] = "actions.parent",
["<C-l>"] = "actions.select",
["<C-r>"] = "actions.refresh",
},
view_options = {
show_hidden = true,
natural_order = false,
},
win_options = {
colorcolumn = "",
},
},
}
+32
View File
@@ -0,0 +1,32 @@
---@type LazyPluginSpec
return {
"navarasu/onedark.nvim",
priority = 1000,
config = function()
require("onedark").setup({ style = "darker" })
local c = require("onedark.colors")
local highlights = {
Cursor = { fg = c.bg, bg = c.fg, fmt = "NONE" },
NormalFloat = { bg = c.bg0 },
FloatBorder = { bg = c.bg0 },
TabLineSel = { fg = c.fg, bg = c.bg0 },
EndOfBuffer = { fg = "NONE", bg = "NONE" },
NvimTreeIndentMarker = { fg = c.bg3 },
TelescopeBorder = { fg = c.orange },
TelescopePromptBorder = { fg = c.grey },
TelescopeResultsBorder = { fg = c.grey },
TelescopePreviewBorder = { fg = c.grey },
TreesitterContextBottom = { fmt = "underline", sp = c.bg3 },
TreesitterContextLineNumberBottom = {
fmt = "underline",
sp = c.bg3,
},
DiffAdd = { bg = "#1e3a2a" },
DiffChange = { bg = "#15304a" },
DiffDelete = { bg = "#3d2224" },
}
require("onedark").set_options("highlights", highlights)
require("onedark").load()
end,
}
+35
View File
@@ -0,0 +1,35 @@
-- https://github.com/nvim-orgmode/orgmode
---@type LazyPluginSpec
return {
"nvim-orgmode/orgmode",
dependencies = {
"nvim-treesitter/nvim-treesitter",
},
opts = {
org_agenda_files = { "~/Documents/org/**/*" },
org_default_notes_file = "~/Documents/org/notes.org",
org_todo_keywords = {
"TODO(t)",
"ACTIVE(a)",
"WAITING(w)",
"|",
"DONE(d)",
"DISCARDED(c)",
},
org_todo_keyword_faces = {
ACTIVE = ":foreground dodgerblue :weight bold",
WAITING = ":foreground lightgoldenrod :weight bold",
DISCARDED = ":foreground grey :weight bold",
},
win_split_mode = "float",
win_border = "rounded",
org_archive_location = "~/Documents/org/archive.org::",
org_log_done = "note",
org_log_into_drawer = "LOGBOOK",
org_highlight_latex_and_related = "entities",
org_agenda_span = "week",
org_agenda_skip_scheduled_if_done = true,
org_agenda_skip_deadline_if_done = true,
},
}
+169
View File
@@ -0,0 +1,169 @@
-- https://github.com/nvim-telescope/telescope.nvim
---@type LazyPluginSpec
return {
"nvim-telescope/telescope.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
"debugloop/telescope-undo.nvim",
"rcarriga/nvim-notify",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
},
},
config = function()
local telescope = require("telescope")
local builtin = require("telescope.builtin")
local actions = require("telescope.actions")
telescope.setup({
defaults = {
mappings = {
n = {
q = actions.close,
["<C-c>"] = actions.close,
["<C-l>"] = actions.select_default,
["<C-u>"] = actions.results_scrolling_up,
["<C-d>"] = actions.results_scrolling_down,
},
},
file_ignore_patterns = {
"^%.git/",
},
layout_config = {
height = 30,
width = 80,
scroll_speed = 3,
},
},
extensions = {
undo = {
mappings = {
i = {
["<cr>"] = require("telescope-undo.actions").yank_deletions,
["<C-cr>"] = false,
["<C-r>"] = false,
["<C-y>"] = require("telescope-undo.actions").yank_additions,
},
n = {
["u"] = false,
},
},
},
},
pickers = {
oldfiles = {
initial_mode = "normal",
},
buffers = {
initial_mode = "normal",
mappings = {
n = {
["<C-x>"] = actions.delete_buffer,
},
},
},
live_grep = {
layout_config = {
width = 160,
preview_width = 80,
},
},
highlights = {
layout_config = {
width = 160,
preview_width = 80,
},
},
diagnostics = {
initial_mode = "normal",
layout_config = {
width = 160,
preview_width = 80,
},
},
lsp_definitions = {
initial_mode = "normal",
},
lsp_type_definitions = {
initial_mode = "normal",
},
lsp_implementations = {
initial_mode = "normal",
},
lsp_references = {
initial_mode = "normal",
layout_config = {
width = 160,
preview_width = 80,
},
},
git_status = {
initial_mode = "normal",
},
},
})
vim.keymap.set("n", "<leader>ff", function()
builtin.find_files({
hidden = true,
no_ignore = true,
no_ignore_parent = true,
previewer = false,
})
end)
vim.keymap.set("n", "<leader>fr", function()
builtin.oldfiles({
only_cwd = true,
hidden = true,
previewer = false,
})
end)
vim.keymap.set("n", "<leader>fg", function()
builtin.live_grep({
additional_args = function(_)
return {
"--hidden",
"--iglob=!.venv",
"--iglob=!vendor",
"--iglob=!.git",
}
end,
previewer = true,
})
end)
vim.keymap.set("n", "<leader>fb", function()
builtin.buffers({ previewer = false, sort_mru = true })
end)
vim.keymap.set("n", "<leader>fd", function()
builtin.diagnostics({
bufnr = 0,
})
end)
telescope.load_extension("fzf")
telescope.load_extension("notify")
vim.keymap.set("n", "<leader>fn", function()
telescope.extensions.notify.notify({
initial_mode = "normal",
layout_config = {
width = 160,
preview_width = 80,
},
})
end)
telescope.load_extension("undo")
vim.keymap.set("n", "<leader>fu", function()
telescope.extensions.undo.undo({
initial_mode = "normal",
layout_config = {
width = 160,
preview_width = 80,
},
})
end)
end,
}
+20
View File
@@ -0,0 +1,20 @@
local function undo_tree_tab()
vim.cmd.tabnew()
vim.cmd.bprevious()
vim.cmd.UndotreeToggle()
vim.cmd.UndotreeFocus()
end
---@type LazyPluginSpec
return {
"mbbill/undotree",
keys = {
{ "<leader>uu", undo_tree_tab, mode = "n" },
},
init = function(_)
vim.g.undotree_WindowLayout = 2
vim.g.undotree_DiffCommand = "diff -u"
vim.g.undotree_SplitWidth = 50
vim.g.undotree_DiffpanelHeight = 20
end,
}