Add .config/nvim/colors/colibri.lua
Add .config/nvim/.luarc.json Add .config/nvim/init.lua Add .config/nvim/lazy-lock.json Add .config/nvim/lua/config/00_lazy.lua Add .config/nvim/lua/config/10_opts.lua Add .config/nvim/lua/config/20_keymaps.lua Add .config/nvim/lua/config/30_autocmds.lua Add .config/nvim/lua/config/40_statusline.lua Add .config/nvim/lua/plugin/00_treesitter.lua Add .config/nvim/lua/plugin/01_lsp.lua Add .config/nvim/lua/plugin/02_completion.lua Add .config/nvim/lua/plugin/03_tmux.lua Add .config/nvim/lua/plugin/04_fzflua.lua Add .config/nvim/lua/plugin/05_whichkey.lua Add .config/nvim/lua/plugin/06_leap.lua Add .config/nvim/lua/plugin/07_oil.lua Add .config/nvim/lua/plugin/08_ai.lua Add .config/nvim/lua/plugin/09_gitsigns.lua Add .config/nvim/lua/plugin/10_conform.lua Add .config/nvim/lua/plugin/11_yanky.lua Add .config/nvim/lua/plugin/12_neoscroll.lua Add .config/nvim/lua/plugin/13_easyalign.lua Add .config/nvim/lua/plugin/14_obsidian.lua Add .config/nvim/snippets/global.json Add .config/nvim/snippets/lua.json Add .config/nvim/snippets/package.json Add .config/nvim/stylua.toml
This commit is contained in:
parent
cf0d36c81a
commit
1f236c5459
28 changed files with 967 additions and 0 deletions
28
private_dot_config/nvim/lua/config/00_lazy.lua
Normal file
28
private_dot_config/nvim/lua/config/00_lazy.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
-- 00_lazy.lua
|
||||
-- Bootstraps 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)
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
{ import = "plugin" },
|
||||
},
|
||||
install = { colorscheme = { "habamax" } },
|
||||
checker = { enabled = true, notify = false },
|
||||
})
|
||||
44
private_dot_config/nvim/lua/config/10_opts.lua
Normal file
44
private_dot_config/nvim/lua/config/10_opts.lua
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
-- 10_opts.lua
|
||||
-- stylua: ignore start
|
||||
-- General ===================================
|
||||
vim.g.mapleader = " "
|
||||
vim.o.mouse = ""
|
||||
vim.o.mousescroll = "ver:25,hor:6"
|
||||
vim.o.switchbuf = "usetab"
|
||||
vim.o.undofile = true
|
||||
-- UI ========================================
|
||||
vim.o.breakindent = true
|
||||
vim.o.breakindentopt = "list:-1"
|
||||
vim.o.colorcolumn = "+1"
|
||||
vim.o.cursorline = true
|
||||
vim.o.linebreak = true
|
||||
vim.o.list = true
|
||||
vim.o.number = true
|
||||
vim.o.relativenumber = true
|
||||
vim.o.pumheight = 10
|
||||
vim.o.ruler = false
|
||||
vim.o.signcolumn = "yes"
|
||||
vim.o.splitbelow = true
|
||||
vim.o.splitright = true
|
||||
vim.o.winborder = "single"
|
||||
vim.o.wrap = false
|
||||
vim.o.cursorlineopt = "screenline,number"
|
||||
-- Folds =====================================
|
||||
vim.o.foldlevel = 10
|
||||
vim.o.foldmethod = "indent"
|
||||
vim.o.foldnestmax = 10
|
||||
vim.o.foldtext = ""
|
||||
-- Editing ===================================
|
||||
vim.o.autoindent = true
|
||||
vim.o.expandtab = true
|
||||
vim.o.ignorecase = true
|
||||
vim.o.incsearch = true
|
||||
vim.o.infercase = true
|
||||
vim.o.smartcase = true
|
||||
vim.o.smartindent = true
|
||||
vim.o.virtualedit = "block"
|
||||
vim.o.iskeyword = "@,48-57,_,192-255,-"
|
||||
vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
-- Diagnostic ================================
|
||||
vim.diagnostic.config({ virtual_text = true })
|
||||
38
private_dot_config/nvim/lua/config/20_keymaps.lua
Normal file
38
private_dot_config/nvim/lua/config/20_keymaps.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
-- 20_keymaps.lua
|
||||
---@diagnostic disable: unused-local, unused-function
|
||||
-- stylua: ignore start
|
||||
|
||||
local map = function(mode, lhs, rhs, desc)
|
||||
vim.keymap.set(mode, lhs, rhs, { noremap = true, desc = desc })
|
||||
end
|
||||
|
||||
local nop = function(lhs) map({ "n", "v" }, lhs, "<nop>", "") end
|
||||
local nmap = function(lhs, rhs, desc) map("n", lhs, rhs, desc) end
|
||||
local xmap = function(lhs, rhs, desc) map("x", lhs, rhs, desc) end
|
||||
|
||||
local nmap_leader = function(lhs, rhs, desc) nmap("<Leader>" .. lhs, rhs, desc) end
|
||||
|
||||
nop('<C-w>s')
|
||||
nop('<C-w>v')
|
||||
|
||||
nmap_leader(';', '<Cmd>vsplit<CR>', 'vsplit')
|
||||
nmap_leader('-', '<Cmd>split<CR>', 'hsplit')
|
||||
|
||||
nmap_leader('ca', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'lsp code action')
|
||||
nmap_leader('ci', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'lsp find implementation')
|
||||
nmap_leader('cr', '<Cmd>lua vim.lsp.buf.references()<CR>', 'lsp find references')
|
||||
nmap_leader('cR', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'lsp rename')
|
||||
|
||||
local c = function(rhs)
|
||||
return function()
|
||||
local count = vim.v.count1
|
||||
for _ = 1, count do
|
||||
vim.cmd(rhs)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
nmap(">", c("normal! >>"), "indent")
|
||||
nmap("<", c("normal! <<"), "dedent")
|
||||
xmap(">", ">gv", "indent and reselect")
|
||||
xmap("<", "<gv", "dedent and reselect")
|
||||
8
private_dot_config/nvim/lua/config/30_autocmds.lua
Normal file
8
private_dot_config/nvim/lua/config/30_autocmds.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
-- 30_autocmds.lua
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
desc = 'Highlight when yanking text',
|
||||
group = vim.api.nvim_create_augroup('highlight-yank', { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
19
private_dot_config/nvim/lua/config/40_statusline.lua
Normal file
19
private_dot_config/nvim/lua/config/40_statusline.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
-- 40_statusline.lua
|
||||
|
||||
local cmp = {}
|
||||
|
||||
function _G._statusline_component(name)
|
||||
return cmp[name]()
|
||||
end
|
||||
|
||||
function cmp.window()
|
||||
return vim.api.nvim_win_get_number(0)
|
||||
end
|
||||
|
||||
local statusline = {
|
||||
"%r",
|
||||
"%m",
|
||||
"%=",
|
||||
}
|
||||
|
||||
vim.o.statusline = table.concat(statusline, "")
|
||||
15
private_dot_config/nvim/lua/plugin/00_treesitter.lua
Normal file
15
private_dot_config/nvim/lua/plugin/00_treesitter.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
branch = "master",
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
config = function()
|
||||
require("treesitter-context").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
49
private_dot_config/nvim/lua/plugin/01_lsp.lua
Normal file
49
private_dot_config/nvim/lua/plugin/01_lsp.lua
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
return {
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "copilot" },
|
||||
},
|
||||
dependencies = {
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = {
|
||||
registries = {
|
||||
"github:mason-org/mason-registry",
|
||||
"github:Crashdummyy/mason-registry",
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "neovim/nvim-lspconfig" },
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"seblyng/roslyn.nvim",
|
||||
config = function()
|
||||
vim.lsp.config("roslyn", {
|
||||
on_attach = function()
|
||||
print("Roslyn attached.")
|
||||
end,
|
||||
settings = {
|
||||
["csharp|inlay_hints"] = {
|
||||
csharp_enable_inlay_hints_for_implicit_object_creation = true,
|
||||
csharp_enable_inlay_hints_for_implicit_variable_types = true,
|
||||
},
|
||||
["csharp|code_lens"] = {
|
||||
dotnet_enable_references_code_lens = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("roslyn").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
67
private_dot_config/nvim/lua/plugin/02_completion.lua
Normal file
67
private_dot_config/nvim/lua/plugin/02_completion.lua
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
return {
|
||||
{ "nvim-mini/mini.pairs", opts = {} },
|
||||
{
|
||||
"saghen/blink.cmp",
|
||||
dependencies = {
|
||||
"rafamadriz/friendly-snippets",
|
||||
"fang2hou/blink-copilot",
|
||||
},
|
||||
version = "1.*",
|
||||
opts = {
|
||||
keymap = { preset = "super-tab" },
|
||||
appearance = { nerd_font_variant = "mono" },
|
||||
completion = {
|
||||
documentation = { auto_show = true, auto_show_delay_ms = 0 },
|
||||
},
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer", "copilot" },
|
||||
providers = {
|
||||
copilot = {
|
||||
name = "copilot",
|
||||
module = "blink-copilot",
|
||||
score_offset = 100,
|
||||
async = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
cmdline = {
|
||||
keymap = { preset = "inherit" },
|
||||
completion = { menu = { auto_show = true } },
|
||||
},
|
||||
},
|
||||
opts_extend = { "sources.default" },
|
||||
},
|
||||
{
|
||||
"nvim-mini/mini.snippets",
|
||||
opts = function()
|
||||
local gen_loader = require("mini.snippets").gen_loader
|
||||
return {
|
||||
snippets = {
|
||||
gen_loader.from_file(
|
||||
vim.fn.stdpath("config") .. "/snippets/global.json"
|
||||
),
|
||||
gen_loader.from_lang(),
|
||||
},
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
"chrisgrieser/nvim-scissors",
|
||||
opts = { snippetDir = vim.fn.stdpath("config") .. "/snippets" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>sa",
|
||||
"<cmd>ScissorsAddNewSnippet<CR>",
|
||||
mode = { "n", "x" },
|
||||
desc = "Save selection as snippet",
|
||||
},
|
||||
{
|
||||
"<leader>se",
|
||||
"<cmd>ScissorsEditSnippet<CR>",
|
||||
mode = { "n", "x" },
|
||||
desc = "Edit existing snippet",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
48
private_dot_config/nvim/lua/plugin/03_tmux.lua
Normal file
48
private_dot_config/nvim/lua/plugin/03_tmux.lua
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
{
|
||||
"aserowy/tmux.nvim",
|
||||
opts = {
|
||||
copy_sync = {
|
||||
enable = true,
|
||||
ignore_buffers = { empty = false },
|
||||
redirect_to_clipboard = false,
|
||||
register_offset = 0,
|
||||
sync_clipboard = false,
|
||||
sync_registers = true,
|
||||
sync_registers_keymap_put = true,
|
||||
sync_registers_keymap_reg = true,
|
||||
sync_deletes = true,
|
||||
sync_unnamed = true,
|
||||
},
|
||||
navigation = {
|
||||
cycle_navigation = true,
|
||||
enable_default_keybindings = false,
|
||||
persist_zoom = false,
|
||||
},
|
||||
resize = {
|
||||
enable_default_keybindings = false,
|
||||
resize_step_x = 5,
|
||||
resize_step_y = 3,
|
||||
},
|
||||
swap = {
|
||||
cycle_navigation = false,
|
||||
enable_default_kebindings = false,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<M-Left>", function() require("tmux").move_left() end, },
|
||||
{ "<M-Right>", function() require("tmux").move_right() end, },
|
||||
{ "<M-Up>", function() require("tmux").move_top() end, },
|
||||
{ "<M-Down>", function() require("tmux").move_bottom() end, },
|
||||
{ "<M-C-Left>", function() require("tmux").resize_left() end, },
|
||||
{ "<M-C-Right>", function() require("tmux").resize_right() end, },
|
||||
{ "<M-C-Up>", function() require("tmux").resize_top() end, },
|
||||
{ "<M-C-Down>", function() require("tmux").resize_bottom() end, },
|
||||
{ "<M-S-Left>", function() require("tmux").swap_left() end, },
|
||||
{ "<M-S-Right>", function() require("tmux").swap_right() end, },
|
||||
{ "<M-S-Up>", function() require("tmux").swap_top() end, },
|
||||
{ "<M-S-Down>", function() require("tmux").swap_bottom() end, },
|
||||
},
|
||||
},
|
||||
}
|
||||
28
private_dot_config/nvim/lua/plugin/04_fzflua.lua
Normal file
28
private_dot_config/nvim/lua/plugin/04_fzflua.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
{
|
||||
"ibhagwan/fzf-lua",
|
||||
dependencies = { { "nvim-mini/mini.icons" } },
|
||||
opts = {
|
||||
winopts = {
|
||||
preview = {
|
||||
vertical = "down:65%",
|
||||
flip_columns = 120,
|
||||
},
|
||||
},
|
||||
files = { git_icons = true },
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ '<leader>f"', "<cmd>FzfLua registers<CR>", mode = { "n" }, desc = "fzf registers" },
|
||||
{ "<leader>fb", "<cmd>FzfLua buffers<CR>", mode = { "n" }, desc = "fzf buffers" },
|
||||
{ "<leader>fc", "<cmd>FzfLua commands<CR>", mode = { "n" }, desc = "fzf commands" },
|
||||
{ "<leader>fe", "<cmd>FzfLua changes<CR>", mode = { "n" }, desc = "fzf edits" },
|
||||
{ "<leader>ff", "<cmd>FzfLua files<CR>", mode = { "n" }, desc = "fzf files" },
|
||||
{ "<leader>fg", "<cmd>FzfLua live_grep<CR>", mode = { "n" }, desc = "fzf grep" },
|
||||
{ "<leader>fh", "<cmd>FzfLua command_history<CR>", mode = { "n" }, desc = "fzf cmd history" },
|
||||
{ "<leader>fk", "<cmd>FzfLua keymaps<CR>", mode = { "n" }, desc = "fzf keymaps" },
|
||||
{ "<leader>fr", "<cmd>FzfLua oldfiles<CR>", mode = { "n" }, desc = "fzf oldfiles" },
|
||||
{ "<leader>fs", "<cmd>FzfLua<CR>", mode = { "n" }, desc = "fzf something else" },
|
||||
},
|
||||
},
|
||||
}
|
||||
34
private_dot_config/nvim/lua/plugin/05_whichkey.lua
Normal file
34
private_dot_config/nvim/lua/plugin/05_whichkey.lua
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
return {
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "echasnovski/mini.icons" },
|
||||
opts = function()
|
||||
local i = require("mini.icons")
|
||||
|
||||
return {
|
||||
preset = "helix",
|
||||
delay = function(ctx)
|
||||
return ctx.plugin and 0 or 20
|
||||
end,
|
||||
-- stylua: ignore
|
||||
spec = {
|
||||
{ "<leader>f", group = "find" },
|
||||
{ "<leader>a", group = "ai" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>c", group = "lsp actions", icon = i.get("lsp", "class") },
|
||||
{ "<leader>s", group = "snippets", icon = i.get("directory", "snippets") },
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = true })
|
||||
end,
|
||||
desc = "show local keymaps",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
45
private_dot_config/nvim/lua/plugin/06_leap.lua
Normal file
45
private_dot_config/nvim/lua/plugin/06_leap.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
{
|
||||
"ggandor/leap.nvim",
|
||||
config = function()
|
||||
require("leap").opts.preview = function(ch0, ch1, ch2)
|
||||
return not (
|
||||
ch1:match("%s")
|
||||
or (ch0:match("%a") and ch1:match("%a") and ch2:match("%a"))
|
||||
)
|
||||
end
|
||||
|
||||
-- hop label at start of word, rather than the end
|
||||
require("leap").opts.on_beacons = function(targets, _, _)
|
||||
for _, t in ipairs(targets) do
|
||||
if t.label and t.beacon then
|
||||
t.beacon[1] = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- gray out backdrop when selecting
|
||||
vim.api.nvim_set_hl(0, "LeapBackdrop", { link = "Comment" })
|
||||
|
||||
require("leap").opts.equivalence_classes = {
|
||||
" \t\r\n",
|
||||
"([{",
|
||||
")]}",
|
||||
"'\"`",
|
||||
}
|
||||
|
||||
vim.keymap.set({ "n", "x", "o" }, "s", function()
|
||||
require("leap").leap({ target_windows = vim.api.nvim_list_wins() })
|
||||
if vim.fn.mode() == "v" then
|
||||
vim.cmd("normal! iw")
|
||||
end
|
||||
end)
|
||||
|
||||
vim.keymap.set({ "n", "o" }, "gs", function()
|
||||
require("leap.remote").action({
|
||||
input = vim.fn.mode(true):match("o") and "" or "v",
|
||||
})
|
||||
end)
|
||||
end,
|
||||
},
|
||||
}
|
||||
32
private_dot_config/nvim/lua/plugin/07_oil.lua
Normal file
32
private_dot_config/nvim/lua/plugin/07_oil.lua
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
{
|
||||
"stevearc/oil.nvim",
|
||||
dependencies = { { "nvim-mini/mini.icons" } },
|
||||
opts = {
|
||||
use_default_keymaps = false,
|
||||
keymaps = {
|
||||
["g?"] = { "actions.show_help", mode = "n" },
|
||||
["<CR>"] = "actions.select",
|
||||
["<leader><leader>"] = "actions.preview",
|
||||
["-"] = { "actions.parent", mode = "n" },
|
||||
["="] = { "actions.open_cwd", mode = "n" },
|
||||
["+"] = { "actions.cd", mode = "n" },
|
||||
["<leader>;"] = { "actions.select", opts = { vertical = true } },
|
||||
["<leader>-"] = { "actions.select", opts = { horizontal = true } },
|
||||
["<leader>x"] = "actions.open_external",
|
||||
["g."] = { "actions.toggle_hidden", mode = "n" },
|
||||
},
|
||||
float = {
|
||||
padding = 2,
|
||||
max_width = 0,
|
||||
max_height = 0,
|
||||
border = nil,
|
||||
preview_split = "auto",
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<leader>o", mode = "n", "<Cmd>Oil<CR>", desc = "oil" },
|
||||
},
|
||||
},
|
||||
}
|
||||
77
private_dot_config/nvim/lua/plugin/08_ai.lua
Normal file
77
private_dot_config/nvim/lua/plugin/08_ai.lua
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
return {
|
||||
{
|
||||
"olimorris/codecompanion.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
{
|
||||
"MeanderingProgrammer/render-markdown.nvim",
|
||||
ft = { "markdown", "codecompanion" },
|
||||
},
|
||||
{
|
||||
"nvim-mini/mini.diff",
|
||||
config = function()
|
||||
require("mini.diff").setup({
|
||||
source = require("mini.diff").gen_source.none(),
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"HakonHarnes/img-clip.nvim",
|
||||
opts = {
|
||||
filetypes = {
|
||||
codecompanion = {
|
||||
prompt_for_file_name = false,
|
||||
template = "[Image]($FILE_PATH)",
|
||||
use_absolute_path = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- stylua: ignore start
|
||||
keys = {
|
||||
{ "<leader>ac", mode = { "n", "v" }, "<cmd>CodeCompanionChat Toggle<cr>", desc = "toggle chat" },
|
||||
{ "<leader>aa", mode = { "n", "v" }, "<cmd>CodeCompanionActions<cr>", desc = "actions picker" },
|
||||
{ "<leader>ap", mode = { "v" }, "<cmd>CodeCompanionChat Add<cr>", desc = "put in chat", },
|
||||
{ "<leader>ai", mode = { "n", "v" }, "<cmd>CodeCompanion<cr>", desc = "in-line prompt", },
|
||||
},
|
||||
-- stylua: ignore end
|
||||
opts = {
|
||||
strategies = {
|
||||
chat = {
|
||||
variables = {
|
||||
["buffer"] = {
|
||||
opts = {
|
||||
default_params = "watch",
|
||||
},
|
||||
},
|
||||
},
|
||||
slash_commands = {
|
||||
["buffer"] = {
|
||||
keymaps = {
|
||||
modes = {
|
||||
i = "<c-b>",
|
||||
n = "<leader>b",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
display = {
|
||||
action_palette = {
|
||||
width = 85,
|
||||
height = 10,
|
||||
prompt = "prompt:",
|
||||
provider = "fzf_lua",
|
||||
opts = {
|
||||
show_default_actions = true,
|
||||
show_default_prompt_library = true,
|
||||
title = "action:",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
36
private_dot_config/nvim/lua/plugin/09_gitsigns.lua
Normal file
36
private_dot_config/nvim/lua/plugin/09_gitsigns.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>gb",
|
||||
function()
|
||||
require("gitsigns").blame_line()
|
||||
end,
|
||||
desc = "git blame current line",
|
||||
},
|
||||
{
|
||||
"<leader>g]",
|
||||
function()
|
||||
require("gitsigns").nav_hunk("next")
|
||||
end,
|
||||
desc = "git next hunk",
|
||||
},
|
||||
{
|
||||
"<leader>g[",
|
||||
function()
|
||||
require("gitsigns").nav_hunk("prev")
|
||||
end,
|
||||
desc = "git prev hunk",
|
||||
},
|
||||
{
|
||||
"<leader>gp",
|
||||
function()
|
||||
require("gitsigns").preview_hunk_inline()
|
||||
end,
|
||||
desc = "git preview hunk",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
39
private_dot_config/nvim/lua/plugin/10_conform.lua
Normal file
39
private_dot_config/nvim/lua/plugin/10_conform.lua
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
{
|
||||
"tpope/vim-sleuth",
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{
|
||||
"<leader>af",
|
||||
function()
|
||||
require("conform").format({ async = true })
|
||||
end,
|
||||
mode = "",
|
||||
desc = "format buffer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
format_on_save = { timeout_ms = 500 },
|
||||
formatters = {
|
||||
shfmt = {
|
||||
append_args = { "-i", "2" },
|
||||
},
|
||||
},
|
||||
},
|
||||
init = function()
|
||||
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
|
||||
end,
|
||||
},
|
||||
}
|
||||
19
private_dot_config/nvim/lua/plugin/11_yanky.lua
Normal file
19
private_dot_config/nvim/lua/plugin/11_yanky.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
{
|
||||
"gbprod/yanky.nvim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "y", "<Plug>(YankyYank)", desc = "yank" },
|
||||
{ "p", "<Plug>(YankyPutAfter)", mode = { "n", "x" }, desc = "put after" },
|
||||
{ "P", "<Plug>(YankyPutBefore)", mode = { "n", "x" }, desc = "put before" },
|
||||
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", mode = { "n", "x" }, desc = "put after line" },
|
||||
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", mode = { "n", "x" }, desc = "put before line" },
|
||||
{ "<c-p>", "<Plug>(YankyPreviousEntry)", mode = "n", desc = "previous yank" },
|
||||
{ "<c-n>", "<Plug>(YankyNextEntry)", mode = "n", desc = "next yank" },
|
||||
{ "<leader>fy", "<Cmd>YankyRingHistory<CR>", mode = { "n", "x" }, desc = "yank history" },
|
||||
},
|
||||
opts = {
|
||||
preserve_cursor_position = { enabled = true },
|
||||
},
|
||||
},
|
||||
}
|
||||
8
private_dot_config/nvim/lua/plugin/12_neoscroll.lua
Normal file
8
private_dot_config/nvim/lua/plugin/12_neoscroll.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"karb94/neoscroll.nvim",
|
||||
opts = {
|
||||
duration_multiplier = 0.3,
|
||||
},
|
||||
},
|
||||
}
|
||||
8
private_dot_config/nvim/lua/plugin/13_easyalign.lua
Normal file
8
private_dot_config/nvim/lua/plugin/13_easyalign.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
{
|
||||
"junegunn/vim-easy-align",
|
||||
keys = {
|
||||
{ "ga", mode = "v", "<Plug>(EasyAlign)", desc = "easy-align" },
|
||||
},
|
||||
},
|
||||
}
|
||||
21
private_dot_config/nvim/lua/plugin/14_obsidian.lua
Normal file
21
private_dot_config/nvim/lua/plugin/14_obsidian.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
{
|
||||
"obsidian-nvim/obsidian.nvim",
|
||||
dependencies = {
|
||||
"saghen/blink.cmp",
|
||||
"ibhagwan/fzf-lua",
|
||||
},
|
||||
version = "*",
|
||||
ft = "markdown",
|
||||
---@module 'obsidian'
|
||||
---@type obsidian.config
|
||||
opts = {
|
||||
workspaces = {
|
||||
{
|
||||
name = "vault",
|
||||
path = "~/Documents/vault",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue