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

View file

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

View file

@ -1,42 +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
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.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.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"
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 = ""
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
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 })

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('fi', '<Cmd>lua vim.lsp.buf.implementation()<CR>', 'lsp find implementation')
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 = {
{ "<leader>ac", mode = { "n", "v" }, "<cmd>CodeCompanionChat Toggle<cr>", desc = "toggle chat" },
{ "<leader>ai", mode = { "n", "v" }, "<cmd>CodeCompanionActions<cr>", desc = "actions picker" },
{ "<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 = {
strategies = {
chat = {