test 0.12.1 config
This commit is contained in:
105
nvim/.config/nvim/lua/plugins/ai/init.lua
Normal file
105
nvim/.config/nvim/lua/plugins/ai/init.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/olimorris/codecompanion.nvim" },
|
||||
{ src = "https://github.com/nvim-lua/plenary.nvim" },
|
||||
{
|
||||
src = "https://github.com/saghen/blink.cmp",
|
||||
version = vim.version.range("^1"),
|
||||
},
|
||||
})
|
||||
|
||||
local codecompanion = require("codecompanion")
|
||||
-- Dynamically choose the adapter based on the environment variable
|
||||
local active_adapter = os.getenv("GEMINI_API_KEY") and "gemini" or "kiro"
|
||||
|
||||
codecompanion.setup({
|
||||
strategies = {
|
||||
chat = { adapter = active_adapter },
|
||||
inline = { adapter = active_adapter },
|
||||
agent = { adapter = active_adapter },
|
||||
},
|
||||
adapters = {
|
||||
gemini = function()
|
||||
return require("codecompanion.adapters").extend("gemini", {
|
||||
env = {
|
||||
-- We read the API key from the environment variable.
|
||||
-- You can also use "cmd:pass show gemini/api_key" or "cmd:cat ~/.gemini_api_key"
|
||||
api_key = os.getenv("GEMINI_API_KEY") or "cmd:cat ~/.gemini_api_key",
|
||||
},
|
||||
schema = {
|
||||
model = {
|
||||
default = "gemini-3.1-pro-preview",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- If 'kiro' is a custom CLI or local LLM, you must define it here.
|
||||
-- This is a generic custom adapter stub for CodeCompanion:
|
||||
kiro = function()
|
||||
return require("codecompanion.adapters").extend("openai_compatible", {
|
||||
name = "kiro",
|
||||
env = {
|
||||
url = "http://localhost:11434", -- Example endpoint
|
||||
-- api_key = "...",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Optional: Keymaps for CodeCompanion
|
||||
vim.keymap.set({ "n", "v" }, "<leader>a", "<cmd>CodeCompanionChat Toggle<cr>", { noremap = true, silent = true })
|
||||
vim.cmd([[cab cc CodeCompanion]])
|
||||
|
||||
vim.cmd("packadd blink.cmp")
|
||||
local blink = require("blink.cmp")
|
||||
blink.setup({
|
||||
keymap = { preset = "default" },
|
||||
appearance = { nerd_font_variant = "mono" },
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
cmdline = {
|
||||
keymap = { ["<Tab>"] = { "show", "accept" } },
|
||||
completion = { menu = { auto_show = true }, ghost_text = { enabled = true } },
|
||||
},
|
||||
|
||||
-- By removing `snippets = { preset = 'luasnip' }`, Blink natively
|
||||
-- defaults to Neovim 0.11+ built-in `vim.snippet` API.
|
||||
|
||||
sources = {
|
||||
-- Added codecompanion, removed emoji
|
||||
default = { "lsp", "path", "snippets", "buffer", "codecompanion" },
|
||||
providers = {
|
||||
cmdline = {
|
||||
min_keyword_length = function(ctx)
|
||||
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then
|
||||
return 3
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
},
|
||||
-- Wire up CodeCompanion to Blink
|
||||
codecompanion = {
|
||||
name = "CodeCompanion",
|
||||
module = "codecompanion.providers.completion.blink",
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = blink.get_lsp_capabilities(capabilities)
|
||||
|
||||
-- Safely merge with existing global LSP capabilities so we don't overwrite settings from ink/lsp.lua
|
||||
local existing_config = vim.lsp.config["*"]
|
||||
if type(existing_config) == "table" and type(existing_config.capabilities) == "table" then
|
||||
capabilities = vim.tbl_deep_extend("force", existing_config.capabilities, capabilities)
|
||||
end
|
||||
|
||||
-- Apply to all natively loaded 0.12 LSP servers
|
||||
vim.lsp.config("*", {
|
||||
capabilities = capabilities,
|
||||
-- Note: We DO NOT use vim.lsp.completion.enable() here because
|
||||
-- Blink is taking over the UI rendering.
|
||||
})
|
||||
@@ -1,98 +0,0 @@
|
||||
-- Avante.nvim: uses Cursor ACP when the agent binary is available,
|
||||
-- otherwise falls back to the Gemini API (requires GEMINI_API_KEY).
|
||||
local agent_path = os.getenv("HOME") .. "/.local/bin/agent"
|
||||
local has_cursor_agent = vim.uv.fs_stat(agent_path) ~= nil
|
||||
|
||||
local provider = has_cursor_agent and "cursor" or "gemini"
|
||||
|
||||
return {
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
version = false,
|
||||
build = "make",
|
||||
opts = {
|
||||
provider = provider,
|
||||
mode = "agentic",
|
||||
behaviour = {
|
||||
auto_approve_tool_permissions = {
|
||||
"web_search",
|
||||
"fetch",
|
||||
"view",
|
||||
"ls",
|
||||
"glob",
|
||||
"grep",
|
||||
"get_diagnostics",
|
||||
"think",
|
||||
"read_todos",
|
||||
"read_file_toplevel_symbols",
|
||||
"read_definitions",
|
||||
},
|
||||
auto_apply_diff_after_generation = false,
|
||||
enable_fastapply = false,
|
||||
},
|
||||
acp_providers = {
|
||||
cursor = {
|
||||
command = agent_path,
|
||||
args = { "acp" },
|
||||
auth_method = "cursor_login",
|
||||
env = {
|
||||
HOME = os.getenv("HOME"),
|
||||
PATH = os.getenv("PATH"),
|
||||
},
|
||||
},
|
||||
},
|
||||
providers = {
|
||||
gemini = {
|
||||
model = "gemini-2.5-flash",
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("avante").setup(opts)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "AvanteInput",
|
||||
callback = function(args)
|
||||
local buf = args.buf
|
||||
local min_height = 5
|
||||
local max_height = 20
|
||||
|
||||
local function resize_input()
|
||||
local win = vim.fn.bufwinid(buf)
|
||||
if win == -1 or not vim.api.nvim_win_is_valid(win) then
|
||||
return
|
||||
end
|
||||
local lines = vim.api.nvim_buf_line_count(buf)
|
||||
local height = math.max(min_height, math.min(lines + 1, max_height))
|
||||
vim.api.nvim_win_set_height(win, height)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ "TextChanged", "TextChangedI" }, {
|
||||
buffer = buf,
|
||||
callback = resize_input,
|
||||
})
|
||||
resize_input()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{ "<C-\\>", "<cmd>AvanteToggle<cr>", mode = { "n", "v", "i" }, desc = "Toggle Avante Chat" },
|
||||
{ "<leader>aa", "<cmd>AvanteAsk<cr>", desc = "Avante Ask" },
|
||||
{ "<leader>ae", "<cmd>AvanteEdit<cr>", desc = "Avante Edit" },
|
||||
{ "<leader>ar", "<cmd>AvanteRefresh<cr>", desc = "Avante Refresh" },
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
return {
|
||||
-- keymap helper
|
||||
{ "folke/which-key.nvim", opts = {} },
|
||||
{ -- undo tree
|
||||
"mbbill/undotree",
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<Leader>u", vim.cmd.UndotreeToggle, desc = "Toggle undo tree" },
|
||||
},
|
||||
},
|
||||
{ -- minimal and fast autopairs
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
modes = { insert = true, command = true, terminal = false },
|
||||
-- skip autopair when next character is one of these
|
||||
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
|
||||
-- skip autopair when the cursor is inside these treesitter nodes
|
||||
skip_ts = { "string" },
|
||||
-- skip autopair when next character is closing pair
|
||||
-- and there are more closing pairs than opening pairs
|
||||
skip_unbalanced = true,
|
||||
-- better deal with markdown code blocks
|
||||
markdown = true,
|
||||
},
|
||||
},
|
||||
{ -- fugitive
|
||||
"tpope/vim-fugitive",
|
||||
keys = {
|
||||
{ "<Leader>gs", vim.cmd.Git, desc = "Fugitive git command" },
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/flash.nvim",
|
||||
event = "VeryLazy",
|
||||
---@type Flash.Config
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"zk",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").jump()
|
||||
end,
|
||||
desc = "Flash",
|
||||
},
|
||||
{
|
||||
"Zk",
|
||||
mode = { "n", "x", "o" },
|
||||
function()
|
||||
require("flash").treesitter()
|
||||
end,
|
||||
desc = "Flash Treesitter",
|
||||
},
|
||||
{
|
||||
"r",
|
||||
mode = "o",
|
||||
function()
|
||||
require("flash").remote()
|
||||
end,
|
||||
desc = "Remote Flash",
|
||||
},
|
||||
{
|
||||
"R",
|
||||
mode = { "o", "x" },
|
||||
function()
|
||||
require("flash").treesitter_search()
|
||||
end,
|
||||
desc = "Treesitter Search",
|
||||
},
|
||||
{
|
||||
"<c-s>",
|
||||
mode = { "c" },
|
||||
function()
|
||||
require("flash").toggle()
|
||||
end,
|
||||
desc = "Toggle Flash Search",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
22
nvim/.config/nvim/lua/plugins/basic/init.lua
Normal file
22
nvim/.config/nvim/lua/plugins/basic/init.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/folke/which-key.nvim" },
|
||||
{ src = "https://github.com/tpope/vim-fugitive" },
|
||||
{ src = "https://github.com/stevearc/oil.nvim" },
|
||||
{ src = "https://github.com/echasnovski/mini.icons" },
|
||||
{ src = "https://github.com/yorickpeterse/nvim-jump" },
|
||||
})
|
||||
require("which-key").setup({
|
||||
preset = "helix",
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>gs", vim.cmd.Git, { desc = "Fugitive git command" })
|
||||
|
||||
require("oil").setup({
|
||||
default_file_explorer = true,
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>pv", "<cmd>Oil<cr>", { desc = "Open current directory" })
|
||||
vim.keymap.set({ "n", "x", "o" }, "<leader>f", require("jump").start, {})
|
||||
@@ -1,114 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "v2.*",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
local snippets_folder = vim.fn.stdpath("config") .. "/snippets"
|
||||
-- Load all Lua files in the snippets directory except init.lua
|
||||
local files = vim.fn.glob(snippets_folder .. "/*.lua", false, true)
|
||||
for _, file in ipairs(files) do
|
||||
local filename = vim.fn.fnamemodify(file, ":t")
|
||||
-- Remove .lua extension to get the filetype
|
||||
local ft = filename:match("(.+)%.lua$")
|
||||
if ft then
|
||||
-- Load the file which should return a table of snippets
|
||||
local ok, snippets = pcall(dofile, file)
|
||||
if ok and type(snippets) == "table" then
|
||||
ls.add_snippets(ft, snippets)
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = "1.*",
|
||||
dependencies = {
|
||||
"moyiz/blink-emoji.nvim",
|
||||
},
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
enabled = function()
|
||||
return vim.bo.filetype ~= "AvanteInput"
|
||||
end,
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = "default" },
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
cmdline = {
|
||||
keymap = {
|
||||
-- recommended, as the default keymap will only show and select the next item
|
||||
["<Tab>"] = { "show", "accept" },
|
||||
},
|
||||
completion = {
|
||||
menu = { auto_show = true },
|
||||
ghost_text = { enabled = true },
|
||||
},
|
||||
},
|
||||
|
||||
snippets = { preset = "luasnip" },
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer", "emoji" },
|
||||
providers = {
|
||||
cmdline = {
|
||||
min_keyword_length = function(ctx)
|
||||
-- when typing a command, only show when the keyword is 3 characters or longer
|
||||
if ctx.mode == "cmdline" and string.find(ctx.line, " ") == nil then
|
||||
return 3
|
||||
end
|
||||
return 0
|
||||
end,
|
||||
},
|
||||
emoji = {
|
||||
module = "blink-emoji",
|
||||
name = "Emoji",
|
||||
score_offset = 15, -- Tune by preference
|
||||
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||
should_show_items = function()
|
||||
return vim.tbl_contains(
|
||||
-- Enable emoji completion only for git commits and markdown.
|
||||
-- By default, enabled for all file-types.
|
||||
{ "gitcommit", "markdown" },
|
||||
vim.o.filetype
|
||||
)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
default_file_explorer = true,
|
||||
view_options = {
|
||||
show_hidden = true,
|
||||
},
|
||||
},
|
||||
-- Optional dependencies
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<leader>pv", "<cmd>Oil<cr>", desc = "Open current directory" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,133 +0,0 @@
|
||||
return {
|
||||
-- heuristic indent
|
||||
{ "tpope/vim-sleuth" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
--@diagnostic disable-next-line: missing-fields
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
--"zsh",
|
||||
"c",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"go",
|
||||
"gotmpl",
|
||||
"java",
|
||||
"json",
|
||||
"lua",
|
||||
"make",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"rust",
|
||||
"terraform",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
},
|
||||
|
||||
-- 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 (or "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 = {},
|
||||
-- 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,
|
||||
},
|
||||
indent = {
|
||||
enable = false,
|
||||
disable = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
-- brew install stylua
|
||||
lua = { "stylua" },
|
||||
-- install rust
|
||||
rust = { "rustfmt" },
|
||||
-- brew install prettier
|
||||
markdown = { "markdownlint-cli2" },
|
||||
json = { "prettierd", "prettier" },
|
||||
yaml = { "yamlfmt" },
|
||||
-- install terraform
|
||||
terraform = { "terraform_fmt" },
|
||||
-- brew install shfmt
|
||||
bash = { "shfmt" },
|
||||
zsh = { "shfmt" },
|
||||
sh = { "shfmt" },
|
||||
-- brew install ruff
|
||||
python = { "ruff" },
|
||||
-- go install mvdan.cc/gofumpt@latest
|
||||
go = { "gofumpt" },
|
||||
},
|
||||
formatters = {
|
||||
prettier = {
|
||||
prepend_args = { "--prose-wrap", "always" },
|
||||
},
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "4", "-ci" },
|
||||
},
|
||||
ruff = {
|
||||
prepend_args = { "--extend-select", "I" },
|
||||
},
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 3000,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 5000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
79
nvim/.config/nvim/lua/plugins/formatting/init.lua
Normal file
79
nvim/.config/nvim/lua/plugins/formatting/init.lua
Normal file
@@ -0,0 +1,79 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" },
|
||||
{ src = "https://github.com/stevearc/conform.nvim" },
|
||||
})
|
||||
|
||||
require("nvim-treesitter").install({
|
||||
--"zsh",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"go",
|
||||
"gotmpl",
|
||||
"java",
|
||||
"json",
|
||||
"make",
|
||||
"regex",
|
||||
"rust",
|
||||
"terraform",
|
||||
"yaml",
|
||||
})
|
||||
|
||||
-- Default to treesitter folding
|
||||
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldtext = "> "
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, {
|
||||
group = vim.api.nvim_create_augroup("LazyLoadConform", { clear = true }),
|
||||
callback = function()
|
||||
vim.cmd("packadd conform.nvim")
|
||||
local conform = require("conform")
|
||||
conform.setup({
|
||||
formatters_by_ft = {
|
||||
-- brew install stylua
|
||||
lua = { "stylua" },
|
||||
-- install rust
|
||||
rust = { "rustfmt" },
|
||||
-- brew install prettier
|
||||
markdown = { "markdownlint-cli2" },
|
||||
json = { "prettierd", "prettier" },
|
||||
yaml = { "yamlfmt" },
|
||||
-- install terraform
|
||||
terraform = { "terraform_fmt" },
|
||||
-- brew install shfmt
|
||||
bash = { "shfmt" },
|
||||
zsh = { "shfmt" },
|
||||
sh = { "shfmt" },
|
||||
-- brew install ruff
|
||||
python = { "ruff" },
|
||||
-- go install mvdan.cc/gofumpt@latest
|
||||
go = { "gofumpt" },
|
||||
},
|
||||
formatters = {
|
||||
prettier = {
|
||||
prepend_args = { "--prose-wrap", "always" },
|
||||
},
|
||||
shfmt = {
|
||||
prepend_args = { "-i", "4", "-ci" },
|
||||
},
|
||||
ruff = {
|
||||
prepend_args = { "--extend-select", "I" },
|
||||
},
|
||||
},
|
||||
format_on_save = {
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 3000,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set({ "n", "v" }, "<leader>mp", function()
|
||||
conform.format({
|
||||
lsp_fallback = true,
|
||||
async = false,
|
||||
timeout_ms = 5000,
|
||||
})
|
||||
end, { desc = "Format file or range (in visual mode)" })
|
||||
end,
|
||||
})
|
||||
6
nvim/.config/nvim/lua/plugins/init.lua
Normal file
6
nvim/.config/nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
require("plugins.basic")
|
||||
require("plugins.tmux")
|
||||
require("plugins.ui")
|
||||
require("plugins.formatting")
|
||||
require("plugins.linting")
|
||||
require("plugins.ai")
|
||||
@@ -1,39 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
lint.linters_by_ft = {
|
||||
-- brew install luacheck
|
||||
lua = { "luacheck" },
|
||||
bash = { "shellcheck" },
|
||||
sh = { "shellcheck" },
|
||||
-- brew install tflint
|
||||
terraform = { "tflint" },
|
||||
-- brew install markdownlint-cli2
|
||||
markdown = { "markdownlint-cli2" },
|
||||
-- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0
|
||||
go = { "golangcilint" },
|
||||
}
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
vim.keymap.set("n", "<leader>d", function()
|
||||
if vim.diagnostic.config().virtual_lines then
|
||||
vim.diagnostic.config({ virtual_lines = false })
|
||||
else
|
||||
vim.diagnostic.config({ virtual_lines = { current_line = true } })
|
||||
end
|
||||
end, { desc = "Toggle inline diagnostics" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
41
nvim/.config/nvim/lua/plugins/linting/init.lua
Normal file
41
nvim/.config/nvim/lua/plugins/linting/init.lua
Normal file
@@ -0,0 +1,41 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/mfussenegger/nvim-lint" },
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufReadPre", "BufNewFile" }, {
|
||||
group = vim.api.nvim_create_augroup("LazyLoadNvimLint", { clear = true }),
|
||||
callback = function()
|
||||
vim.cmd("packadd lint.nvim")
|
||||
local lint = require("lint")
|
||||
lint.linters_by_ft = {
|
||||
-- brew install luacheck
|
||||
lua = { "luacheck" },
|
||||
bash = { "shellcheck" },
|
||||
sh = { "shellcheck" },
|
||||
-- brew install tflint
|
||||
terraform = { "tflint" },
|
||||
-- brew install markdownlint-cli2
|
||||
markdown = { "markdownlint-cli2" },
|
||||
-- go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.0
|
||||
go = { "golangcilint" },
|
||||
}
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
vim.keymap.set("n", "<leader>l", function()
|
||||
lint.try_lint()
|
||||
end, { desc = "Trigger linting for current file" })
|
||||
vim.keymap.set("n", "<leader>d", function()
|
||||
if vim.diagnostic.config().virtual_lines then
|
||||
vim.diagnostic.config({ virtual_lines = false })
|
||||
else
|
||||
vim.diagnostic.config({ virtual_lines = { current_line = true } })
|
||||
end
|
||||
end, { desc = "Toggle inline diagnostics" })
|
||||
end,
|
||||
})
|
||||
@@ -1,149 +0,0 @@
|
||||
return {
|
||||
{ -- file finder
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
event = "VimEnter",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
-- Only load if `make` is available. Make sure you have the system
|
||||
-- requirements installed.
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
|
||||
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
local builtin = require("telescope.builtin")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-l>"] = actions.select_default, -- open file
|
||||
},
|
||||
n = {
|
||||
["q"] = actions.close,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
file_ignore_patterns = {
|
||||
"node_modules",
|
||||
"target",
|
||||
".terraform",
|
||||
".venv",
|
||||
".git",
|
||||
-- Ignore git submodules
|
||||
"^./.git/",
|
||||
"^./*/.git/",
|
||||
".gitmodules",
|
||||
".gitignore",
|
||||
".*/%.git/.*", -- Ignore any .git directories in subdirectories
|
||||
},
|
||||
hidden = true,
|
||||
-- Ignore git submodules
|
||||
follow = true,
|
||||
},
|
||||
git_files = {
|
||||
recurse_submodules = false,
|
||||
show_untracked = true,
|
||||
},
|
||||
buffers = {
|
||||
initial_mode = "normal",
|
||||
sort_lastused = true,
|
||||
-- sort_mru = true,
|
||||
mappings = {
|
||||
n = {
|
||||
["d"] = actions.delete_buffer,
|
||||
["l"] = actions.select_default,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
live_grep = {
|
||||
file_ignore_patterns = {
|
||||
"node_modules",
|
||||
"target",
|
||||
".terraform",
|
||||
".git",
|
||||
".venv",
|
||||
},
|
||||
additional_args = function(_)
|
||||
return { "--hidden" }
|
||||
end,
|
||||
},
|
||||
path_display = {
|
||||
filename_first = {
|
||||
reverse_directories = true,
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown(),
|
||||
},
|
||||
},
|
||||
git_files = {
|
||||
previewer = false,
|
||||
},
|
||||
})
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "ui-select")
|
||||
|
||||
vim.keymap.set("n", "<leader>pf", builtin.find_files, { desc = "Telescope find files" })
|
||||
vim.keymap.set("n", "<C-p>", builtin.git_files, { desc = "Telescope find git files" })
|
||||
vim.keymap.set("n", "<leader>ps", function()
|
||||
builtin.grep_string({ search = vim.fn.input("Grep > ") })
|
||||
end, { desc = "Telescope grep" })
|
||||
vim.keymap.set("n", "<leader>gc", builtin.git_commits, { desc = "Search [G]it [C]ommits" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>gcf",
|
||||
builtin.git_bcommits,
|
||||
{ desc = "Search [G]it [C]ommits for current [F]ile" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>gb", builtin.git_branches, { desc = "Search [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gs", builtin.git_status, { desc = "Search [G]it [S]tatus (diff view)" })
|
||||
|
||||
vim.keymap.set("n", "<leader>?", builtin.oldfiles, { desc = "[?] Find recently opened files" })
|
||||
vim.keymap.set("n", "<leader>sb", builtin.buffers, { desc = "[S]earch existing [B]uffers" })
|
||||
|
||||
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
|
||||
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
|
||||
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
|
||||
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]resume" })
|
||||
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
||||
vim.keymap.set("n", "<leader>sds", function()
|
||||
builtin.lsp_document_symbols({
|
||||
symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Property" },
|
||||
})
|
||||
end, { desc = "[S]each LSP document [S]ymbols" })
|
||||
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
|
||||
vim.keymap.set("n", "<leader>s/", function()
|
||||
builtin.live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]earch [/] in Open Files" })
|
||||
vim.keymap.set("n", "<leader>/", function()
|
||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
previewer = false,
|
||||
}))
|
||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
return {
|
||||
{ -- integration with tmux config
|
||||
"alexghergh/nvim-tmux-navigation",
|
||||
config = function()
|
||||
local nvim_tmux_nav = require("nvim-tmux-navigation")
|
||||
|
||||
nvim_tmux_nav.setup({
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
})
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<S-left>",
|
||||
nvim_tmux_nav.NvimTmuxNavigateLeft,
|
||||
{ desc = "Move to the split to the left" }
|
||||
)
|
||||
vim.keymap.set("n", "<S-down>", nvim_tmux_nav.NvimTmuxNavigateDown, { desc = "Move to the split below" })
|
||||
vim.keymap.set("n", "<S-up>", nvim_tmux_nav.NvimTmuxNavigateUp, { desc = "Move to the split above" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<S-right>",
|
||||
nvim_tmux_nav.NvimTmuxNavigateRight,
|
||||
{ desc = "Move to the split to the right" }
|
||||
)
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<C-\\>",
|
||||
nvim_tmux_nav.NvimTmuxNavigateLastActive,
|
||||
{ desc = "Move to the last active split" }
|
||||
)
|
||||
vim.keymap.set("n", "<C-Space>", nvim_tmux_nav.NvimTmuxNavigateNext, { desc = "Move to the next split" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
16
nvim/.config/nvim/lua/plugins/tmux/init.lua
Normal file
16
nvim/.config/nvim/lua/plugins/tmux/init.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/alexghergh/nvim-tmux-navigation" },
|
||||
})
|
||||
|
||||
local nvim_tmux_nav = require("nvim-tmux-navigation")
|
||||
|
||||
nvim_tmux_nav.setup({
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<S-left>", nvim_tmux_nav.NvimTmuxNavigateLeft, { desc = "Move to the split to the left" })
|
||||
vim.keymap.set("n", "<S-down>", nvim_tmux_nav.NvimTmuxNavigateDown, { desc = "Move to the split below" })
|
||||
vim.keymap.set("n", "<S-up>", nvim_tmux_nav.NvimTmuxNavigateUp, { desc = "Move to the split above" })
|
||||
vim.keymap.set("n", "<S-right>", nvim_tmux_nav.NvimTmuxNavigateRight, { desc = "Move to the split to the right" })
|
||||
vim.keymap.set("n", "<C-\\>", nvim_tmux_nav.NvimTmuxNavigateLastActive, { desc = "Move to the last active split" })
|
||||
vim.keymap.set("n", "<C-Space>", nvim_tmux_nav.NvimTmuxNavigateNext, { desc = "Move to the next split" })
|
||||
@@ -1,207 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"zaldih/themery.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("themery").setup({
|
||||
-- add the config here
|
||||
themes = { "rose-pine-dawn", "rose-pine-main" }, -- Your list of installed colorschemes.
|
||||
livePreview = true, -- Apply theme while picking. Default to true.
|
||||
})
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
local themery = require("themery")
|
||||
local currentTheme = themery.getCurrentTheme()
|
||||
if currentTheme and currentTheme.name == "rose-pine-dawn" then
|
||||
themery.setThemeByName("rose-pine-main", true)
|
||||
else
|
||||
themery.setThemeByName("rose-pine-dawn", true)
|
||||
end
|
||||
end, { noremap = true, desc = "Alternate between light and dark mode" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
config = function()
|
||||
-- vim.cmd("colorscheme rose-pine")
|
||||
end,
|
||||
},
|
||||
-- highlight color hex codes
|
||||
{
|
||||
"brenoprata10/nvim-highlight-colors",
|
||||
opts = {},
|
||||
config = function()
|
||||
local highlight = require("nvim-highlight-colors")
|
||||
highlight.setup()
|
||||
end,
|
||||
},
|
||||
{ --statusline
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
lazy = false,
|
||||
opts = {
|
||||
options = {
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
theme = "rose-pine",
|
||||
},
|
||||
-- extensions = { "neo-tree", "lazy", "fzf" },
|
||||
extensions = { "fugitive", "lazy" },
|
||||
},
|
||||
},
|
||||
{ -- git symbols on sidebar
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"f-person/git-blame.nvim",
|
||||
-- load the plugin at startup
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>gk", "<cmd>GitBlameToggle<cr>", desc = "Toggle git-blame" },
|
||||
},
|
||||
config = function()
|
||||
vim.g.gitblame_display_virtual_text = false
|
||||
-- schedule_event = "CursorHold"
|
||||
-- clear_event = "CursorHoldI"
|
||||
vim.g.gitblame_delay = 50 -- miliseconds
|
||||
local git_blame = require("gitblame")
|
||||
require("lualine").setup({
|
||||
sections = {
|
||||
lualine_c = {
|
||||
{ "filename" },
|
||||
{ git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{ -- cosmetic indent lines
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = {
|
||||
indent = {
|
||||
char = "▏",
|
||||
},
|
||||
scope = {
|
||||
show_start = false,
|
||||
show_end = false,
|
||||
show_exact_scope = false,
|
||||
},
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help",
|
||||
"startify",
|
||||
"dashboard",
|
||||
"packer",
|
||||
"neogitstatus",
|
||||
"NvimTree",
|
||||
"Trouble",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{ -- colorful mode indicators
|
||||
"mvllow/modes.nvim",
|
||||
tag = "v0.2.1",
|
||||
config = function()
|
||||
require("modes").setup()
|
||||
end,
|
||||
},
|
||||
{ -- dashboard snack
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
dashboard = {
|
||||
preset = {
|
||||
header = [[
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗
|
||||
████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║
|
||||
██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║
|
||||
██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║
|
||||
██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║
|
||||
╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]],
|
||||
},
|
||||
sections = {
|
||||
{ section = "header" },
|
||||
{
|
||||
pane = 2,
|
||||
section = "terminal",
|
||||
cmd = "pokemon-colorscripts -n snorlax --no-title; sleep .1",
|
||||
height = 20,
|
||||
padding = 0,
|
||||
},
|
||||
{ section = "keys", gap = 1, padding = 1 },
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Recent Files",
|
||||
section = "recent_files",
|
||||
indent = 2,
|
||||
padding = 1,
|
||||
},
|
||||
{ pane = 2, icon = " ", title = "Projects", section = "projects", indent = 2, padding = 1 },
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Git Status",
|
||||
section = "terminal",
|
||||
enabled = function()
|
||||
return Snacks.git.get_root() ~= nil
|
||||
end,
|
||||
cmd = "git status --short --branch --renames",
|
||||
height = 5,
|
||||
padding = 1,
|
||||
ttl = 5 * 60,
|
||||
indent = 3,
|
||||
},
|
||||
{ section = "startup" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
|
||||
---@module 'render-markdown'
|
||||
---@type render.md.UserConfig
|
||||
opts = {},
|
||||
config = function()
|
||||
require("render-markdown").setup({
|
||||
completions = { lsp = { enabled = true } },
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
84
nvim/.config/nvim/lua/plugins/ui/init.lua
Normal file
84
nvim/.config/nvim/lua/plugins/ui/init.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
require("vim._core.ui2").enable({
|
||||
enable = true,
|
||||
})
|
||||
|
||||
vim.opt.cmdheight = 2 -- more space in the neovim command line for displaying messages
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/rose-pine/neovim" },
|
||||
{ src = "https://github.com/zaldih/themery.nvim" },
|
||||
{ src = "https://github.com/mvllow/modes.nvim", version = "v0.3.0" },
|
||||
{ src = "https://github.com/brenoprata10/nvim-highlight-colors" },
|
||||
})
|
||||
|
||||
require("themery").setup({
|
||||
-- add the config here
|
||||
themes = { "rose-pine-dawn", "rose-pine-main" }, -- Your list of installed colorschemes.
|
||||
livePreview = true, -- Apply theme while picking. Default to true.
|
||||
})
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
local themery = require("themery")
|
||||
local currentTheme = themery.getCurrentTheme()
|
||||
if currentTheme and currentTheme.name == "rose-pine-dawn" then
|
||||
themery.setThemeByName("rose-pine-main", true)
|
||||
else
|
||||
themery.setThemeByName("rose-pine-dawn", true)
|
||||
end
|
||||
end, { noremap = true, desc = "Alternate between light and dark mode" })
|
||||
|
||||
require("nvim-highlight-colors").setup()
|
||||
require("modes").setup()
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/nvim-tree/nvim-web-devicons" },
|
||||
{ src = "https://github.com/nvim-lualine/lualine.nvim" },
|
||||
{ src = "https://github.com/lukas-reineke/indent-blankline.nvim" },
|
||||
})
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
section_separators = "",
|
||||
component_separators = "",
|
||||
theme = "rose-pine",
|
||||
},
|
||||
extensions = { "fugitive", "lazy" },
|
||||
})
|
||||
|
||||
require("ibl").setup()
|
||||
|
||||
vim.pack.add({
|
||||
{ src = "https://github.com/lewis6991/gitsigns.nvim" },
|
||||
{ src = "https://github.com/f-person/git-blame.nvim" },
|
||||
})
|
||||
|
||||
require("gitsigns").setup({
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>gk", "<cmd>GitBlameToggle<cr>", { desc = "Toggle git-blame" })
|
||||
vim.g.gitblame_display_virtual_text = false
|
||||
-- schedule_event = "CursorHold"
|
||||
-- clear_event = "CursorHoldI"
|
||||
vim.g.gitblame_delay = 50 -- miliseconds
|
||||
local git_blame = require("gitblame")
|
||||
require("lualine").setup({
|
||||
sections = {
|
||||
lualine_c = {
|
||||
{ "filename" },
|
||||
{ git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available },
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user