Add .config/nvim/.luarc.json

Update .config/nvim/init.lua
Update .config/nvim/lazy-lock.json
Update .config/nvim/lua/config/10_opts.lua
Update .config/nvim/lua/config/20_keymaps.lua
Add .config/nvim/lua/config/40_statusline.lua
Add .config/nvim/lua/plugin/18_align.lua
Add .config/nvim/lua/plugin/38_oil.lua
Update .config/nvim/lua/plugin/40_ai.lua
This commit is contained in:
Lewis Wynne 2025-11-04 03:26:22 +00:00
parent 9e208ecbe9
commit 941794402e
9 changed files with 117 additions and 60 deletions

View file

@ -0,0 +1,5 @@
{
"diagnostics.globals": [
"vim"
]
}

View file

@ -1,33 +1,37 @@
-- init.lua -- init.lua
-- --
-- Config structure -- Configuration Structure:
-- ├ init.lua Bootstraps config (you are here) -- ├ init.lua -- Bootstraps config (you are here)
-- ├ lua/ -- ├ lua/
-- ├── config/ Files sourced during startup are in here -- │ ├ config/ -- Startup configuration files
-- ├──── 00_lazy.lua Bootstraps lazy.nvim -- │ │ ├ 00_lazy.lua -- Bootstraps lazy.nvim
-- ├──── 10_opts.lua Built-in Nvim options -- │ │ ├ 10_opts.lua -- Built-in Neovim options
-- ├──── 20_keymaps.lua Custom keymaps -- │ │ ├ 20_keymaps.lua -- Custom keymaps
-- ├──── 30_autocmds.lua Custom autocmds -- │ │ ├ 30_autocmds.lua -- Custom autocommands
-- ├── plugin/ Plugins for lazy.nvim are in here -- │ │ └ 40_statusline.lua -- Minimal statusline, showing win num
-- ├──── 00_colorscheme.lua Sets theme -- │ └ plugin/ -- Plugin configurations for lazy.nvim
-- ├──── 01_whichkey.lua Displays keymaps on input -- │ ├ 00_colorscheme.lua -- Sets colorscheme/theme
-- ├──── 03_treesitter.lua Does anybody know what this does? -- │ ├ 01_whichkey.lua -- Displays keymaps on input
-- ├──── 05_fzf.lua Pickers with fzf-lua -- │ ├ 03_treesitter.lua -- Treesitter configuration
-- ├──── 10_hop.lua Enables hopping to words in the current buffer -- │ ├ 05_fzf.lua -- Fuzzy pickers with fzf-lua
-- ├──── 11_eyeliner.lua Highligts unique chars in words on f/F -- │ ├ 10_hop.lua -- Enables word hopping in buffer
-- ├──── 15_lsp.lua Mason, LSP configurations -- │ ├ 11_eyeliner.lua -- Highlights unique characters for f/F
-- ├──── 20_completion.lua Autocompletion with blink.cmp, and mini.snippets -- │ ├ 15_lsp.lua -- Mason and LSP configurations
-- ├──── 25_git.lua Gitsigns -- │ ├ 18_align.lua -- Visual mode: align around "=" with ga=
-- ├──── 30_formatting.lua vim-sleuth and conform formatting configs -- │ ├ 20_completion.lua -- Autocompletion (blink.cmp, mini.snippets)
-- ├──── 35_yanky.lua Yank and Put improvements -- │ ├ 25_git.lua -- Git integration (Gitsigns)
-- ├──── 40_ai.lua Github Copilot integration, CodeCompanion,etc. -- │ ├ 30_formatting.lua -- Formatting (vim-sleuth, conform)
-- ├ snippets/ Snippets definitions are in here -- │ ├ 35_yanky.lua -- Yank and put enhancements
-- ├── package.json Snippet repository metadata -- │ ├ 38_oil.lua -- Treat filesystem as a buffer
-- ├── global.json Global text snippets -- │ └ 40_ai.lua -- AI integrations
-- ├── lua.json Lua-specific snippets -- └ snippets/ -- Snippet definitions
-- ├── etc. ... and the same for any other language-specific snippets. -- ├ package.json -- Snippet repository metadata
-- ├ global.json -- Global text snippets
-- ├ lua.json -- Lua-specific snippets
-- └ etc. -- Other language-specific snippets
require("config.00_lazy") require("config.00_lazy")
require("config.10_opts") require("config.10_opts")
require("config.20_keymaps") require("config.20_keymaps")
require("config.30_autocmds") require("config.30_autocmds")
require("config.40_statusline")

View file

@ -12,6 +12,7 @@
"img-clip.nvim": { "branch": "main", "commit": "e7e29f0d07110405adecd576b602306a7edd507a" }, "img-clip.nvim": { "branch": "main", "commit": "e7e29f0d07110405adecd576b602306a7edd507a" },
"lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" }, "lazy.nvim": { "branch": "main", "commit": "db067881fff0fd4be8c00e5bde7492e0e1c77a2f" },
"lazydev.nvim": { "branch": "main", "commit": "371cd7434cbf95606f1969c2c744da31b77fcfa6" }, "lazydev.nvim": { "branch": "main", "commit": "371cd7434cbf95606f1969c2c744da31b77fcfa6" },
"lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.diff": { "branch": "main", "commit": "98fc732d5835eb7b6539f43534399b07b17f4e28" }, "mini.diff": { "branch": "main", "commit": "98fc732d5835eb7b6539f43534399b07b17f4e28" },
@ -24,9 +25,11 @@
"nvim-scissors": { "branch": "main", "commit": "9b4fc66427568b2139480fcc645dd7bb91884ade" }, "nvim-scissors": { "branch": "main", "commit": "9b4fc66427568b2139480fcc645dd7bb91884ade" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-treesitter-context": { "branch": "master", "commit": "ec308c7827b5f8cb2dd0ad303a059c945dd21969" }, "nvim-treesitter-context": { "branch": "master", "commit": "ec308c7827b5f8cb2dd0ad303a059c945dd21969" },
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"render-markdown.nvim": { "branch": "main", "commit": "10126effbafb74541b69219711dfb2c631e7ebf8" }, "render-markdown.nvim": { "branch": "main", "commit": "10126effbafb74541b69219711dfb2c631e7ebf8" },
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
"vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" },
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" },
"yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" }

View file

@ -1,4 +1,5 @@
-- 10_opts.lua -- 10_opts.lua
-- stylua: ignore start
-- General =================================== -- General ===================================
vim.g.mapleader = " " vim.g.mapleader = " "
vim.o.mouse = "" vim.o.mouse = ""
@ -12,6 +13,7 @@ vim.o.colorcolumn = "+1"
vim.o.cursorline = true vim.o.cursorline = true
vim.o.linebreak = true vim.o.linebreak = true
vim.o.list = true vim.o.list = true
vim.o.number = true
vim.o.relativenumber = true vim.o.relativenumber = true
vim.o.pumheight = 10 vim.o.pumheight = 10
vim.o.ruler = false vim.o.ruler = false

View file

@ -16,3 +16,9 @@ nmap_leader('aa', '<Cmd>lua vim.lsp.buf.code_action()<CR>', 'lsp code action'
nmap_leader('ar', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'lsp rename') nmap_leader('ar', '<Cmd>lua vim.lsp.buf.rename()<CR>', 'lsp rename')
nmap_leader('fi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'lsp find implementation') nmap_leader('fi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'lsp find implementation')
nmap_leader('fr', '<Cmd>lua vim.lsp.buf.references()<CR>', 'lsp find references') nmap_leader('fr', '<Cmd>lua vim.lsp.buf.references()<CR>', 'lsp find references')
for i = 1, 6 do
nmap_leader(i, i .. "<c-w>w", "move to " .. i)
end
nmap_leader(';', '<Cmd>vsplit<CR>', 'vsplit')
nmap_leader('-', '<Cmd>split<CR>', 'hsplit')

View file

@ -0,0 +1,20 @@
-- 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 = {
'^%{%v:lua._statusline_component("window")%} ',
"%r",
"%m",
"%=",
}
vim.o.statusline = table.concat(statusline, "")

View file

@ -0,0 +1,8 @@
return {
{
"junegunn/vim-easy-align",
keys = {
{ "ga", mode = "v", "<Plug>(EasyAlign)", desc = "easy-align" },
},
},
}

View file

@ -0,0 +1,8 @@
return {
{
"stevearc/oil.nvim",
dependencies = { { "nvim-mini/mini.icons" } },
opts = {},
lazy = false,
},
}

View file

@ -29,13 +29,14 @@ return {
}, },
}, },
}, },
-- stylua: ignore -- stylua: ignore start
keys = { keys = {
{ "<leader>ac", mode = { "n", "v" }, "<cmd>CodeCompanionChat Toggle<cr>", desc = "toggle chat" }, { "<leader>ac", mode = { "n", "v" }, "<cmd>CodeCompanionChat Toggle<cr>", desc = "toggle chat" },
{ "<leader>ai", mode = { "n", "v" }, "<cmd>CodeCompanionActions<cr>", desc = "actions picker" }, { "<leader>ai", mode = { "n", "v" }, "<cmd>CodeCompanionActions<cr>", desc = "actions picker" },
{ "<leader>y", mode = { "v" }, "<cmd>CodeCompanionChat Add<cr>", desc = "put in chat", }, { "<leader>y", mode = { "v" }, "<cmd>CodeCompanionChat Add<cr>", desc = "put in chat", },
{ "<leader>ap", mode = { "n", "v" }, "<cmd>CodeCompanion<cr>", desc = "in-line prompt", },
}, },
-- stylua: unignore -- stylua: ignore end
opts = { opts = {
strategies = { strategies = {
chat = { chat = {