mirror of
https://github.com/itme-brain/nvim.git
synced 2026-05-08 07:00:13 -04:00
updated
This commit is contained in:
parent
17bf7e4973
commit
7d72471237
17 changed files with 297 additions and 538 deletions
|
|
@ -1,32 +1,22 @@
|
||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "642b0c595e11608b4c18219e93b88d7637af27bc" },
|
"anticuus": { "branch": "main", "commit": "259315038503e2327cc3024dc306af36563d7f5b" },
|
||||||
"autoclose.nvim": { "branch": "main", "commit": "bafd0368716216fa6a7bb2a43ecd889b44efdb46" },
|
"autoclose.nvim": { "branch": "main", "commit": "bafd0368716216fa6a7bb2a43ecd889b44efdb46" },
|
||||||
"base16-vim": { "branch": "master", "commit": "3be3cd82cd31acfcab9a41bad853d9c68d30478d" },
|
"blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" },
|
||||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
"fzf-lua": { "branch": "main", "commit": "b437bafc981a180d609bb4092c56ce8999f7a2c4" },
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "6d808f99bd63303646794406e270bd553ad7792e" },
|
"gitsigns.nvim": { "branch": "main", "commit": "6d808f99bd63303646794406e270bd553ad7792e" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||||
"log-highlight.nvim": { "branch": "main", "commit": "ca88628f6dd3b9bb46f9a7401669e24cf7de47a4" },
|
"log-highlight.nvim": { "branch": "main", "commit": "ca88628f6dd3b9bb46f9a7401669e24cf7de47a4" },
|
||||||
"lualine.nvim": { "branch": "master", "commit": "131a558e13f9f28b15cd235557150ccb23f89286" },
|
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "0c2823e0418f3d9230ff8b201c976e84de1cb401" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "0c2823e0418f3d9230ff8b201c976e84de1cb401" },
|
||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
|
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" },
|
"mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" },
|
||||||
"neo-tree.nvim": { "branch": "main", "commit": "19d20a99bf0061a5ecc4343d2f09fa713306c965" },
|
|
||||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
|
||||||
"nvim-cmp": { "branch": "main", "commit": "a1d504892f2bc56c2e79b65c6faded2fd21f3eca" },
|
|
||||||
"nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" },
|
"nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" },
|
"nvim-lspconfig": { "branch": "master", "commit": "31026a13eefb20681124706a79fc1df6bf11ab27" },
|
||||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" },
|
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "f7e89f3d19fb436e1fbeff3bf4291eef35da94e3" },
|
|
||||||
"nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" },
|
|
||||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
|
||||||
"nvim-treesitter": { "branch": "main", "commit": "df7489eeea351bece7fd0f9c825be5cb6a1438f0" },
|
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "4fc505ac7bd7692824a142e96e5f529c133862f8" },
|
"nvim-web-devicons": { "branch": "master", "commit": "4fc505ac7bd7692824a142e96e5f529c133862f8" },
|
||||||
|
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
"plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" },
|
||||||
"telescope-dap.nvim": { "branch": "master", "commit": "783366bd6c1e7fa0a5c59c07db37f49c805a28df" },
|
"render-markdown.nvim": { "branch": "main", "commit": "3f3eea97b80839f629c951ca660ffd125bfa5b34" },
|
||||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
|
||||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||||
"treesitter-parser-registry": { "branch": "main", "commit": "6eb15358bb9fc88f0d3401d8538d56652e9bdf3c" },
|
"treesitter-parser-registry": { "branch": "main", "commit": "6eb15358bb9fc88f0d3401d8538d56652e9bdf3c" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ require("lazy").setup({
|
||||||
},
|
},
|
||||||
-- Configure any other settings here. See the documentation for more details.
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
-- colorscheme that will be used when installing plugins.
|
-- colorscheme that will be used when installing plugins.
|
||||||
install = { colorscheme = { "onedark" } },
|
install = { colorscheme = { "anticuus" } },
|
||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = false },
|
checker = { enabled = false },
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ vim.opt.tabstop = 2
|
||||||
vim.opt.shiftwidth = 2
|
vim.opt.shiftwidth = 2
|
||||||
vim.opt.softtabstop = 2
|
vim.opt.softtabstop = 2
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.opt.smartindent = true
|
|
||||||
vim.opt.ignorecase = true
|
vim.opt.ignorecase = true
|
||||||
vim.opt.smartcase = true
|
vim.opt.smartcase = true
|
||||||
vim.opt.incsearch = false
|
vim.opt.incsearch = false
|
||||||
|
|
@ -26,11 +25,29 @@ vim.opt.guicursor = "n-v-c:block,i:block,r:block"
|
||||||
|
|
||||||
vim.opt.fillchars = { eob = " " }
|
vim.opt.fillchars = { eob = " " }
|
||||||
|
|
||||||
|
vim.opt.laststatus = 3
|
||||||
|
|
||||||
|
local mode_names = {
|
||||||
|
n = "NORMAL", i = "INSERT", v = "VISUAL", V = "V-LINE",
|
||||||
|
["\22"] = "V-BLOCK", c = "COMMAND", R = "REPLACE", t = "TERM",
|
||||||
|
}
|
||||||
|
|
||||||
|
_G.statusline_mode = function()
|
||||||
|
return mode_names[vim.api.nvim_get_mode().mode] or "?"
|
||||||
|
end
|
||||||
|
|
||||||
|
_G.statusline_branch = function()
|
||||||
|
local b = vim.b.gitsigns_head
|
||||||
|
return b and (" " .. b) or ""
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.opt.statusline = " %{v:lua.statusline_mode()} %f%m%r %= %{v:lua.statusline_branch()} %l:%c "
|
||||||
|
|
||||||
local options_group = vim.api.nvim_create_augroup("config_options", { clear = true })
|
local options_group = vim.api.nvim_create_augroup("config_options", { clear = true })
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
group = options_group,
|
group = options_group,
|
||||||
pattern = { "python", "haskell", "c", "cpp" },
|
pattern = { "python", "c", "cpp" },
|
||||||
callback = function()
|
callback = function()
|
||||||
local opt = vim.opt_local
|
local opt = vim.opt_local
|
||||||
opt.tabstop = 4
|
opt.tabstop = 4
|
||||||
|
|
@ -38,11 +55,3 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
opt.softtabstop = 4
|
opt.softtabstop = 4
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
|
||||||
group = options_group,
|
|
||||||
pattern = "*.purs",
|
|
||||||
callback = function(event)
|
|
||||||
vim.bo[event.buf].filetype = "purescript"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
|
||||||
30
lua/plugins/blink-cmp.lua
Normal file
30
lua/plugins/blink-cmp.lua
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"saghen/blink.cmp",
|
||||||
|
version = "*",
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {
|
||||||
|
keymap = {
|
||||||
|
preset = "none",
|
||||||
|
["<C-y>"] = { "select_and_accept" },
|
||||||
|
["<C-e>"] = { "cancel" },
|
||||||
|
["<C-j>"] = { "select_next", "fallback" },
|
||||||
|
["<C-k>"] = { "select_prev", "fallback" },
|
||||||
|
["<C-f>"] = { "scroll_documentation_down", "fallback" },
|
||||||
|
["<C-d>"] = { "scroll_documentation_up", "fallback" },
|
||||||
|
},
|
||||||
|
completion = {
|
||||||
|
list = {
|
||||||
|
selection = { preselect = false, auto_insert = false },
|
||||||
|
},
|
||||||
|
documentation = {
|
||||||
|
auto_show = true,
|
||||||
|
auto_show_delay_ms = 200,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
default = { "lsp", "buffer", "path" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"akinsho/bufferline.nvim",
|
|
||||||
version = "*",
|
|
||||||
dependencies = "nvim-tree/nvim-web-devicons",
|
|
||||||
config = function()
|
|
||||||
require("bufferline").setup{
|
|
||||||
options = {
|
|
||||||
separator_style = "thin",
|
|
||||||
show_buffer_close_buttons = false,
|
|
||||||
show_close_icon = false,
|
|
||||||
},
|
|
||||||
highlights = {
|
|
||||||
-- Force all icon backgrounds to transparent
|
|
||||||
buffer_selected = { bg = "NONE" },
|
|
||||||
buffer_visible = { bg = "NONE" },
|
|
||||||
background = { bg = "NONE" },
|
|
||||||
fill = { bg = "NONE" },
|
|
||||||
separator = { bg = "NONE" },
|
|
||||||
separator_selected = { bg = "NONE" },
|
|
||||||
separator_visible = { bg = "NONE" },
|
|
||||||
close_button = { bg = "NONE" },
|
|
||||||
close_button_selected = { bg = "NONE" },
|
|
||||||
close_button_visible = { bg = "NONE" },
|
|
||||||
modified = { bg = "NONE" },
|
|
||||||
modified_selected = { bg = "NONE" },
|
|
||||||
modified_visible = { bg = "NONE" },
|
|
||||||
duplicate = { bg = "NONE" },
|
|
||||||
duplicate_selected = { bg = "NONE" },
|
|
||||||
duplicate_visible = { bg = "NONE" },
|
|
||||||
indicator_selected = { bg = "NONE" },
|
|
||||||
indicator_visible = { bg = "NONE" },
|
|
||||||
pick = { bg = "NONE" },
|
|
||||||
pick_selected = { bg = "NONE" },
|
|
||||||
pick_visible = { bg = "NONE" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,60 +1,70 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
"chriskempson/base16-vim",
|
"https://codeberg.org/juanmilkah/anticuus.nvim",
|
||||||
|
name = "anticuus",
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
local color_group = vim.api.nvim_create_augroup("config_colorscheme", { clear = true })
|
local color_group = vim.api.nvim_create_augroup("config_colorscheme", { clear = true })
|
||||||
|
|
||||||
|
vim.cmd.colorscheme("anticuus")
|
||||||
|
|
||||||
local highlights = {
|
local highlights = {
|
||||||
Normal = { bg = "NONE", fg = "#FFFFFF" },
|
Comment = { fg = "#5a5a5a", italic = true },
|
||||||
Visual = { bg = "Gray", fg = "Black" },
|
["@comment"] = { fg = "#5a5a5a", italic = true },
|
||||||
NonText = { bg = "NONE" },
|
|
||||||
LineNr = { bg = "NONE" },
|
Function = { fg = "#88ddcc" },
|
||||||
CursorLine = { bg = "NONE" },
|
["@function"] = { fg = "#88ddcc" },
|
||||||
CursorLineNr = { bg = "NONE", fg = "#E5C07B", bold = true },
|
["@function.builtin"] = { fg = "#88ddcc" },
|
||||||
Search = { bg = "#FFCC66", fg = "#000000" },
|
["@function.method"] = { fg = "#88ddcc" },
|
||||||
Pmenu = { bg = "Black", fg = "White" },
|
|
||||||
PmenuSel = { bg = "Green", fg = "Black" },
|
Type = { fg = "#e8a060" },
|
||||||
PmenuThumb = { bg = "Green" },
|
Typedef = { fg = "#e8a060" },
|
||||||
PmenuSbar = { bg = "Black" },
|
["@type"] = { fg = "#e8a060" },
|
||||||
WinSeparator = { bg = "NONE" },
|
["@type.builtin"] = { fg = "#e8a060" },
|
||||||
GitGutterChange = { bg = "NONE" },
|
|
||||||
GitGutterAdd = { bg = "NONE" },
|
Number = { fg = "#c490d0" },
|
||||||
GitGutterDelete = { bg = "NONE" },
|
Boolean = { fg = "#c490d0" },
|
||||||
GitSignsAddNr = { bg = "NONE", fg = "#98c379" },
|
Float = { fg = "#c490d0" },
|
||||||
GitSignsChangeNr = { bg = "NONE", fg = "#61afef" },
|
Constant = { fg = "#c490d0" },
|
||||||
GitSignsDeleteNr = { bg = "NONE", fg = "#e06c75" },
|
["@number"] = { fg = "#c490d0" },
|
||||||
SignColumn = { bg = "NONE" },
|
["@number.float"] = { fg = "#c490d0" },
|
||||||
NeoTreeGitAdded = { bg = "NONE", fg = "#98c379" },
|
["@boolean"] = { fg = "#c490d0" },
|
||||||
NeoTreeGitModified = { bg = "NONE", fg = "#e5c07b" },
|
["@constant"] = { fg = "#c490d0" },
|
||||||
NeoTreeGitDeleted = { bg = "NONE", fg = "#e06c75" },
|
["@constant.builtin"] = { fg = "#c490d0" },
|
||||||
NeoTreeGitConflict = { bg = "NONE", fg = "#e06c75" },
|
|
||||||
NeoTreeGitUntracked = { bg = "NONE", fg = "#61afef" },
|
["@tag"] = { fg = "#ff6b6b" },
|
||||||
TelescopeSelection = { bg = "Gray", fg = "Green", bold = true },
|
["@tag.delimiter"] = { fg = "#ff6b6b" },
|
||||||
TelescopePreviewMatch = { bg = "Yellow", fg = "Black" },
|
["@keyword.return"] = { fg = "#ff6b6b" },
|
||||||
TreesitterContext = { bg = "NONE" },
|
["@keyword.exception"] = { fg = "#ff6b6b" },
|
||||||
LazyH1 = { bg = "Black", fg = "Green" },
|
|
||||||
IblScope = { bg = "NONE", fg = "Yellow" },
|
MatchParen = { fg = "#c490d0", bold = true, underline = true },
|
||||||
ConflictMarker = { fg = "red" },
|
|
||||||
DiffAdd = { bg = "NONE" },
|
IncSearch = { fg = "#000000", bg = "#88ddcc" },
|
||||||
DiffChange = { bg = "NONE" },
|
CurSearch = { fg = "#000000", bg = "#c490d0" },
|
||||||
DiffDelete = { bg = "NONE" },
|
|
||||||
DiffText = { bg = "NONE" },
|
DiffAdd = { fg = "#a5d6a7", bg = "#0a2010" },
|
||||||
BufferLineFill = { bg = "NONE" },
|
DiffChange = { fg = "#e8a060", bg = "#201a0a" },
|
||||||
BufferLineBackground = { bg = "NONE", fg = "#5c6370" },
|
DiffDelete = { fg = "#ff6b6b", bg = "#200a0a" },
|
||||||
BufferLineBuffer = { bg = "NONE", fg = "#5c6370" },
|
DiffText = { fg = "#ffcc00", bg = "#3a2000", bold = true },
|
||||||
BufferLineBufferSelected = { bg = "NONE", fg = "#FFFFFF", bold = true },
|
|
||||||
BufferLineBufferVisible = { bg = "NONE", fg = "#abb2bf" },
|
WinBar = { fg = "#dadada", bold = true },
|
||||||
BufferLineCloseButton = { bg = "NONE", fg = "#5c6370" },
|
WinBarNC = { fg = "#888888" },
|
||||||
BufferLineCloseButtonSelected = { bg = "NONE", fg = "#e06c75" },
|
|
||||||
BufferLineCloseButtonVisible = { bg = "NONE", fg = "#5c6370" },
|
ConflictMarker = { link = "DiagnosticError" },
|
||||||
BufferLineModified = { bg = "NONE", fg = "#e5c07b" },
|
YankHighlight = { link = "Search" },
|
||||||
BufferLineModifiedSelected = { bg = "NONE", fg = "#e5c07b" },
|
|
||||||
BufferLineModifiedVisible = { bg = "NONE", fg = "#e5c07b" },
|
OilCreate = { link = "DiagnosticOk" },
|
||||||
BufferLineSeparator = { bg = "NONE", fg = "#3e4452" },
|
OilDelete = { link = "DiagnosticError" },
|
||||||
BufferLineSeparatorSelected = { bg = "NONE", fg = "#3e4452" },
|
OilMove = { link = "DiagnosticWarn" },
|
||||||
BufferLineSeparatorVisible = { bg = "NONE", fg = "#3e4452" },
|
OilCopy = { link = "DiagnosticInfo" },
|
||||||
BufferLineIndicatorSelected = { bg = "NONE", fg = "#61afef" },
|
|
||||||
YankHighlight = { bg = "yellow", fg = "black" },
|
BlinkCmpLabelMatch = { link = "Search" },
|
||||||
|
BlinkCmpMenuSelection = { link = "PmenuSel" },
|
||||||
|
|
||||||
|
FzfLuaTitle = { link = "Title" },
|
||||||
|
FzfLuaPreviewTitle = { link = "Title" },
|
||||||
|
FzfLuaHeaderBind = { link = "Special" },
|
||||||
}
|
}
|
||||||
|
|
||||||
local function apply_highlights()
|
local function apply_highlights()
|
||||||
|
|
@ -73,7 +83,6 @@ return {
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.cmd.colorscheme("base16-onedark")
|
|
||||||
apply_highlights()
|
apply_highlights()
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||||
|
|
@ -83,7 +92,7 @@ return {
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufWinEnter", "WinEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufWinEnter", "WinEnter" }, {
|
||||||
group = color_group,
|
group = color_group,
|
||||||
callback = function(event)
|
callback = function()
|
||||||
apply_conflict_match(vim.api.nvim_get_current_win())
|
apply_conflict_match(vim.api.nvim_get_current_win())
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
@ -103,7 +112,6 @@ return {
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"fei6409/log-highlight.nvim"
|
"fei6409/log-highlight.nvim",
|
||||||
}
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,6 @@ return {
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"williamboman/mason.nvim",
|
"williamboman/mason.nvim",
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
"nvim-neotest/nvim-nio",
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
"theHamsta/nvim-dap-virtual-text",
|
|
||||||
"nvim-telescope/telescope-dap.nvim",
|
|
||||||
},
|
},
|
||||||
cmd = {
|
cmd = {
|
||||||
"DapContinue",
|
"DapContinue",
|
||||||
|
|
@ -41,15 +37,41 @@ return {
|
||||||
{ "<leader>dO", function() require("dap").step_out() end, desc = "Step Out" },
|
{ "<leader>dO", function() require("dap").step_out() end, desc = "Step Out" },
|
||||||
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
|
||||||
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
{ "<leader>dl", function() require("dap").run_last() end, desc = "Run Last" },
|
||||||
{ "<leader>du", function() require("dapui").toggle() end, desc = "Toggle Debug UI" },
|
|
||||||
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
{ "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
|
||||||
{ "<leader>de", function() require("dapui").eval() end, mode = { "n", "v" }, desc = "Evaluate" },
|
{ "<leader>de", function() require("dap.ui.widgets").hover() end, mode = { "n", "v" }, desc = "Evaluate" },
|
||||||
{ "<leader>ds", function() require("telescope").extensions.dap.configurations() end, desc = "Debug Configurations" },
|
{ "<leader>du",
|
||||||
{ "<leader>dS", function() require("telescope").extensions.dap.list_breakpoints() end, desc = "Debug Breakpoints" },
|
function()
|
||||||
|
local widgets = require("dap.ui.widgets")
|
||||||
|
widgets.centered_float(widgets.scopes)
|
||||||
|
end,
|
||||||
|
desc = "Show Scopes" },
|
||||||
|
{ "<leader>df",
|
||||||
|
function()
|
||||||
|
local widgets = require("dap.ui.widgets")
|
||||||
|
widgets.centered_float(widgets.frames)
|
||||||
|
end,
|
||||||
|
desc = "Call Stack" },
|
||||||
|
{ "<leader>ds",
|
||||||
|
function()
|
||||||
|
local dap = require("dap")
|
||||||
|
local ft = vim.bo.filetype
|
||||||
|
local configs = dap.configurations[ft] or {}
|
||||||
|
if #configs == 0 then
|
||||||
|
vim.notify("No DAP configurations for filetype: " .. ft, vim.log.levels.WARN)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
vim.ui.select(configs, {
|
||||||
|
prompt = "Select DAP configuration:",
|
||||||
|
format_item = function(c) return c.name end,
|
||||||
|
}, function(choice)
|
||||||
|
if choice then dap.run(choice) end
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
desc = "Debug Configurations" },
|
||||||
|
{ "<leader>dS", function() require("dap").list_breakpoints() end, desc = "List Breakpoints" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local dapui = require("dapui")
|
|
||||||
|
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-nvim-dap").setup({
|
require("mason-nvim-dap").setup({
|
||||||
|
|
@ -58,52 +80,12 @@ return {
|
||||||
handlers = {},
|
handlers = {},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("nvim-dap-virtual-text").setup({
|
|
||||||
commented = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
dapui.setup({
|
|
||||||
layouts = {
|
|
||||||
{
|
|
||||||
elements = {
|
|
||||||
{ id = "scopes", size = 0.45 },
|
|
||||||
{ id = "breakpoints", size = 0.15 },
|
|
||||||
{ id = "stacks", size = 0.25 },
|
|
||||||
{ id = "watches", size = 0.15 },
|
|
||||||
},
|
|
||||||
position = "right",
|
|
||||||
size = 50,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
elements = {
|
|
||||||
{ id = "repl", size = 0.5 },
|
|
||||||
{ id = "console", size = 0.5 },
|
|
||||||
},
|
|
||||||
position = "bottom",
|
|
||||||
size = 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.fn.sign_define("DapBreakpoint", { text = "B", texthl = "DiagnosticSignError" })
|
vim.fn.sign_define("DapBreakpoint", { text = "B", texthl = "DiagnosticSignError" })
|
||||||
vim.fn.sign_define("DapBreakpointCondition", { text = "C", texthl = "DiagnosticSignWarn" })
|
vim.fn.sign_define("DapBreakpointCondition", { text = "C", texthl = "DiagnosticSignWarn" })
|
||||||
vim.fn.sign_define("DapLogPoint", { text = "L", texthl = "DiagnosticSignInfo" })
|
vim.fn.sign_define("DapLogPoint", { text = "L", texthl = "DiagnosticSignInfo" })
|
||||||
vim.fn.sign_define("DapStopped", { text = ">", texthl = "DiagnosticSignWarn", linehl = "Visual" })
|
vim.fn.sign_define("DapStopped", { text = ">", texthl = "DiagnosticSignWarn", linehl = "Visual" })
|
||||||
vim.fn.sign_define("DapBreakpointRejected", { text = "R", texthl = "DiagnosticSignError" })
|
vim.fn.sign_define("DapBreakpointRejected", { text = "R", texthl = "DiagnosticSignError" })
|
||||||
|
|
||||||
dap.listeners.before.attach.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.launch.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_terminated.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
dap.adapters["pwa-node"] = {
|
dap.adapters["pwa-node"] = {
|
||||||
type = "server",
|
type = "server",
|
||||||
host = "localhost",
|
host = "localhost",
|
||||||
|
|
@ -136,10 +118,6 @@ return {
|
||||||
dap.configurations.typescript = js_configurations
|
dap.configurations.typescript = js_configurations
|
||||||
dap.configurations.javascriptreact = js_configurations
|
dap.configurations.javascriptreact = js_configurations
|
||||||
dap.configurations.typescriptreact = js_configurations
|
dap.configurations.typescriptreact = js_configurations
|
||||||
|
|
||||||
pcall(function()
|
|
||||||
require("telescope").load_extension("dap")
|
|
||||||
end)
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
return {}
|
|
||||||
87
lua/plugins/fzf-lua.lua
Normal file
87
lua/plugins/fzf-lua.lua
Normal file
|
|
@ -0,0 +1,87 @@
|
||||||
|
local function get_root()
|
||||||
|
local result = vim.system({ "git", "rev-parse", "--show-toplevel" }, { text = true }):wait()
|
||||||
|
if result.code == 0 and result.stdout then
|
||||||
|
local git_dir = vim.trim(result.stdout)
|
||||||
|
if git_dir ~= "" then
|
||||||
|
return git_dir
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return vim.fn.getcwd()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Close oil first so picker actions land in a normal window, not oil's float.
|
||||||
|
local function pick(action)
|
||||||
|
return function()
|
||||||
|
if vim.bo.filetype == "oil" then
|
||||||
|
require("oil").close()
|
||||||
|
end
|
||||||
|
action()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"ibhagwan/fzf-lua",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = function()
|
||||||
|
local fzf = require("fzf-lua")
|
||||||
|
local fzf_actions = require("fzf-lua.actions")
|
||||||
|
|
||||||
|
fzf.setup({
|
||||||
|
keymap = {
|
||||||
|
fzf = {
|
||||||
|
["ctrl-d"] = "preview-half-page-down",
|
||||||
|
["ctrl-u"] = "preview-half-page-up",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
files = {
|
||||||
|
["enter"] = fzf_actions.file_edit,
|
||||||
|
["ctrl-x"] = fzf_actions.file_split,
|
||||||
|
["ctrl-v"] = fzf_actions.file_vsplit,
|
||||||
|
["ctrl-t"] = fzf_actions.file_tabedit,
|
||||||
|
["alt-q"] = fzf_actions.file_sel_to_qf,
|
||||||
|
["alt-l"] = fzf_actions.file_sel_to_ll,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
fzf.register_ui_select()
|
||||||
|
|
||||||
|
require("which-key").add({
|
||||||
|
{ "<leader>/", pick(function() fzf.live_grep({ cwd = get_root() }) end), desc = "grep" },
|
||||||
|
{ "<leader>ff", pick(function() fzf.files({ cwd = get_root() }) end), desc = "Search for Files" },
|
||||||
|
{ "<leader>fp", pick(fzf.oldfiles), desc = "Oldfiles" },
|
||||||
|
{ "<leader>bf",
|
||||||
|
pick(function()
|
||||||
|
fzf.buffers({ sort_lastused = true, ignore_current_buffer = true })
|
||||||
|
end),
|
||||||
|
desc = "Find Buffer" },
|
||||||
|
{ "<leader>?", pick(fzf.command_history), desc = "Command History" },
|
||||||
|
{ "<leader>cm", pick(fzf.manpages), desc = "Manpages" },
|
||||||
|
|
||||||
|
-- Code
|
||||||
|
{ "gd",
|
||||||
|
pick(function()
|
||||||
|
local attached = vim.lsp.get_clients({ bufnr = 0 })
|
||||||
|
if next(attached) ~= nil then
|
||||||
|
fzf.lsp_definitions()
|
||||||
|
else
|
||||||
|
vim.api.nvim_feedkeys("gd", "n", false)
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
mode = "n",
|
||||||
|
desc = "Go to Definition" },
|
||||||
|
{ "<leader>gd", pick(fzf.lsp_definitions), desc = "Go to Definition" },
|
||||||
|
{ "<leader>gr", pick(fzf.lsp_references), desc = "Goto References" },
|
||||||
|
{ "<leader>gi", pick(fzf.lsp_implementations), desc = "Go to Implementations" },
|
||||||
|
{ "<leader>gt", pick(fzf.lsp_typedefs), desc = "Go to Type Definition" },
|
||||||
|
{ "<leader>cv", pick(fzf.lsp_document_symbols), desc = "Document Symbols" },
|
||||||
|
{ "<leader>cd", pick(fzf.diagnostics_workspace), desc = "Code Diagnostics" },
|
||||||
|
|
||||||
|
-- Git
|
||||||
|
{ "<leader>Gt", pick(fzf.git_branches), desc = "Git Branches" },
|
||||||
|
{ "<leader>Gc", pick(fzf.git_commits), desc = "Git Commits" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -2,58 +2,13 @@ return {
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
require('gitsigns').setup {
|
require("gitsigns").setup({
|
||||||
signs = {
|
signcolumn = false,
|
||||||
add = { text = '+' },
|
numhl = true,
|
||||||
change = { text = '~' },
|
|
||||||
delete = { text = '-' },
|
|
||||||
topdelete = { text = '‾' },
|
|
||||||
changedelete = { text = '~' },
|
|
||||||
untracked = { text = '┆' },
|
|
||||||
},
|
|
||||||
signs_staged = {
|
|
||||||
add = { text = '+' },
|
|
||||||
change = { text = '~' },
|
|
||||||
delete = { text = '-' },
|
|
||||||
topdelete = { text = '‾' },
|
|
||||||
changedelete = { text = '~' },
|
|
||||||
untracked = { text = '┆' },
|
|
||||||
},
|
|
||||||
signs_staged_enable = true,
|
|
||||||
signcolumn = false, -- Toggle with `:Gitsigns toggle_signs`
|
|
||||||
numhl = true, -- Toggle with `:Gitsigns toggle_numhl`
|
|
||||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
|
||||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
|
||||||
watch_gitdir = {
|
|
||||||
follow_files = true
|
|
||||||
},
|
|
||||||
auto_attach = true,
|
|
||||||
attach_to_untracked = false,
|
|
||||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
|
||||||
current_line_blame_opts = {
|
|
||||||
virt_text = true,
|
|
||||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
|
||||||
delay = 0,
|
|
||||||
ignore_whitespace = false,
|
|
||||||
virt_text_priority = 100,
|
|
||||||
},
|
|
||||||
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
|
||||||
sign_priority = 6,
|
|
||||||
update_debounce = 100,
|
|
||||||
status_formatter = nil, -- Use default
|
|
||||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
|
||||||
preview_config = {
|
|
||||||
-- Options passed to nvim_open_win
|
|
||||||
border = 'single',
|
|
||||||
style = 'minimal',
|
|
||||||
relative = 'cursor',
|
|
||||||
row = 0,
|
|
||||||
col = 1
|
|
||||||
},
|
|
||||||
}
|
|
||||||
require("which-key").add({
|
|
||||||
{ "<leader>Gb", ":Gitsigns toggle_current_line_blame<CR>", desc = "Git blame" }
|
|
||||||
})
|
})
|
||||||
end
|
require("which-key").add({
|
||||||
}
|
{ "<leader>Gb", ":Gitsigns toggle_current_line_blame<CR>", desc = "Git blame" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,10 @@ local treesitter_parsers = {
|
||||||
"rust",
|
"rust",
|
||||||
"bash",
|
"bash",
|
||||||
"markdown",
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
"html",
|
"html",
|
||||||
"html_tags",
|
"html_tags",
|
||||||
"javascript",
|
"javascript",
|
||||||
"ecma",
|
|
||||||
"jsx",
|
"jsx",
|
||||||
"css",
|
"css",
|
||||||
"vim",
|
"vim",
|
||||||
|
|
@ -198,58 +198,6 @@ return {
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
version = "v2.*",
|
|
||||||
build = "make install_jsregexp",
|
|
||||||
},
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
"hrsh7th/cmp-nvim-lsp"
|
|
||||||
},
|
|
||||||
|
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
cmp.setup({
|
|
||||||
enabled = function()
|
|
||||||
local context = require("cmp.config.context")
|
|
||||||
if vim.api.nvim_get_mode().mode == "c" then
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("comment")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
|
||||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<C-y>"] = cmp.mapping.confirm(),
|
|
||||||
["<CR>"] = cmp.mapping(function(fallback)
|
|
||||||
fallback()
|
|
||||||
end, { "i", "s" }),
|
|
||||||
}),
|
|
||||||
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' },
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' }
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Mason: portable LSP installer. On NixOS this requires nix-ld for
|
-- Mason: portable LSP installer. On NixOS this requires nix-ld for
|
||||||
-- downloaded Linux binaries to run.
|
-- downloaded Linux binaries to run.
|
||||||
{
|
{
|
||||||
|
|
@ -272,7 +220,7 @@ return {
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
"saghen/blink.cmp",
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local lspconfig = require('lspconfig')
|
local lspconfig = require('lspconfig')
|
||||||
|
|
@ -349,18 +297,12 @@ return {
|
||||||
|
|
||||||
local all_servers = get_all_servers()
|
local all_servers = get_all_servers()
|
||||||
|
|
||||||
-- local navic = require('nvim-navic')
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
|
|
||||||
-- Global config applied to all servers
|
-- Global config applied to all servers
|
||||||
vim.lsp.config('*', {
|
vim.lsp.config('*', {
|
||||||
autostart = false, -- Don't auto-attach, use <leader>css to start manually
|
autostart = false, -- Don't auto-attach, use <leader>css to start manually
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
-- on_attach = function(client, bufnr)
|
|
||||||
-- if client.server_capabilities.documentSymbolProvider then
|
|
||||||
-- navic.attach(client, bufnr)
|
|
||||||
-- end
|
|
||||||
-- end,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Server-specific settings (merged with lspconfig defaults)
|
-- Server-specific settings (merged with lspconfig defaults)
|
||||||
|
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"SmiteshP/nvim-navic"
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("lualine").setup ({
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'material',
|
|
||||||
component_separators = { left = '>', right = '|'},
|
|
||||||
section_separators = { left = '', right = ''},
|
|
||||||
disabled_filetypes = {
|
|
||||||
statusline = {},
|
|
||||||
winbar = {},
|
|
||||||
},
|
|
||||||
ignore_focus = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
globalstatus = true,
|
|
||||||
refresh = {
|
|
||||||
statusline = 1000,
|
|
||||||
tabline = 1000,
|
|
||||||
winbar = 1000,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {'mode'},
|
|
||||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
|
||||||
lualine_c = {
|
|
||||||
{'filename'},
|
|
||||||
{ function() return require("nvim-navic").get_location() end, cond = function()
|
|
||||||
return require("nvim-navic").is_available()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
lualine_x = {'filetype'},
|
|
||||||
lualine_y = {'progress'},
|
|
||||||
lualine_z = {'location'}
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = {},
|
|
||||||
lualine_x = {},
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {}
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
winbar = {},
|
|
||||||
inactive_winbar = {},
|
|
||||||
extensions = {
|
|
||||||
'lazy',
|
|
||||||
'neo-tree',
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
require("neo-tree").setup({
|
|
||||||
enable_diagnostics = false,
|
|
||||||
default_component_configs = {
|
|
||||||
git_status = {
|
|
||||||
symbols = {
|
|
||||||
added = "+",
|
|
||||||
modified = "~",
|
|
||||||
deleted = "-",
|
|
||||||
renamed = ">",
|
|
||||||
untracked = "?",
|
|
||||||
ignored = "!",
|
|
||||||
unstaged = "U",
|
|
||||||
staged = "S",
|
|
||||||
conflict = "C",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
position = "left",
|
|
||||||
width = 20,
|
|
||||||
},
|
|
||||||
event_handlers = {
|
|
||||||
{
|
|
||||||
event = "neo_tree_window_after_open",
|
|
||||||
handler = function()
|
|
||||||
local win = vim.api.nvim_get_current_win()
|
|
||||||
vim.wo[win].winfixwidth = true
|
|
||||||
vim.wo[win].winfixbuf = true
|
|
||||||
vim.wo[win].cursorline = true
|
|
||||||
end
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Keep the selected entry readable without a solid row background.
|
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeCursorLine", { bg = "NONE", fg = "#a6e3a1" })
|
|
||||||
|
|
||||||
-- Apply highlight and re-apply on colorscheme change
|
|
||||||
vim.api.nvim_create_autocmd({ "FileType", "ColorScheme" }, {
|
|
||||||
pattern = { "neo-tree", "*" },
|
|
||||||
callback = function(ev)
|
|
||||||
if ev.event == "ColorScheme" then
|
|
||||||
vim.api.nvim_set_hl(0, "NeoTreeCursorLine", { bg = "NONE", fg = "#a6e3a1" })
|
|
||||||
end
|
|
||||||
local win = vim.api.nvim_get_current_win()
|
|
||||||
local buf = vim.api.nvim_win_get_buf(win)
|
|
||||||
if vim.bo[buf].filetype == "neo-tree" then
|
|
||||||
vim.wo[win].winhighlight = "CursorLine:NeoTreeCursorLine"
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Lock cursor to leftmost column in neo-tree
|
|
||||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
|
||||||
pattern = "neo-tree*",
|
|
||||||
callback = function()
|
|
||||||
local col = vim.api.nvim_win_get_cursor(0)[2]
|
|
||||||
if col ~= 0 then
|
|
||||||
vim.api.nvim_win_set_cursor(0, { vim.api.nvim_win_get_cursor(0)[1], 0 })
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
local function toggle_neotree()
|
|
||||||
local api = vim.api
|
|
||||||
local bufs = api.nvim_list_bufs()
|
|
||||||
|
|
||||||
for _, buf in ipairs(bufs) do
|
|
||||||
local name = api.nvim_buf_get_name(buf)
|
|
||||||
if name:match("neo%-tree filesystem") then
|
|
||||||
vim.cmd("Neotree close")
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.cmd("Neotree")
|
|
||||||
end
|
|
||||||
|
|
||||||
require("which-key").add({
|
|
||||||
{ "<leader>e", toggle_neotree, desc = "File Explorer" }
|
|
||||||
})
|
|
||||||
|
|
||||||
--vim.fn.sign_define("DiagnosticSignError",
|
|
||||||
-- {text = " ", texthl = "DiagnosticSignError"})
|
|
||||||
--vim.fn.sign_define("DiagnosticSignWarn",
|
|
||||||
-- {text = " ", texthl = "DiagnosticSignWarn"})
|
|
||||||
--vim.fn.sign_define("DiagnosticSignInfo",
|
|
||||||
-- {text = " ", texthl = "DiagnosticSignInfo"})
|
|
||||||
--vim.fn.sign_define("DiagnosticSignHint",
|
|
||||||
-- {text = "", texthl = "DiagnosticSignHint"})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
29
lua/plugins/oil.lua
Normal file
29
lua/plugins/oil.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"stevearc/oil.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
lazy = false,
|
||||||
|
config = function()
|
||||||
|
local oil = require("oil")
|
||||||
|
|
||||||
|
oil.setup({
|
||||||
|
default_file_explorer = true,
|
||||||
|
skip_confirm_for_simple_edits = true,
|
||||||
|
view_options = {
|
||||||
|
show_hidden = true,
|
||||||
|
},
|
||||||
|
float = {
|
||||||
|
padding = 4,
|
||||||
|
max_width = 100,
|
||||||
|
max_height = 30,
|
||||||
|
border = "rounded",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
require("which-key").add({
|
||||||
|
{ "-", "<cmd>Oil<cr>", desc = "Open Parent Dir" },
|
||||||
|
{ "<leader>e", oil.toggle_float, desc = "File Explorer" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
17
lua/plugins/render-markdown.lua
Normal file
17
lua/plugins/render-markdown.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
ft = { "markdown" },
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
enabled = false,
|
||||||
|
completions = { lsp = { enabled = true } },
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ "<leader>mr", "<cmd>RenderMarkdown toggle<cr>", desc = "Toggle Markdown Render" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
local function get_root()
|
|
||||||
local result = vim.system({ "git", "rev-parse", "--show-toplevel" }, { text = true }):wait()
|
|
||||||
if result.code == 0 and result.stdout then
|
|
||||||
local git_dir = vim.trim(result.stdout)
|
|
||||||
if git_dir ~= "" then
|
|
||||||
return git_dir
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return vim.fn.getcwd()
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
branch = '0.1.x',
|
|
||||||
dependencies = {
|
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
|
||||||
{ 'nvim-tree/nvim-web-devicons' }
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- Custom Telescope command to grep from Git root
|
|
||||||
require("which-key").add({
|
|
||||||
{ "<leader>/", function()
|
|
||||||
require('telescope.builtin').live_grep({ cwd = get_root() })
|
|
||||||
end,
|
|
||||||
desc = "grep" },
|
|
||||||
{ "<leader>ff", function()
|
|
||||||
require('telescope.builtin').find_files({ cwd = get_root() })
|
|
||||||
end,
|
|
||||||
desc = "Search for Files" },
|
|
||||||
{ "<leader>fp", ":Telescope oldfiles<CR>", desc = "Oldfiles" },
|
|
||||||
{ "<leader>?", ":Telescope command_history<CR>", desc = "Command History" },
|
|
||||||
{ "<leader>cm", ":Telescope man_pages<CR>", desc = "Manpages" },
|
|
||||||
|
|
||||||
-- Code
|
|
||||||
{ "gd",
|
|
||||||
function()
|
|
||||||
local attached = vim.lsp.get_clients({ bufnr = 0 })
|
|
||||||
if next(attached) ~= nil then
|
|
||||||
require('telescope.builtin').lsp_definitions()
|
|
||||||
else
|
|
||||||
vim.api.nvim_feedkeys("gd", "n", false)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
mode = "n",
|
|
||||||
desc = "Go to Definition"
|
|
||||||
},
|
|
||||||
{ "<leader>gd", ":Telescope lsp_definitions<CR>", desc = "Go to Definition" },
|
|
||||||
{ "<leader>gr", ":Telescope lsp_references<CR>", desc = "Goto References" },
|
|
||||||
{ "<leader>gi", ":Telescope lsp_implementations<CR>", desc = "Go to Implementations" },
|
|
||||||
{ "<leader>gt", ":Telescope lsp_type_definitions<CR>", desc = "Go to Type Definition" },
|
|
||||||
{ "<leader>cv", ":Telescope treesitter<CR>", desc = "Function Names & Variables" },
|
|
||||||
{ "<leader>cd", ":Telescope diagnostics<CR>", desc = "Code Diagnostics" },
|
|
||||||
|
|
||||||
-- Git
|
|
||||||
{ "<leader>Gt", ":Telescope git_branches<CR>", desc = "Git Branches" },
|
|
||||||
{ "<leader>Gc", ":Telescope git_commits<CR>", desc = "Git Commits" },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,7 +7,7 @@ return {
|
||||||
{ "<leader>l", ":Lazy<CR>", desc = "Lazy" },
|
{ "<leader>l", ":Lazy<CR>", desc = "Lazy" },
|
||||||
{ "<leader>t",
|
{ "<leader>t",
|
||||||
function()
|
function()
|
||||||
vim.cmd.botright("new")
|
vim.cmd("botright new")
|
||||||
vim.opt_local.number = false
|
vim.opt_local.number = false
|
||||||
vim.opt_local.relativenumber = false
|
vim.opt_local.relativenumber = false
|
||||||
vim.cmd.resize(10)
|
vim.cmd.resize(10)
|
||||||
|
|
@ -28,40 +28,19 @@ return {
|
||||||
|
|
||||||
{ "<leader>b", group = "Buffers"},
|
{ "<leader>b", group = "Buffers"},
|
||||||
{ "<leader>bd", function()
|
{ "<leader>bd", function()
|
||||||
local function is_neotree(bufnr)
|
|
||||||
return vim.bo[bufnr].filetype == "neo-tree"
|
|
||||||
end
|
|
||||||
|
|
||||||
local current_buf = vim.api.nvim_get_current_buf()
|
local current_buf = vim.api.nvim_get_current_buf()
|
||||||
|
|
||||||
-- Skip if in neo-tree
|
|
||||||
if is_neotree(current_buf) then
|
|
||||||
vim.notify("Cannot delete buffer from neo-tree", vim.log.levels.WARN)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local buflisted = vim.fn.getbufinfo({ buflisted = 1 })
|
local buflisted = vim.fn.getbufinfo({ buflisted = 1 })
|
||||||
-- Prevent deleting last buffer
|
|
||||||
if #buflisted <= 1 then
|
if #buflisted <= 1 then
|
||||||
vim.notify("Cannot delete last buffer", vim.log.levels.WARN)
|
vim.notify("Cannot delete last buffer", vim.log.levels.WARN)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
vim.cmd.bprevious()
|
vim.cmd.bprevious()
|
||||||
vim.cmd.bdelete({ args = { tostring(current_buf) } })
|
vim.cmd.bdelete({ args = { tostring(current_buf) } })
|
||||||
-- If we ended up in neo-tree, move back to a regular window
|
|
||||||
local new_buf = vim.api.nvim_get_current_buf()
|
|
||||||
if is_neotree(new_buf) then
|
|
||||||
vim.cmd.wincmd("l")
|
|
||||||
end
|
|
||||||
end, desc = "Delete Buffer" },
|
end, desc = "Delete Buffer" },
|
||||||
{ "<leader>bD", function()
|
{ "<leader>bD", function()
|
||||||
local current_buf = vim.api.nvim_get_current_buf()
|
local current_buf = vim.api.nvim_get_current_buf()
|
||||||
local current_win = vim.api.nvim_get_current_win()
|
local current_win = vim.api.nvim_get_current_win()
|
||||||
|
|
||||||
if vim.bo[current_buf].filetype == "neo-tree" then
|
|
||||||
vim.notify("Cannot delete neo-tree buffer", vim.log.levels.WARN)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local wins = vim.fn.win_findbuf(current_buf)
|
local wins = vim.fn.win_findbuf(current_buf)
|
||||||
if #wins > 1 then
|
if #wins > 1 then
|
||||||
vim.api.nvim_win_close(current_win, false)
|
vim.api.nvim_win_close(current_win, false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue