Compare commits

...

3 Commits

Author SHA1 Message Date
Ducky SSH User
7b0cdd0b2d Opencode Init 2025-12-07 22:59:51 +00:00
Ducky SSH User
abfadff35e Enable Copilot suggestions and panel 2025-12-07 22:59:37 +00:00
Ducky SSH User
736a2699b9 Add ansible filetype so that LSP works correctly 2025-12-07 22:59:28 +00:00
5 changed files with 101 additions and 9 deletions

57
AGENTS.md Normal file
View File

@@ -0,0 +1,57 @@
# AGENTS.md - Neovim Configuration Guide
## Overview
This is a kickstart.nvim fork - a modular Neovim configuration written in Lua. Code is organized in:
- `/init.lua` - Main entry point (kept concise for learning)
- `/lua/custom/` - User custom configurations and plugins
- `/lua/kickstart/` - Core plugin configurations
## Code Style Guidelines
### Lua Formatting
- **Formatter**: Stylua (enforced via CI)
- **Config**: `.stylua.toml` (column_width=160, indent=2 spaces, auto quote style)
- **Command**: `stylua .` to format all files, `stylua --check .` to verify
### Code Conventions
- **Imports**: Use `require()` to load modules; prefer relative paths from `/lua/`
- **Comments**: Use `--` for single-line, `--[[` for block comments; include URLs for plugins
- **Naming**: snake_case for variables/functions, PascalCase for classes
- **Lua tables**: Preferred data structure; use clear key names
- **Error handling**: Use `pcall()` for risky operations; fail gracefully with fallbacks
### Plugin Structure
- Each plugin is a separate file returning a table with name, dependencies, config
- Use `event`, `cmd`, `ft` keys for lazy-loading optimization
- Config functions should be self-contained and well-commented
## Build/Lint/Test Commands
### Format & Lint
```bash
# Format all Lua files
stylua .
# Check formatting without changing files
stylua --check .
# Format specific file
stylua path/to/file.lua
```
### No traditional tests
This is a configuration repo, not a testable library. Validation is manual:
- Start Neovim: `nvim`
- Check `:Lazy` status for plugin errors
- Review `:checkhealth` for configuration issues
- Test manually in editor to verify keymaps/features work
### Linting
- Neovim's built-in Lua LSP provides type checking (integrated via plugin)
- The GitHub Actions workflow runs `stylua --check` on PRs
## Key Notes
- **Language**: Lua 5.1+ (Neovim's version)
- **No external build process**: Configuration is interpreted at runtime
- **Plugin manager**: Lazy.nvim (auto-installs missing plugins on startup)
- **Target**: Latest Neovim stable + nightly versions

View File

@@ -643,6 +643,9 @@ require('lazy').setup({
}, },
}, },
}, },
ansiblels = {
filetypes = { 'yaml.ansible', 'ansible' },
},
} }
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
@@ -658,6 +661,7 @@ require('lazy').setup({
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {
'stylua', -- Used to format Lua code 'stylua', -- Used to format Lua code
'ansible-language-server', -- Ansible LSP for YAML Ansible files
}) })
require('mason-tool-installer').setup { ensure_installed = ensure_installed } require('mason-tool-installer').setup { ensure_installed = ensure_installed }

View File

@@ -0,0 +1,21 @@
-- Ansible configuration for detecting .yml files in roles and playbooks directories
return {
{
'neovim/nvim-lspconfig',
optional = true,
-- This table sets up file type detection for Ansible files
init = function()
-- Set up autocommand to detect Ansible files and set their filetype
local ansible_augroup = vim.api.nvim_create_augroup('ansible-detection', { clear = true })
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
group = ansible_augroup,
pattern = { '*/roles/**/*.yml', '*/roles/**/*.yaml', '*/playbooks/**/*.yml', '*/playbooks/**/*.yaml', '*/hosts/**/*.yml', '*/hosts/**/*.yaml' },
callback = function()
vim.bo.filetype = 'yaml.ansible'
end,
desc = 'Set filetype to yaml.ansible for Ansible files',
})
end,
},
}

View File

@@ -7,6 +7,10 @@ return {
require('copilot').setup { require('copilot').setup {
suggestion = { enabled = false }, suggestion = { enabled = false },
panel = { enabled = false }, panel = { enabled = false },
filetypes = {
yaml = true,
['yaml.ansible'] = true,
},
} }
end, end,
}, },
@@ -21,8 +25,12 @@ return {
cmd = 'Copilot', cmd = 'Copilot',
config = function() config = function()
require('copilot').setup { require('copilot').setup {
suggestion = { enabled = false }, suggestion = { enabled = true },
panel = { enabled = false }, panel = { enabled = true },
filetypes = {
yaml = true,
['yaml.ansible'] = true,
},
} }
end, end,
}, },

View File

@@ -2,4 +2,6 @@
-- I promise not to create any merge conflicts in this directory :) -- I promise not to create any merge conflicts in this directory :)
-- --
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return {} return {
require 'custom.plugins.ansible',
}