update config to lazy
- add some new plugins - remove some old ones - clean up/update some configs
This commit is contained in:
parent
f1d8f5f834
commit
9c083c98a3
9
init.lua
9
init.lua
@ -1,8 +1 @@
|
|||||||
require('core.options')
|
require("core.lazy")
|
||||||
require('core.keymaps')
|
|
||||||
require('core.plugins')
|
|
||||||
require('core.autocmds')
|
|
||||||
require('plugins.lsp')
|
|
||||||
require('plugins.ui')
|
|
||||||
require('plugins.ai')
|
|
||||||
require('plugins.colorscheme')
|
|
||||||
|
61
lazy-lock.json
Normal file
61
lazy-lock.json
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||||
|
"any-jump.vim": { "branch": "master", "commit": "f95674d9a4251ac02f452d5f1861e4422f4652c7" },
|
||||||
|
"auto-format.nvim": { "branch": "main", "commit": "1e3c069753d4b0960b351292c1a01af1b122907c" },
|
||||||
|
"blink.cmp": { "branch": "main", "commit": "cc2f10e9d8b6420324d4743a4d9a428de427e2cf" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "0b2437bcc12b4021614dc41fcea9d0f136d94063" },
|
||||||
|
"cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
|
"cmp-nvim-lsp-document-symbol": { "branch": "main", "commit": "f94f7ba948e32cd302caba1c2ca3f7c697fb4fcf" },
|
||||||
|
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||||
|
"codecompanion.nvim": { "branch": "main", "commit": "f1f05fa75dcb6016b2f2af121f1558ebcaf35ef9" },
|
||||||
|
"copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" },
|
||||||
|
"copilot-lualine": { "branch": "main", "commit": "dc4b8ed0f75bc2557b3158c526624bf04ad233ea" },
|
||||||
|
"copilot.lua": { "branch": "master", "commit": "30321e33b03cb924fdcd6a806a0dc6fa0b0eafb9" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "000448d837f6e7a47f8f342f29526c4d7e49e9ce" },
|
||||||
|
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "8b00147519d6f8353867d5d0b55f587306b0cfb6" },
|
||||||
|
"goto-preview": { "branch": "main", "commit": "4972fcd01c568c2ae981f3f48182e7832ed544ec" },
|
||||||
|
"image.nvim": { "branch": "master", "commit": "6ffafab2e98b5bda46bf227055aa84b90add8cdc" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "e10626f7fcd51ccd56d7ffc00883ba7e0aa28f78" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "e5e9bf48211a13d9ee6c1077c88327c49c1ab4a0" },
|
||||||
|
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
|
||||||
|
"lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
|
||||||
|
"lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "f4f791f67e70d378a754d02da068231d2352e5bc" },
|
||||||
|
"mini.diff": { "branch": "main", "commit": "bc3a7be30fd45ed4961ea90de1d9d04637cdeae6" },
|
||||||
|
"mini.nvim": { "branch": "main", "commit": "4dd209e4f03bacd46d6d87408b2529a8823112fb" },
|
||||||
|
"none-ls.nvim": { "branch": "main", "commit": "02f5275d8a5546092f01306f162c00c71d6e0281" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "68f0e5c3dab23261a945272032ee6700af86227a" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "12509903a5723a876abd65953109f926f4634c30" },
|
||||||
|
"nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" },
|
||||||
|
"nvim-html-css": { "branch": "main", "commit": "fa7e2da75edfd3d110fc8d4f8e5215b5de56ff42" },
|
||||||
|
"nvim-lint": { "branch": "master", "commit": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8" },
|
||||||
|
"nvim-lsp-notify": { "branch": "main", "commit": "9541bdde0b84b7a33a24dbc2eccc3df33d4a0cdb" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "7af2c37192deae28d1305ae9e68544f7fb5408e1" },
|
||||||
|
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||||
|
"nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "d529a99f88e0dff02e0aa275db2f595cd252a2c8" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "38e46a6d7ade5c8718f77b2b9fd98a0f7ab32c1e" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "1020869742ecb191f260818234517f4a1515cfe8" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||||
|
"presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" },
|
||||||
|
"rainbow-delimiters.nvim": { "branch": "master", "commit": "011d98eaa3a73b5a51d82ce5bc6b1397dde95562" },
|
||||||
|
"render-markdown.nvim": { "branch": "main", "commit": "e05a9f22f31c088ece3fa5928daf546a015b66ee" },
|
||||||
|
"telescope-cmdline.nvim": { "branch": "main", "commit": "8b05928ac1b9f2b772cedde891faa6669b0ec59a" },
|
||||||
|
"telescope-color-names.nvim": { "branch": "main", "commit": "95b372b9a8ba0fc7cf6a67be637ee37453f322da" },
|
||||||
|
"telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" },
|
||||||
|
"telescope-fzf-native.nvim": { "branch": "main", "commit": "2a5ceff981501cff8f46871d5402cd3378a8ab6a" },
|
||||||
|
"telescope-glyph.nvim": { "branch": "master", "commit": "f63f01e129e71cc25b79637610674bbf0be5ce9d" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "78857db9e8d819d3cc1a9a7bdc1d39d127a36495" },
|
||||||
|
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||||
|
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
|
||||||
|
"vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" },
|
||||||
|
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||||
|
"vim-wakatime": { "branch": "master", "commit": "e46d7c4f98ee0f40782008dd60cb2a79c377fb1d" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "5bf7a73fe851896d5ac26d313db849bf00f45b78" }
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
local augroup = vim.api.nvim_create_augroup
|
local augroup = vim.api.nvim_create_augroup
|
||||||
local autocmd = vim.api.nvim_create_autocmd
|
local autocmd = vim.api.nvim_create_autocmd
|
||||||
|
|
||||||
-- Restore cursor position
|
-- {{{ Restore cursor position
|
||||||
local restore_cursor = augroup("RestoreCursor", { clear = true })
|
local restore_cursor = augroup("RestoreCursor", { clear = true })
|
||||||
autocmd("BufReadPost", {
|
autocmd("BufReadPost", {
|
||||||
group = restore_cursor,
|
group = restore_cursor,
|
||||||
@ -13,23 +13,27 @@ autocmd("BufReadPost", {
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- Help and man pages in vertical split
|
-- {{{ Open help and man in vertical split
|
||||||
local help_config = augroup("HelpConfig", { clear = true })
|
local help_config = augroup("HelpConfig", { clear = true })
|
||||||
autocmd("FileType", {
|
autocmd("FileType", {
|
||||||
group = help_config,
|
group = help_config,
|
||||||
pattern = { "help", "man" },
|
pattern = { "help", "man" },
|
||||||
command = "wincmd L",
|
command = "wincmd L",
|
||||||
})
|
})
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- Terminal settings
|
-- {{{ set term options
|
||||||
local term_config = augroup("TermConfig", { clear = true })
|
local term_config = augroup("TermConfig", { clear = true })
|
||||||
autocmd("TermOpen", {
|
autocmd("TermOpen", {
|
||||||
group = term_config,
|
group = term_config,
|
||||||
pattern = "*",
|
pattern = "*",
|
||||||
command = "setlocal nonumber norelativenumber",
|
command = "setlocal nonumber norelativenumber",
|
||||||
})
|
})
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Highlight yanked text
|
||||||
local highlight_yank = augroup("HighlightYank", { clear = true })
|
local highlight_yank = augroup("HighlightYank", { clear = true })
|
||||||
autocmd("TextYankPost", {
|
autocmd("TextYankPost", {
|
||||||
group = highlight_yank,
|
group = highlight_yank,
|
||||||
@ -38,7 +42,9 @@ autocmd("TextYankPost", {
|
|||||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 420 })
|
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 420 })
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
-- }}}
|
||||||
|
|
||||||
|
-- {{{ Disable indent-blankline for dashboard
|
||||||
function disable_for_dashboard()
|
function disable_for_dashboard()
|
||||||
local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
local buftype = vim.api.nvim_buf_get_option(0, "buftype")
|
||||||
local filetype = vim.api.nvim_buf_get_option(0, "filetype")
|
local filetype = vim.api.nvim_buf_get_option(0, "filetype")
|
||||||
@ -52,39 +58,19 @@ vim.cmd([[
|
|||||||
autocmd FileType dashboard lua disable_for_dashboard()
|
autocmd FileType dashboard lua disable_for_dashboard()
|
||||||
augroup END
|
augroup END
|
||||||
]])
|
]])
|
||||||
|
-- }}}
|
||||||
|
|
||||||
-- Code actions on cursor hold
|
-- {{{ Code companion hook
|
||||||
-- local code_action = augroup('CodeAction', { clear = true })
|
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
||||||
-- autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
|
||||||
-- group = code_action,
|
|
||||||
-- callback = function()
|
|
||||||
-- if vim.tbl_isempty(vim.lsp.buf_get_clients()) then
|
|
||||||
-- require('code_action_utils').code_action_listener()
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
-- })
|
|
||||||
|
|
||||||
local function set_timeoutlen_for_insert_mode()
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
if vim.bo.buftype == "terminal" or vim.bo.filetype == "codecompanion" then
|
pattern = "CodeCompanionInline*",
|
||||||
vim.o.timeoutlen = 0
|
group = group,
|
||||||
else
|
callback = function(request)
|
||||||
vim.o.timeoutlen = 300 -- Default timeoutlen for other buffers
|
if request.match == "CodeCompanionInlineFinished" then
|
||||||
|
-- Format the buffer after the inline request has completed
|
||||||
|
require("conform").format({ bufnr = request.buf })
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Create an augroup for managing the autocmds
|
|
||||||
local augroup = vim.api.nvim_create_augroup("InsertModeTimeout", { clear = true })
|
|
||||||
|
|
||||||
-- Autocommand to adjust timeoutlen when entering insert mode
|
|
||||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
|
||||||
group = augroup,
|
|
||||||
callback = set_timeoutlen_for_insert_mode,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Autocommand to reset timeoutlen when leaving insert mode
|
|
||||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
|
||||||
group = augroup,
|
|
||||||
callback = function()
|
|
||||||
vim.o.timeoutlen = 300
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
-- }}}
|
||||||
|
59
lua/core/highlights.lua
Normal file
59
lua/core/highlights.lua
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
-- gray
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemAbbrDeprecated", { bg = "NONE", strikethrough = true, fg = "#808080" })
|
||||||
|
-- blue
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemAbbrMatch", { bg = "NONE", fg = "#569CD6" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemAbbrMatchFuzzy", { link = "CmpIntemAbbrMatch" })
|
||||||
|
-- light blue
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindVariable", { bg = "NONE", fg = "#9CDCFE" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindInterface", { link = "CmpItemKindVariable" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindText", { link = "CmpItemKindVariable" })
|
||||||
|
-- pink
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindFunction", { bg = "NONE", fg = "#C586C0" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindMethod", { link = "CmpItemKindFunction" })
|
||||||
|
-- front
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindKeyword", { bg = "NONE", fg = "#D4D4D4" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindProperty", { link = "CmpItemKindKeyword" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindUnit", { link = "CmpItemKindKeyword" })
|
||||||
|
|
||||||
|
-- Customization for Pmenu
|
||||||
|
vim.api.nvim_set_hl(0, "PmenuSel", { bg = "#282C34", fg = "NONE" })
|
||||||
|
vim.api.nvim_set_hl(0, "Pmenu", { fg = "#C5CDD9", bg = "#22252A" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemAbbrDeprecated", { fg = "#7E8294", bg = "NONE", strikethrough = true })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemAbbrMatch", { fg = "#82AAFF", bg = "NONE", bold = true })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemAbbrMatchFuzzy", { fg = "#82AAFF", bg = "NONE", bold = true })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemMenu", { fg = "#C792EA", bg = "NONE", italic = true })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindField", { fg = "#EED8DA", bg = "#B5585F" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindProperty", { fg = "#EED8DA", bg = "#B5585F" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindEvent", { fg = "#EED8DA", bg = "#B5585F" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindText", { fg = "#C3E88D", bg = "#9FBD73" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindEnum", { fg = "#C3E88D", bg = "#9FBD73" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindKeyword", { fg = "#C3E88D", bg = "#9FBD73" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindConstant", { fg = "#FFE082", bg = "#D4BB6C" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindConstructor", { fg = "#FFE082", bg = "#D4BB6C" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindReference", { fg = "#FFE082", bg = "#D4BB6C" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindFunction", { fg = "#EADFF0", bg = "#A377BF" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindStruct", { fg = "#EADFF0", bg = "#A377BF" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindClass", { fg = "#EADFF0", bg = "#A377BF" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindModule", { fg = "#EADFF0", bg = "#A377BF" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindOperator", { fg = "#EADFF0", bg = "#A377BF" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindVariable", { fg = "#C5CDD9", bg = "#7E8294" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindFile", { fg = "#C5CDD9", bg = "#7E8294" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindUnit", { fg = "#F5EBD9", bg = "#D4A959" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindSnippet", { fg = "#F5EBD9", bg = "#D4A959" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindFolder", { fg = "#F5EBD9", bg = "#D4A959" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindMethod", { fg = "#DDE5F5", bg = "#6C8ED4" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindValue", { fg = "#DDE5F5", bg = "#6C8ED4" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindEnumMember", { fg = "#DDE5F5", bg = "#6C8ED4" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindInterface", { fg = "#D8EEEB", bg = "#58B5A8" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindColor", { fg = "#D8EEEB", bg = "#58B5A8" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindTypeParameter", { fg = "#D8EEEB", bg = "#58B5A8" })
|
||||||
|
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644", bg = "#181926" })
|
@ -1,7 +1,5 @@
|
|||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
local Terminal = require("toggleterm.terminal").Terminal
|
local Terminal = require("toggleterm.terminal").Terminal
|
||||||
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
|
|
||||||
local ipython = Terminal:new({ cmd = "ipython", hidden = true })
|
|
||||||
local notify = require("notify")
|
local notify = require("notify")
|
||||||
|
|
||||||
local function term_factory(cfg)
|
local function term_factory(cfg)
|
||||||
@ -19,6 +17,7 @@ local function term_toggle(term)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local opts = { silent = true, noremap = true }
|
local opts = { silent = true, noremap = true }
|
||||||
|
local notsilent = { silent = false, noremap = true }
|
||||||
|
|
||||||
local function ReloadConfig()
|
local function ReloadConfig()
|
||||||
dofile(vim.fn.stdpath("config") .. "/init.lua")
|
dofile(vim.fn.stdpath("config") .. "/init.lua")
|
||||||
@ -87,22 +86,17 @@ map("v", "oP", "<C-\\><C-N>:ToggleTerm name=ipython-full")
|
|||||||
map("n", "<C-T>", ":ToggleTerm name=toggleterm<CR>", opts)
|
map("n", "<C-T>", ":ToggleTerm name=toggleterm<CR>", opts)
|
||||||
map("n", "<leader>tt", ":ToggleTerm name=toggleterm<CR>", opts)
|
map("n", "<leader>tt", ":ToggleTerm name=toggleterm<CR>", opts)
|
||||||
map("n", "<leader>tT", ":ToggleTerm name=toggleterm-full direction=tab<CR>", opts)
|
map("n", "<leader>tT", ":ToggleTerm name=toggleterm-full direction=tab<CR>", opts)
|
||||||
|
map("n", "<leader>ot", ":ToggleTerm name=toggleterm<CR>", opts)
|
||||||
|
map("n", "<leader>oT", ":ToggleTerm name=toggleterm-full direction=tab<CR>", opts)
|
||||||
map("n", "<leader>ts", ":TermSelect<CR>", opts)
|
map("n", "<leader>ts", ":TermSelect<CR>", opts)
|
||||||
map("n", "<leader>tv", ":ToggleTerm direction=vertical name=toggleterm-vert<CR>", opts)
|
map("n", "<leader>tv", ":ToggleTerm direction=vertical name=toggleterm-vert<CR>", opts)
|
||||||
map("n", "<leader>th", ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>", opts)
|
map("n", "<leader>th", ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>", opts)
|
||||||
|
map("n", "<leader>ov", ":ToggleTerm direction=vertical name=toggleterm-vert<CR>", opts)
|
||||||
|
map("n", "<leader>oh", ":ToggleTerm direction=horizontal name=toggleterm-hori<CR>", opts)
|
||||||
map("n", "<leader>tf", ":ToggleTerm name=toggleterm<CR>", opts)
|
map("n", "<leader>tf", ":ToggleTerm name=toggleterm<CR>", opts)
|
||||||
map("n", "<leader>-", "<C-\\><C-N>:ToggleTerm direction='horizontal'<CR>", opts)
|
map("n", "<leader>-", ":ToggleTerm direction='horizontal'<CR>", opts)
|
||||||
map("n", "<leader>|", "<C-\\><C-N>:ToggleTerm direction='vertical'<CR>", opts)
|
map("n", "<leader>|", ":ToggleTerm direction='vertical'<CR>", opts)
|
||||||
|
|
||||||
-- map("t", "<leader>tt", "<C-\\><C-N>:ToggleTerm<CR>", opts)
|
|
||||||
-- map("t", "<leader>tf", "<C-\\><C-N>:ToggleTerm<CR>", opts)
|
|
||||||
-- map("t", "<leader>-", "<C-\\><C-N>:ToggleTerm direction='horizontal'<CR>", opts)
|
|
||||||
-- map("t", "<leader>|", "<C-\\><C-N>:ToggleTerm direction='vertical'<CR>", opts)
|
|
||||||
-- map("t", "<leader>tv", "<C-\\><C-N>:ToggleTerm --name=toggleterm-vert<CR>", opts)
|
|
||||||
-- map("t", "<leader>th", "<C-\\><C-N>:ToggleTerm --name=toggleterm-hori<CR>", opts)
|
|
||||||
-- map("t", "<C-T>", "<C-\\><C-n>:Toggleterm<CR>", opts)
|
|
||||||
-- map("t", "<Esc>", "<C-\\><C-n>", opts)
|
|
||||||
-- map("n", "<space>", "<nop>", opts) -- fix space in terminal
|
|
||||||
function _G.set_terminal_keymaps()
|
function _G.set_terminal_keymaps()
|
||||||
local opts = { buffer = 0 }
|
local opts = { buffer = 0 }
|
||||||
map("t", "<esc>", [[<C-\><C-n>]], opts)
|
map("t", "<esc>", [[<C-\><C-n>]], opts)
|
||||||
@ -128,34 +122,41 @@ map("n", "gl", vim.lsp.codelens.run, opts)
|
|||||||
map("n", "gr", ":Telescope lsp_references<CR>", opts)
|
map("n", "gr", ":Telescope lsp_references<CR>", opts)
|
||||||
map("n", "gs", vim.lsp.buf.signature_help, opts)
|
map("n", "gs", vim.lsp.buf.signature_help, opts)
|
||||||
map("n", "K", vim.lsp.buf.hover, opts)
|
map("n", "K", vim.lsp.buf.hover, opts)
|
||||||
--}}}
|
map("n", "<leader>cd", ":Telescope lsp_definitions<CR>")
|
||||||
|
map("n", "<leader>ca", vim.lsp.buf.code_action)
|
||||||
--{{{ Code Companion and Copilot
|
map("n", "<leader>cci", ":Telescope lsp_incoming_calls<CR>")
|
||||||
map("n", "<leader>oc", ":CodeCompanionChat<CR>")
|
map("n", "<leader>cco", ":Telescope lsp_outgoing_calls<CR>")
|
||||||
map("n", "<leader>cc", ":CodeCompanionChat<CR>", opts)
|
map("n", "<leader>ch", ":lua vim.lsp.buf.signature_help()<CR>")
|
||||||
map("n", "<leader>ct", ":CodeCompanionChat Toggle<CR>", opts)
|
map("n", "<leader>ci", ":Telescope lsp_implementations<CR>")
|
||||||
map("n", "<leader>ci", ":CodeCompanion ", opts)
|
map("n", "<leader>cr", ":Telescope lsp_references<CR>")
|
||||||
map("n", "<leader>cp", ":vert Copilot panel<CR>", opts)
|
map("n", "<leader>cR", ":lua vim.lsp.buf.rename()<CR>")
|
||||||
map("n", "<leader>Ca", ":CodeCompanionActions<CR>", opts)
|
map("n", "<leader>cs", ":Telescope lsp_document_symbols<CR>")
|
||||||
map("v", "<leader>Cc", ":CodeCompanionChat Add<CR>", opts)
|
map("n", "<leader>ct", ":Telescope lsp_type_definitions<CR>")
|
||||||
map("v", "<leader>Ce", ":CodeCompanion /explain<CR>", opts)
|
map("n", "<leader>cw", ":Telescope lsp_dynamic_workspace_symbols<CR>")
|
||||||
map("v", "<leader>Cf", ":CodeCompanion /fix<CR>", opts)
|
|
||||||
map("v", "<leader>Cl", ":CodeCompanion /lsp<CR>", opts)
|
|
||||||
map("v", "<leader>CT", ":CodeCompanion /tests<CR>", opts)
|
|
||||||
--}}}
|
|
||||||
|
|
||||||
--{{{ Diagnostics
|
|
||||||
-- nnoremap <leader>cd :Telescope diagnostics<CR>
|
|
||||||
-- nnoremap <leader>cDn :lua vim.diagnostic.goto_next()<CR>
|
|
||||||
-- nnoremap <leader>cDp :lua vim.diagnostic.goto_prev()<CR>
|
|
||||||
-- nnoremap <leader>cl :lua vim.diagnostic.setloclist()<CR>
|
|
||||||
map("n", "<leader>cd", ":Telescope diagnostics<CR>")
|
map("n", "<leader>cd", ":Telescope diagnostics<CR>")
|
||||||
|
map("n", "<leader>cDs", ":Telescope diagnostics<CR>")
|
||||||
map("n", "<leader>cDn", ":lua vim.diagnostic.goto_next()<CR>")
|
map("n", "<leader>cDn", ":lua vim.diagnostic.goto_next()<CR>")
|
||||||
map("n", "<leader>cDp", ":lua vim.diagnostic.goto_prev()<CR<CR>")
|
map("n", "<leader>cDp", ":lua vim.diagnostic.goto_prev()<CR<CR>")
|
||||||
map("n", "<leader>cl", ":lua vim.diagnostic.setloclist()<CR>")
|
map("n", "<leader>cl", ":lua vim.diagnostic.setloclist()<CR>")
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
|
--{{{ Code Companion and Copilot
|
||||||
|
map("n", "<leader>cp", ":vert Copilot panel<CR>", opts)
|
||||||
|
map("n", "<leader>oc", ":CodeCompanionChat Toggle<CR>")
|
||||||
|
map("n", "<leader>Cc", ":CodeCompanionChat Toggle<CR>", opts)
|
||||||
|
map("n", "<leader>Ci", ":CodeCompanion ", opts)
|
||||||
|
map("n", "<leader>CT", ":CodeCompanionChat Toggle<CR>", opts)
|
||||||
|
map("n", "<leader>Ca", ":CodeCompanionActions<CR>", opts)
|
||||||
|
map("v", "<leader>Cc", ":CodeCompanionChat Add<CR>", opts)
|
||||||
|
map("v", "<leader>Ci", ":CodeCompanion /buffer ", notsilent)
|
||||||
|
map("v", "<leader>Ce", ":CodeCompanion /explain<CR>", notsilent)
|
||||||
|
map("v", "<leader>Cf", ":CodeCompanion /fix<CR>", notsilent)
|
||||||
|
map("v", "<leader>Cl", ":CodeCompanion /lsp<CR>", notsilent)
|
||||||
|
map("v", "<leader>Ct", ":CodeCompanion /tests<CR>", notsilent)
|
||||||
|
--}}}
|
||||||
|
|
||||||
--{{{ Telescope mappings
|
--{{{ Telescope mappings
|
||||||
|
-- {{{ Telescope Finders
|
||||||
map("n", "//", ":Telescope current_buffer_fuzzy_find<CR>", opts)
|
map("n", "//", ":Telescope current_buffer_fuzzy_find<CR>", opts)
|
||||||
map("n", "??", ":Telescope lsp_document_symbols<CR>", opts)
|
map("n", "??", ":Telescope lsp_document_symbols<CR>", opts)
|
||||||
map(
|
map(
|
||||||
@ -165,8 +166,12 @@ map(
|
|||||||
opts
|
opts
|
||||||
)
|
)
|
||||||
-- map('n', '<leader>ob', ':Telescope file_browser<CR>')
|
-- map('n', '<leader>ob', ':Telescope file_browser<CR>')
|
||||||
map("n", "<leader>ff", ":Telescope find_files<CR>", opts)
|
map(
|
||||||
map("n", "<leader>sf", ":Telescope find_files<CR>", opts)
|
"n",
|
||||||
|
"<leader>ff",
|
||||||
|
":Telescope find_files find_command=rg,--ignore,--follow,--hidden,--files prompt_prefix=🔍<CR>",
|
||||||
|
opts
|
||||||
|
)
|
||||||
map("n", "<leader>fg", ":Telescope live_grep<CR>", opts)
|
map("n", "<leader>fg", ":Telescope live_grep<CR>", opts)
|
||||||
map(
|
map(
|
||||||
"n",
|
"n",
|
||||||
@ -176,8 +181,9 @@ map(
|
|||||||
)
|
)
|
||||||
map("n", "<leader>fb", ":Telescope file_browser<CR>", opts)
|
map("n", "<leader>fb", ":Telescope file_browser<CR>", opts)
|
||||||
map("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
map("n", "<leader>fr", ":Telescope oldfiles<CR>", opts)
|
||||||
|
-- }}}
|
||||||
|
|
||||||
--{{{ Telescope Helper
|
--{{{ Telescope Help
|
||||||
map("n", "<leader>hc", ":Telescope commands<CR>")
|
map("n", "<leader>hc", ":Telescope commands<CR>")
|
||||||
map("n", "<leader>hv", ":Telescope vim_options<CR>")
|
map("n", "<leader>hv", ":Telescope vim_options<CR>")
|
||||||
map("n", "<leader>hk", ":Telescope keymaps<CR>")
|
map("n", "<leader>hk", ":Telescope keymaps<CR>")
|
||||||
@ -186,13 +192,26 @@ map("n", "<leader>hm", ":Telescope man_pages<CR>")
|
|||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
--{{{ Telescope Search
|
--{{{ Telescope Search
|
||||||
map("n", "<leader>sf", ":Telescope find_files<CR>")
|
map(
|
||||||
|
"n",
|
||||||
|
"<leader>sf",
|
||||||
|
":Telescope find_files find_command=rg,--ignore,--follow,--hidden,--files prompt_prefix=🔍<CR>",
|
||||||
|
opts
|
||||||
|
)
|
||||||
|
map("n", "<leader>sF", ":Telescope fidget<CR>")
|
||||||
map("n", "<leader>sg", ":Telescope live_grep<CR>")
|
map("n", "<leader>sg", ":Telescope live_grep<CR>")
|
||||||
map("n", "<leader>sh", ":Telescope command_history<CR>")
|
map("n", "<leader>sh", ":Telescope command_history<CR>")
|
||||||
map("n", "<leader>sm", ":Telescope man_pages<CR>")
|
map("n", "<leader>sm", ":Telescope man_pages<CR>")
|
||||||
map("n", "<leader>s/", ":Telescope search_history<CR>")
|
map("n", "<leader>s/", ":Telescope search_history<CR>")
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
|
--{{{ Git mappings
|
||||||
|
map("n", "<leader>gc", ":Telescope git_commits<CR>", opts)
|
||||||
|
map("n", "<leader>gf", ":Telescope git_files<CR>", opts)
|
||||||
|
--}}}
|
||||||
|
|
||||||
|
map("n", "Q", ":Telescope cmdline<CR>", opts)
|
||||||
|
map("n", "<leader><leader>", ":Telescope cmdline<CR>", opts)
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
--{{{ File explorer and tools
|
--{{{ File explorer and tools
|
||||||
@ -200,11 +219,6 @@ map("n", "<leader>n", ":NvimTreeToggle<CR>", opts)
|
|||||||
map("n", "<leader>D", ":Dotenv .env<CR>", opts)
|
map("n", "<leader>D", ":Dotenv .env<CR>", opts)
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
--{{{ Git mappings
|
|
||||||
map("n", "<leader>gc", ":Telescope git_commits<CR>", opts)
|
|
||||||
map("n", "<leader>gf", ":Telescope git_files<CR>", opts)
|
|
||||||
--}}}
|
|
||||||
|
|
||||||
--{{{ Misc utilities
|
--{{{ Misc utilities
|
||||||
map("n", "<leader>x", "<cmd>!chmod +x %<CR>", opts)
|
map("n", "<leader>x", "<cmd>!chmod +x %<CR>", opts)
|
||||||
map("n", "<leader>y", '"+', opts)
|
map("n", "<leader>y", '"+', opts)
|
||||||
@ -225,18 +239,3 @@ map("n", "<leader>wl", function()
|
|||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
end, opts)
|
end, opts)
|
||||||
--}}}
|
--}}}
|
||||||
|
|
||||||
--{{{ LSP
|
|
||||||
map("n", "<leader>ld", ":Telescope lsp_definitions<CR>")
|
|
||||||
map("n", "<leader>lD", ":Telescope diagnostic<CR>")
|
|
||||||
map("n", "<leader>la", vim.lsp.buf.code_action)
|
|
||||||
map("n", "<leader>lci", ":Telescope lsp_incoming_calls<CR>")
|
|
||||||
map("n", "<leader>lco", ":Telescope lsp_outgoing_calls<CR>")
|
|
||||||
map("n", "<leader>lh", ":lua vim.lsp.buf.signature_help()<CR>")
|
|
||||||
map("n", "<leader>li", ":Telescope lsp_implementations<CR>")
|
|
||||||
map("n", "<leader>lr", ":Telescope lsp_references<CR>")
|
|
||||||
map("n", "<leader>lR", ":lua vim.lsp.buf.rename()<CR>")
|
|
||||||
map("n", "<leader>ls", ":Telescope lsp_document_symbols<CR>")
|
|
||||||
map("n", "<leader>lt", ":Telescope lsp_type_definitions<CR>")
|
|
||||||
map("n", "<leader>lw", ":Telescope lsp_dynamic_workspace_symbols<CR>")
|
|
||||||
--}}}
|
|
||||||
|
37
lua/core/lazy.lua
Normal file
37
lua/core/lazy.lua
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
-- 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
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
require("core.options")
|
||||||
|
require("core.autocmds")
|
||||||
|
require("core.highlights")
|
||||||
|
|
||||||
|
-- Setup lazy.nvim
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- import your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
-- Configure any other settings here. See the documentation for more details.
|
||||||
|
-- colorscheme that will be used when installing plugins.
|
||||||
|
install = { colorscheme = { "habamax" } },
|
||||||
|
-- automatically check for plugin updates
|
||||||
|
checker = { enabled = true },
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd("colorscheme catppuccin")
|
||||||
|
require("core.keymaps")
|
||||||
|
require("core.lsp-notifications")
|
98
lua/core/lsp-notifications.lua
Normal file
98
lua/core/lsp-notifications.lua
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
-- Utility functions shared between progress reports for LSP and DAP
|
||||||
|
vim.notify = require("notify")
|
||||||
|
|
||||||
|
local client_notifs = {}
|
||||||
|
|
||||||
|
local function get_notif_data(client_id, token)
|
||||||
|
if not client_notifs[client_id] then
|
||||||
|
client_notifs[client_id] = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
if not client_notifs[client_id][token] then
|
||||||
|
client_notifs[client_id][token] = {}
|
||||||
|
end
|
||||||
|
|
||||||
|
return client_notifs[client_id][token]
|
||||||
|
end
|
||||||
|
|
||||||
|
local spinner_frames = { "⣾", "⣽", "⣻", "⢿", "⡿", "⣟", "⣯", "⣷" }
|
||||||
|
|
||||||
|
local function update_spinner(client_id, token)
|
||||||
|
local notif_data = get_notif_data(client_id, token)
|
||||||
|
|
||||||
|
if notif_data.spinner then
|
||||||
|
local new_spinner = (notif_data.spinner + 1) % #spinner_frames
|
||||||
|
notif_data.spinner = new_spinner
|
||||||
|
|
||||||
|
notif_data.notification = vim.notify("", nil, {
|
||||||
|
hide_from_history = true,
|
||||||
|
icon = spinner_frames[new_spinner],
|
||||||
|
replace = notif_data.notification,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.defer_fn(function()
|
||||||
|
update_spinner(client_id, token)
|
||||||
|
end, 100)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function format_title(title, client_name)
|
||||||
|
return client_name .. (#title > 0 and ": " .. title or "")
|
||||||
|
end
|
||||||
|
|
||||||
|
local function format_message(message, percentage)
|
||||||
|
return (percentage and percentage .. "%\t" or "") .. (message or "")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- LSP integration
|
||||||
|
-- Make sure to also have the snippet with the common helper functions in your config!
|
||||||
|
|
||||||
|
vim.lsp.handlers["$/progress"] = function(_, result, ctx)
|
||||||
|
local client_id = ctx.client_id
|
||||||
|
|
||||||
|
local val = result.value
|
||||||
|
|
||||||
|
if not val.kind then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local notif_data = get_notif_data(client_id, result.token)
|
||||||
|
|
||||||
|
if val.kind == "begin" then
|
||||||
|
local message = format_message(val.message, val.percentage)
|
||||||
|
|
||||||
|
notif_data.notification = vim.notify(message, "info", {
|
||||||
|
title = format_title(val.title, vim.lsp.get_client_by_id(client_id).name),
|
||||||
|
icon = spinner_frames[1],
|
||||||
|
timeout = false,
|
||||||
|
hide_from_history = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
notif_data.spinner = 1
|
||||||
|
update_spinner(client_id, result.token)
|
||||||
|
elseif val.kind == "report" and notif_data then
|
||||||
|
notif_data.notification = vim.notify(format_message(val.message, val.percentage), "info", {
|
||||||
|
replace = notif_data.notification,
|
||||||
|
hide_from_history = false,
|
||||||
|
})
|
||||||
|
elseif val.kind == "end" and notif_data then
|
||||||
|
notif_data.notification = vim.notify(val.message and format_message(val.message) or "Complete", "info", {
|
||||||
|
icon = "",
|
||||||
|
replace = notif_data.notification,
|
||||||
|
timeout = 3000,
|
||||||
|
})
|
||||||
|
|
||||||
|
notif_data.spinner = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- table from lsp severity to vim severity.
|
||||||
|
local severity = {
|
||||||
|
"error",
|
||||||
|
"warn",
|
||||||
|
"info",
|
||||||
|
"info", -- map both hint and info to info?
|
||||||
|
}
|
||||||
|
vim.lsp.handlers["window/showMessage"] = function(err, method, params, client_id)
|
||||||
|
vim.notify(method.message, severity[params.type])
|
||||||
|
end
|
@ -4,19 +4,18 @@ local A = vim.api
|
|||||||
local l = vim.lsp
|
local l = vim.lsp
|
||||||
|
|
||||||
g.mapleader = " "
|
g.mapleader = " "
|
||||||
g.maplocalleader = ','
|
g.maplocalleader = ","
|
||||||
g.fzf_command =
|
g.fzf_command = 'fzf --height 90% --width=85% --layout=reverse --preview "bat --color=always {}"'
|
||||||
'fzf --height 90% --width=85% --layout=reverse --preview "bat --color=always {}"'
|
|
||||||
o.completeopt = "menu,menuone,noselect"
|
o.completeopt = "menu,menuone,noselect"
|
||||||
o.showmode = false
|
o.showmode = false
|
||||||
o.termguicolors = true
|
o.termguicolors = true
|
||||||
o.background = 'dark'
|
o.background = "dark"
|
||||||
o.mouse = 'a'
|
o.mouse = "a"
|
||||||
o.syntax = 'on'
|
o.syntax = "on"
|
||||||
o.laststatus = 3
|
o.laststatus = 3
|
||||||
o.number = true
|
o.number = true
|
||||||
o.relativenumber = true
|
o.relativenumber = true
|
||||||
o.colorcolumn = '80'
|
o.colorcolumn = "80"
|
||||||
o.textwidth = 80
|
o.textwidth = 80
|
||||||
o.shiftwidth = 4
|
o.shiftwidth = 4
|
||||||
o.expandtab = true
|
o.expandtab = true
|
||||||
@ -31,33 +30,49 @@ o.splitright = true
|
|||||||
o.cursorline = true
|
o.cursorline = true
|
||||||
o.scrolloff = 8
|
o.scrolloff = 8
|
||||||
o.sidescrolloff = 8
|
o.sidescrolloff = 8
|
||||||
o.wildmenu = true
|
o.wildmenu = false --cmp
|
||||||
o.wildignore =
|
o.wildmode = "" --cmp
|
||||||
'.git,.hg,.svn,CVS,.DS_Store,.idea,.vscode,.vscode-test,node_modules'
|
o.wildoptions = ""
|
||||||
|
o.wildignore = ".git,.hg,.svn,CVS,.DS_Store,.idea,.vscode,.vscode-test,node_modules"
|
||||||
o.showmatch = true
|
o.showmatch = true
|
||||||
o.list = true
|
o.list = true
|
||||||
o.listchars = 'tab:»·,trail:·,nbsp:·,extends:>,precedes:<'
|
o.listchars = "tab:»·,trail:·,nbsp:·,extends:>,precedes:<"
|
||||||
o.encoding = 'utf-8'
|
o.encoding = "utf-8"
|
||||||
o.guifont = 'JetBrainsMono Nerd Font 14'
|
o.guifont = "JetBrainsMono Nerd Font 14"
|
||||||
o.expandtab = true
|
o.expandtab = true
|
||||||
o.hidden = true
|
o.hidden = true
|
||||||
o.cmdheight = 1
|
o.cmdheight = 1
|
||||||
o.updatetime = 300
|
o.updatetime = 300
|
||||||
o.timeoutlen = 500
|
o.timeoutlen = 500
|
||||||
o.pumwidth = 35
|
o.pumwidth = 35
|
||||||
o.foldmethod = 'marker'
|
o.foldmethod = "marker"
|
||||||
-- g.colorscheme = 'catppuccin-macchiato'
|
|
||||||
g.db_ui_use_nerd_fonts = 1
|
g.db_ui_use_nerd_fonts = 1
|
||||||
|
|
||||||
vim.cmd("colorscheme catppuccin-macchiato")
|
-- vim.cmd.colorscheme = 'catppuccin-macchiato'
|
||||||
|
vim.cmd.colorscheme = "catppuccin"
|
||||||
|
|
||||||
local border = {
|
local border = {
|
||||||
{ "╭", "FloatBorder" }, { "─", "FloatBorder" }, { "╮", "FloatBorder" },
|
{ "╭", "FloatBorder" },
|
||||||
{ "│", "FloatBorder" }, { "╯", "FloatBorder" }, { "─", "FloatBorder" },
|
{ "─", "FloatBorder" },
|
||||||
{ "╰", "FloatBorder" }, { "│", "FloatBorder" }
|
{ "╮", "FloatBorder" },
|
||||||
|
{ "│", "FloatBorder" },
|
||||||
|
{ "╯", "FloatBorder" },
|
||||||
|
{ "─", "FloatBorder" },
|
||||||
|
{ "╰", "FloatBorder" },
|
||||||
|
{ "│", "FloatBorder" },
|
||||||
}
|
}
|
||||||
|
|
||||||
l.handlers["textDocument/signatureHelp"] =
|
l.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border })
|
||||||
vim.lsp.with(vim.lsp.handlers.signature_help, { border = border })
|
l.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
|
||||||
l.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover,
|
|
||||||
{ border = border })
|
-- lsp status
|
||||||
|
-- table from lsp severity to vim severity.
|
||||||
|
local severity = {
|
||||||
|
"error",
|
||||||
|
"warn",
|
||||||
|
"info",
|
||||||
|
"info", -- map both hint and info to info?
|
||||||
|
}
|
||||||
|
vim.lsp.handlers["window/showMessage"] = function(err, method, params, client_id)
|
||||||
|
vim.notify(method.message, severity[params.type])
|
||||||
|
end
|
||||||
|
@ -1,354 +0,0 @@
|
|||||||
local lsp_dev = {}
|
|
||||||
|
|
||||||
vim.cmd([[packadd packer.nvim]])
|
|
||||||
require("packer").startup(function(use)
|
|
||||||
use("wbthomason/packer.nvim")
|
|
||||||
use("nvim-lua/plenary.nvim")
|
|
||||||
use({
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
run = function()
|
|
||||||
require("nvim-treesitter.install").update({ with_sync = true })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({ "nvim-treesitter/nvim-treesitter-context" })
|
|
||||||
|
|
||||||
use({
|
|
||||||
"kndndrj/nvim-dbee",
|
|
||||||
requires = {
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
run = function()
|
|
||||||
-- Install tries to automatically detect the install method.
|
|
||||||
-- if it fails, try calling it with one of these parameters:
|
|
||||||
-- "curl", "wget", "bitsadmin", "go"
|
|
||||||
require("dbee").install()
|
|
||||||
end,
|
|
||||||
config = function()
|
|
||||||
require("dbee").setup( --[[optional config]])
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- TELESCOPE {{{
|
|
||||||
|
|
||||||
use({ "nvim-telescope/telescope.nvim" })
|
|
||||||
use({ "nvim-telescope/telescope-file-browser.nvim" })
|
|
||||||
use("nvim-telescope/telescope-dap.nvim")
|
|
||||||
use({ "ghassan0/telescope-glyph.nvim" })
|
|
||||||
use({ "nat-418/telescope-color-names.nvim" })
|
|
||||||
use({
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
run = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- LSP/DEV {{{
|
|
||||||
use({
|
|
||||||
"zbirenbaum/copilot.lua",
|
|
||||||
cmd = "Copilot",
|
|
||||||
event = "InsertEnter",
|
|
||||||
config = function()
|
|
||||||
require("copilot").setup({
|
|
||||||
panel = {
|
|
||||||
enabled = true,
|
|
||||||
auto_refresh = false,
|
|
||||||
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 = false,
|
|
||||||
auto_trigger = false,
|
|
||||||
hide_during_completion = true,
|
|
||||||
debounce = 75,
|
|
||||||
keymap = {
|
|
||||||
accept = "<M-l>",
|
|
||||||
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,
|
|
||||||
-- ["."] = false,
|
|
||||||
-- },
|
|
||||||
copilot_node_command = "node", -- Node.js version must be > 18.x
|
|
||||||
server_opts_overrides = {
|
|
||||||
trace = "verbose",
|
|
||||||
settings = {
|
|
||||||
advanced = {
|
|
||||||
listCount = 10, -- #completions for panel
|
|
||||||
inlineSuggestCount = 3, -- #completions for getCompletions
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({ "zbirenbaum/copilot-cmp" })
|
|
||||||
|
|
||||||
use({
|
|
||||||
"olimorris/codecompanion.nvim",
|
|
||||||
requires = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
},
|
|
||||||
init = function()
|
|
||||||
require("plugins.codecompanion.fidget-spinner"):init()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
use({
|
|
||||||
"iamcco/markdown-preview.nvim",
|
|
||||||
run = function()
|
|
||||||
vim.fn["mkdp#util#install"]()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
-- tag = "v2.*",
|
|
||||||
run = "make install_jsregexp",
|
|
||||||
dependencies = { "rafamadriz/friendly-snippets" },
|
|
||||||
})
|
|
||||||
use({ "folke/neodev.nvim" })
|
|
||||||
use({ "saadparwaiz1/cmp_luasnip" })
|
|
||||||
use({ "hrsh7th/cmp-buffer" })
|
|
||||||
use({ "hrsh7th/cmp-cmdline" })
|
|
||||||
use({ "hrsh7th/cmp-nvim-lsp" })
|
|
||||||
use({ "hrsh7th/cmp-nvim-lsp-document-symbol" })
|
|
||||||
use({ "hrsh7th/cmp-nvim-lsp-signature-help" })
|
|
||||||
use({ "hrsh7th/cmp-nvim-lua" })
|
|
||||||
use({ "hrsh7th/cmp-path" })
|
|
||||||
use({ "hrsh7th/nvim-cmp" })
|
|
||||||
use({ "https://git.sr.ht/~whynothugo/lsp_lines.nvim" })
|
|
||||||
-- use { 'jose-elias-alvarez/null-ls.nvim' }
|
|
||||||
use({ "nvimtools/none-ls.nvim" })
|
|
||||||
use({ "neovim/nvim-lspconfig" })
|
|
||||||
use({ "onsails/lspkind-nvim" })
|
|
||||||
use({
|
|
||||||
"https://git.sr.ht/~nedia/auto-format.nvim",
|
|
||||||
config = function()
|
|
||||||
require("auto-format").setup()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use("mfussenegger/nvim-lint")
|
|
||||||
|
|
||||||
use("nvim-neotest/nvim-nio")
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- DADBOD {{{
|
|
||||||
|
|
||||||
-- use { 'tpope/vim-dadbod' }
|
|
||||||
-- use { 'kristijanhusak/vim-dadbod-ui' }
|
|
||||||
-- use { 'kristijanhusak/vim-dadbod-completion' }
|
|
||||||
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- UI {{{
|
|
||||||
|
|
||||||
use({ "akinsho/toggleterm.nvim", tag = "*" })
|
|
||||||
use({ "HiPhish/rainbow-delimiters.nvim" })
|
|
||||||
use({
|
|
||||||
"lukas-reineke/indent-blankline.nvim",
|
|
||||||
})
|
|
||||||
|
|
||||||
--{{{ DASHBOARD
|
|
||||||
use({
|
|
||||||
"nvimdev/dashboard-nvim",
|
|
||||||
event = "VimEnter",
|
|
||||||
config = function()
|
|
||||||
require("dashboard").setup({
|
|
||||||
theme = "hyper",
|
|
||||||
config = {
|
|
||||||
week_header = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
shortcut = {
|
|
||||||
{ desc = " Update", group = "@property", action = "Lazy update", key = "u" },
|
|
||||||
{
|
|
||||||
icon = " ",
|
|
||||||
icon_hl = "@variable",
|
|
||||||
desc = "Files",
|
|
||||||
group = "Label",
|
|
||||||
action = "Telescope find_files",
|
|
||||||
key = "f",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
desc = " Apps",
|
|
||||||
group = "DiagnosticHint",
|
|
||||||
action = "Telescope app",
|
|
||||||
key = "a",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
desc = " dotfiles",
|
|
||||||
group = "Number",
|
|
||||||
action = "Telescope ~/.config",
|
|
||||||
key = "d",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
requires = { "nvim-tree/nvim-web-devicons" },
|
|
||||||
})
|
|
||||||
--}}}
|
|
||||||
|
|
||||||
use({
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
tag = "legacy",
|
|
||||||
config = function()
|
|
||||||
require("fidget").setup({
|
|
||||||
-- options
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use({
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
requires = { "kyazdani42/nvim-web-devicons", opt = true },
|
|
||||||
})
|
|
||||||
use({ "AndreM222/copilot-lualine" })
|
|
||||||
use({ "kyazdani42/nvim-web-devicons" })
|
|
||||||
use({ "norcalli/nvim-colorizer.lua" })
|
|
||||||
use({ "akinsho/nvim-bufferline.lua" })
|
|
||||||
use({ "andweeb/presence.nvim" })
|
|
||||||
use({ "folke/which-key.nvim" })
|
|
||||||
use({ "kyazdani42/nvim-tree.lua" })
|
|
||||||
use({ "lewis6991/gitsigns.nvim" })
|
|
||||||
use({ "rcarriga/nvim-notify" })
|
|
||||||
use({ "stevearc/dressing.nvim" })
|
|
||||||
use({ "echasnovski/mini.nvim" })
|
|
||||||
use({
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
event = "InsertEnter",
|
|
||||||
config = function()
|
|
||||||
local npairs = require("nvim-autopairs")
|
|
||||||
local Rule = require("nvim-autopairs.rule")
|
|
||||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
|
||||||
local cmp = require("cmp")
|
|
||||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
|
||||||
|
|
||||||
npairs.setup({
|
|
||||||
disable_filetype = { "TelescopePrompt", "spectre_panel", "Terminal", "terminal" },
|
|
||||||
check_ts = true,
|
|
||||||
ts_config = {
|
|
||||||
lua = { "string" }, -- it will not add a pair on that treesitter node
|
|
||||||
javascript = { "template_string" },
|
|
||||||
java = false, -- don't check treesitter on java
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
local ts_conds = require("nvim-autopairs.ts-conds")
|
|
||||||
|
|
||||||
-- press % => %% only while inside a comment or string
|
|
||||||
npairs.add_rules({
|
|
||||||
Rule("%", "%", "lua"):with_pair(ts_conds.is_ts_node({ "string", "comment" })),
|
|
||||||
Rule("$", "$", "lua"):with_pair(ts_conds.is_not_ts_node({ "function" })),
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- EXTRAS {{{
|
|
||||||
|
|
||||||
use({
|
|
||||||
"nvim-neorg/neorg",
|
|
||||||
-- tag = "*",
|
|
||||||
ft = "norg",
|
|
||||||
after = "nvim-treesitter", -- You may want to specify Telescope here as well
|
|
||||||
config = function()
|
|
||||||
require("neorg").setup({
|
|
||||||
load = {
|
|
||||||
["core.defaults"] = {}, -- Loads default behaviour
|
|
||||||
["core.concealer"] = {}, -- Adds pretty icons to your documents
|
|
||||||
["core.completion"] = { config = { engine = "nvim-cmp" } }, -- Adds completion
|
|
||||||
["core.dirman"] = { -- Manages Neorg workspaces
|
|
||||||
config = { workspaces = { notes = "~/notes" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
use("pechorin/any-jump.vim")
|
|
||||||
use("tpope/vim-commentary")
|
|
||||||
use("tpope/vim-dotenv")
|
|
||||||
use("tpope/vim-surround")
|
|
||||||
-- use 'voldikss/vim-floaterm'
|
|
||||||
use("wakatime/vim-wakatime")
|
|
||||||
use("rmagatti/goto-preview")
|
|
||||||
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- COLORSCHEMES {{{
|
|
||||||
|
|
||||||
use({ "Mofiqul/dracula.nvim" })
|
|
||||||
-- use({
|
|
||||||
-- 'NTBBloodbath/doom-one.nvim',
|
|
||||||
-- setup = function()
|
|
||||||
-- -- Add color to cursor
|
|
||||||
-- vim.g.doom_one_cursor_coloring = false
|
|
||||||
-- -- Set :terminal colors
|
|
||||||
-- vim.g.doom_one_terminal_colors = true
|
|
||||||
-- -- Enable italic comments
|
|
||||||
-- vim.g.doom_one_italic_comments = false
|
|
||||||
-- -- Enable TS support
|
|
||||||
-- vim.g.doom_one_enable_treesitter = true
|
|
||||||
-- -- Color whole diagnostic text or only underline
|
|
||||||
-- vim.g.doom_one_diagnostics_text_color = false
|
|
||||||
-- -- Enable transparent background
|
|
||||||
-- vim.g.doom_one_transparent_background = false
|
|
||||||
|
|
||||||
-- -- Pumblend transparency
|
|
||||||
-- vim.g.doom_one_pumblend_enable = false
|
|
||||||
-- vim.g.doom_one_pumblend_transparency = 20
|
|
||||||
|
|
||||||
-- -- Plugins integration
|
|
||||||
-- vim.g.doom_one_plugin_neorg = true
|
|
||||||
-- vim.g.doom_one_plugin_barbar = false
|
|
||||||
-- vim.g.doom_one_plugin_telescope = true
|
|
||||||
-- vim.g.doom_one_plugin_neogit = true
|
|
||||||
-- vim.g.doom_one_plugin_nvim_tree = true
|
|
||||||
-- vim.g.doom_one_plugin_dashboard = true
|
|
||||||
-- vim.g.doom_one_plugin_startify = true
|
|
||||||
-- vim.g.doom_one_plugin_whichkey = true
|
|
||||||
-- vim.g.doom_one_plugin_indent_blankline = true
|
|
||||||
-- vim.g.doom_one_plugin_vim_illuminate = false
|
|
||||||
-- vim.g.doom_one_plugin_lspsaga = false
|
|
||||||
-- end
|
|
||||||
-- config = function()
|
|
||||||
-- vim.cmd("colorscheme doom-one")
|
|
||||||
-- vim.cmd(
|
|
||||||
-- "highlight Pmenu ctermfg=white ctermbg=black gui=NONE guifg=white guibg=#282C34")
|
|
||||||
-- vim.cmd("highlight PmenuSel guifg=purple guibg=red")
|
|
||||||
-- end
|
|
||||||
-- })
|
|
||||||
use({ "olimorris/onedarkpro.nvim" })
|
|
||||||
|
|
||||||
use({
|
|
||||||
"catppuccin/nvim",
|
|
||||||
as = "catppuccin",
|
|
||||||
config = function()
|
|
||||||
vim.cmd("colorscheme catppuccin-macchiato")
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- }}}
|
|
||||||
end)
|
|
@ -1,15 +0,0 @@
|
|||||||
require("codecompanion").setup({
|
|
||||||
strategies = {
|
|
||||||
chat = {
|
|
||||||
adapter = "copilot",
|
|
||||||
},
|
|
||||||
inline = {
|
|
||||||
adapter = "copilot",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
display = {
|
|
||||||
action_palette = {
|
|
||||||
provider = "telescope"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
@ -1,71 +0,0 @@
|
|||||||
local progress = require("fidget.progress")
|
|
||||||
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
function M:init()
|
|
||||||
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "User" }, {
|
|
||||||
pattern = "CodeCompanionRequestStarted",
|
|
||||||
group = group,
|
|
||||||
callback = function(request)
|
|
||||||
local handle = M:create_progress_handle(request)
|
|
||||||
M:store_progress_handle(request.data.id, handle)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "User" }, {
|
|
||||||
pattern = "CodeCompanionRequestFinished",
|
|
||||||
group = group,
|
|
||||||
callback = function(request)
|
|
||||||
local handle = M:pop_progress_handle(request.data.id)
|
|
||||||
if handle then
|
|
||||||
M:report_exit_status(handle, request)
|
|
||||||
handle:finish()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
M.handles = {}
|
|
||||||
|
|
||||||
function M:store_progress_handle(id, handle)
|
|
||||||
M.handles[id] = handle
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:pop_progress_handle(id)
|
|
||||||
local handle = M.handles[id]
|
|
||||||
M.handles[id] = nil
|
|
||||||
return handle
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:create_progress_handle(request)
|
|
||||||
return progress.handle.create({
|
|
||||||
title = " Requesting assistance (" .. request.data.strategy .. ")",
|
|
||||||
message = "In progress...",
|
|
||||||
lsp_client = {
|
|
||||||
name = M:llm_role_title(request.data.adapter),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:llm_role_title(adapter)
|
|
||||||
local parts = {}
|
|
||||||
table.insert(parts, adapter.formatted_name)
|
|
||||||
if adapter.model and adapter.model ~= "" then
|
|
||||||
table.insert(parts, "(" .. adapter.model .. ")")
|
|
||||||
end
|
|
||||||
return table.concat(parts, " ")
|
|
||||||
end
|
|
||||||
|
|
||||||
function M:report_exit_status(handle, request)
|
|
||||||
if request.data.status == "success" then
|
|
||||||
handle.message = "Completed"
|
|
||||||
elseif request.data.status == "error" then
|
|
||||||
handle.message = " Error"
|
|
||||||
else
|
|
||||||
handle.message = " Cancelled"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
@ -1 +0,0 @@
|
|||||||
require("plugins.ai.codecompanion")
|
|
1
lua/plugins/anyjump.lua
Normal file
1
lua/plugins/anyjump.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { "pechorin/any-jump.vim" }
|
7
lua/plugins/auto-format.lua
Normal file
7
lua/plugins/auto-format.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"https://git.sr.ht/~nedia/auto-format.nvim",
|
||||||
|
event = "BufWinEnter",
|
||||||
|
config = function()
|
||||||
|
require("auto-format").setup()
|
||||||
|
end
|
||||||
|
}
|
100
lua/plugins/bufferline.lua
Normal file
100
lua/plugins/bufferline.lua
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
return {
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
version = "*",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons", "catppuccin/nvim" },
|
||||||
|
opts = {
|
||||||
|
options = {
|
||||||
|
-- numbers = function(opts)
|
||||||
|
-- return string.format("%s", opts.id)
|
||||||
|
-- end,
|
||||||
|
numbers = function(opts)
|
||||||
|
return ""
|
||||||
|
end,
|
||||||
|
-- number_style = "superscript" | "subscript" | "" | { "none", "subscript" }, -- buffer_id at index 1, ordinal at index 2
|
||||||
|
-- number_style = "none",
|
||||||
|
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||||
|
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||||
|
-- NOTE: this plugin is designed with this icon in mind,
|
||||||
|
-- and so changing this is NOT recommended, this is intended
|
||||||
|
-- as an escape hatch for people who cannot bear it for whatever reason
|
||||||
|
indicator = {
|
||||||
|
-- icon = "▎",
|
||||||
|
style = "underline",
|
||||||
|
},
|
||||||
|
-- indicator_style = "▎",
|
||||||
|
buffer_close_icon = "",
|
||||||
|
modified_icon = "●",
|
||||||
|
close_icon = "",
|
||||||
|
left_trunc_marker = "",
|
||||||
|
right_trunc_marker = "",
|
||||||
|
--- name_formatter can be used to change the buffer's label in the bufferline.
|
||||||
|
--- Please note some names can/will break the
|
||||||
|
--- bufferline so use this at your discretion knowing that it has
|
||||||
|
--- some limitations that will *NOT* be fixed.
|
||||||
|
name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||||
|
-- remove extension from markdown files for example
|
||||||
|
if buf.name:match("%.md") then
|
||||||
|
return vim.fn.fnamemodify(buf.name, ":t:r")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
max_name_length = 18,
|
||||||
|
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||||
|
tab_size = 18,
|
||||||
|
-- diagnostics = false | "nvim_lsp" | "coc",
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
|
diagnostics_update_in_insert = false,
|
||||||
|
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 == "hint" and " "
|
||||||
|
or (e == "warning" and " " or "")
|
||||||
|
s = s .. n .. sym
|
||||||
|
end
|
||||||
|
return s
|
||||||
|
end,
|
||||||
|
custom_filter = function(buf_number, buf_numbers)
|
||||||
|
-- filter out filetypes you don't want to see
|
||||||
|
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
-- filter out by buffer name
|
||||||
|
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
-- filter out based on arbitrary rules
|
||||||
|
-- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||||
|
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
-- filter out by it's index number in list (don't show first buffer)
|
||||||
|
if buf_numbers[1] ~= buf_number then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
-- offsets = {{filetype = "NvimTree", text = "File Explorer" | function , text_align = "left" | "center" | "right"}},
|
||||||
|
-- offsets = text_align = "left" | "center" | "right"}},
|
||||||
|
show_buffer_icons = true,
|
||||||
|
show_buffer_close_icons = true,
|
||||||
|
show_close_icon = false,
|
||||||
|
show_tab_indicators = true,
|
||||||
|
persist_buffer_sort = false, -- whether or not custom sorted buffers should persist
|
||||||
|
-- can also be a table containing 2 custom separators
|
||||||
|
-- [focused and unfocused]. eg: { '|', '|' }
|
||||||
|
-- separator_style = "slant" | "thick" | "thin" | { 'any', 'any' },
|
||||||
|
separator_style = "slant",
|
||||||
|
enforce_regular_tabs = false,
|
||||||
|
always_show_bufferline = true,
|
||||||
|
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
||||||
|
sort_by = "id",
|
||||||
|
-- highlights = require("catppuccin.groups.integrations.bufferline").get(),
|
||||||
|
hover = {
|
||||||
|
enabled = true,
|
||||||
|
delay = 200,
|
||||||
|
reveal = { "close" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
56
lua/plugins/catppuccin.lua
Normal file
56
lua/plugins/catppuccin.lua
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
return {
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
opts = {
|
||||||
|
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
||||||
|
term_colors = true, -- sets terminal colors (e.g. `g:terminal_color_0`)
|
||||||
|
integrations = {
|
||||||
|
cmp = true,
|
||||||
|
gitsigns = true,
|
||||||
|
nvimtree = true,
|
||||||
|
mini = {
|
||||||
|
enabled = true,
|
||||||
|
indentscope_color = "",
|
||||||
|
},
|
||||||
|
bufferline = true,
|
||||||
|
dashboard = true,
|
||||||
|
fidget = true,
|
||||||
|
indent_blankline = {
|
||||||
|
enabled = true,
|
||||||
|
scope_color = "lavendar", -- catppuccin color (eg. `lavender`) Default: text
|
||||||
|
colored_indent_levels = true,
|
||||||
|
},
|
||||||
|
copilot_vim = true,
|
||||||
|
native_lsp = {
|
||||||
|
enabled = true,
|
||||||
|
virtual_text = {
|
||||||
|
errors = { "italic" },
|
||||||
|
hints = { "italic" },
|
||||||
|
warnings = { "italic" },
|
||||||
|
information = { "italic" },
|
||||||
|
ok = { "italic" },
|
||||||
|
},
|
||||||
|
underlines = {
|
||||||
|
errors = { "underline" },
|
||||||
|
hints = { "underline" },
|
||||||
|
warnings = { "underline" },
|
||||||
|
information = { "underline" },
|
||||||
|
ok = { "underline" },
|
||||||
|
},
|
||||||
|
inlay_hints = {
|
||||||
|
background = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
notify = true,
|
||||||
|
treesitter = true,
|
||||||
|
rainbow_delimiters = true,
|
||||||
|
telescope = {
|
||||||
|
enabled = true,
|
||||||
|
-- style = "nvchad"
|
||||||
|
},
|
||||||
|
which_key = true
|
||||||
|
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
lua/plugins/codecompanion.lua
Normal file
36
lua/plugins/codecompanion.lua
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
"olimorris/codecompanion.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"j-hui/fidget.nvim",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
strategies = {
|
||||||
|
chat = {
|
||||||
|
adapter = "copilot",
|
||||||
|
},
|
||||||
|
inline = {
|
||||||
|
adapter = "copilot",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
display = {
|
||||||
|
action_palette = {
|
||||||
|
provider = "default",
|
||||||
|
width = 150,
|
||||||
|
heigth = 85,
|
||||||
|
},
|
||||||
|
chat = {
|
||||||
|
layout = "vertical",
|
||||||
|
border = "single",
|
||||||
|
},
|
||||||
|
diff = {
|
||||||
|
enabled = true,
|
||||||
|
provider = "mini_diff",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
require("plugins.codecompanion.fidget-spinner"):init()
|
||||||
|
end,
|
||||||
|
}
|
71
lua/plugins/codecompanion/fidget-spinner.lua
Normal file
71
lua/plugins/codecompanion/fidget-spinner.lua
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
local progress = require("fidget.progress")
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M:init()
|
||||||
|
local group = vim.api.nvim_create_augroup("CodeCompanionFidgetHooks", {})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
|
pattern = "CodeCompanionRequestStarted",
|
||||||
|
group = group,
|
||||||
|
callback = function(request)
|
||||||
|
local handle = M:create_progress_handle(request)
|
||||||
|
M:store_progress_handle(request.data.id, handle)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
|
pattern = "CodeCompanionRequestFinished",
|
||||||
|
group = group,
|
||||||
|
callback = function(request)
|
||||||
|
local handle = M:pop_progress_handle(request.data.id)
|
||||||
|
if handle then
|
||||||
|
M:report_exit_status(handle, request)
|
||||||
|
handle:finish()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
M.handles = {}
|
||||||
|
|
||||||
|
function M:store_progress_handle(id, handle)
|
||||||
|
M.handles[id] = handle
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:pop_progress_handle(id)
|
||||||
|
local handle = M.handles[id]
|
||||||
|
M.handles[id] = nil
|
||||||
|
return handle
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:create_progress_handle(request)
|
||||||
|
return progress.handle.create({
|
||||||
|
title = " Requesting assistance (" .. request.data.strategy .. ")",
|
||||||
|
message = "In progress...",
|
||||||
|
lsp_client = {
|
||||||
|
name = M:llm_role_title(request.data.adapter),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:llm_role_title(adapter)
|
||||||
|
local parts = {}
|
||||||
|
table.insert(parts, adapter.formatted_name)
|
||||||
|
if adapter.model and adapter.model ~= "" then
|
||||||
|
table.insert(parts, "(" .. adapter.model .. ")")
|
||||||
|
end
|
||||||
|
return table.concat(parts, " ")
|
||||||
|
end
|
||||||
|
|
||||||
|
function M:report_exit_status(handle, request)
|
||||||
|
if request.data.status == "success" then
|
||||||
|
handle.message = "Completed"
|
||||||
|
elseif request.data.status == "error" then
|
||||||
|
handle.message = " Error"
|
||||||
|
else
|
||||||
|
handle.message = " Cancelled"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
@ -1,68 +0,0 @@
|
|||||||
require("catppuccin").setup({
|
|
||||||
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
|
||||||
background = { -- :h background
|
|
||||||
light = "latte",
|
|
||||||
-- dark = "mocha",
|
|
||||||
dark = "macchiato",
|
|
||||||
},
|
|
||||||
transparent_background = false,
|
|
||||||
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
|
|
||||||
term_colors = false,
|
|
||||||
dim_inactive = {
|
|
||||||
enabled = false,
|
|
||||||
shade = "dark",
|
|
||||||
percentage = 0.15,
|
|
||||||
},
|
|
||||||
no_italic = false, -- Force no italic
|
|
||||||
no_bold = false, -- Force no bold
|
|
||||||
styles = {
|
|
||||||
comments = { "italic" },
|
|
||||||
conditionals = { "italic" },
|
|
||||||
loops = { "bold" },
|
|
||||||
functions = { "bold", "italic" },
|
|
||||||
keywords = { "bold" },
|
|
||||||
strings = { "italic" },
|
|
||||||
variables = { "italic" },
|
|
||||||
numbers = {},
|
|
||||||
booleans = {},
|
|
||||||
properties = {},
|
|
||||||
types = { "bold" },
|
|
||||||
operators = {},
|
|
||||||
},
|
|
||||||
color_overrides = {},
|
|
||||||
custom_highlights = {},
|
|
||||||
integrations = {
|
|
||||||
cmp = true,
|
|
||||||
gitsigns = true,
|
|
||||||
treesitter = true,
|
|
||||||
nvimtree = true,
|
|
||||||
telescope = true,
|
|
||||||
which_key = true,
|
|
||||||
notify = false,
|
|
||||||
mini = false
|
|
||||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
|
||||||
},
|
|
||||||
native_lsp = {
|
|
||||||
enabled = true,
|
|
||||||
virtual_text = {
|
|
||||||
errors = { "italic" },
|
|
||||||
hints = { "italic" },
|
|
||||||
warnings = { "italic" },
|
|
||||||
information = { "italic" },
|
|
||||||
},
|
|
||||||
underlines = {
|
|
||||||
errors = { "underline" },
|
|
||||||
hints = { "underline" },
|
|
||||||
warnings = { "underline" },
|
|
||||||
information = { "underline" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
require("nvim-treesitter.configs").setup {
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
additional_vim_regex_highlighting = false
|
|
||||||
},
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
-- customize dracula color palette
|
|
||||||
vim.g.dracula_colors = {
|
|
||||||
bg = "#282A36",
|
|
||||||
fg = "#F8F8F2",
|
|
||||||
selection = "#44475A",
|
|
||||||
comment = "#6272A4",
|
|
||||||
red = "#FF5555",
|
|
||||||
orange = "#FFB86C",
|
|
||||||
yellow = "#F1FA8C",
|
|
||||||
green = "#50fa7b",
|
|
||||||
purple = "#BD93F9",
|
|
||||||
cyan = "#8BE9FD",
|
|
||||||
pink = "#FF79C6",
|
|
||||||
bright_red = "#FF6E6E",
|
|
||||||
bright_green = "#69FF94",
|
|
||||||
bright_yellow = "#FFFFA5",
|
|
||||||
bright_blue = "#D6ACFF",
|
|
||||||
bright_magenta = "#FF92DF",
|
|
||||||
bright_cyan = "#A4FFFF",
|
|
||||||
bright_white = "#FFFFFF",
|
|
||||||
menu = "#21222C",
|
|
||||||
visual = "#3E4452",
|
|
||||||
gutter_fg = "#4B5263",
|
|
||||||
nontext = "#3B4048",
|
|
||||||
}
|
|
||||||
-- show the '~' characters after the end of buffers
|
|
||||||
vim.g.dracula_show_end_of_buffer = true
|
|
||||||
-- use transparent background
|
|
||||||
vim.g.dracula_transparent_bg = true
|
|
||||||
-- set custom lualine background color
|
|
||||||
vim.g.dracula_lualine_bg_color = "#44475a"
|
|
||||||
-- set italic comment
|
|
||||||
vim.g.dracula_italic_comment = true
|
|
@ -1,3 +0,0 @@
|
|||||||
require("plugins.colorscheme.catppuccin")
|
|
||||||
require("plugins.colorscheme.dracula")
|
|
||||||
require("plugins.colorscheme.onedarkpro")
|
|
@ -1,74 +0,0 @@
|
|||||||
require("onedarkpro").setup({
|
|
||||||
colors = {}, -- Override default colors or create your own
|
|
||||||
filetypes = { -- Override which filetype highlight groups are loaded
|
|
||||||
java = true,
|
|
||||||
javascript = true,
|
|
||||||
lua = true,
|
|
||||||
markdown = true,
|
|
||||||
php = true,
|
|
||||||
python = true,
|
|
||||||
ruby = true,
|
|
||||||
rust = true,
|
|
||||||
toml = true,
|
|
||||||
typescript = true,
|
|
||||||
typescriptreact = true,
|
|
||||||
vue = true,
|
|
||||||
yaml = true,
|
|
||||||
},
|
|
||||||
plugins = { -- Override which plugin highlight groups are loaded
|
|
||||||
aerial = false,
|
|
||||||
barbar = false,
|
|
||||||
copilot = true,
|
|
||||||
dashboard = true,
|
|
||||||
gitsigns = true,
|
|
||||||
hop = false,
|
|
||||||
indentline = false,
|
|
||||||
leap = false,
|
|
||||||
lsp_saga = false,
|
|
||||||
marks = true,
|
|
||||||
neotest = false,
|
|
||||||
neo_tree = true,
|
|
||||||
nvim_cmp = true,
|
|
||||||
nvim_bqf = false,
|
|
||||||
nvim_dap = true,
|
|
||||||
nvim_dap_ui = true,
|
|
||||||
nvim_hlslens = true,
|
|
||||||
nvim_lsp = true,
|
|
||||||
nvim_navic = false,
|
|
||||||
nvim_notify = true,
|
|
||||||
nvim_tree = true,
|
|
||||||
nvim_ts_rainbow = true,
|
|
||||||
op_nvim = false,
|
|
||||||
packer = true,
|
|
||||||
polygot = true,
|
|
||||||
startify = false,
|
|
||||||
telescope = true,
|
|
||||||
toggleterm = true,
|
|
||||||
treesitter = true,
|
|
||||||
trouble = true,
|
|
||||||
vim_ultest = false,
|
|
||||||
which_key = true,
|
|
||||||
},
|
|
||||||
highlights = {}, -- Override default highlight groups or create your own
|
|
||||||
styles = { -- For example, to apply bold and italic, use "bold,italic"
|
|
||||||
types = "bold", -- Style that is applied to types
|
|
||||||
methods = "NONE", -- Style that is applied to methods
|
|
||||||
numbers = "NONE", -- Style that is applied to numbers
|
|
||||||
strings = "italic", -- Style that is applied to strings
|
|
||||||
comments = "italic", -- Style that is applied to comments
|
|
||||||
keywords = "bold,italic", -- Style that is applied to keywords
|
|
||||||
constants = "bold", -- Style that is applied to constants
|
|
||||||
functions = "bold,italic", -- Style that is applied to functions
|
|
||||||
operators = "NONE", -- Style that is applied to operators
|
|
||||||
variables = "italic", -- Style that is applied to variables
|
|
||||||
parameters = "italic", -- Style that is applied to parameters
|
|
||||||
conditionals = "NONE", -- Style that is applied to conditionals
|
|
||||||
virtual_text = "italic", -- Style that is applied to virtual text
|
|
||||||
},
|
|
||||||
options = {
|
|
||||||
cursorline = true, -- Use cursorline highlighting?
|
|
||||||
transparency = false, -- Use a transparent background?
|
|
||||||
terminal_colors = true, -- Use the theme's colors for Neovim's :terminal?
|
|
||||||
highlight_inactive_windows = false, -- When the window is out of focus, change the normal background?
|
|
||||||
}
|
|
||||||
})
|
|
7
lua/plugins/copilot-cmp.lua
Normal file
7
lua/plugins/copilot-cmp.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"zbirenbaum/copilot-cmp",
|
||||||
|
opts = {
|
||||||
|
suggestion = { enabled = false },
|
||||||
|
panel = { enabled = false },
|
||||||
|
},
|
||||||
|
}
|
3
lua/plugins/copilot-lualine.lua
Normal file
3
lua/plugins/copilot-lualine.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
'AndreM222/copilot-lualine'
|
||||||
|
}
|
55
lua/plugins/copilot.lua
Normal file
55
lua/plugins/copilot.lua
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
return {
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
opts = {
|
||||||
|
panel = {
|
||||||
|
enabled = true,
|
||||||
|
auto_refresh = false,
|
||||||
|
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 = false,
|
||||||
|
auto_trigger = false,
|
||||||
|
hide_during_completion = true,
|
||||||
|
debounce = 75,
|
||||||
|
keymap = {
|
||||||
|
accept = "<M-l>",
|
||||||
|
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,
|
||||||
|
-- ["."] = false,
|
||||||
|
-- },
|
||||||
|
-- copilot_node_command = "node", -- Node.js version must be > 18.x
|
||||||
|
server_opts_overrides = {
|
||||||
|
trace = "verbose",
|
||||||
|
settings = {
|
||||||
|
advanced = {
|
||||||
|
listCount = 10, -- #completions for panel
|
||||||
|
inlineSuggestCount = 5, -- #completions for getCompletions
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
36
lua/plugins/dashboard.lua
Normal file
36
lua/plugins/dashboard.lua
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
"nvimdev/dashboard-nvim",
|
||||||
|
event = "VimEnter",
|
||||||
|
opts = {
|
||||||
|
theme = "hyper",
|
||||||
|
config = {
|
||||||
|
week_header = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
shortcut = {
|
||||||
|
{ desc = " Update", group = "@property", action = "Lazy update", key = "u" },
|
||||||
|
{
|
||||||
|
icon = " ",
|
||||||
|
icon_hl = "@variable",
|
||||||
|
desc = "Files",
|
||||||
|
group = "Label",
|
||||||
|
action = "Telescope find_files",
|
||||||
|
key = "f",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc = " Apps",
|
||||||
|
group = "DiagnosticHint",
|
||||||
|
action = "Telescope app",
|
||||||
|
key = "a",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
desc = " dotfiles",
|
||||||
|
group = "Number",
|
||||||
|
action = "Telescope ~/.config",
|
||||||
|
key = "d",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
depends = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
}
|
101
lua/plugins/fidget.lua
Normal file
101
lua/plugins/fidget.lua
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
return {
|
||||||
|
"j-hui/fidget.nvim",
|
||||||
|
opts = {
|
||||||
|
-- text = {
|
||||||
|
-- spinner = "pipe", -- animation shown when tasks are ongoing
|
||||||
|
-- done = "✔", -- character shown when all tasks are complete
|
||||||
|
-- commenced = "Started", -- message shown when task starts
|
||||||
|
-- completed = "Completed", -- message shown when task completes
|
||||||
|
-- },
|
||||||
|
-- align = {
|
||||||
|
-- bottom = true, -- align fidgets along bottom edge of buffer
|
||||||
|
-- right = true, -- align fidgets along right edge of buffer
|
||||||
|
-- },
|
||||||
|
progress = {
|
||||||
|
poll_rate = 0, -- How and when to poll for progress messages
|
||||||
|
suppress_on_insert = false, -- Suppress new messages while in insert mode
|
||||||
|
ignore_done_already = false, -- Ignore new tasks that are already complete
|
||||||
|
ignore_empty_message = false, -- Ignore new tasks that don't contain a message
|
||||||
|
clear_on_detach = -- Clear notification group when LSP server detaches
|
||||||
|
function(client_id)
|
||||||
|
local client = vim.lsp.get_client_by_id(client_id)
|
||||||
|
return client and client.name or nil
|
||||||
|
end,
|
||||||
|
notification_group = -- How to get a progress message's notification group key
|
||||||
|
function(msg) return msg.lsp_client.name end,
|
||||||
|
ignore = {}, -- List of LSP servers to ignore
|
||||||
|
|
||||||
|
-- Options related to how LSP progress messages are displayed as notifications
|
||||||
|
display = {
|
||||||
|
render_limit = 16, -- How many LSP messages to show at once
|
||||||
|
done_ttl = 3, -- How long a message should persist after completion
|
||||||
|
done_icon = "✔", -- Icon shown when all LSP progress tasks are complete
|
||||||
|
done_style = "Constant", -- Highlight group for completed LSP tasks
|
||||||
|
progress_ttl = math.huge, -- How long a message should persist when in progress
|
||||||
|
progress_icon = -- Icon shown when LSP progress tasks are in progress
|
||||||
|
{ "dots" },
|
||||||
|
progress_style = -- Highlight group for in-progress LSP tasks
|
||||||
|
"WarningMsg",
|
||||||
|
group_style = "Title", -- Highlight group for group name (LSP server name)
|
||||||
|
icon_style = "Question", -- Highlight group for group icons
|
||||||
|
priority = 30, -- Ordering priority for LSP notification group
|
||||||
|
skip_history = true, -- Whether progress notifications should be omitted from history
|
||||||
|
format_message = -- How to format a progress message
|
||||||
|
require("fidget.progress.display").default_format_message,
|
||||||
|
format_annote = -- How to format a progress annotation
|
||||||
|
function(msg) return msg.title end,
|
||||||
|
format_group_name = -- How to format a progress notification group's name
|
||||||
|
function(group) return tostring(group) end,
|
||||||
|
overrides = { -- Override options from the default notification config
|
||||||
|
rust_analyzer = { name = "rust-analyzer" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Options related to Neovim's built-in LSP client
|
||||||
|
lsp = {
|
||||||
|
progress_ringbuf_size = 0, -- Configure the nvim's LSP progress ring buffer size
|
||||||
|
log_handler = false, -- Log `$/progress` handler invocations (for debugging)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
notification = {
|
||||||
|
window = {
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
poll_rate = 10, -- How frequently to update and render notifications
|
||||||
|
filter = vim.log.levels.INFO, -- Minimum notifications level
|
||||||
|
history_size = 128, -- Number of removed messages to retain in history
|
||||||
|
override_vim_notify = false, -- Automatically override vim.notify() with Fidget
|
||||||
|
-- How to configure notification groups when instantiated
|
||||||
|
configs = { default = require("fidget.notification").default_config },
|
||||||
|
-- Conditionally redirect notifications to another backend
|
||||||
|
redirect = function(msg, level, opts)
|
||||||
|
if opts and opts.on_open then
|
||||||
|
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Options related to how notifications are rendered as text
|
||||||
|
view = {
|
||||||
|
stack_upwards = true, -- Display notification items from bottom to top
|
||||||
|
icon_separator = " ", -- Separator between group name and icon
|
||||||
|
group_separator = "---", -- Separator between notification groups
|
||||||
|
},
|
||||||
|
},
|
||||||
|
integration = {
|
||||||
|
["nvim-tree"] = {
|
||||||
|
enable = true, -- Integrate with nvim-tree/nvim-tree.lua (if installed)
|
||||||
|
},
|
||||||
|
["xcodebuild-nvim"] = {
|
||||||
|
enable = false, -- Integrate with wojciech-kulik/xcodebuild.nvim (if installed)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Options related to logging
|
||||||
|
logger = {
|
||||||
|
level = vim.log.levels.WARN, -- Minimum logging level
|
||||||
|
max_size = 10000, -- Maximum log file size, in KB
|
||||||
|
float_precision = 0.01, -- Limit the number of decimals displayed for floats
|
||||||
|
-- Where Fidget writes its logs to
|
||||||
|
path = string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache")),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
50
lua/plugins/gitsigns.lua
Normal file
50
lua/plugins/gitsigns.lua
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
return {
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
opts = {
|
||||||
|
signs = {
|
||||||
|
add = { text = "┃" },
|
||||||
|
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 = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||||
|
numhl = false, -- 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 = 1000,
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
1
lua/plugins/goto-preview.lua
Normal file
1
lua/plugins/goto-preview.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { "rmagatti/goto-preview" }
|
41
lua/plugins/image.lua
Normal file
41
lua/plugins/image.lua
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
return {
|
||||||
|
"3rd/image.nvim",
|
||||||
|
opts = {
|
||||||
|
backend = "kitty",
|
||||||
|
-- processor = "magick_rock", -- or "magick_cli"
|
||||||
|
processor = "magick_cli", -- or "magick_cli"
|
||||||
|
integrations = {
|
||||||
|
markdown = {
|
||||||
|
enabled = true,
|
||||||
|
clear_in_insert_mode = false,
|
||||||
|
download_remote_images = true,
|
||||||
|
only_render_image_at_cursor = false,
|
||||||
|
floating_windows = false, -- if true, images will be rendered in floating markdown windows
|
||||||
|
filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here
|
||||||
|
},
|
||||||
|
neorg = {
|
||||||
|
enabled = true,
|
||||||
|
filetypes = { "norg" },
|
||||||
|
},
|
||||||
|
typst = {
|
||||||
|
enabled = true,
|
||||||
|
filetypes = { "typst" },
|
||||||
|
},
|
||||||
|
html = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
css = {
|
||||||
|
enabled = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
max_width = nil,
|
||||||
|
max_height = nil,
|
||||||
|
max_width_window_percentage = nil,
|
||||||
|
max_height_window_percentage = 50,
|
||||||
|
window_overlap_clear_enabled = false, -- toggles images when windows are overlapped
|
||||||
|
window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" },
|
||||||
|
editor_only_render_when_focused = false, -- auto show/hide images when the editor gains/looses focus
|
||||||
|
tmux_show_only_in_active_window = false, -- auto show/hide images in the correct Tmux window (needs visual-activity off)
|
||||||
|
hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif" }, -- render image files as images when opened
|
||||||
|
},
|
||||||
|
}
|
35
lua/plugins/indent-blanklines.lua
Normal file
35
lua/plugins/indent-blanklines.lua
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
return {
|
||||||
|
"lukas-reineke/indent-blankline.nvim",
|
||||||
|
config = function()
|
||||||
|
local highlight = {
|
||||||
|
"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 = "#ED8796" })
|
||||||
|
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#EED49F" })
|
||||||
|
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#8AADF4" })
|
||||||
|
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#F5A97F" })
|
||||||
|
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#A6DA95" })
|
||||||
|
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C6A0F6" })
|
||||||
|
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#8BD5CA" })
|
||||||
|
end)
|
||||||
|
|
||||||
|
vim.g.rainbow_delimiters = { highlight = highlight }
|
||||||
|
require("ibl").setup({
|
||||||
|
scope = { highlight = highlight },
|
||||||
|
exclude = { filetypes = { "dashboard" } },
|
||||||
|
})
|
||||||
|
|
||||||
|
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
||||||
|
end,
|
||||||
|
}
|
14
lua/plugins/lazydev.lua
Normal file
14
lua/plugins/lazydev.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"folke/lazydev.nvim",
|
||||||
|
ft = "lua", -- only load on lua files
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
-- See the configuration section for more details
|
||||||
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
|
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ "folke/neodev.nvim", enabled = false }, -- make sure to uninstall or disable neodev.nvim
|
||||||
|
}
|
@ -1,8 +0,0 @@
|
|||||||
require("copilot_cmp").setup({
|
|
||||||
suggestion = { enabled = false },
|
|
||||||
panel = { enabled = false }
|
|
||||||
-- method = "getCompletionsCycling",
|
|
||||||
-- formatters = {
|
|
||||||
-- insert_text = require("copilot_cmp.format").remove_existing
|
|
||||||
-- }
|
|
||||||
})
|
|
@ -1,9 +0,0 @@
|
|||||||
require('plugins.lsp.copilot-cmp')
|
|
||||||
require('plugins.lsp.lsp-kind')
|
|
||||||
require('plugins.lsp.lspconfig')
|
|
||||||
-- require('plugins.lsp.lspfuzzy')
|
|
||||||
require('plugins.lsp.lsplines')
|
|
||||||
require('plugins.lsp.luasnip')
|
|
||||||
require('plugins.lsp.null-ls')
|
|
||||||
require('plugins.lsp.nvim-cmp')
|
|
||||||
require('plugins.lsp.nvim-lint')
|
|
@ -1 +0,0 @@
|
|||||||
-- require("lsp-format").setup {}
|
|
@ -1,33 +0,0 @@
|
|||||||
-- lspkind.lua
|
|
||||||
local lspkind = require("lspkind")
|
|
||||||
lspkind.init({
|
|
||||||
preset = 'default',
|
|
||||||
symbol_map = {
|
|
||||||
Copilot = "",
|
|
||||||
Function = "",
|
|
||||||
Text = "",
|
|
||||||
Method = "",
|
|
||||||
Operator = "",
|
|
||||||
Keyword = "",
|
|
||||||
Variable = "",
|
|
||||||
Field = "",
|
|
||||||
Class = "",
|
|
||||||
Interface = "",
|
|
||||||
Module = "",
|
|
||||||
Property = "",
|
|
||||||
Unit = "",
|
|
||||||
Value = "",
|
|
||||||
Enum = "",
|
|
||||||
Snippet = "",
|
|
||||||
Color = "",
|
|
||||||
File = "",
|
|
||||||
Reference = "",
|
|
||||||
Folder = "",
|
|
||||||
EnumMember = "",
|
|
||||||
Constant = "",
|
|
||||||
Struct = "",
|
|
||||||
Event = "",
|
|
||||||
TypeParameter = "",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"})
|
|
@ -1,203 +0,0 @@
|
|||||||
-- local opts = { noremap = true, silent = true }
|
|
||||||
-- vim.api.nvim_set_keymap('n', '<space>e',
|
|
||||||
-- '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
|
||||||
-- vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>',
|
|
||||||
-- opts)
|
|
||||||
-- vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>',
|
|
||||||
-- opts)
|
|
||||||
-- vim.api.nvim_set_keymap('n', '<space>q',
|
|
||||||
-- '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
|
||||||
-- Use an on_attach function to only map the following keys
|
|
||||||
-- after the language server attaches to the current buffer
|
|
||||||
local on_attach = function(client, bufnr)
|
|
||||||
-- Enable completion triggered by <c-x><c-o>
|
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
||||||
|
|
||||||
-- Mappings.
|
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
|
||||||
-- set in ~/.config/nvim/keybindings.vim
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-s>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
|
||||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
|
||||||
-- highlighting things under cursor
|
|
||||||
-- if client.resolved_capabilities.document_highlight then
|
|
||||||
-- vim.cmd [[
|
|
||||||
-- hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
|
|
||||||
-- hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
|
|
||||||
-- hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
|
|
||||||
-- augroup lsp_document_highlight
|
|
||||||
-- autocmd! * <buffer>
|
|
||||||
-- autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
|
||||||
-- autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
|
||||||
-- augroup END
|
|
||||||
-- ]]
|
|
||||||
-- end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]]
|
|
||||||
-- vim.cmd [[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]]
|
|
||||||
|
|
||||||
-- squared corners
|
|
||||||
|
|
||||||
-- local border = {
|
|
||||||
-- {"┌", "FloatBorder"},
|
|
||||||
-- {"─", "FloatBorder"},
|
|
||||||
-- {"┐", "FloatBorder"},
|
|
||||||
-- {"|", "FloatBorder"},
|
|
||||||
-- {"┘", "FloatBorder"},
|
|
||||||
-- {"─", "FloatBorder"},
|
|
||||||
-- {"└", "FloatBorder"},
|
|
||||||
-- {"|", "FloatBorder"},
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- rounded
|
|
||||||
|
|
||||||
local border = {
|
|
||||||
{ "╭", "FloatBorder" }, { "─", "FloatBorder" }, { "╮", "FloatBorder" },
|
|
||||||
{ "│", "FloatBorder" }, { "╯", "FloatBorder" }, { "─", "FloatBorder" },
|
|
||||||
{ "╰", "FloatBorder" }, { "│", "FloatBorder" }
|
|
||||||
}
|
|
||||||
|
|
||||||
local handlers = {
|
|
||||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover,
|
|
||||||
{ border = border }),
|
|
||||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers
|
|
||||||
.signature_help,
|
|
||||||
{ border = border })
|
|
||||||
}
|
|
||||||
|
|
||||||
-- local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
|
||||||
-- function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
|
||||||
-- opts = {
|
|
||||||
-- { "border", border },
|
|
||||||
-- }
|
|
||||||
-- opts.border = opts.border or border
|
|
||||||
-- return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
local DEFAULT_SETTINGS = {
|
|
||||||
ui = {
|
|
||||||
icons = {
|
|
||||||
-- The list icon to use for installed servers.
|
|
||||||
server_installed = "◍",
|
|
||||||
-- The list icon to use for servers that are pending installation.
|
|
||||||
server_pending = "◍",
|
|
||||||
-- The list icon to use for servers that are not installed.
|
|
||||||
server_uninstalled = "◍"
|
|
||||||
},
|
|
||||||
keymaps = {
|
|
||||||
-- Keymap to expand a server in the UI
|
|
||||||
toggle_server_expand = "<CR>",
|
|
||||||
-- Keymap to install a server
|
|
||||||
install_server = "i",
|
|
||||||
-- Keymap to reinstall/update a server
|
|
||||||
update_server = "u",
|
|
||||||
-- Keymap to update all installed servers
|
|
||||||
update_all_servers = "U",
|
|
||||||
-- Keymap to uninstall a server
|
|
||||||
uninstall_server = "X"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
-- The directory in which to install all servers.
|
|
||||||
-- install_root_dir = "/home/sudacode/.vim/lsp",
|
|
||||||
|
|
||||||
pip = {
|
|
||||||
-- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior
|
|
||||||
-- and is not recommended.
|
|
||||||
--
|
|
||||||
-- Example: { "--proxy", "https://proxyserver" }
|
|
||||||
install_args = {}
|
|
||||||
},
|
|
||||||
on_attach = on_attach,
|
|
||||||
handlers = handlers,
|
|
||||||
|
|
||||||
-- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
|
|
||||||
-- debugging issues with server installations.
|
|
||||||
log_level = vim.log.levels.INFO,
|
|
||||||
|
|
||||||
-- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
|
|
||||||
-- servers that are requested to be installed will be put in a queue.
|
|
||||||
max_concurrent_installers = 4
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
virtual_text = true,
|
|
||||||
signs = true,
|
|
||||||
underline = false,
|
|
||||||
update_in_insert = false,
|
|
||||||
severity_sort = true
|
|
||||||
})
|
|
||||||
|
|
||||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
|
||||||
for type, icon in pairs(signs) do
|
|
||||||
local hl = "DiagnosticSign" .. type
|
|
||||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
|
||||||
end
|
|
||||||
|
|
||||||
function PrintDiagnostics(opts, bufnr, line_nr, client_id)
|
|
||||||
bufnr = bufnr or 0
|
|
||||||
line_nr = line_nr or (vim.api.nvim_win_get_cursor(0)[1] - 1)
|
|
||||||
opts = opts or { ['lnum'] = line_nr }
|
|
||||||
|
|
||||||
local line_diagnostics = vim.diagnostic.get(bufnr, opts)
|
|
||||||
if vim.tbl_isempty(line_diagnostics) then return end
|
|
||||||
|
|
||||||
local diagnostic_message = ""
|
|
||||||
for i, diagnostic in ipairs(line_diagnostics) do
|
|
||||||
diagnostic_message = diagnostic_message ..
|
|
||||||
string.format("%d: %s", i,
|
|
||||||
diagnostic.message or "")
|
|
||||||
print(diagnostic_message)
|
|
||||||
if i ~= #line_diagnostics then
|
|
||||||
diagnostic_message = diagnostic_message .. "\n"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
vim.api.nvim_echo({ { diagnostic_message, "Normal" } }, false, {})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- vim.cmd [[ autocmd! CursorHold * lua PrintDiagnostics() ]]
|
|
||||||
|
|
||||||
-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished
|
|
||||||
-- or if the server is already installed).
|
|
||||||
|
|
||||||
-- local servers = { 'jedi_language_server', 'bashls', 'vimls', 'yamlls', 'dockerls', 'rust_analyzer', 'clangd', 'ansiblels' }
|
|
||||||
-- for _, lsp in pairs(servers) do
|
|
||||||
-- require('lspconfig')[lsp].setup {
|
|
||||||
-- on_attach = on_attach,
|
|
||||||
-- handlers = handlers,
|
|
||||||
-- flags = {
|
|
||||||
-- -- This will be the default in neovim 0.7+
|
|
||||||
-- debounce_text_changes = 150,
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- local plugins_path = vim.fn.stdpath("data") .. "site/autoload/plug.vim"
|
|
||||||
-- local dir_list = vim.fn.glob(plugins_path .. "/*", true, true)
|
|
||||||
-- local library_table = {}
|
|
||||||
-- for _, v in ipairs(dir_list) do
|
|
||||||
-- library_table[v .. "/lua"] = true
|
|
||||||
-- end
|
|
||||||
-- library_table[vim.fn.expand("$VIMRUNTIME/lua")] = true
|
|
||||||
-- library_table[vim.fn.stdpath("config") .. "/lua"] = true
|
|
||||||
-- require('lspconfig').sumneko_lua.setup({
|
|
||||||
-- settings = {
|
|
||||||
-- Lua = {
|
|
||||||
-- diagnostics = { globals = { "vim" } },
|
|
||||||
-- workspace = { library = library_table },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- -- require 'lspconfig'.bashls.setup {}
|
|
@ -1,16 +0,0 @@
|
|||||||
require('lspfuzzy').setup {
|
|
||||||
methods = 'all', -- either 'all' or a list of LSP methods (see below)
|
|
||||||
jump_one = true, -- jump immediately if there is only one location
|
|
||||||
save_last = false, -- save last location results for the :LspFuzzyLast command
|
|
||||||
callback = nil, -- callback called after jumping to a location
|
|
||||||
fzf_preview = { -- arguments to the FZF '--preview-window' option
|
|
||||||
'right:+{2}-/2' -- preview on the right and centered on entry
|
|
||||||
},
|
|
||||||
fzf_action = { -- FZF actions
|
|
||||||
['ctrl-t'] = 'tab split', -- go to location in a new tab
|
|
||||||
['ctrl-v'] = 'vsplit', -- go to location in a vertical split
|
|
||||||
['ctrl-x'] = 'split', -- go to location in a horizontal split
|
|
||||||
},
|
|
||||||
fzf_modifier = ':~:.', -- format FZF entries, see |filename-modifiers|
|
|
||||||
fzf_trim = false, -- trim FZF entries
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
require("lsp_lines").setup()
|
|
||||||
-- Disable virtual_text since it's redundant due to lsp_lines.
|
|
||||||
vim.diagnostic.config({ virtual_text = false })
|
|
||||||
|
|
||||||
vim.keymap.set("", "<Leader>tl", require("lsp_lines").toggle,
|
|
||||||
{ desc = "Toggle lsp_lines" })
|
|
@ -1 +0,0 @@
|
|||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
@ -1,58 +0,0 @@
|
|||||||
local null_ls = require("null-ls")
|
|
||||||
local helpers = require("null-ls.helpers")
|
|
||||||
-- syncronous formatting
|
|
||||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
|
||||||
require("null-ls").setup({
|
|
||||||
-- you can reuse a shared lspconfig on_attach callback here
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
if client.supports_method("textDocument/formatting") then
|
|
||||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
group = augroup,
|
|
||||||
buffer = bufnr,
|
|
||||||
callback = function()
|
|
||||||
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
|
|
||||||
-- on later neovim version, you should use vim.lsp.buf.format({ async = false }) instead
|
|
||||||
-- vim.lsp.buf.formatting_sync()
|
|
||||||
vim.lsp.buf.format({
|
|
||||||
async = false,
|
|
||||||
bufnr = bufnr,
|
|
||||||
filter = function(client)
|
|
||||||
return client.name == "null-ls"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
sources = {
|
|
||||||
null_ls.builtins.completion.luasnip,
|
|
||||||
null_ls.builtins.formatting.black,
|
|
||||||
null_ls.builtins.formatting.isort,
|
|
||||||
null_ls.builtins.diagnostics.mypy,
|
|
||||||
null_ls.builtins.diagnostics.markdownlint,
|
|
||||||
null_ls.builtins.diagnostics.pylint,
|
|
||||||
-- null_ls.builtins.diagnostics.pydoclint,
|
|
||||||
null_ls.builtins.formatting.stylua,
|
|
||||||
null_ls.builtins.formatting.markdownlint,
|
|
||||||
null_ls.builtins.formatting.prettier, -- handled by lsp server
|
|
||||||
null_ls.builtins.formatting.shfmt.with({
|
|
||||||
filetypes = { "sh", "bash" },
|
|
||||||
extra_args = { "-i", "0", "-ci", "-sr" },
|
|
||||||
}),
|
|
||||||
-- null_ls.builtins.diagnostics.actionlint,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- null_ls.setup({
|
|
||||||
-- on_attach = function(client)
|
|
||||||
-- if client.supports_method "textDocument/formatting" then
|
|
||||||
-- vim.cmd([[
|
|
||||||
-- augroup LspFormatting
|
|
||||||
-- autocmd! * <buffer>
|
|
||||||
-- autocmd BufWritePre <buffer> lua vim.lsp.buf.format()
|
|
||||||
-- augroup END
|
|
||||||
-- ]])
|
|
||||||
-- end
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
@ -1,274 +0,0 @@
|
|||||||
-- Setup nvim-cmp.
|
|
||||||
local cmp = require 'cmp'
|
|
||||||
local lspkind = require('lspkind')
|
|
||||||
local lspconfig = require('lspconfig')
|
|
||||||
-- luasnip setup
|
|
||||||
local luasnip = require 'luasnip'
|
|
||||||
local highlight = require('cmp.utils.highlight')
|
|
||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
|
|
||||||
local has_words_before = function()
|
|
||||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and
|
|
||||||
vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match(
|
|
||||||
"^%s*$") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
lspkind.init({ symbol_map = { Copilot = "" } })
|
|
||||||
|
|
||||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
||||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
|
||||||
end
|
|
||||||
},
|
|
||||||
capabilities = capabilities,
|
|
||||||
mapping = {
|
|
||||||
['<C-p>'] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
['<C-n>'] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { 'i', 's' }),
|
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = false
|
|
||||||
},
|
|
||||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
-- if cmp.visible() then
|
|
||||||
-- cmp.select_next_item()
|
|
||||||
-- elseif luasnip.expand_or_jumpable() then
|
|
||||||
-- luasnip.expand_or_jump()
|
|
||||||
-- else
|
|
||||||
-- fallback()
|
|
||||||
-- end
|
|
||||||
-- end, { "i", "s" }),
|
|
||||||
["<Tab>"] = vim.schedule_wrap(function(fallback)
|
|
||||||
if cmp.visible() and has_words_before() then
|
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
['<S-Tab>'] = cmp.mapping(function()
|
|
||||||
if cmp.visible() then cmp.select_prev_item() end
|
|
||||||
end, { "i", "s" })
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = {
|
|
||||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
|
||||||
col_offset = -3,
|
|
||||||
side_padding = 0,
|
|
||||||
border = "rounded",
|
|
||||||
borderchars = {
|
|
||||||
"─", "│", "─", "│", "╭", "╮", "╯", "╰"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
documentation = {
|
|
||||||
border = "rounded",
|
|
||||||
borderchars = {
|
|
||||||
"─", "│", "─", "│", "╭", "╮", "╯", "╰"
|
|
||||||
}
|
|
||||||
-- padding = 15,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
formatting = {
|
|
||||||
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
|
|
||||||
-- mode = 'symbol_text',
|
|
||||||
fields = { "kind", "abbr", "menu" },
|
|
||||||
format = function(entry, vim_item)
|
|
||||||
local kind = require("lspkind").cmp_format({
|
|
||||||
mode = "symbol_text",
|
|
||||||
maxwidth = 75,
|
|
||||||
symbol_map = {
|
|
||||||
Copilot = "",
|
|
||||||
Function = "",
|
|
||||||
Text = "",
|
|
||||||
Method = "",
|
|
||||||
Operator = "",
|
|
||||||
Keyword = "",
|
|
||||||
Variable = "",
|
|
||||||
Field = "",
|
|
||||||
Class = "",
|
|
||||||
Interface = "",
|
|
||||||
Module = "",
|
|
||||||
Property = "",
|
|
||||||
Unit = "",
|
|
||||||
Value = "",
|
|
||||||
Enum = "",
|
|
||||||
Snippet = "",
|
|
||||||
Color = "",
|
|
||||||
File = "",
|
|
||||||
Reference = "",
|
|
||||||
Folder = "",
|
|
||||||
EnumMember = "",
|
|
||||||
Constant = "",
|
|
||||||
Struct = "",
|
|
||||||
Event = "",
|
|
||||||
TypeParameter = ""
|
|
||||||
}
|
|
||||||
})(entry, vim_item)
|
|
||||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
|
||||||
kind.kind = " " .. strings[1] .. " "
|
|
||||||
kind.menu = " (" .. strings[2] .. ")"
|
|
||||||
|
|
||||||
return kind
|
|
||||||
end
|
|
||||||
-- format = lspkind.cmp_format({
|
|
||||||
-- mode = 'symbol_text', -- show only symbol annotations
|
|
||||||
-- menu = ({
|
|
||||||
-- buffer = "[Buffer]",
|
|
||||||
-- nvim_lsp = "[LSP]",
|
|
||||||
-- luasnip = "[LuaSnip]",
|
|
||||||
-- nvim_lua = "[Lua]",
|
|
||||||
-- latex_symbols = "[Latex]",
|
|
||||||
-- })
|
|
||||||
-- })
|
|
||||||
},
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "copilot", group_index = 2 },
|
|
||||||
{ name = "codecompanion", group_index = 2 },
|
|
||||||
{ name = "path", group_index = 2 },
|
|
||||||
{ name = 'nvim_lsp', group_index = 2 },
|
|
||||||
{ name = 'nvim_lsp_signature_help', group_index = 2 },
|
|
||||||
{ name = 'nvim_lsp_document_symbol', group_index = 2 },
|
|
||||||
{ name = 'vim-dadbod-completion', group_index = 2 },
|
|
||||||
{ name = 'neorg', group_index = 2 }, -- For luasnip users.
|
|
||||||
{ name = 'luasnip', group_index = 2 }, -- For luasnip users.
|
|
||||||
{
|
|
||||||
name = 'buffer',
|
|
||||||
option = {
|
|
||||||
get_bufnrs = function()
|
|
||||||
local bufs = {}
|
|
||||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
|
||||||
bufs[vim.api.nvim_win_get_buf(win)] = true
|
|
||||||
end
|
|
||||||
return vim.tbl_keys(bufs)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
|
||||||
-- { name = 'snippy' }, -- For snippy users.
|
|
||||||
}, { { name = 'buffer' } }),
|
|
||||||
sorting = {
|
|
||||||
priority_weight = 2,
|
|
||||||
comparators = {
|
|
||||||
require("copilot_cmp.comparators").prioritize,
|
|
||||||
cmp.config.compare.offset,
|
|
||||||
cmp.config.compare.exact,
|
|
||||||
require("copilot_cmp.comparators").score,
|
|
||||||
require("copilot_cmp.comparators").recently_used,
|
|
||||||
cmp.config.compare.locality,
|
|
||||||
require("copilot_cmp.comparators").kind,
|
|
||||||
require("copilot_cmp.comparators").sort_text,
|
|
||||||
require("copilot_cmp.comparators").length,
|
|
||||||
require("copilot_cmp.comparators").order,
|
|
||||||
|
|
||||||
-- Below is the default comparitor list and order for nvim-cmp
|
|
||||||
cmp.config.compare.offset,
|
|
||||||
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
|
||||||
cmp.config.compare.exact, cmp.config.compare.score,
|
|
||||||
cmp.config.compare.recently_used, cmp.config.compare.locality,
|
|
||||||
cmp.config.compare.kind, cmp.config.compare.sort_text,
|
|
||||||
cmp.config.compare.length, cmp.config.compare.order
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
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 = { 'Man', '!' } } }
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
local servers = {
|
|
||||||
'bashls', 'jedi_language_server', 'jsonls', 'yamlls', 'vimls', 'dotls', 'dockerls',
|
|
||||||
'html', 'cssls', 'lua_ls', 'eslint', 'ts_ls', 'angularls', 'ansiblels'
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
|
||||||
if lsp == 'lua_ls' then
|
|
||||||
lspconfig[lsp].setup {
|
|
||||||
-- on_attach = require("lsp-format").on_attach,
|
|
||||||
on_init = function(client)
|
|
||||||
if client.workspace_folders then
|
|
||||||
local path = client.workspace_folders[1].name
|
|
||||||
if path ~= vim.fn.stdpath('config') and (vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc')) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
|
||||||
runtime = {
|
|
||||||
-- Tell the language server which version of Lua you're using
|
|
||||||
-- (most likely LuaJIT in the case of Neovim)
|
|
||||||
version = 'LuaJIT'
|
|
||||||
},
|
|
||||||
-- Make the server aware of Neovim runtime files
|
|
||||||
workspace = {
|
|
||||||
checkThirdParty = false,
|
|
||||||
library = {
|
|
||||||
vim.env.VIMRUNTIME
|
|
||||||
-- Depending on the usage, you might want to add additional paths here.
|
|
||||||
-- "${3rd}/luv/library"
|
|
||||||
-- "${3rd}/busted/library",
|
|
||||||
}
|
|
||||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
|
||||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
capabilities = capabilities,
|
|
||||||
callSnippet = "Replace",
|
|
||||||
settings = {
|
|
||||||
Lua = {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
lspconfig[lsp].setup {
|
|
||||||
-- on_attach = require("lsp-format").on_attach,
|
|
||||||
capabilities = capabilities
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- cmp.event:on("menu_opened",
|
|
||||||
-- function() vim.b.copilot_suggestion_hidden = true end)
|
|
||||||
-- cmp.event:on("menu_closed",
|
|
||||||
-- function() vim.b.copilot_suggestion_hidden = false end)
|
|
@ -1,21 +0,0 @@
|
|||||||
require('lint').linters_by_ft = {
|
|
||||||
markdown = { 'markdownlint' },
|
|
||||||
lua = { 'luacheck', 'luac' },
|
|
||||||
vim = { 'vint' },
|
|
||||||
sh = { 'shellcheck' },
|
|
||||||
pyton = { 'pycodestyle', 'black', 'pydocstyle', 'pylint' },
|
|
||||||
json = { 'jsonlint' },
|
|
||||||
yaml = { 'yamllint' }
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
|
||||||
callback = function()
|
|
||||||
-- try_lint without arguments runs the linters defined in `linters_by_ft`
|
|
||||||
-- for the current filetype
|
|
||||||
require("lint").try_lint()
|
|
||||||
|
|
||||||
-- You can call `try_lint` with a linter name or a list of names to always
|
|
||||||
-- run specific linters, independent of the `linters_by_ft` configuration
|
|
||||||
-- require("lint").try_lint("cspell")
|
|
||||||
end,
|
|
||||||
})
|
|
9
lua/plugins/lsp_lines.lua
Normal file
9
lua/plugins/lsp_lines.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
return {
|
||||||
|
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
|
||||||
|
config = function()
|
||||||
|
-- lsp_lines
|
||||||
|
vim.diagnostic.config({ virtual_text = false })
|
||||||
|
-- --
|
||||||
|
vim.keymap.set("", "<Leader>tl", require("lsp_lines").toggle, { desc = "Toggle lsp_lines" })
|
||||||
|
end,
|
||||||
|
}
|
78
lua/plugins/lspconfig.lua
Normal file
78
lua/plugins/lspconfig.lua
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
return {
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = { "saghen/blink.cmp" },
|
||||||
|
config = function()
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
|
vim.notify = require("notify")
|
||||||
|
local servers = {
|
||||||
|
"bashls",
|
||||||
|
"jedi_language_server",
|
||||||
|
"jsonls",
|
||||||
|
"yamlls",
|
||||||
|
"vimls",
|
||||||
|
"dotls",
|
||||||
|
"dockerls",
|
||||||
|
"html",
|
||||||
|
"cssls",
|
||||||
|
"lua_ls",
|
||||||
|
"eslint",
|
||||||
|
"ts_ls",
|
||||||
|
"angularls",
|
||||||
|
"ansiblels",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, lsp in ipairs(servers) do
|
||||||
|
if lsp == "lua_ls" then
|
||||||
|
lspconfig[lsp].setup({
|
||||||
|
-- on_attach = require("lsp-format").on_attach,
|
||||||
|
on_attach = function()
|
||||||
|
vim.notify("Lua LSP attached", nil, { title = "LSP" })
|
||||||
|
end,
|
||||||
|
on_init = function(client)
|
||||||
|
if client.workspace_folders then
|
||||||
|
local path = client.workspace_folders[1].name
|
||||||
|
if
|
||||||
|
path ~= vim.fn.stdpath("config")
|
||||||
|
and (
|
||||||
|
vim.loop.fs_stat(path .. "/.luarc.json")
|
||||||
|
or vim.loop.fs_stat(path .. "/.luarc.jsonc")
|
||||||
|
)
|
||||||
|
then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
|
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using
|
||||||
|
-- (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = "LuaJIT",
|
||||||
|
},
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
workspace = {
|
||||||
|
checkThirdParty = false,
|
||||||
|
library = {
|
||||||
|
vim.env.VIMRUNTIME,
|
||||||
|
-- Depending on the usage, you might want to add additional paths here.
|
||||||
|
-- "${3rd}/luv/library"
|
||||||
|
-- "${3rd}/busted/library",
|
||||||
|
},
|
||||||
|
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
||||||
|
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
callSnippet = "Replace",
|
||||||
|
settings = {
|
||||||
|
Lua = {},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
else
|
||||||
|
lspconfig[lsp].setup({
|
||||||
|
on_attach = function()
|
||||||
|
vim.notify(lsp .. " LSP attached", nil, { title = "LSP" })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
}
|
1
lua/plugins/lspkind.lua
Normal file
1
lua/plugins/lspkind.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { "onsails/lspkind.nvim" }
|
137
lua/plugins/lualine.lua
Normal file
137
lua/plugins/lualine.lua
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
config = function()
|
||||||
|
local M = require("lualine.component"):extend()
|
||||||
|
|
||||||
|
M.processing = false
|
||||||
|
M.spinner_index = 1
|
||||||
|
|
||||||
|
local spinner_symbols = {
|
||||||
|
"⠋",
|
||||||
|
"⠙",
|
||||||
|
"⠹",
|
||||||
|
"⠸",
|
||||||
|
"⠼",
|
||||||
|
"⠴",
|
||||||
|
"⠦",
|
||||||
|
"⠧",
|
||||||
|
"⠇",
|
||||||
|
"⠏",
|
||||||
|
}
|
||||||
|
local spinner_symbols_len = 10
|
||||||
|
|
||||||
|
-- Initializer
|
||||||
|
function M:init(options)
|
||||||
|
M.super.init(self, options)
|
||||||
|
|
||||||
|
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "User" }, {
|
||||||
|
pattern = "CodeCompanionRequest*",
|
||||||
|
group = group,
|
||||||
|
callback = function(request)
|
||||||
|
if request.match == "CodeCompanionRequestStarted" then
|
||||||
|
self.processing = true
|
||||||
|
elseif request.match == "CodeCompanionRequestFinished" then
|
||||||
|
self.processing = false
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Function that runs every time statusline is updated
|
||||||
|
function M:update_status()
|
||||||
|
if self.processing then
|
||||||
|
self.spinner_index = (self.spinner_index % spinner_symbols_len) + 1
|
||||||
|
return spinner_symbols[self.spinner_index]
|
||||||
|
else
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
require('lualine').setup({
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = "catppuccin",
|
||||||
|
-- theme = 'dracula',
|
||||||
|
-- theme = 'horizon',
|
||||||
|
-- theme = 'onedark',
|
||||||
|
component_separators = { left = "", right = "" },
|
||||||
|
section_separators = { left = "", right = "" },
|
||||||
|
disabled_filetypes = {},
|
||||||
|
always_divide_middle = true,
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = { "mode" },
|
||||||
|
lualine_b = { "branch", "diff" },
|
||||||
|
lualine_c = { "filename" },
|
||||||
|
lualine_x = {
|
||||||
|
M,
|
||||||
|
{
|
||||||
|
"copilot",
|
||||||
|
symbols = {
|
||||||
|
status = {
|
||||||
|
icons = {
|
||||||
|
enabled = " ",
|
||||||
|
sleep = " ", -- auto-trigger disabled
|
||||||
|
disabled = " ",
|
||||||
|
warning = " ",
|
||||||
|
unknown = " ",
|
||||||
|
},
|
||||||
|
hl = {
|
||||||
|
enabled = "#50FA7B",
|
||||||
|
sleep = "#AEB7D0",
|
||||||
|
disabled = "#6272A4",
|
||||||
|
warning = "#FFB86C",
|
||||||
|
unknown = "#FF5555",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
spinners = "dots", -- has some premade spinners
|
||||||
|
spinner_color = "#6272A4",
|
||||||
|
},
|
||||||
|
show_colors = false,
|
||||||
|
show_loading = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"diagnostics",
|
||||||
|
"fileformat",
|
||||||
|
symbols = {
|
||||||
|
unix = "", -- e712
|
||||||
|
dos = "", -- e70f
|
||||||
|
mac = "", -- e711
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"encoding",
|
||||||
|
"fileformat",
|
||||||
|
{ "filetype", colored = true, icon_only = false },
|
||||||
|
},
|
||||||
|
lualine_y = { "progress" },
|
||||||
|
lualine_z = { "location" },
|
||||||
|
},
|
||||||
|
inactive_sections = {
|
||||||
|
lualine_a = {},
|
||||||
|
lualine_b = {},
|
||||||
|
lualine_c = {
|
||||||
|
{
|
||||||
|
"filename",
|
||||||
|
file_status = true, -- Displays file status (readonly status, modified status)
|
||||||
|
path = 0, -- 0: Just the filename
|
||||||
|
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||||
|
symbols = {
|
||||||
|
modified = "[+]", -- Text to show when the file is modified.
|
||||||
|
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||||
|
unnamed = "[No Name]", -- Text to show for unnamed buffers.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
M,
|
||||||
|
},
|
||||||
|
lualine_x = { "location" },
|
||||||
|
lualine_y = {},
|
||||||
|
lualine_z = {},
|
||||||
|
},
|
||||||
|
tabline = {},
|
||||||
|
extensions = { "quickfix", "fzf", "nvim-tree", "symbols-outline", "fugitive" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
depends = { "kyazdani42/nvim-web-devicons" },
|
||||||
|
}
|
7
lua/plugins/luasnip.lua
Normal file
7
lua/plugins/luasnip.lua
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
-- follow latest release.
|
||||||
|
version = "v2.*", -- Replace <CurrentMajor> by the latest released major (first number of latest release)
|
||||||
|
-- install jsregexp (optional!).
|
||||||
|
build = "make install_jsregexp",
|
||||||
|
}
|
63
lua/plugins/mini.lua
Normal file
63
lua/plugins/mini.lua
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
return {
|
||||||
|
"echasnovski/mini.diff",
|
||||||
|
depends = "echasnovski/mini.nvim",
|
||||||
|
opts = {
|
||||||
|
|
||||||
|
-- Options for how hunks are visualized
|
||||||
|
view = {
|
||||||
|
-- Visualization style. Possible values are 'sign' and 'number'.
|
||||||
|
-- Default: 'number' if line numbers are enabled, 'sign' otherwise.
|
||||||
|
style = vim.go.number and "number" or "sign",
|
||||||
|
|
||||||
|
-- Signs used for hunks with 'sign' view
|
||||||
|
signs = { add = "▒", change = "▒", delete = "▒" },
|
||||||
|
|
||||||
|
-- Priority of used visualization extmarks
|
||||||
|
priority = 199,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Source for how reference text is computed/updated/etc
|
||||||
|
-- Uses content from Git index by default
|
||||||
|
source = nil,
|
||||||
|
|
||||||
|
-- Delays (in ms) defining asynchronous processes
|
||||||
|
delay = {
|
||||||
|
-- How much to wait before update following every text change
|
||||||
|
text_change = 200,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Module mappings. Use `''` (empty string) to disable one.
|
||||||
|
mappings = {
|
||||||
|
-- Apply hunks inside a visual/operator region
|
||||||
|
apply = "gh",
|
||||||
|
|
||||||
|
-- Reset hunks inside a visual/operator region
|
||||||
|
reset = "gH",
|
||||||
|
|
||||||
|
-- Hunk range textobject to be used inside operator
|
||||||
|
-- Works also in Visual mode if mapping differs from apply and reset
|
||||||
|
textobject = "gh",
|
||||||
|
|
||||||
|
-- Go to hunk range in corresponding direction
|
||||||
|
goto_first = "[H",
|
||||||
|
goto_prev = "[h",
|
||||||
|
goto_next = "]h",
|
||||||
|
goto_last = "]H",
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Various options
|
||||||
|
options = {
|
||||||
|
-- Diff algorithm. See `:h vim.diff()`.
|
||||||
|
algorithm = "histogram",
|
||||||
|
|
||||||
|
-- Whether to use "indent heuristic". See `:h vim.diff()`.
|
||||||
|
indent_heuristic = true,
|
||||||
|
|
||||||
|
-- The amount of second-stage diff to align lines (in Neovim>=0.9)
|
||||||
|
linematch = 60,
|
||||||
|
|
||||||
|
-- Whether to wrap around edges during hunk navigation
|
||||||
|
wrap_goto = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
1
lua/plugins/nio.lua
Normal file
1
lua/plugins/nio.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { "nvim-neotest/nvim-nio" }
|
65
lua/plugins/none-ls.lua
Normal file
65
lua/plugins/none-ls.lua
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
return {
|
||||||
|
"nvimtools/none-ls.nvim",
|
||||||
|
config = function()
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
local helpers = require("null-ls.helpers")
|
||||||
|
-- syncronous formatting
|
||||||
|
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||||
|
|
||||||
|
-- null_ls.setup({
|
||||||
|
-- on_attach = function(client)
|
||||||
|
-- if client.supports_method "textDocument/formatting" then
|
||||||
|
-- vim.cmd([[
|
||||||
|
-- augroup LspFormatting
|
||||||
|
-- autocmd! * <buffer>
|
||||||
|
-- autocmd BufWritePre <buffer> lua vim.lsp.buf.format()
|
||||||
|
-- augroup END
|
||||||
|
-- ]])
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
-- you can reuse a shared lspconfig on_attach callback here
|
||||||
|
|
||||||
|
|
||||||
|
require('null-ls').setup({
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
group = augroup,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
|
||||||
|
-- on later neovim version, you should use vim.lsp.buf.format({ async = false }) instead
|
||||||
|
-- vim.lsp.buf.formatting_sync()
|
||||||
|
vim.lsp.buf.format({
|
||||||
|
async = false,
|
||||||
|
bufnr = bufnr,
|
||||||
|
filter = function(client)
|
||||||
|
return client.name == "null-ls"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
sources = {
|
||||||
|
null_ls.builtins.completion.luasnip,
|
||||||
|
null_ls.builtins.formatting.black,
|
||||||
|
null_ls.builtins.formatting.isort,
|
||||||
|
null_ls.builtins.diagnostics.mypy,
|
||||||
|
null_ls.builtins.diagnostics.markdownlint,
|
||||||
|
null_ls.builtins.diagnostics.pylint,
|
||||||
|
-- null_ls.builtins.diagnostics.pydoclint,
|
||||||
|
null_ls.builtins.formatting.stylua,
|
||||||
|
null_ls.builtins.formatting.markdownlint,
|
||||||
|
null_ls.builtins.formatting.prettier, -- handled by lsp server
|
||||||
|
null_ls.builtins.formatting.shfmt.with({
|
||||||
|
filetypes = { "sh", "bash" },
|
||||||
|
extra_args = { "-i", "0", "-ci", "-sr" },
|
||||||
|
}),
|
||||||
|
-- null_ls.builtins.diagnostics.actionlint,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
20
lua/plugins/notify.lua
Normal file
20
lua/plugins/notify.lua
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
return {
|
||||||
|
"rcarriga/nvim-notify",
|
||||||
|
opts = {
|
||||||
|
background_colour = "#000000",
|
||||||
|
fps = 144,
|
||||||
|
icons = {
|
||||||
|
DEBUG = "",
|
||||||
|
ERROR = "",
|
||||||
|
INFO = "",
|
||||||
|
TRACE = "✎",
|
||||||
|
WARN = "",
|
||||||
|
},
|
||||||
|
level = 2,
|
||||||
|
minimum_width = 50,
|
||||||
|
render = "default",
|
||||||
|
stages = "fade_in_slide_out",
|
||||||
|
timeout = 5000,
|
||||||
|
top_down = true,
|
||||||
|
},
|
||||||
|
}
|
26
lua/plugins/nvim-autopairs.lua
Normal file
26
lua/plugins/nvim-autopairs.lua
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
return {
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
event = "InsertEnter",
|
||||||
|
config = true,
|
||||||
|
opts = {
|
||||||
|
enabled = function(bufnr)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
disable_filetype = { "TelescopePrompt", "spectre_panel" },
|
||||||
|
disable_in_macro = true, -- disable when recording or executing a macro
|
||||||
|
disable_in_visualblock = false, -- disable when insert after visual block mode
|
||||||
|
disable_in_replace_mode = true,
|
||||||
|
ignored_next_char = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||||
|
enable_moveright = true,
|
||||||
|
enable_afterquote = true, -- add bracket pairs after quote
|
||||||
|
enable_check_bracket_line = true, --- check bracket in same line
|
||||||
|
enable_bracket_in_quote = true, --
|
||||||
|
enable_abbr = false, -- trigger abbreviation
|
||||||
|
break_undo = true, -- switch for basic rule break undo sequence
|
||||||
|
check_ts = false,
|
||||||
|
map_cr = true,
|
||||||
|
map_bs = true, -- map the <BS> key
|
||||||
|
map_c_h = false, -- Map the <C-h> key to delete a pair
|
||||||
|
map_c_w = false, -- map <c-w> to delete a pair if possible
|
||||||
|
},
|
||||||
|
}
|
263
lua/plugins/nvim-cmp.lua
Normal file
263
lua/plugins/nvim-cmp.lua
Normal file
@ -0,0 +1,263 @@
|
|||||||
|
return {
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"saadparwaiz1/cmp_luasnip",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||||
|
"hrsh7th/cmp-nvim-lsp-document-symbol",
|
||||||
|
-- "hrsh7th/cmp-nvim-lsp",
|
||||||
|
-- "hrsh7th/cmp-path",
|
||||||
|
"rafamadriz/friendly-snippets",
|
||||||
|
"Jezda1337/nvim-html-css",
|
||||||
|
"https://codeberg.org/FelipeLema/cmp-async-path",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- Setup nvim-cmp.
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local lspkind = require("lspkind")
|
||||||
|
-- luasnip setup
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||||
|
|
||||||
|
local has_words_before = function()
|
||||||
|
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil
|
||||||
|
end
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
|
lspkind.init({ symbol_map = { Copilot = "" } })
|
||||||
|
|
||||||
|
cmp.setup.cmdline("/", {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp_document_symbol" },
|
||||||
|
}, {
|
||||||
|
{ name = "buffer" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.setup.cmdline(":", {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({ { name = "path" } }, {
|
||||||
|
{ name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
|
||||||
|
}),
|
||||||
|
matching = { disallow_symbol_nonprefix_matching = false },
|
||||||
|
})
|
||||||
|
|
||||||
|
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||||
|
|
||||||
|
require('cmp').setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||||
|
luasnip.lsp_expand(args.body) -- For `luasnip` users.
|
||||||
|
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||||
|
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = {
|
||||||
|
["<C-p>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<C-n>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
|
select = false,
|
||||||
|
}),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() and has_words_before() then
|
||||||
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
|
elseif luasnip.locally_jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
},
|
||||||
|
window = {
|
||||||
|
completion = {
|
||||||
|
-- winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||||
|
col_offset = 0,
|
||||||
|
side_padding = 0,
|
||||||
|
border = "rounded",
|
||||||
|
borderchars = {
|
||||||
|
"─",
|
||||||
|
"│",
|
||||||
|
"─",
|
||||||
|
"│",
|
||||||
|
"╭",
|
||||||
|
"╮",
|
||||||
|
"╯",
|
||||||
|
"╰",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documentation = {
|
||||||
|
border = "rounded",
|
||||||
|
borderchars = {
|
||||||
|
"─",
|
||||||
|
"│",
|
||||||
|
"─",
|
||||||
|
"│",
|
||||||
|
"╭",
|
||||||
|
"╮",
|
||||||
|
"╯",
|
||||||
|
"╰",
|
||||||
|
},
|
||||||
|
-- padding = 15,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
|
||||||
|
-- mode = 'symbol_text',
|
||||||
|
fields = { "kind", "abbr", "menu" },
|
||||||
|
expandable_indicator = true,
|
||||||
|
format = function(entry, vim_item)
|
||||||
|
local kind = require("lspkind").cmp_format({
|
||||||
|
mode = "symbol_text",
|
||||||
|
-- mode = "symbol",
|
||||||
|
maxwidth = 75,
|
||||||
|
symbol_map = {
|
||||||
|
Copilot = " ",
|
||||||
|
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 = " ",
|
||||||
|
},
|
||||||
|
})(entry, vim_item)
|
||||||
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
|
kind.kind = " " .. strings[1] .. " "
|
||||||
|
kind.menu = " (" .. strings[2] .. ")"
|
||||||
|
|
||||||
|
return kind
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp_signature_help", group_index = 0 },
|
||||||
|
{ name = "lazydev", group_index = 0 },
|
||||||
|
{ name = "nvim_lsp", group_index = 1 },
|
||||||
|
{ name = "copilot", group_index = 1 },
|
||||||
|
{ name = "codecompanion", group_index = 1 },
|
||||||
|
{ name = "async_path", group_index = 2 },
|
||||||
|
-- { name = "path", group_index = 2 },
|
||||||
|
-- { name = "cmdline", option = { ignore_cmds = { "Man", "!" } } },
|
||||||
|
{ name = "nvim_lsp_document_symbol", group_index = 2 },
|
||||||
|
{ name = "luasnip", group_index = 2 }, -- For luasnip users.
|
||||||
|
{ name = "render-markdown", group_index = 2 },
|
||||||
|
{
|
||||||
|
name = "html-css",
|
||||||
|
group_indx = 2,
|
||||||
|
option = {
|
||||||
|
enable_on = { "html", "jsx", "tsx", "typescript", "typescriptreact" }, -- html is enabled by default
|
||||||
|
notify = false,
|
||||||
|
documentation = {
|
||||||
|
auto_show = true, -- show documentation on select
|
||||||
|
},
|
||||||
|
-- add any external scss like one below
|
||||||
|
style_sheets = {
|
||||||
|
"https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css",
|
||||||
|
"https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name = "buffer",
|
||||||
|
option = {
|
||||||
|
get_bufnrs = function()
|
||||||
|
local bufs = {}
|
||||||
|
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||||
|
bufs[vim.api.nvim_win_get_buf(win)] = true
|
||||||
|
end
|
||||||
|
return vim.tbl_keys(bufs)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||||
|
-- { name = 'snippy' }, -- For snippy users.
|
||||||
|
}, { { name = "buffer" } }),
|
||||||
|
sorting = {
|
||||||
|
priority_weight = 2,
|
||||||
|
comparators = {
|
||||||
|
require("copilot_cmp.comparators").prioritize,
|
||||||
|
cmp.config.compare.offset,
|
||||||
|
cmp.config.compare.exact,
|
||||||
|
require("copilot_cmp.comparators").score,
|
||||||
|
require("copilot_cmp.comparators").recently_used,
|
||||||
|
cmp.config.compare.locality,
|
||||||
|
require("copilot_cmp.comparators").kind,
|
||||||
|
require("copilot_cmp.comparators").sort_text,
|
||||||
|
require("copilot_cmp.comparators").length,
|
||||||
|
require("copilot_cmp.comparators").order,
|
||||||
|
|
||||||
|
-- Below is the default comparitor list and order for nvim-cmp
|
||||||
|
cmp.config.compare.offset,
|
||||||
|
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
||||||
|
cmp.config.compare.exact,
|
||||||
|
cmp.config.compare.score,
|
||||||
|
cmp.config.compare.recently_used,
|
||||||
|
cmp.config.compare.locality,
|
||||||
|
cmp.config.compare.kind,
|
||||||
|
cmp.config.compare.sort_text,
|
||||||
|
cmp.config.compare.length,
|
||||||
|
cmp.config.compare.order,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
}
|
6
lua/plugins/nvim-colorizer.lua
Normal file
6
lua/plugins/nvim-colorizer.lua
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
return {
|
||||||
|
"norcalli/nvim-colorizer.lua",
|
||||||
|
config = function()
|
||||||
|
require("colorizer").setup()
|
||||||
|
end,
|
||||||
|
}
|
14
lua/plugins/nvim-lint.lua
Normal file
14
lua/plugins/nvim-lint.lua
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
return {
|
||||||
|
"mfussenegger/nvim-lint",
|
||||||
|
config = function()
|
||||||
|
require("lint").linters_by_ft = {
|
||||||
|
markdown = { "markdownlint" },
|
||||||
|
lua = { "luacheck" },
|
||||||
|
py = { "pylint", "pydocstyle", "pycodestyle", "mypy" },
|
||||||
|
sh = { "shellcheck" },
|
||||||
|
json = { "jsonlint" },
|
||||||
|
yaml = { "yamllint" },
|
||||||
|
vim = { "vint" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
11
lua/plugins/nvim-tree.lua
Normal file
11
lua/plugins/nvim-tree.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
return {
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
version = "*",
|
||||||
|
lazy = false,
|
||||||
|
dependencies = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("nvim-tree").setup({})
|
||||||
|
end,
|
||||||
|
}
|
3
lua/plugins/plenary.lua
Normal file
3
lua/plugins/plenary.lua
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
return {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
}
|
25
lua/plugins/presence.lua
Normal file
25
lua/plugins/presence.lua
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
return {
|
||||||
|
"andweeb/presence.nvim",
|
||||||
|
opts = {
|
||||||
|
-- General options
|
||||||
|
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
|
||||||
|
neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
|
||||||
|
main_image = "neovim", -- Main image display (either "neovim" or "file")
|
||||||
|
-- client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
|
||||||
|
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
|
||||||
|
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
|
||||||
|
enable_line_number = false, -- Displays the current line number instead of the current project
|
||||||
|
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
||||||
|
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
|
||||||
|
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
|
||||||
|
|
||||||
|
-- Rich Presence text options
|
||||||
|
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
|
||||||
|
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
|
||||||
|
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
|
||||||
|
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
|
||||||
|
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
|
||||||
|
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
|
||||||
|
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
|
||||||
|
},
|
||||||
|
}
|
24
lua/plugins/rainbow-delimeters.lua
Normal file
24
lua/plugins/rainbow-delimeters.lua
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
return {
|
||||||
|
"HiPhish/rainbow-delimiters.nvim",
|
||||||
|
config = function()
|
||||||
|
-- This module contains a number of default definitions
|
||||||
|
local rainbow_delimiters = require("rainbow-delimiters")
|
||||||
|
|
||||||
|
vim.g.rainbow_delimiters = {
|
||||||
|
strategy = {
|
||||||
|
[""] = rainbow_delimiters.strategy["global"],
|
||||||
|
vim = rainbow_delimiters.strategy["local"],
|
||||||
|
},
|
||||||
|
query = { [""] = "rainbow-delimiters", lua = "rainbow-blocks" },
|
||||||
|
highlight = {
|
||||||
|
"RainbowDelimiterRed",
|
||||||
|
"RainbowDelimiterYellow",
|
||||||
|
"RainbowDelimiterBlue",
|
||||||
|
"RainbowDelimiterOrange",
|
||||||
|
"RainbowDelimiterGreen",
|
||||||
|
"RainbowDelimiterViolet",
|
||||||
|
"RainbowDelimiterCyan",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}
|
196
lua/plugins/render-markdown.lua
Normal file
196
lua/plugins/render-markdown.lua
Normal file
@ -0,0 +1,196 @@
|
|||||||
|
return {
|
||||||
|
"MeanderingProgrammer/render-markdown.nvim",
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter", "echasnovski/mini.nvim" }, -- if you use the mini.nvim suite
|
||||||
|
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'echasnovski/mini.icons' }, -- if you use standalone mini plugins
|
||||||
|
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons
|
||||||
|
---@module 'render-markdown'
|
||||||
|
---@type render.md.UserConfig
|
||||||
|
opts = {
|
||||||
|
injections = {
|
||||||
|
gitcommit = {
|
||||||
|
enabled = true,
|
||||||
|
query = [[
|
||||||
|
((message) @injection.content
|
||||||
|
(#set! injection.combined)
|
||||||
|
(#set! injection.include-children)
|
||||||
|
(#set! injection.language "markdown"))
|
||||||
|
]],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
heading = {
|
||||||
|
enabled = true,
|
||||||
|
render_modes = false,
|
||||||
|
sign = true,
|
||||||
|
icons = { " ", " ", " ", " ", " ", " " },
|
||||||
|
position = "overlay",
|
||||||
|
signs = { " " },
|
||||||
|
width = "full",
|
||||||
|
left_margin = 0,
|
||||||
|
left_pad = 0,
|
||||||
|
right_pad = 0,
|
||||||
|
min_width = 0,
|
||||||
|
border = false,
|
||||||
|
border_virtual = false,
|
||||||
|
border_prefix = false,
|
||||||
|
-- above = "▄",
|
||||||
|
-- below = "▀",
|
||||||
|
backgrounds = {
|
||||||
|
"RenderMarkdownH1Bg",
|
||||||
|
"RenderMarkdownH2Bg",
|
||||||
|
"RenderMarkdownH3Bg",
|
||||||
|
"RenderMarkdownH4Bg",
|
||||||
|
"RenderMarkdownH5Bg",
|
||||||
|
"RenderMarkdownH6Bg",
|
||||||
|
},
|
||||||
|
foregrounds = {
|
||||||
|
"RenderMarkdownH1",
|
||||||
|
"RenderMarkdownH2",
|
||||||
|
"RenderMarkdownH3",
|
||||||
|
"RenderMarkdownH4",
|
||||||
|
"RenderMarkdownH5",
|
||||||
|
"RenderMarkdownH6",
|
||||||
|
},
|
||||||
|
custom = {},
|
||||||
|
},
|
||||||
|
code = {
|
||||||
|
enabled = true,
|
||||||
|
render_modes = false,
|
||||||
|
sign = true,
|
||||||
|
style = "full",
|
||||||
|
position = "left",
|
||||||
|
language_pad = 0,
|
||||||
|
language_name = true,
|
||||||
|
disable_background = { "diff" },
|
||||||
|
width = "full",
|
||||||
|
left_margin = 0,
|
||||||
|
left_pad = 0,
|
||||||
|
right_pad = 0,
|
||||||
|
min_width = 0,
|
||||||
|
border = "thin",
|
||||||
|
above = "▄",
|
||||||
|
below = "▀",
|
||||||
|
highlight = "RenderMarkdownCode",
|
||||||
|
highlight_language = nil,
|
||||||
|
inline_pad = 0,
|
||||||
|
highlight_inline = "RenderMarkdownCodeInline",
|
||||||
|
},
|
||||||
|
bullet = {
|
||||||
|
enabled = true,
|
||||||
|
render_modes = false,
|
||||||
|
icons = { "●", "○", "◆", "◇" },
|
||||||
|
ordered_icons = function(ctx)
|
||||||
|
local value = vim.trim(ctx.value)
|
||||||
|
local index = tonumber(value:sub(1, #value - 1))
|
||||||
|
return string.format("%d.", index > 1 and index or ctx.index)
|
||||||
|
end,
|
||||||
|
left_pad = 0,
|
||||||
|
right_pad = 0,
|
||||||
|
highlight = "RenderMarkdownBullet",
|
||||||
|
},
|
||||||
|
callout = {
|
||||||
|
note = { raw = "[!NOTE]", rendered = " Note", highlight = "RenderMarkdownInfo" },
|
||||||
|
tip = { raw = "[!TIP]", rendered = " Tip", highlight = "RenderMarkdownSuccess" },
|
||||||
|
important = { raw = "[!IMPORTANT]", rendered = " Important", highlight = "RenderMarkdownHint" },
|
||||||
|
warning = { raw = "[!WARNING]", rendered = " Warning", highlight = "RenderMarkdownWarn" },
|
||||||
|
caution = { raw = "[!CAUTION]", rendered = " Caution", highlight = "RenderMarkdownError" },
|
||||||
|
abstract = { raw = "[!ABSTRACT]", rendered = " Abstract", highlight = "RenderMarkdownInfo" },
|
||||||
|
summary = { raw = "[!SUMMARY]", rendered = " Summary", highlight = "RenderMarkdownInfo" },
|
||||||
|
tldr = { raw = "[!TLDR]", rendered = " Tldr", highlight = "RenderMarkdownInfo" },
|
||||||
|
info = { raw = "[!INFO]", rendered = " Info", highlight = "RenderMarkdownInfo" },
|
||||||
|
todo = { raw = "[!TODO]", rendered = " Todo", highlight = "RenderMarkdownInfo" },
|
||||||
|
hint = { raw = "[!HINT]", rendered = " Hint", highlight = "RenderMarkdownSuccess" },
|
||||||
|
success = { raw = "[!SUCCESS]", rendered = " Success", highlight = "RenderMarkdownSuccess" },
|
||||||
|
check = { raw = "[!CHECK]", rendered = " Check", highlight = "RenderMarkdownSuccess" },
|
||||||
|
done = { raw = "[!DONE]", rendered = " Done", highlight = "RenderMarkdownSuccess" },
|
||||||
|
question = { raw = "[!QUESTION]", rendered = " Question", highlight = "RenderMarkdownWarn" },
|
||||||
|
help = { raw = "[!HELP]", rendered = " Help", highlight = "RenderMarkdownWarn" },
|
||||||
|
faq = { raw = "[!FAQ]", rendered = " Faq", highlight = "RenderMarkdownWarn" },
|
||||||
|
attention = { raw = "[!ATTENTION]", rendered = " Attention", highlight = "RenderMarkdownWarn" },
|
||||||
|
failure = { raw = "[!FAILURE]", rendered = " Failure", highlight = "RenderMarkdownError" },
|
||||||
|
fail = { raw = "[!FAIL]", rendered = " Fail", highlight = "RenderMarkdownError" },
|
||||||
|
missing = { raw = "[!MISSING]", rendered = " Missing", highlight = "RenderMarkdownError" },
|
||||||
|
danger = { raw = "[!DANGER]", rendered = " Danger", highlight = "RenderMarkdownError" },
|
||||||
|
error = { raw = "[!ERROR]", rendered = " Error", highlight = "RenderMarkdownError" },
|
||||||
|
bug = { raw = "[!BUG]", rendered = " Bug", highlight = "RenderMarkdownError" },
|
||||||
|
example = { raw = "[!EXAMPLE]", rendered = " Example", highlight = "RenderMarkdownHint" },
|
||||||
|
quote = { raw = "[!QUOTE]", rendered = " Quote", highlight = "RenderMarkdownQuote" },
|
||||||
|
cite = { raw = "[!CITE]", rendered = " Cite", highlight = "RenderMarkdownQuote" },
|
||||||
|
},
|
||||||
|
link = {
|
||||||
|
enabled = true,
|
||||||
|
render_modes = false,
|
||||||
|
footnote = {
|
||||||
|
superscript = true,
|
||||||
|
prefix = "",
|
||||||
|
suffix = "",
|
||||||
|
},
|
||||||
|
image = " ",
|
||||||
|
email = " ",
|
||||||
|
hyperlink = " ",
|
||||||
|
highlight = "RenderMarkdownLink",
|
||||||
|
wiki = { icon = " ", highlight = "RenderMarkdownWikiLink" },
|
||||||
|
custom = {
|
||||||
|
web = { pattern = "^http", icon = " " },
|
||||||
|
discord = { pattern = "discord%.com", icon = " " },
|
||||||
|
github = { pattern = "github%.com", icon = " " },
|
||||||
|
gitlab = { pattern = "gitlab%.com", icon = " " },
|
||||||
|
google = { pattern = "google%.com", icon = " " },
|
||||||
|
neovim = { pattern = "neovim%.io", icon = " " },
|
||||||
|
reddit = { pattern = "reddit%.com", icon = " " },
|
||||||
|
stackoverflow = { pattern = "stackoverflow%.com", icon = " " },
|
||||||
|
wikipedia = { pattern = "wikipedia%.org", icon = " " },
|
||||||
|
youtube = { pattern = "youtube%.com", icon = " " },
|
||||||
|
python = { pattern = "%.py$", icon = " " },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
pipe_table = {
|
||||||
|
enabled = true,
|
||||||
|
render_modes = false,
|
||||||
|
preset = "round",
|
||||||
|
style = "full",
|
||||||
|
cell = "padded",
|
||||||
|
padding = 1,
|
||||||
|
min_width = 0,
|
||||||
|
border = {
|
||||||
|
"┌",
|
||||||
|
"┬",
|
||||||
|
"┐",
|
||||||
|
"├",
|
||||||
|
"┼",
|
||||||
|
"┤",
|
||||||
|
"└",
|
||||||
|
"┴",
|
||||||
|
"┘",
|
||||||
|
"│",
|
||||||
|
"─",
|
||||||
|
},
|
||||||
|
alignment_indicator = "━",
|
||||||
|
head = "RenderMarkdownTableHead",
|
||||||
|
row = "RenderMarkdownTableRow",
|
||||||
|
filler = "RenderMarkdownTableFill",
|
||||||
|
},
|
||||||
|
checkbox = {
|
||||||
|
enabled = true,
|
||||||
|
render_modes = false,
|
||||||
|
position = "inline",
|
||||||
|
unchecked = {
|
||||||
|
icon = " ",
|
||||||
|
highlight = "RenderMarkdownUnchecked",
|
||||||
|
scope_highlight = nil,
|
||||||
|
},
|
||||||
|
checked = {
|
||||||
|
icon = " ",
|
||||||
|
highlight = "RenderMarkdownChecked",
|
||||||
|
scope_highlight = nil,
|
||||||
|
},
|
||||||
|
custom = {
|
||||||
|
todo = {
|
||||||
|
raw = "[-]",
|
||||||
|
rendered = " ",
|
||||||
|
highlight = "RenderMarkdownTodo",
|
||||||
|
scope_highlight = nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
5
lua/plugins/telescope-glyph.lua
Normal file
5
lua/plugins/telescope-glyph.lua
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
return {
|
||||||
|
"tpope/vim-commentary",
|
||||||
|
"tpope/vim-dotenv",
|
||||||
|
"tpope/vim-surround",
|
||||||
|
}
|
119
lua/plugins/telescope.lua
Normal file
119
lua/plugins/telescope.lua
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
return {
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"jonarrien/telescope-cmdline.nvim",
|
||||||
|
"nat-418/telescope-color-names.nvim",
|
||||||
|
"nvim-telescope/telescope-file-browser.nvim",
|
||||||
|
"ghassan0/telescope-glyph.nvim",
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
-- Default configuration for telescope goes here:
|
||||||
|
-- config_key = value,
|
||||||
|
layout_strategy = "flex",
|
||||||
|
width = 0.9,
|
||||||
|
wrap_results = true,
|
||||||
|
preview = {
|
||||||
|
border = true,
|
||||||
|
borderchars = {
|
||||||
|
"─",
|
||||||
|
"│",
|
||||||
|
"─",
|
||||||
|
"│",
|
||||||
|
"╭",
|
||||||
|
"╮",
|
||||||
|
"╯",
|
||||||
|
"╰",
|
||||||
|
},
|
||||||
|
title = true,
|
||||||
|
dynamic_preview_title = true,
|
||||||
|
treesitter = true,
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
-- map actions.which_key to <C-h> (default: <C-/>)
|
||||||
|
-- actions.which_key shows the mappings for your picker,
|
||||||
|
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
||||||
|
["<C-h>"] = "which_key",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
file_ignore_patterns = { "^node_modules/", "^env/", "^__pycache__/" },
|
||||||
|
},
|
||||||
|
pickers = {
|
||||||
|
-- Default configuration for builtin pickers goes here:
|
||||||
|
-- picker_name = {
|
||||||
|
-- picker_config_key = value,
|
||||||
|
-- ...
|
||||||
|
-- }
|
||||||
|
-- Now the picker_config_key will be applied every time you call this
|
||||||
|
-- builtin picker
|
||||||
|
find_files = {
|
||||||
|
-- theme = "dropdown"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
fzf = {
|
||||||
|
fuzzy = true, -- false will only do exact matching
|
||||||
|
override_generic_sorter = true, -- override the generic sorter
|
||||||
|
override_file_sorter = true, -- override the file sorter
|
||||||
|
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||||
|
-- the default case_mode is "smart_case"
|
||||||
|
},
|
||||||
|
glyph = {
|
||||||
|
action = function(glyph)
|
||||||
|
-- argument glyph is a table.
|
||||||
|
-- {name="", value="", category="", description=""}
|
||||||
|
-- vim.fn.setreg("*", glyph.value)
|
||||||
|
-- print([[Press p or "*p to paste this glyph]] .. glyph.value)
|
||||||
|
-- insert glyph when picked
|
||||||
|
vim.api.nvim_put({ glyph.value }, "c", false, true)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
cmdline = {
|
||||||
|
-- Adjust telescope picker size and layout
|
||||||
|
picker = {
|
||||||
|
layout_config = {
|
||||||
|
width = 120,
|
||||||
|
height = 25,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Adjust your mappings
|
||||||
|
mappings = {
|
||||||
|
complete = "<Tab>",
|
||||||
|
run_selection = "<C-CR>",
|
||||||
|
run_input = "<CR>",
|
||||||
|
},
|
||||||
|
-- Triggers any shell command using overseer.nvim (`:!`)
|
||||||
|
overseer = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
file_browser = {
|
||||||
|
theme = "ivy",
|
||||||
|
-- disables netrw and use telescope-file-browser in its place
|
||||||
|
hijack_netrw = true,
|
||||||
|
mappings = {
|
||||||
|
["i"] = {
|
||||||
|
-- your custom insert mode mappings
|
||||||
|
},
|
||||||
|
["n"] = {
|
||||||
|
-- your custom normal mode mappings
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
local ts = require("telescope")
|
||||||
|
ts.load_extension("fzf")
|
||||||
|
ts.load_extension("glyph")
|
||||||
|
ts.load_extension("color_names")
|
||||||
|
-- ts.load_extension("notify")
|
||||||
|
ts.load_extension("cmdline")
|
||||||
|
ts.load_extension("file_browser")
|
||||||
|
end,
|
||||||
|
}
|
85
lua/plugins/toggleterm.lua
Normal file
85
lua/plugins/toggleterm.lua
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
return {
|
||||||
|
"akinsho/toggleterm.nvim",
|
||||||
|
version = "*",
|
||||||
|
opts = {
|
||||||
|
-- size can be a number or function which is passed the current terminal
|
||||||
|
size = function(term)
|
||||||
|
if term.direction == "horizontal" then
|
||||||
|
return 20
|
||||||
|
elseif term.direction == "vertical" then
|
||||||
|
return vim.o.columns * 0.45
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
open_mapping = { [[<c-t>]] }, -- or { [[<c-\>]], [[<c-¥>]] } if you also use a Japanese keyboard.
|
||||||
|
-- on_create = fun(t: Terminal), -- function to run when the terminal is first created
|
||||||
|
-- on_open = fun(t: Terminal), -- function to run when the terminal opens
|
||||||
|
-- on_close = fun(t: Terminal), -- function to run when the terminal closes
|
||||||
|
-- on_stdout = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stdout
|
||||||
|
-- on_stderr = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stderr
|
||||||
|
-- on_exit = fun(t: Terminal, job: number, exit_code: number, name: string) -- function to run when terminal process exits
|
||||||
|
hide_numbers = true, -- hide the number column in toggleterm buffers
|
||||||
|
-- shade_filetypes = {},
|
||||||
|
autochdir = false, -- when neovim changes it current directory the terminal will change it's own when next it's opened
|
||||||
|
highlights = {
|
||||||
|
-- highlights which map to a highlight group name and a table of it's values
|
||||||
|
-- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split
|
||||||
|
Normal = {
|
||||||
|
guibg = "#24273A",
|
||||||
|
},
|
||||||
|
NormalFloat = {
|
||||||
|
link = "Normal",
|
||||||
|
},
|
||||||
|
-- FloatBorder = {
|
||||||
|
-- guifg = "<VALUE-HERE>",
|
||||||
|
-- guibg = "<VALUE-HERE>",
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
shade_terminals = false, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
|
||||||
|
-- shading_factor = '-10', -- the percentage by which to lighten dark terminal background, default: -30
|
||||||
|
-- shading_ratio = '-3', -- the ratio of shading factor for light/dark terminal background, default: -3
|
||||||
|
start_in_insert = true,
|
||||||
|
insert_mappings = true, -- whether or not the open mapping applies in insert mode
|
||||||
|
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
|
||||||
|
persist_size = false,
|
||||||
|
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
|
||||||
|
-- direction = 'vertical' | 'horizontal' | 'tab' | 'float',
|
||||||
|
direction = "float",
|
||||||
|
-- close_on_exit = true, -- close the terminal window when the process exits
|
||||||
|
-- clear_env = false, -- use only environmental variables from `env`, passed to jobstart()
|
||||||
|
-- Change the default shell. Can be a string or a function returning a string
|
||||||
|
shell = vim.o.shell,
|
||||||
|
auto_scroll = true, -- automatically scroll to the bottom on terminal output
|
||||||
|
-- This field is only relevant if direction is set to 'float'
|
||||||
|
float_opts = {
|
||||||
|
-- The border key is *almost* the same as 'nvim_open_win'
|
||||||
|
-- see :h nvim_open_win for details on borders however
|
||||||
|
-- the 'curved' border is a custom border type
|
||||||
|
-- not natively supported but implemented in this plugin.
|
||||||
|
-- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
|
||||||
|
border = "curved",
|
||||||
|
-- like `size`, width, height, row, and col can be a number or function which is passed the current terminal
|
||||||
|
width = function()
|
||||||
|
return vim.o.columns - 35
|
||||||
|
end,
|
||||||
|
-- height = 75,
|
||||||
|
-- row = <value>,
|
||||||
|
-- col = vim.o.columns * 0.8,
|
||||||
|
winblend = 3,
|
||||||
|
zindex = 10,
|
||||||
|
-- title_pos = 'left' | 'center' | 'right', position of the title of the floating window
|
||||||
|
title_pos = "center",
|
||||||
|
},
|
||||||
|
winbar = {
|
||||||
|
enabled = false,
|
||||||
|
name_formatter = function(term) -- term: Terminal
|
||||||
|
return term.name
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
responsiveness = {
|
||||||
|
-- breakpoint in terms of `vim.o.columns` at which terminals will start to stack on top of each other
|
||||||
|
-- instead of next to each other
|
||||||
|
-- default = 0 which means the feature is turned off
|
||||||
|
horizontal_breakpoint = 135,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
46
lua/plugins/treesitter.lua
Normal file
46
lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
return {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
build = ":TSUpdate",
|
||||||
|
config = function()
|
||||||
|
local configs = require("nvim-treesitter.configs")
|
||||||
|
|
||||||
|
configs.setup({
|
||||||
|
ensure_installed = {
|
||||||
|
"c",
|
||||||
|
"lua",
|
||||||
|
"vim",
|
||||||
|
"vimdoc",
|
||||||
|
"query",
|
||||||
|
"cpp",
|
||||||
|
"python",
|
||||||
|
"bash",
|
||||||
|
"sql",
|
||||||
|
"yaml",
|
||||||
|
"toml",
|
||||||
|
"dockerfile",
|
||||||
|
"gitcommit",
|
||||||
|
"gitignore",
|
||||||
|
"html",
|
||||||
|
"css",
|
||||||
|
"javascript",
|
||||||
|
"typescript",
|
||||||
|
"rust",
|
||||||
|
"go",
|
||||||
|
"json",
|
||||||
|
"regex",
|
||||||
|
"latex",
|
||||||
|
"comment",
|
||||||
|
"cmake",
|
||||||
|
"graphql",
|
||||||
|
"haskell",
|
||||||
|
"java",
|
||||||
|
"php",
|
||||||
|
"ruby",
|
||||||
|
"vue",
|
||||||
|
},
|
||||||
|
sync_install = false,
|
||||||
|
highlight = { enable = true },
|
||||||
|
indent = { enable = true },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
@ -1,85 +0,0 @@
|
|||||||
require('bufferline').setup {
|
|
||||||
options = {
|
|
||||||
-- numbers = function(opts)
|
|
||||||
-- return string.format("%s", opts.id)
|
|
||||||
-- end,
|
|
||||||
numbers = function(opts)
|
|
||||||
return ""
|
|
||||||
end,
|
|
||||||
-- number_style = "superscript" | "subscript" | "" | { "none", "subscript" }, -- buffer_id at index 1, ordinal at index 2
|
|
||||||
-- number_style = "none",
|
|
||||||
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
|
||||||
right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
|
||||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
|
||||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
|
||||||
-- NOTE: this plugin is designed with this icon in mind,
|
|
||||||
-- and so changing this is NOT recommended, this is intended
|
|
||||||
-- as an escape hatch for people who cannot bear it for whatever reason
|
|
||||||
indicator_style = '▎',
|
|
||||||
buffer_close_icon = '',
|
|
||||||
modified_icon = '●',
|
|
||||||
close_icon = '',
|
|
||||||
left_trunc_marker = '',
|
|
||||||
right_trunc_marker = '',
|
|
||||||
--- name_formatter can be used to change the buffer's label in the bufferline.
|
|
||||||
--- Please note some names can/will break the
|
|
||||||
--- bufferline so use this at your discretion knowing that it has
|
|
||||||
--- some limitations that will *NOT* be fixed.
|
|
||||||
name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
|
||||||
-- remove extension from markdown files for example
|
|
||||||
if buf.name:match('%.md') then
|
|
||||||
return vim.fn.fnamemodify(buf.name, ':t:r')
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
max_name_length = 18,
|
|
||||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
|
||||||
tab_size = 18,
|
|
||||||
-- diagnostics = false | "nvim_lsp" | "coc",
|
|
||||||
diagnostics = "nvim_lsp",
|
|
||||||
diagnostics_update_in_insert = false,
|
|
||||||
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 == "hint" and " "
|
|
||||||
or (e == "warning" and " " or "" )
|
|
||||||
s = s .. n .. sym
|
|
||||||
end
|
|
||||||
return s
|
|
||||||
end,
|
|
||||||
custom_filter = function(buf_number, buf_numbers)
|
|
||||||
-- filter out filetypes you don't want to see
|
|
||||||
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- filter out by buffer name
|
|
||||||
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- filter out based on arbitrary rules
|
|
||||||
-- e.g. filter out vim wiki buffer from tabline in your work repo
|
|
||||||
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
-- filter out by it's index number in list (don't show first buffer)
|
|
||||||
if buf_numbers[1] ~= buf_number then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
-- offsets = {{filetype = "NvimTree", text = "File Explorer" | function , text_align = "left" | "center" | "right"}},
|
|
||||||
-- offsets = text_align = "left" | "center" | "right"}},
|
|
||||||
show_buffer_icons = true,
|
|
||||||
show_buffer_close_icons = true,
|
|
||||||
show_close_icon = false,
|
|
||||||
show_tab_indicators = true,
|
|
||||||
persist_buffer_sort = false, -- whether or not custom sorted buffers should persist
|
|
||||||
-- can also be a table containing 2 custom separators
|
|
||||||
-- [focused and unfocused]. eg: { '|', '|' }
|
|
||||||
-- separator_style = "slant" | "thick" | "thin" | { 'any', 'any' },
|
|
||||||
separator_style = "thick",
|
|
||||||
enforce_regular_tabs = false,
|
|
||||||
always_show_bufferline = true,
|
|
||||||
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
|
||||||
sort_by = 'id',
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
local lualine = require('lualine')
|
|
||||||
lualine.setup({
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'cozynight',
|
|
||||||
component_separators = { left = '', right = '' },
|
|
||||||
section_separators = { left = '', right = '' },
|
|
||||||
disabled_filetypes = {},
|
|
||||||
always_divide_middle = true
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = { 'mode' },
|
|
||||||
lualine_b = {
|
|
||||||
'branch', 'diff', {
|
|
||||||
'diagnostics',
|
|
||||||
sources = { "nvim_diagnostic" },
|
|
||||||
symbols = {
|
|
||||||
error = ' ',
|
|
||||||
warn = ' ',
|
|
||||||
info = ' ',
|
|
||||||
hint = ' '
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
lualine_c = { 'filename' },
|
|
||||||
lualine_x = { 'copilot', 'encoding', 'fileformat', 'filetype' }, -- I added copilot here
|
|
||||||
lualine_y = { 'progress' },
|
|
||||||
lualine_z = { 'location' }
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = { 'filename' },
|
|
||||||
lualine_x = { 'location' },
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {}
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
extensions = {}
|
|
||||||
})
|
|
@ -1,49 +0,0 @@
|
|||||||
require"fidget".setup {
|
|
||||||
text = {
|
|
||||||
spinner = "pipe", -- animation shown when tasks are ongoing
|
|
||||||
done = "✔", -- character shown when all tasks are complete
|
|
||||||
commenced = "Started", -- message shown when task starts
|
|
||||||
completed = "Completed", -- message shown when task completes
|
|
||||||
},
|
|
||||||
align = {
|
|
||||||
bottom = true, -- align fidgets along bottom edge of buffer
|
|
||||||
right = true, -- align fidgets along right edge of buffer
|
|
||||||
},
|
|
||||||
timer = {
|
|
||||||
spinner_rate = 125, -- frame rate of spinner animation, in ms
|
|
||||||
fidget_decay = 2000, -- how long to keep around empty fidget, in ms
|
|
||||||
task_decay = 1000, -- how long to keep around completed task, in ms
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
relative = "win", -- where to anchor, either "win" or "editor"
|
|
||||||
blend = 100, -- &winblend for the window
|
|
||||||
zindex = nil, -- the zindex value for the window
|
|
||||||
},
|
|
||||||
fmt = {
|
|
||||||
leftpad = true, -- right-justify text in fidget box
|
|
||||||
stack_upwards = true, -- list of tasks grows upwards
|
|
||||||
max_width = 0, -- maximum width of the fidget box
|
|
||||||
fidget = -- function to format fidget title
|
|
||||||
function(fidget_name, spinner)
|
|
||||||
return string.format("%s %s", spinner, fidget_name)
|
|
||||||
end,
|
|
||||||
task = -- function to format each task line
|
|
||||||
function(task_name, message, percentage)
|
|
||||||
return string.format(
|
|
||||||
"%s%s [%s]",
|
|
||||||
message,
|
|
||||||
percentage and string.format(" (%s%%)", percentage) or "",
|
|
||||||
task_name
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
-- sources = {
|
|
||||||
-- * = {
|
|
||||||
-- ignore = false,
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- debug = {
|
|
||||||
-- logging = false, -- whether to enable logging, for debugging
|
|
||||||
-- strict = false, -- whether to interpret LSP strictly
|
|
||||||
-- },
|
|
||||||
}
|
|
@ -1,2 +0,0 @@
|
|||||||
vim.g.gitblame_highlight_group = "Question"
|
|
||||||
vim.g.gitblame_enabled = 0
|
|
@ -1,48 +0,0 @@
|
|||||||
require('gitsigns').setup {
|
|
||||||
signs = {
|
|
||||||
add = { text = '┃' },
|
|
||||||
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 = true, -- Toggle with `:Gitsigns toggle_signs`
|
|
||||||
numhl = false, -- 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 = 1000,
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
|||||||
local highlight = {
|
|
||||||
"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 = "#ED8796" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#EED49F" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#8AADF4" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#F5A97F" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#A6DA95" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C6A0F6" })
|
|
||||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#8BD5CA" })
|
|
||||||
end)
|
|
||||||
|
|
||||||
vim.g.rainbow_delimiters = { highlight = highlight }
|
|
||||||
require("ibl").setup({
|
|
||||||
scope = { highlight = highlight },
|
|
||||||
exclude = { filetypes = { "dashboard" } },
|
|
||||||
})
|
|
||||||
|
|
||||||
hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark)
|
|
@ -1,17 +0,0 @@
|
|||||||
require("plugins.ui.bufferline")
|
|
||||||
require("plugins.ui.copilot-lualine")
|
|
||||||
require("plugins.ui.fidget")
|
|
||||||
require("plugins.ui.gitsigns")
|
|
||||||
require("plugins.ui.lualine")
|
|
||||||
require("plugins.ui.nvim-colorizer")
|
|
||||||
require("plugins.ui.nvim-notify")
|
|
||||||
require("plugins.ui.nvimtree")
|
|
||||||
require("plugins.ui.presence")
|
|
||||||
require("plugins.ui.rainbow-delimiters")
|
|
||||||
require("plugins.ui.telescope-file-browser")
|
|
||||||
require("plugins.ui.telescope")
|
|
||||||
require("plugins.ui.treesitter-context")
|
|
||||||
require("plugins.ui.treesitter")
|
|
||||||
require("plugins.ui.whichkey")
|
|
||||||
require("plugins.ui.indent-blankline")
|
|
||||||
require("plugins.ui.toggleterm")
|
|
@ -1,103 +0,0 @@
|
|||||||
local M = require("lualine.component"):extend()
|
|
||||||
|
|
||||||
M.processing = false
|
|
||||||
M.spinner_index = 1
|
|
||||||
|
|
||||||
local spinner_symbols = {
|
|
||||||
"⠋",
|
|
||||||
"⠙",
|
|
||||||
"⠹",
|
|
||||||
"⠸",
|
|
||||||
"⠼",
|
|
||||||
"⠴",
|
|
||||||
"⠦",
|
|
||||||
"⠧",
|
|
||||||
"⠇",
|
|
||||||
"⠏",
|
|
||||||
}
|
|
||||||
local spinner_symbols_len = 10
|
|
||||||
|
|
||||||
-- Initializer
|
|
||||||
function M:init(options)
|
|
||||||
M.super.init(self, options)
|
|
||||||
|
|
||||||
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "User" }, {
|
|
||||||
pattern = "CodeCompanionRequest*",
|
|
||||||
group = group,
|
|
||||||
callback = function(request)
|
|
||||||
if request.match == "CodeCompanionRequestStarted" then
|
|
||||||
self.processing = true
|
|
||||||
elseif request.match == "CodeCompanionRequestFinished" then
|
|
||||||
self.processing = false
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Function that runs every time statusline is updated
|
|
||||||
function M:update_status()
|
|
||||||
if self.processing then
|
|
||||||
self.spinner_index = (self.spinner_index % spinner_symbols_len) + 1
|
|
||||||
return spinner_symbols[self.spinner_index]
|
|
||||||
else
|
|
||||||
return nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
require('lualine').setup {
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'codedark',
|
|
||||||
-- theme = 'dracula',
|
|
||||||
-- theme = 'horizon',
|
|
||||||
-- theme = 'onedark',
|
|
||||||
component_separators = { left = '', right = '' },
|
|
||||||
section_separators = { left = '', right = '' },
|
|
||||||
disabled_filetypes = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = { 'mode' },
|
|
||||||
lualine_b = { 'branch', 'diff' },
|
|
||||||
lualine_c = { 'filename', M },
|
|
||||||
lualine_x = {
|
|
||||||
{
|
|
||||||
'diagnostics',
|
|
||||||
'fileformat',
|
|
||||||
symbols = {
|
|
||||||
unix = '', -- e712
|
|
||||||
dos = '', -- e70f
|
|
||||||
mac = '', -- e711
|
|
||||||
}
|
|
||||||
}, 'encoding', 'fileformat', { 'filetype', colored = true, icon_only = false } },
|
|
||||||
lualine_y = { 'progress' },
|
|
||||||
lualine_z = { 'location' }
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = {
|
|
||||||
{
|
|
||||||
'filename',
|
|
||||||
file_status = true, -- Displays file status (readonly status, modified status)
|
|
||||||
path = 0, -- 0: Just the filename
|
|
||||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
|
||||||
symbols = {
|
|
||||||
modified = '[+]', -- Text to show when the file is modified.
|
|
||||||
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
|
|
||||||
unnamed = '[No Name]', -- Text to show for unnamed buffers.
|
|
||||||
}
|
|
||||||
},
|
|
||||||
M
|
|
||||||
},
|
|
||||||
lualine_x = { 'location' },
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {}
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
extensions = { 'quickfix', 'fzf', 'nvim-tree', 'symbols-outline', 'fugitive' }
|
|
||||||
}
|
|
||||||
|
|
||||||
-- return M
|
|
@ -1 +0,0 @@
|
|||||||
require 'colorizer'.setup()
|
|
@ -1,17 +0,0 @@
|
|||||||
require("notify").setup({
|
|
||||||
background_colour = "#000000",
|
|
||||||
fps = 144,
|
|
||||||
icons = {
|
|
||||||
DEBUG = "",
|
|
||||||
ERROR = "",
|
|
||||||
INFO = "",
|
|
||||||
TRACE = "✎",
|
|
||||||
WARN = ""
|
|
||||||
},
|
|
||||||
level = 2,
|
|
||||||
minimum_width = 50,
|
|
||||||
render = "default",
|
|
||||||
stages = "fade_in_slide_out",
|
|
||||||
timeout = 5000,
|
|
||||||
top_down = true
|
|
||||||
})
|
|
@ -1,67 +0,0 @@
|
|||||||
require 'nvim-tree'.setup {
|
|
||||||
disable_netrw = false,
|
|
||||||
hijack_netrw = false,
|
|
||||||
-- open_on_setup = false,
|
|
||||||
-- ignore_ft_on_setup = {},
|
|
||||||
-- auto_close = false,
|
|
||||||
open_on_tab = false,
|
|
||||||
hijack_cursor = false,
|
|
||||||
update_cwd = false,
|
|
||||||
-- update_to_buf_dir = {
|
|
||||||
-- enable = true,
|
|
||||||
-- auto_open = true,
|
|
||||||
-- },
|
|
||||||
diagnostics = {
|
|
||||||
enable = true,
|
|
||||||
icons = { hint = "", info = "", warning = "", error = "" }
|
|
||||||
},
|
|
||||||
update_focused_file = { enable = false, update_cwd = false, ignore_list = {} },
|
|
||||||
system_open = { cmd = nil, args = {} },
|
|
||||||
filters = { dotfiles = false, custom = {} },
|
|
||||||
git = { enable = true, ignore = true, timeout = 500 },
|
|
||||||
view = {
|
|
||||||
width = 35,
|
|
||||||
-- height = 35,
|
|
||||||
-- hide_root_folder = false,
|
|
||||||
side = 'left',
|
|
||||||
-- auto_resize = false,
|
|
||||||
-- mappings = {
|
|
||||||
-- custom_only = false,
|
|
||||||
-- list = {}
|
|
||||||
-- },
|
|
||||||
number = false,
|
|
||||||
relativenumber = false,
|
|
||||||
signcolumn = "yes"
|
|
||||||
},
|
|
||||||
trash = { cmd = "trash", require_confirm = true },
|
|
||||||
actions = {
|
|
||||||
change_dir = { global = false },
|
|
||||||
open_file = { quit_on_open = false }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- local tree_cb = require'nvim-tree.config'.nvim_tree_callback
|
|
||||||
|
|
||||||
-- default mappings
|
|
||||||
local list = {
|
|
||||||
{ key = { "<CR>", "o", "<2-LeftMouse>" }, action = "edit" },
|
|
||||||
{ key = { "O" }, action = "edit_no_picker" },
|
|
||||||
{ key = { "<2-RightMouse>", "<C-]>" }, action = "cd" },
|
|
||||||
{ key = "<C-v>", action = "vsplit" }, { key = "<C-x>", action = "split" },
|
|
||||||
{ key = "<C-t>", action = "tabnew" }, { key = "<", action = "prev_sibling" },
|
|
||||||
{ key = ">", action = "next_sibling" }, { key = "P", action = "parent_node" },
|
|
||||||
{ key = "<BS>", action = "close_node" }, { key = "<Tab>", action = "preview" },
|
|
||||||
{ key = "K", action = "first_sibling" }, { key = "J", action = "last_sibling" },
|
|
||||||
{ key = "I", action = "toggle_ignored" },
|
|
||||||
{ key = "H", action = "toggle_dotfiles" }, { key = "R", action = "refresh" },
|
|
||||||
{ key = "a", action = "create" }, { key = "d", action = "remove" },
|
|
||||||
{ key = "D", action = "trash" }, { key = "r", action = "rename" },
|
|
||||||
{ key = "<C-r>", action = "full_rename" }, { key = "x", action = "cut" },
|
|
||||||
{ key = "c", action = "copy" }, { key = "p", action = "paste" },
|
|
||||||
{ key = "y", action = "copy_name" }, { key = "Y", action = "copy_path" },
|
|
||||||
{ key = "gy", action = "copy_absolute_path" },
|
|
||||||
{ key = "[c", action = "prev_git_item" },
|
|
||||||
{ key = "]c", action = "next_git_item" }, { key = "-", action = "dir_up" },
|
|
||||||
{ key = "s", action = "system_open" }, { key = "q", action = "close" },
|
|
||||||
{ key = "g?", action = "toggle_help" }
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
require("presence"):setup({
|
|
||||||
-- General options
|
|
||||||
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
|
|
||||||
neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
|
|
||||||
main_image = "neovim", -- Main image display (either "neovim" or "file")
|
|
||||||
-- client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
|
|
||||||
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
|
|
||||||
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
|
|
||||||
enable_line_number = false, -- Displays the current line number instead of the current project
|
|
||||||
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
|
||||||
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
|
|
||||||
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
|
|
||||||
|
|
||||||
-- Rich Presence text options
|
|
||||||
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
|
|
||||||
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
|
|
||||||
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
|
|
||||||
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
|
|
||||||
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
|
|
||||||
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
|
|
||||||
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
|
|
||||||
})
|
|
@ -1,15 +0,0 @@
|
|||||||
-- This module contains a number of default definitions
|
|
||||||
local rainbow_delimiters = require 'rainbow-delimiters'
|
|
||||||
|
|
||||||
vim.g.rainbow_delimiters = {
|
|
||||||
strategy = {
|
|
||||||
[''] = rainbow_delimiters.strategy['global'],
|
|
||||||
vim = rainbow_delimiters.strategy['local']
|
|
||||||
},
|
|
||||||
query = { [''] = 'rainbow-delimiters', lua = 'rainbow-blocks' },
|
|
||||||
highlight = {
|
|
||||||
'RainbowDelimiterRed', 'RainbowDelimiterYellow', 'RainbowDelimiterBlue',
|
|
||||||
'RainbowDelimiterOrange', 'RainbowDelimiterGreen',
|
|
||||||
'RainbowDelimiterViolet', 'RainbowDelimiterCyan'
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
local fb_actions = require "telescope".extensions.file_browser.actions
|
|
||||||
require("telescope").setup {
|
|
||||||
extensions = {
|
|
||||||
file_browser = {
|
|
||||||
-- theme = "ivy",
|
|
||||||
-- disables netrw and use telescope-file-browser in its place
|
|
||||||
hijack_netrw = true,
|
|
||||||
mappings = {
|
|
||||||
["i"] = {
|
|
||||||
-- your custom insert mode mappings
|
|
||||||
["<C-h>"] = fb_actions.goto_home_dir,
|
|
||||||
["<C-x>"] = function(prompt_bufnr)
|
|
||||||
end
|
|
||||||
},
|
|
||||||
["n"] = {
|
|
||||||
-- your custom normal mode mappings
|
|
||||||
f = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
-- To get telescope-file-browser loaded and working with telescope,
|
|
||||||
-- you need to call load_extension, somewhere after setup function:
|
|
||||||
require("telescope").load_extension "file_browser"
|
|
@ -1,67 +0,0 @@
|
|||||||
local ts = require('telescope')
|
|
||||||
ts.setup({
|
|
||||||
defaults = {
|
|
||||||
-- Default configuration for telescope goes here:
|
|
||||||
-- config_key = value,
|
|
||||||
layout_strategy = 'flex',
|
|
||||||
width = 0.9,
|
|
||||||
wrap_results = true,
|
|
||||||
preview = {
|
|
||||||
border = true,
|
|
||||||
borderchars = {
|
|
||||||
'─', '│', '─', '│', '╭', '╮', '╯', '╰'
|
|
||||||
},
|
|
||||||
title = true,
|
|
||||||
dynamic_preview_title = true,
|
|
||||||
treesitter = true
|
|
||||||
},
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
-- map actions.which_key to <C-h> (default: <C-/>)
|
|
||||||
-- actions.which_key shows the mappings for your picker,
|
|
||||||
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
|
||||||
["<C-/>"] = "which_key"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
file_ignore_patterns = { "^node_modules/", "^env/", "^__pycache__/" }
|
|
||||||
},
|
|
||||||
pickers = {
|
|
||||||
-- Default configuration for builtin pickers goes here:
|
|
||||||
-- picker_name = {
|
|
||||||
-- picker_config_key = value,
|
|
||||||
-- ...
|
|
||||||
-- }
|
|
||||||
-- Now the picker_config_key will be applied every time you call this
|
|
||||||
-- builtin picker
|
|
||||||
find_files = {
|
|
||||||
-- theme = "dropdown"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
extensions = {
|
|
||||||
fzf = {
|
|
||||||
fuzzy = true, -- false will only do exact matching
|
|
||||||
override_generic_sorter = true, -- override the generic sorter
|
|
||||||
override_file_sorter = true, -- override the file sorter
|
|
||||||
case_mode = "smart_case" -- or "ignore_case" or "respect_case"
|
|
||||||
-- the default case_mode is "smart_case"
|
|
||||||
},
|
|
||||||
glyph = {
|
|
||||||
action = function(glyph)
|
|
||||||
-- argument glyph is a table.
|
|
||||||
-- {name="", value="", category="", description=""}
|
|
||||||
|
|
||||||
-- vim.fn.setreg("*", glyph.value)
|
|
||||||
-- print([[Press p or "*p to paste this glyph]] .. glyph.value)
|
|
||||||
|
|
||||||
-- insert glyph when picked
|
|
||||||
vim.api.nvim_put({ glyph.value }, 'c', false, true)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
-- ts.load_extension('dap')
|
|
||||||
ts.load_extension('fzf')
|
|
||||||
ts.load_extension('glyph')
|
|
||||||
ts.load_extension('color_names')
|
|
||||||
ts.load_extension('notify')
|
|
@ -1,81 +0,0 @@
|
|||||||
require("toggleterm").setup({
|
|
||||||
-- size can be a number or function which is passed the current terminal
|
|
||||||
size = function(term)
|
|
||||||
if term.direction == "horizontal" then
|
|
||||||
return 20
|
|
||||||
elseif term.direction == "vertical" then
|
|
||||||
return vim.o.columns * 0.45
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
open_mapping = { [[<c-t>]] }, -- or { [[<c-\>]], [[<c-¥>]] } if you also use a Japanese keyboard.
|
|
||||||
-- on_create = fun(t: Terminal), -- function to run when the terminal is first created
|
|
||||||
-- on_open = fun(t: Terminal), -- function to run when the terminal opens
|
|
||||||
-- on_close = fun(t: Terminal), -- function to run when the terminal closes
|
|
||||||
-- on_stdout = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stdout
|
|
||||||
-- on_stderr = fun(t: Terminal, job: number, data: string[], name: string) -- callback for processing output on stderr
|
|
||||||
-- on_exit = fun(t: Terminal, job: number, exit_code: number, name: string) -- function to run when terminal process exits
|
|
||||||
hide_numbers = true, -- hide the number column in toggleterm buffers
|
|
||||||
-- shade_filetypes = {},
|
|
||||||
autochdir = false, -- when neovim changes it current directory the terminal will change it's own when next it's opened
|
|
||||||
highlights = {
|
|
||||||
-- highlights which map to a highlight group name and a table of it's values
|
|
||||||
-- NOTE: this is only a subset of values, any group placed here will be set for the terminal window split
|
|
||||||
Normal = {
|
|
||||||
guibg = "#24273A",
|
|
||||||
},
|
|
||||||
NormalFloat = {
|
|
||||||
link = "Normal",
|
|
||||||
},
|
|
||||||
-- FloatBorder = {
|
|
||||||
-- guifg = "<VALUE-HERE>",
|
|
||||||
-- guibg = "<VALUE-HERE>",
|
|
||||||
-- },
|
|
||||||
},
|
|
||||||
shade_terminals = false, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false
|
|
||||||
-- shading_factor = '-10', -- the percentage by which to lighten dark terminal background, default: -30
|
|
||||||
-- shading_ratio = '-3', -- the ratio of shading factor for light/dark terminal background, default: -3
|
|
||||||
start_in_insert = true,
|
|
||||||
insert_mappings = true, -- whether or not the open mapping applies in insert mode
|
|
||||||
terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals
|
|
||||||
persist_size = false,
|
|
||||||
persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered
|
|
||||||
-- direction = 'vertical' | 'horizontal' | 'tab' | 'float',
|
|
||||||
direction = "float",
|
|
||||||
-- close_on_exit = true, -- close the terminal window when the process exits
|
|
||||||
-- clear_env = false, -- use only environmental variables from `env`, passed to jobstart()
|
|
||||||
-- Change the default shell. Can be a string or a function returning a string
|
|
||||||
shell = vim.o.shell,
|
|
||||||
auto_scroll = true, -- automatically scroll to the bottom on terminal output
|
|
||||||
-- This field is only relevant if direction is set to 'float'
|
|
||||||
float_opts = {
|
|
||||||
-- The border key is *almost* the same as 'nvim_open_win'
|
|
||||||
-- see :h nvim_open_win for details on borders however
|
|
||||||
-- the 'curved' border is a custom border type
|
|
||||||
-- not natively supported but implemented in this plugin.
|
|
||||||
-- border = 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
|
|
||||||
border = "curved",
|
|
||||||
-- like `size`, width, height, row, and col can be a number or function which is passed the current terminal
|
|
||||||
width = function()
|
|
||||||
return vim.o.columns - 35
|
|
||||||
end,
|
|
||||||
-- height = 75,
|
|
||||||
-- row = <value>,
|
|
||||||
-- col = vim.o.columns * 0.8,
|
|
||||||
winblend = 3,
|
|
||||||
zindex = 10,
|
|
||||||
-- title_pos = 'left' | 'center' | 'right', position of the title of the floating window
|
|
||||||
title_pos = "center",
|
|
||||||
},
|
|
||||||
winbar = {
|
|
||||||
enabled = false,
|
|
||||||
name_formatter = function(term) -- term: Terminal
|
|
||||||
return term.name
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
responsiveness = {
|
|
||||||
-- breakpoint in terms of `vim.o.columns` at which terminals will start to stack on top of each other
|
|
||||||
-- instead of next to each other
|
|
||||||
-- default = 0 which means the feature is turned off
|
|
||||||
horizontal_breakpoint = 135,
|
|
||||||
},
|
|
||||||
})
|
|
@ -1,14 +0,0 @@
|
|||||||
require 'treesitter-context'.setup {
|
|
||||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
|
||||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
|
||||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
|
||||||
line_numbers = true,
|
|
||||||
multiline_threshold = 20, -- Maximum number of lines to show for a single context
|
|
||||||
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
|
||||||
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
|
|
||||||
-- Separator between context and content. Should be a single character string, like '-'.
|
|
||||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
|
||||||
separator = nil,
|
|
||||||
zindex = 20, -- The Z-index of the context window
|
|
||||||
on_attach = nil -- (fun(buf: integer): boolean) return false to disable attaching
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
require 'nvim-treesitter.configs'.setup {
|
|
||||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
|
||||||
ensure_installed = {
|
|
||||||
"c", "lua", "vim", "vimdoc", "query", "cpp", "python", "bash", "sql",
|
|
||||||
"yaml", "toml", "dockerfile", "gitcommit", "gitignore", "html", "css",
|
|
||||||
"javascript", "typescript", "rust", "go", "json", "regex", "latex",
|
|
||||||
"comment", "cmake", "graphql", "haskell", "java", "php", "ruby",
|
|
||||||
"sparql", "vue"
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
|
||||||
sync_install = false,
|
|
||||||
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
|
||||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
-- List of parsers to ignore installing (for "all")
|
|
||||||
-- ignore_install = { "javascript" },
|
|
||||||
|
|
||||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
|
||||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
|
|
||||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
|
||||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
|
||||||
-- the name of the parser)
|
|
||||||
-- list of language that will be disabled
|
|
||||||
-- disable = { "c", "rust" },
|
|
||||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
|
||||||
-- disable = function(lang, buf)
|
|
||||||
-- local max_filesize = 100 * 1024 -- 100 KB
|
|
||||||
-- local ok, stats = pcall(vim.loop.fs_stat,
|
|
||||||
-- vim.api.nvim_buf_get_name(buf))
|
|
||||||
-- if ok and stats and stats.size > max_filesize then
|
|
||||||
-- return true
|
|
||||||
-- end
|
|
||||||
-- end,
|
|
||||||
|
|
||||||
-- 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 = false
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,96 +0,0 @@
|
|||||||
local wk = require("which-key")
|
|
||||||
|
|
||||||
wk.add({
|
|
||||||
{ "<leader>C", group = "ChatGPT", desc = "ChatGPT", icon = "" },
|
|
||||||
{ "<leader>Cd", desc = "Docstring" }, { "<leader>Ce", desc = "Explain Code" },
|
|
||||||
{ "<leader>Cf", desc = "Fix Bugs" },
|
|
||||||
{ "<leader>Ci", desc = "Edit with Instructions" },
|
|
||||||
{ "<leader>Co", desc = "Optimize Code" }, { "<leader>Cs", desc = "Summarize" },
|
|
||||||
{ "<leader>Ct", desc = "Add Tests" },
|
|
||||||
{ "<leader>K", desc = "Show Docs", icon = "" },
|
|
||||||
{ "<leader>T", group = "Telescope", icon = "" },
|
|
||||||
{ "<leader>Tc", desc = "Color Names" }, { "<leader>Tg", desc = "Glyph" },
|
|
||||||
{ "<leader>Tn", desc = "Notifications" }, { "<leader>Tt", desc = "Telescope" },
|
|
||||||
{ "<leader>a", group = "AnyJump", icon = "" },
|
|
||||||
{ "<leader>ab", desc = "Back" }, { "<leader>al", desc = "Last Result" },
|
|
||||||
{ "<leader>b", group = "Buffers" }, { "<leader>bb", desc = "Show Buffers" },
|
|
||||||
{ "<leader>bd", desc = "Delete Buffer" },
|
|
||||||
{ "<leader>bn", desc = "Next Buffer" },
|
|
||||||
{ "<leader>bp", desc = "Previous Buffer" },
|
|
||||||
{ "<leader>c", group = "Code", icon = "" },
|
|
||||||
{ "<leader>cD", group = "Diagnostic List" },
|
|
||||||
{ "<leader>cDn", desc = "Next Diagnostic" },
|
|
||||||
{ "<leader>cDp", desc = "Previous Diagnostic" },
|
|
||||||
{ "<leader>ca", desc = "Code Action" }, { "<leader>cd", desc = "Diagnostics" },
|
|
||||||
{ "<leader>cl", desc = "Set Loclist" },
|
|
||||||
{ "<leader>cp", desc = "Copilot Panel" }, { "<leader>d", group = "Debug" },
|
|
||||||
{ "<leader>dO", desc = "Step Out" }, { "<leader>dP", group = "Dap-python" },
|
|
||||||
{ "<leader>dPc", desc = "Test Class" }, { "<leader>dPm", desc = "Test Method" },
|
|
||||||
{ "<leader>dPs", desc = "Debug Selection" },
|
|
||||||
{ "<leader>db", desc = "Toggle Breakpoint" },
|
|
||||||
{ "<leader>dc", desc = "Continue" }, { "<leader>df", desc = "Frames" },
|
|
||||||
{ "<leader>dh", desc = "Hover" }, { "<leader>di", desc = "Step Into" },
|
|
||||||
{ "<leader>dl", desc = "Run Last" }, { "<leader>do", desc = "Step Over" },
|
|
||||||
{ "<leader>dp", desc = "Preview" }, { "<leader>dr", desc = "REPL Open" },
|
|
||||||
{ "<leader>ds", desc = "Scopes" }, { "<leader>du", group = "Dap UI" },
|
|
||||||
{ "<leader>duc", desc = "Close" }, { "<leader>duo", desc = "Open" },
|
|
||||||
{ "<leader>dut", desc = "Toggle" }, { "<leader>f", group = "Find File" },
|
|
||||||
{ "<leader>fb", desc = "File Browser" }, { "<leader>fc", desc = "File Color" },
|
|
||||||
{ "<leader>ff", desc = "Find in Current Directory" },
|
|
||||||
{ "<leader>fg", desc = "Live Grep" }, { "<leader>fr", desc = "File Recent" },
|
|
||||||
{ "<leader>g", group = "Git" },
|
|
||||||
{ "<leader>gP", desc = "Close goto-preview window" },
|
|
||||||
{ "<leader>gR", desc = "Telescope References" },
|
|
||||||
{ "<leader>gb", desc = "Blame" }, { "<leader>gc", desc = "Commit" },
|
|
||||||
{ "<leader>gf", desc = "Files" }, { "<leader>gg", desc = "Lazygit" },
|
|
||||||
{ "<leader>gp", desc = "Peek" }, { "<leader>gpc", desc = "Close Preview" },
|
|
||||||
{ "<leader>gpd", desc = "Preview Definition" },
|
|
||||||
{ "<leader>gpi", desc = "Preview Implementation" },
|
|
||||||
{ "<leader>h", group = "Help", icon = "" },
|
|
||||||
{ "<leader>hc", desc = "Commands" },
|
|
||||||
{ "<leader>hd", group = "Dap", icon = "" },
|
|
||||||
{ "<leader>hdC", desc = "Configurations" },
|
|
||||||
{ "<leader>hdb", desc = "Breakpoints" }, { "<leader>hdc", desc = "Commands" },
|
|
||||||
{ "<leader>hdf", desc = "Frames" }, { "<leader>hdv", desc = "Variables" },
|
|
||||||
{ "<leader>hk", desc = "Keymaps" }, { "<leader>hs", desc = "Spell Suggest" },
|
|
||||||
{ "<leader>hv", desc = "Vim Options" },
|
|
||||||
{ "<leader>i", group = "Insert", icon = "" },
|
|
||||||
{ "<leader>is", group = "Snippet" }, { "<leader>isp", desc = "Python File" },
|
|
||||||
{ "<leader>j", desc = "Any Jump", icon = "" },
|
|
||||||
{ "<leader>l", group = "LSP", icon = "" },
|
|
||||||
{ "<leader>lD", desc = "Diagnostics" }, { "<leader>lR", desc = "Rename" },
|
|
||||||
{ "<leader>la", desc = "Code Actions" }, { "<leader>lc", group = "Calls" },
|
|
||||||
{ "<leader>lci", desc = "Incoming" }, { "<leader>lco", desc = "Outgoing" },
|
|
||||||
{ "<leader>ld", desc = "Definitions" },
|
|
||||||
{ "<leader>lh", desc = "Signature Help" },
|
|
||||||
{ "<leader>li", desc = "Implementations" },
|
|
||||||
{ "<leader>lr", desc = "References" },
|
|
||||||
{ "<leader>ls", desc = "Document Symbols" },
|
|
||||||
{ "<leader>lt", desc = "Type Definitions" },
|
|
||||||
{ "<leader>lw", desc = "Workspace Symbols" },
|
|
||||||
{ "<leader>n", desc = "NvimTree" },
|
|
||||||
{ "<leader>o", group = "Open", icon = "" }, { "<leader>oB", desc = "Btop" },
|
|
||||||
{ "<leader>oC", desc = "Nvim Config" },
|
|
||||||
{ "<leader>oP", desc = "Ipython (fullscreen)" },
|
|
||||||
{ "<leader>ob", desc = "File Browser" }, { "<leader>oc", desc = "ChatGPT" },
|
|
||||||
{ "<leader>od", desc = "Lazydocker" },
|
|
||||||
{ "<leader>of", desc = "Floating Terminal" },
|
|
||||||
{ "<leader>oh", desc = "Horizontal Terminal" },
|
|
||||||
{ "<leader>op", desc = "Ipython" }, { "<leader>or", desc = "Ranger" },
|
|
||||||
{ "<leader>ot", desc = "Vertical Terminal" }, { "<leader>s", group = "Search" },
|
|
||||||
{ "<leader>sC", desc = "Commands" },
|
|
||||||
{ "<leader>sc", desc = "Clear Highlights" }, { "<leader>sf", desc = "Files" },
|
|
||||||
{ "<leader>sG", desc = "Glyph" }, { "<leader>sg", desc = "Grep" },
|
|
||||||
{ "<leader>sh", desc = "Command History" },
|
|
||||||
{ "<leader>sm", desc = "Man Pages" }, { "<leader>t", group = "Toggle" },
|
|
||||||
{ "<leader>tP", desc = "Ipython (fullscreen)" },
|
|
||||||
{ "<leader>tc", desc = "Colorscheme" }, { "<leader>td", desc = "DBUI" },
|
|
||||||
{ "<leader>tf", desc = "Floating Terminal" },
|
|
||||||
{ "<leader>tp", desc = "Ipython" }, { "<leader>tt", desc = "Split Terminal" },
|
|
||||||
{ "<leader>w", group = "Workspace" }, { "<leader>wa", desc = "Add Folder" },
|
|
||||||
{ "<leader>wl", desc = "List Folders" },
|
|
||||||
{ "<leader>wr", desc = "Remove Folder" },
|
|
||||||
{ "<leader>x", group = "Set Executable Bit", desc = "Set Executable Bit" },
|
|
||||||
{ "<leader>y", desc = "System Yank", icon = "" },
|
|
||||||
{ "<leader>e", desc = "Edit", icon = "" }
|
|
||||||
})
|
|
1
lua/plugins/vim-commentary.lua
Normal file
1
lua/plugins/vim-commentary.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { "tpope/vim-commentary" }
|
1
lua/plugins/vim-wakatime.lua
Normal file
1
lua/plugins/vim-wakatime.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
return { "wakatime/vim-wakatime" }
|
143
lua/plugins/whichkey.lua
Normal file
143
lua/plugins/whichkey.lua
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
return {
|
||||||
|
"folke/which-key.nvim",
|
||||||
|
config = function()
|
||||||
|
local wk = require("which-key")
|
||||||
|
|
||||||
|
wk.add({
|
||||||
|
{ "<leader>C", group = "CodeCompanion", desc = "CodeCompanion", icon = "" },
|
||||||
|
{ "<leader>Ca", desc = "CodeCompanion Actions" },
|
||||||
|
{ "<leader>Cc", desc = "CodeCompanionChat" },
|
||||||
|
{ "<leader>Cd", desc = "Docstring" },
|
||||||
|
{ "<leader>Ce", desc = "Explain Code" },
|
||||||
|
{ "<leader>Ci", desc = "Inline Chat" },
|
||||||
|
{ "<leader>Cf", desc = "Fix Code" },
|
||||||
|
{ "<leader>Cl", desc = "Explain LSP Diagnostics" },
|
||||||
|
{ "<leader>Ct", desc = "Generate Tests" },
|
||||||
|
{ "<leader>CT", desc = "Toggle CodeCompanionChat" },
|
||||||
|
-- { "<leader>Ci", desc = "Edit with Instructions" },
|
||||||
|
-- { "<leader>Co", desc = "Optimize Code" },
|
||||||
|
-- { "<leader>Cs", desc = "Summarize" },
|
||||||
|
{ "<leader>K", desc = "Show Docs", icon = "" },
|
||||||
|
{ "<leader>T", group = "Telescope", icon = "" },
|
||||||
|
{ "<leader>Tc", desc = "Color Names" },
|
||||||
|
{ "<leader>Tg", desc = "Glyph" },
|
||||||
|
{ "<leader>Tn", desc = "Notifications" },
|
||||||
|
{ "<leader>Tt", desc = "Telescope" },
|
||||||
|
{ "<leader>a", group = "AnyJump", icon = "" },
|
||||||
|
{ "<leader>ab", desc = "Back" },
|
||||||
|
{ "<leader>al", desc = "Last Result" },
|
||||||
|
{ "<leader>b", group = "Buffers" },
|
||||||
|
{ "<leader>bb", desc = "Show Buffers" },
|
||||||
|
{ "<leader>bd", desc = "Delete Buffer" },
|
||||||
|
{ "<leader>bn", desc = "Next Buffer" },
|
||||||
|
{ "<leader>bp", desc = "Previous Buffer" },
|
||||||
|
{ "<leader>c", group = "Code", icon = "" },
|
||||||
|
{ "<leader>cD", group = "Diagnostic List" },
|
||||||
|
{ "<leader>cDn", desc = "Next Diagnostic" },
|
||||||
|
{ "<leader>cDp", desc = "Previous Diagnostic" },
|
||||||
|
{ "<leader>ca", desc = "Code Action" },
|
||||||
|
{ "<leader>cd", desc = "Diagnostics" },
|
||||||
|
{ "<leader>cl", desc = "Set Loclist" },
|
||||||
|
{ "<leader>cp", desc = "Copilot Panel" },
|
||||||
|
{ "<leader>d", group = "Debug" },
|
||||||
|
{ "<leader>dO", desc = "Step Out" },
|
||||||
|
{ "<leader>dP", group = "Dap-python" },
|
||||||
|
{ "<leader>dPc", desc = "Test Class" },
|
||||||
|
{ "<leader>dPm", desc = "Test Method" },
|
||||||
|
{ "<leader>dPs", desc = "Debug Selection" },
|
||||||
|
{ "<leader>db", desc = "Toggle Breakpoint" },
|
||||||
|
{ "<leader>dc", desc = "Continue" },
|
||||||
|
{ "<leader>df", desc = "Frames" },
|
||||||
|
{ "<leader>dh", desc = "Hover" },
|
||||||
|
{ "<leader>di", desc = "Step Into" },
|
||||||
|
{ "<leader>dl", desc = "Run Last" },
|
||||||
|
{ "<leader>do", desc = "Step Over" },
|
||||||
|
{ "<leader>dp", desc = "Preview" },
|
||||||
|
{ "<leader>dr", desc = "REPL Open" },
|
||||||
|
{ "<leader>ds", desc = "Scopes" },
|
||||||
|
{ "<leader>du", group = "Dap UI" },
|
||||||
|
{ "<leader>duc", desc = "Close" },
|
||||||
|
{ "<leader>duo", desc = "Open" },
|
||||||
|
{ "<leader>dut", desc = "Toggle" },
|
||||||
|
{ "<leader>f", group = "Find File" },
|
||||||
|
{ "<leader>fb", desc = "File Browser" },
|
||||||
|
{ "<leader>fc", desc = "File Color" },
|
||||||
|
{ "<leader>ff", desc = "Find in Current Directory" },
|
||||||
|
{ "<leader>fg", desc = "Live Grep" },
|
||||||
|
{ "<leader>fr", desc = "File Recent" },
|
||||||
|
{ "<leader>g", group = "Git" },
|
||||||
|
{ "<leader>gP", desc = "Close goto-preview window" },
|
||||||
|
{ "<leader>gR", desc = "Telescope References" },
|
||||||
|
{ "<leader>gb", desc = "Blame" },
|
||||||
|
{ "<leader>gc", desc = "Commit" },
|
||||||
|
{ "<leader>gf", desc = "Files" },
|
||||||
|
{ "<leader>gg", desc = "Lazygit" },
|
||||||
|
{ "<leader>gp", desc = "Peek" },
|
||||||
|
{ "<leader>gpc", desc = "Close Preview" },
|
||||||
|
{ "<leader>gpd", desc = "Preview Definition" },
|
||||||
|
{ "<leader>gpi", desc = "Preview Implementation" },
|
||||||
|
{ "<leader>h", group = "Help", icon = "" },
|
||||||
|
{ "<leader>hc", desc = "Commands" },
|
||||||
|
{ "<leader>hd", group = "Dap", icon = "" },
|
||||||
|
{ "<leader>hdC", desc = "Configurations" },
|
||||||
|
{ "<leader>hdb", desc = "Breakpoints" },
|
||||||
|
{ "<leader>hdc", desc = "Commands" },
|
||||||
|
{ "<leader>hdf", desc = "Frames" },
|
||||||
|
{ "<leader>hdv", desc = "Variables" },
|
||||||
|
{ "<leader>hk", desc = "Keymaps" },
|
||||||
|
{ "<leader>hs", desc = "Spell Suggest" },
|
||||||
|
{ "<leader>hv", desc = "Vim Options" },
|
||||||
|
{ "<leader>i", group = "Insert", icon = "" },
|
||||||
|
{ "<leader>is", group = "Snippet" },
|
||||||
|
{ "<leader>isp", desc = "Python File" },
|
||||||
|
{ "<leader>j", desc = "Any Jump", icon = "" },
|
||||||
|
{ "<leader>cD", desc = "Diagnostics" },
|
||||||
|
{ "<leader>cR", desc = "Rename" },
|
||||||
|
{ "<leader>ca", desc = "Code Actions" },
|
||||||
|
{ "<leader>cc", group = "Calls" },
|
||||||
|
{ "<leader>cci", desc = "Incoming" },
|
||||||
|
{ "<leader>cco", desc = "Outgoing" },
|
||||||
|
{ "<leader>cd", desc = "Definitions" },
|
||||||
|
{ "<leader>ch", desc = "Signature Help" },
|
||||||
|
{ "<leader>ci", desc = "Implementations" },
|
||||||
|
{ "<leader>cr", desc = "References" },
|
||||||
|
{ "<leader>cs", desc = "Document Symbols" },
|
||||||
|
{ "<leader>ct", desc = "Type Definitions" },
|
||||||
|
{ "<leader>cw", desc = "Workspace Symbols" },
|
||||||
|
{ "<leader>n", desc = "NvimTree" },
|
||||||
|
{ "<leader>o", group = "Open", icon = "" },
|
||||||
|
{ "<leader>oB", desc = "Btop" },
|
||||||
|
{ "<leader>oC", desc = "Nvim Config" },
|
||||||
|
{ "<leader>oP", desc = "Ipython (fullscreen)" },
|
||||||
|
{ "<leader>ob", desc = "File Browser" },
|
||||||
|
{ "<leader>oc", desc = "CodeCompanionChat" },
|
||||||
|
{ "<leader>od", desc = "Lazydocker" },
|
||||||
|
{ "<leader>of", desc = "Floating Terminal" },
|
||||||
|
{ "<leader>oh", desc = "Horizontal Terminal" },
|
||||||
|
{ "<leader>op", desc = "Ipython" },
|
||||||
|
{ "<leader>or", desc = "Ranger" },
|
||||||
|
{ "<leader>ot", desc = "Vertical Terminal" },
|
||||||
|
{ "<leader>s", group = "Search" },
|
||||||
|
{ "<leader>sc", desc = "Clear Highlights" },
|
||||||
|
{ "<leader>sf", desc = "Files" },
|
||||||
|
{ "<leader>tG", desc = "Glyph" },
|
||||||
|
{ "<leader>sg", desc = "Grep" },
|
||||||
|
{ "<leader>sh", desc = "Command History" },
|
||||||
|
{ "<leader>sm", desc = "Man Pages" },
|
||||||
|
{ "<leader>t", group = "Toggle" },
|
||||||
|
{ "<leader>tP", desc = "Ipython (fullscreen)" },
|
||||||
|
{ "<leader>tc", desc = "Colorscheme" },
|
||||||
|
{ "<leader>td", desc = "DBUI" },
|
||||||
|
{ "<leader>tf", desc = "Floating Terminal" },
|
||||||
|
{ "<leader>tp", desc = "Ipython" },
|
||||||
|
{ "<leader>tt", desc = "Split Terminal" },
|
||||||
|
{ "<leader>w", group = "Workspace" },
|
||||||
|
{ "<leader>wa", desc = "Add Folder" },
|
||||||
|
{ "<leader>wl", desc = "List Folders" },
|
||||||
|
{ "<leader>wr", desc = "Remove Folder" },
|
||||||
|
{ "<leader>x", group = "Set Executable Bit", desc = "Set Executable Bit" },
|
||||||
|
{ "<leader>y", desc = "System Yank", icon = "" },
|
||||||
|
{ "<leader>e", desc = "Edit", icon = "" },
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user