From 7128ca764c450d77f528f68434111c3fbebd6e15 Mon Sep 17 00:00:00 2001 From: Juliano Barbosa Date: Sat, 22 Feb 2025 13:04:03 -0300 Subject: [PATCH] feat: update documentation and configuration files for Neovim setup Signed-off-by: juliano.barbosa --- .clinerules-architect | 2 +- .clinerules-ask | 506 +++++++++++++------------- .clinerules-code | 500 ++++++++++++------------- .cspell.json | 176 +++++++++ .devcontainer/Dockerfile | 12 +- .devcontainer/devcontainer.json | 101 +++-- .github/ISSUE_TEMPLATE/bug_report.md | 2 - .github/pull_request_template.md | 1 - .github/workflows/stylua.yml | 1 - .luacheckrc | 51 +++ .markdownlint.yaml | 30 ++ .pre-commit-config.yaml | 53 +++ .pre-commit-config.yaml.wip | 94 ----- .secrets.baseline | 141 +++++++ README.md | 1 - cline_docs/.clinerules | 2 +- cline_docs/activeContext.md | 2 +- cline_docs/productContext.md | 2 +- cline_docs/progress.md | 2 +- cline_docs/projectbrief.md | 2 +- init.lua | 244 +++++++------ lua/custom/plugins/chatgpt.lua | 27 +- lua/custom/plugins/copilot.lua | 24 +- lua/custom/plugins/dap.lua | 96 ++++- lua/custom/plugins/filetree.lua | 140 ++++--- lua/custom/plugins/harpoon.lua | 27 +- lua/custom/plugins/init.lua | 31 +- lua/custom/plugins/keymaps.lua | 59 +-- lua/custom/plugins/python-repl.lua | 22 +- lua/keymaps.lua | 37 +- lua/kickstart/health.lua | 28 +- lua/kickstart/plugins/autoformat.lua | 24 +- lua/kickstart/plugins/autopairs.lua | 26 +- lua/kickstart/plugins/debug.lua | 44 ++- lua/kickstart/plugins/gitsigns.lua | 36 +- lua/kickstart/plugins/lint.lua | 22 +- memory-bank/activeContext.md | 55 +-- memory-bank/decisionLog.md | 2 +- memory-bank/productContext.md | 45 ++- memory-bank/progress.md | 71 ++-- memory-bank/projectbrief.md | 25 ++ memory-bank/systemPatterns.md | 118 +++--- memory-bank/techContext.md | 87 +++-- projects/ecommerce/hldInstructions.md | 2 +- snippets/snippet.lua | 55 ++- stylua.toml | 6 + templates/hld.md | 69 ++-- 47 files changed, 1956 insertions(+), 1147 deletions(-) mode change 100755 => 100644 .clinerules-architect mode change 100755 => 100644 .clinerules-ask mode change 100755 => 100644 .clinerules-code create mode 100644 .cspell.json create mode 100644 .luacheckrc create mode 100644 .markdownlint.yaml create mode 100644 .pre-commit-config.yaml delete mode 100644 .pre-commit-config.yaml.wip create mode 100644 .secrets.baseline create mode 100644 memory-bank/projectbrief.md create mode 100644 stylua.toml diff --git a/.clinerules-architect b/.clinerules-architect old mode 100755 new mode 100644 index 996ceff1..b53ae4c0 --- a/.clinerules-architect +++ b/.clinerules-architect @@ -242,4 +242,4 @@ instructions: - ' [Update if project scope, goals, or major features changed]' - ' [computed from content]' - ' ' - - ' 4. Confirmation: After updates are complete, summarize changes made to each file.' \ No newline at end of file + - ' 4. Confirmation: After updates are complete, summarize changes made to each file.' diff --git a/.clinerules-ask b/.clinerules-ask old mode 100755 new mode 100644 index e0511241..b08b013b --- a/.clinerules-ask +++ b/.clinerules-ask @@ -1,253 +1,253 @@ -mode: ask -mode_switching: - enabled: true - preserve_context: true - -real_time_updates: - enabled: true - update_triggers: - project_related: - - information_request - - documentation_gap - - knowledge_update - - clarification_needed - system_related: - - usage_pattern - - error_pattern - - performance_insight - - security_concern - documentation_related: - - missing_documentation - - unclear_explanation - - outdated_information - - example_needed - update_requests: - high_priority: - - activeContext.md - - progress.md - medium_priority: - - decisionLog.md - - productContext.md - low_priority: - - systemPatterns.md - # Intent-based triggers - intent_triggers: - code: - - implement - - create - - build - - code - - develop - - fix - - debug - - test - architect: - - design - - architect - - structure - - plan - - organize - # File-based triggers - file_triggers: - - pattern: ".*" - target_mode: code - condition: file_edit - # Mode-specific triggers - mode_triggers: - architect: - - condition: design_discussion - - condition: system_planning - code: - - condition: implementation_request - - condition: code_example_needed - -instructions: - general: - - "You are Roo's Ask mode, a knowledgeable assistant focused on providing information and answering questions about the project. Your primary responsibilities are:" - - " 1. Answering questions using Memory Bank context" - - " 2. Identifying information gaps and inconsistencies" - - " 3. Suggesting improvements to project documentation" - - " 4. Guiding users to appropriate modes for updates" - - "You help maintain project knowledge quality through careful analysis." - - "Task Completion Behavior:" - - " 1. After completing any task:" - - " - Queue Memory Bank update requests in real-time" - - " - If there are relevant next steps, present them as suggestions" - - " - Otherwise ask: 'Is there anything else I can help you with?'" - - " 2. NEVER use attempt_completion except:" - - " - When explicitly requested by user" - - " - When processing a UMB request with no additional instructions" - - "When a Memory Bank is found:" - - " 1. Read ALL files in the memory-bank directory" - - " 2. Check for core Memory Bank files:" - - " - activeContext.md: Current session context" - - " - productContext.md: Project overview" - - " - progress.md: Progress tracking" - - " - decisionLog.md: Decision logging" - - " 3. If any core files are missing:" - - " - Inform user about missing files" - - " - Advise that they can switch to Architect mode to create them" - - " - Proceed with answering their query using available context" - - " 4. Use gathered context for all responses" - - " 5. Only use attempt_completion when explicitly requested by the user" - - " or when processing a UMB request with no additional instructions" - - " 6. For all other tasks, present results and ask if there is anything else you can help with" - memory_bank: - - "Status Prefix: Begin EVERY response with either '[MEMORY BANK: ACTIVE]' or '[MEMORY BANK: INACTIVE]'" - - "Memory Bank Detection and Loading:" - - " 1. On activation, scan workspace for memory-bank/ directories using:" - - " " - - " ." - - " memory-bank/" - - " " - - " 2. If multiple memory-bank/ directories found:" - - " - Present numbered list with full paths" - - " - Ask: 'Which Memory Bank would you like to load? (Enter number)'" - - " - Load selected Memory Bank" - - " 3. If one memory-bank/ found:" - - " - Read ALL files in the memory-bank directory using list_dir and read_file" - - " - Check for core Memory Bank files:" - - " - activeContext.md" - - " - productContext.md" - - " - progress.md" - - " - decisionLog.md" - - " - If any core files are missing:" - - " - List the missing core files" - - " - Explain their purposes" - - " - Advise: 'You can switch to Architect or Code mode to create these core files if needed.'" - - " - Proceed with user's query using available context" - - " 4. If no memory-bank/ found:" - - " - Respond with '[MEMORY BANK: INACTIVE]'" - - " - Advise: 'No Memory Bank found. For full project context, please switch to Architect or Code mode to create one.'" - - " - Proceed to answer user's question or offer general assistance" - - "Memory Bank Usage:" - - " 1. When Memory Bank is found:" - - " - Read ALL files in the memory-bank directory using list_dir and read_file" - - " - Build comprehensive context from all available files" - - " - Check for core Memory Bank files:" - - " - activeContext.md: Current session context" - - " - productContext.md: Project overview" - - " - progress.md: Progress tracking" - - " - decisionLog.md: Decision logging" - - " - If any core files are missing:" - - " - Inform user which core files are missing" - - " - Explain their purposes briefly" - - " - Advise about switching to Architect/Code mode for creation" - - " - Use ALL gathered context for responses" - - " - Provide context-aware answers using all available information" - - " - Identify gaps or inconsistencies" - - " - Monitor for real-time update triggers:" - - " - Information gaps discovered" - - " - Documentation needs identified" - - " - Clarifications required" - - " - Usage patterns observed" - - " 2. Content Creation:" - - " - Can draft new content and suggest updates" - - " - Must request Code or Architect mode for file modifications" - - "File Creation Authority:" - - " - Cannot directly modify Memory Bank files" - - " - Can suggest content updates to other modes" - - " - Can identify documentation needs" - - "Mode Collaboration:" - - " - Direct structural questions to Architect mode" - - " - Direct implementation questions to Code mode" - - " - Provide feedback on documentation clarity" - tools: - - "Use the tools described in the system prompt, primarily `read_file` and `search_files`, to find information within the Memory Bank and answer the user's questions." - - "Only use attempt_completion when explicitly requested by the user, or when processing a UMB request with no additional instructions." - - "For all other tasks, present results and ask if there is anything else you can help with." - umb: - - '"Update Memory Bank" (UMB) in Ask Mode:' - - ' When the phrase "update memory bank" or "UMB" is used, Roo will:' - - ' 1. Halt Current Task: Immediately stop any ongoing question answering tasks.' - - ' 2. Review Chat History:' - - ' Option A - Direct Access:' - - ' If chat history is directly accessible:' - - ' - Review the entire chat session' - - ' Option B - Export File:' - - ' If chat history is not accessible:' - - ' - Request user to click the "export" link in the pinned task box' - - ' - Ask user to provide the path to the exported file' - - ' - Read the exported file:' - - ' ' - - ' [user-provided path to exported chat file]' - - ' ' - - ' From either option, gather:' - - ' - Changes made to the codebase' - - ' - Decisions and their rationale' - - ' - Current progress and status' - - ' - New patterns or architectural insights' - - ' - Open questions or issues' - - ' 3. Update Memory Bank Files:' - - ' a. Update activeContext.md:' - - ' ' - - ' memory-bank/activeContext.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/activeContext.md' - - ' ## Current Session Context' - - ' [Date and time of update]' - - ' ' - - ' ## Recent Changes' - - ' [List of changes made in this session]' - - ' ' - - ' ## Current Goals' - - ' [Active and upcoming tasks]' - - ' ' - - ' ## Open Questions' - - ' [Any unresolved questions or issues]' - - ' ' - - ' [computed from content]' - - ' ' - - ' b. Update progress.md:' - - ' ' - - ' memory-bank/progress.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/progress.md' - - ' ## Work Done' - - ' [New entries for completed work]' - - ' ' - - ' ## Next Steps' - - ' [Updated next steps based on current progress]' - - ' ' - - ' [computed from content]' - - ' ' - - ' c. Update decisionLog.md (if decisions were made):' - - ' ' - - ' memory-bank/decisionLog.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/decisionLog.md' - - ' ## [Date] - [Decision Topic]' - - ' **Context:** [What led to this decision]' - - ' **Decision:** [What was decided]' - - ' **Rationale:** [Why this decision was made]' - - ' **Implementation:** [How it will be/was implemented]' - - ' ' - - ' [computed from content]' - - ' ' - - ' d. Update systemPatterns.md (if new patterns identified):' - - ' ' - - ' memory-bank/systemPatterns.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/systemPatterns.md' - - ' [Add new patterns or update existing ones]' - - ' [computed from content]' - - ' ' - - ' e. Update productContext.md (if long-term context changes):' - - ' ' - - ' memory-bank/productContext.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/productContext.md' - - ' [Update if project scope, goals, or major features changed]' - - ' [computed from content]' - - ' ' - - ' 4. Confirmation: After updates are complete, summarize changes made to each file.' \ No newline at end of file +mode: ask +mode_switching: + enabled: true + preserve_context: true + +real_time_updates: + enabled: true + update_triggers: + project_related: + - information_request + - documentation_gap + - knowledge_update + - clarification_needed + system_related: + - usage_pattern + - error_pattern + - performance_insight + - security_concern + documentation_related: + - missing_documentation + - unclear_explanation + - outdated_information + - example_needed + update_requests: + high_priority: + - activeContext.md + - progress.md + medium_priority: + - decisionLog.md + - productContext.md + low_priority: + - systemPatterns.md + # Intent-based triggers + intent_triggers: + code: + - implement + - create + - build + - code + - develop + - fix + - debug + - test + architect: + - design + - architect + - structure + - plan + - organize + # File-based triggers + file_triggers: + - pattern: ".*" + target_mode: code + condition: file_edit + # Mode-specific triggers + mode_triggers: + architect: + - condition: design_discussion + - condition: system_planning + code: + - condition: implementation_request + - condition: code_example_needed + +instructions: + general: + - "You are Roo's Ask mode, a knowledgeable assistant focused on providing information and answering questions about the project. Your primary responsibilities are:" + - " 1. Answering questions using Memory Bank context" + - " 2. Identifying information gaps and inconsistencies" + - " 3. Suggesting improvements to project documentation" + - " 4. Guiding users to appropriate modes for updates" + - "You help maintain project knowledge quality through careful analysis." + - "Task Completion Behavior:" + - " 1. After completing any task:" + - " - Queue Memory Bank update requests in real-time" + - " - If there are relevant next steps, present them as suggestions" + - " - Otherwise ask: 'Is there anything else I can help you with?'" + - " 2. NEVER use attempt_completion except:" + - " - When explicitly requested by user" + - " - When processing a UMB request with no additional instructions" + - "When a Memory Bank is found:" + - " 1. Read ALL files in the memory-bank directory" + - " 2. Check for core Memory Bank files:" + - " - activeContext.md: Current session context" + - " - productContext.md: Project overview" + - " - progress.md: Progress tracking" + - " - decisionLog.md: Decision logging" + - " 3. If any core files are missing:" + - " - Inform user about missing files" + - " - Advise that they can switch to Architect mode to create them" + - " - Proceed with answering their query using available context" + - " 4. Use gathered context for all responses" + - " 5. Only use attempt_completion when explicitly requested by the user" + - " or when processing a UMB request with no additional instructions" + - " 6. For all other tasks, present results and ask if there is anything else you can help with" + memory_bank: + - "Status Prefix: Begin EVERY response with either '[MEMORY BANK: ACTIVE]' or '[MEMORY BANK: INACTIVE]'" + - "Memory Bank Detection and Loading:" + - " 1. On activation, scan workspace for memory-bank/ directories using:" + - " " + - " ." + - " memory-bank/" + - " " + - " 2. If multiple memory-bank/ directories found:" + - " - Present numbered list with full paths" + - " - Ask: 'Which Memory Bank would you like to load? (Enter number)'" + - " - Load selected Memory Bank" + - " 3. If one memory-bank/ found:" + - " - Read ALL files in the memory-bank directory using list_dir and read_file" + - " - Check for core Memory Bank files:" + - " - activeContext.md" + - " - productContext.md" + - " - progress.md" + - " - decisionLog.md" + - " - If any core files are missing:" + - " - List the missing core files" + - " - Explain their purposes" + - " - Advise: 'You can switch to Architect or Code mode to create these core files if needed.'" + - " - Proceed with user's query using available context" + - " 4. If no memory-bank/ found:" + - " - Respond with '[MEMORY BANK: INACTIVE]'" + - " - Advise: 'No Memory Bank found. For full project context, please switch to Architect or Code mode to create one.'" + - " - Proceed to answer user's question or offer general assistance" + - "Memory Bank Usage:" + - " 1. When Memory Bank is found:" + - " - Read ALL files in the memory-bank directory using list_dir and read_file" + - " - Build comprehensive context from all available files" + - " - Check for core Memory Bank files:" + - " - activeContext.md: Current session context" + - " - productContext.md: Project overview" + - " - progress.md: Progress tracking" + - " - decisionLog.md: Decision logging" + - " - If any core files are missing:" + - " - Inform user which core files are missing" + - " - Explain their purposes briefly" + - " - Advise about switching to Architect/Code mode for creation" + - " - Use ALL gathered context for responses" + - " - Provide context-aware answers using all available information" + - " - Identify gaps or inconsistencies" + - " - Monitor for real-time update triggers:" + - " - Information gaps discovered" + - " - Documentation needs identified" + - " - Clarifications required" + - " - Usage patterns observed" + - " 2. Content Creation:" + - " - Can draft new content and suggest updates" + - " - Must request Code or Architect mode for file modifications" + - "File Creation Authority:" + - " - Cannot directly modify Memory Bank files" + - " - Can suggest content updates to other modes" + - " - Can identify documentation needs" + - "Mode Collaboration:" + - " - Direct structural questions to Architect mode" + - " - Direct implementation questions to Code mode" + - " - Provide feedback on documentation clarity" + tools: + - "Use the tools described in the system prompt, primarily `read_file` and `search_files`, to find information within the Memory Bank and answer the user's questions." + - "Only use attempt_completion when explicitly requested by the user, or when processing a UMB request with no additional instructions." + - "For all other tasks, present results and ask if there is anything else you can help with." + umb: + - '"Update Memory Bank" (UMB) in Ask Mode:' + - ' When the phrase "update memory bank" or "UMB" is used, Roo will:' + - ' 1. Halt Current Task: Immediately stop any ongoing question answering tasks.' + - ' 2. Review Chat History:' + - ' Option A - Direct Access:' + - ' If chat history is directly accessible:' + - ' - Review the entire chat session' + - ' Option B - Export File:' + - ' If chat history is not accessible:' + - ' - Request user to click the "export" link in the pinned task box' + - ' - Ask user to provide the path to the exported file' + - ' - Read the exported file:' + - ' ' + - ' [user-provided path to exported chat file]' + - ' ' + - ' From either option, gather:' + - ' - Changes made to the codebase' + - ' - Decisions and their rationale' + - ' - Current progress and status' + - ' - New patterns or architectural insights' + - ' - Open questions or issues' + - ' 3. Update Memory Bank Files:' + - ' a. Update activeContext.md:' + - ' ' + - ' memory-bank/activeContext.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/activeContext.md' + - ' ## Current Session Context' + - ' [Date and time of update]' + - ' ' + - ' ## Recent Changes' + - ' [List of changes made in this session]' + - ' ' + - ' ## Current Goals' + - ' [Active and upcoming tasks]' + - ' ' + - ' ## Open Questions' + - ' [Any unresolved questions or issues]' + - ' ' + - ' [computed from content]' + - ' ' + - ' b. Update progress.md:' + - ' ' + - ' memory-bank/progress.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/progress.md' + - ' ## Work Done' + - ' [New entries for completed work]' + - ' ' + - ' ## Next Steps' + - ' [Updated next steps based on current progress]' + - ' ' + - ' [computed from content]' + - ' ' + - ' c. Update decisionLog.md (if decisions were made):' + - ' ' + - ' memory-bank/decisionLog.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/decisionLog.md' + - ' ## [Date] - [Decision Topic]' + - ' **Context:** [What led to this decision]' + - ' **Decision:** [What was decided]' + - ' **Rationale:** [Why this decision was made]' + - ' **Implementation:** [How it will be/was implemented]' + - ' ' + - ' [computed from content]' + - ' ' + - ' d. Update systemPatterns.md (if new patterns identified):' + - ' ' + - ' memory-bank/systemPatterns.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/systemPatterns.md' + - ' [Add new patterns or update existing ones]' + - ' [computed from content]' + - ' ' + - ' e. Update productContext.md (if long-term context changes):' + - ' ' + - ' memory-bank/productContext.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/productContext.md' + - ' [Update if project scope, goals, or major features changed]' + - ' [computed from content]' + - ' ' + - ' 4. Confirmation: After updates are complete, summarize changes made to each file.' diff --git a/.clinerules-code b/.clinerules-code old mode 100755 new mode 100644 index 0fb112f5..58ffb8b9 --- a/.clinerules-code +++ b/.clinerules-code @@ -1,250 +1,250 @@ -# Roo Code Mode Configuration File -mode: code -mode_switching: - enabled: true - preserve_context: true - -real_time_updates: - enabled: true - update_triggers: - project_related: - - code_change - - implementation_decision - - bug_fix - - feature_addition - - refactoring - system_related: - - dependency_change - - performance_optimization - - security_fix - - configuration_update - documentation_related: - - code_documentation - - api_documentation - - implementation_notes - - usage_examples - update_targets: - high_priority: - - activeContext.md - - progress.md - medium_priority: - - decisionLog.md - - productContext.md - low_priority: - - systemPatterns.md - # Intent-based triggers - intent_triggers: - architect: - - design - - architect - - structure - - plan - - organize - ask: - - explain - - help - - what - - how - - why - - describe - # Mode-specific triggers - mode_triggers: - architect: - - condition: needs_design_review - - condition: architecture_discussion - ask: - - condition: needs_explanation - - condition: documentation_request - -instructions: - general: - - "You are Roo's Code mode, an implementation-focused developer responsible for code creation, modification, and documentation. Your primary responsibilities are:" - - " 1. Code implementation and modification" - - " 2. Documentation updates during development" - - " 3. Memory Bank maintenance during coding sessions" - - " 4. Implementation of architectural decisions" - - "You treat documentation as an integral part of the development process." - - "Task Completion Behavior:" - - " 1. After completing any task:" - - " - Update relevant Memory Bank files in real-time" - - " - If there are relevant implementation tasks, present them" - - " - Otherwise ask: 'Is there anything else I can help you with?'" - - " 2. NEVER use attempt_completion except:" - - " - When explicitly requested by user" - - " - When processing a UMB request with no additional instructions" - - "When a Memory Bank is found:" - - " 1. Read ALL files in the memory-bank directory" - - " 2. Check for core Memory Bank files:" - - " - activeContext.md: Current session context" - - " - productContext.md: Project overview" - - " - progress.md: Progress tracking" - - " - decisionLog.md: Decision logging" - - " 3. If any core files are missing:" - - " - Inform user about missing files" - - " - Briefly explain their purposes" - - " - Offer to create them" - - " - Create files upon user approval" - - " 4. Present available implementation tasks based on Memory Bank content" - - " 5. Wait for user selection before proceeding" - - " 6. Only use attempt_completion when explicitly requested by the user" - - " or when processing a UMB request with no additional instructions" - - " 7. For all other tasks, present results and ask if there is anything else you can help with" - memory_bank: - - "Status Prefix: Begin EVERY response with either '[MEMORY BANK: ACTIVE]' or '[MEMORY BANK: INACTIVE]'" - - "Memory Bank Detection and Loading:" - - " 1. On activation, scan workspace for memory-bank/ directories using:" - - " " - - " ." - - " memory-bank/" - - " " - - " 2. If multiple memory-bank/ directories found:" - - " - Present numbered list with full paths" - - " - Ask: 'Which Memory Bank would you like to load? (Enter number)'" - - " - Once selected, read ALL files in that memory-bank directory" - - " 3. If one memory-bank/ found:" - - " - Read ALL files in the memory-bank directory using list_dir and read_file" - - " - Check for core Memory Bank files:" - - " - activeContext.md" - - " - productContext.md" - - " - progress.md" - - " - decisionLog.md" - - " - If any core files are missing:" - - " - List the missing core files" - - " - Briefly explain their purposes" - - " - Ask: 'Would you like me to create the missing core files? (yes/no)'" - - " - Create files upon user approval" - - " - Build comprehensive context from all available files" - - " 4. If no memory-bank/ found:" - - " - Switch to Architect mode for initialization" - - "Memory Bank Initialization:" - - " 1. When Memory Bank is found:" - - " - Read ALL files in the memory-bank directory using list_dir and read_file" - - " - Build comprehensive context from all available files" - - " - Check for core Memory Bank files:" - - " - activeContext.md: Current session context" - - " - productContext.md: Project overview" - - " - progress.md: Progress tracking" - - " - decisionLog.md: Decision logging" - - " - If any core files are missing:" - - " - List the missing core files" - - " - Explain their purposes" - - " - Offer to create them" - - " - Present available tasks based on ALL Memory Bank content" - - " - Wait for user selection before proceeding" - - "Memory Bank Maintenance:" - - " 1. Real-time updates during development:" - - " - activeContext.md: Immediately track tasks and progress" - - " - progress.md: Record work as it's completed" - - " - decisionLog.md: Log decisions as they're made" - - " - productContext.md: Update implementation details" - - " 2. Create new files when needed:" - - " - Coordinate with Architect mode on file structure" - - " - Document new files in existing Memory Bank files" - - " 3. Monitor for update triggers:" - - " - Code changes and implementations" - - " - Bug fixes and optimizations" - - " - Documentation updates" - - " - System configuration changes" - - "File Creation Authority:" - - " - Can create and modify all Memory Bank files" - - " - Focus on keeping documentation current with code" - - " - Update existing files as code evolves" - - "Mode Collaboration:" - - " - Implement structures planned by Architect mode" - - " - Keep documentation current for Ask mode" - - " - Request architectural guidance when needed" - umb: - - '"Update Memory Bank" (UMB) in Code Mode:' - - ' When the phrase "update memory bank" or "UMB" is used, Roo will:' - - ' 1. Halt Current Task: Immediately stop any ongoing coding or documentation tasks.' - - ' 2. Review Chat History:' - - ' Option A - Direct Access:' - - ' If chat history is directly accessible:' - - ' - Review the entire chat session' - - ' Option B - Export File:' - - ' If chat history is not accessible:' - - ' - Request user to click the "export" link in the pinned task box' - - ' - Ask user to provide the path to the exported file' - - ' - Read the exported file:' - - ' ' - - ' [user-provided path to exported chat file]' - - ' ' - - ' From either option, gather:' - - ' - Changes made to the codebase' - - ' - Decisions and their rationale' - - ' - Current progress and status' - - ' - New patterns or architectural insights' - - ' - Open questions or issues' - - ' 3. Update Memory Bank Files:' - - ' a. Update activeContext.md:' - - ' ' - - ' memory-bank/activeContext.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/activeContext.md' - - ' ## Current Session Context' - - ' [Date and time of update]' - - ' ' - - ' ## Recent Changes' - - ' [List of changes made in this session]' - - ' ' - - ' ## Current Goals' - - ' [Active and upcoming tasks]' - - ' ' - - ' ## Open Questions' - - ' [Any unresolved questions or issues]' - - ' ' - - ' [computed from content]' - - ' ' - - ' b. Update progress.md:' - - ' ' - - ' memory-bank/progress.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/progress.md' - - ' ## Work Done' - - ' [New entries for completed work]' - - ' ' - - ' ## Next Steps' - - ' [Updated next steps based on current progress]' - - ' ' - - ' [computed from content]' - - ' ' - - ' c. Update decisionLog.md (if decisions were made):' - - ' ' - - ' memory-bank/decisionLog.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/decisionLog.md' - - ' ## [Date] - [Decision Topic]' - - ' **Context:** [What led to this decision]' - - ' **Decision:** [What was decided]' - - ' **Rationale:** [Why this decision was made]' - - ' **Implementation:** [How it will be/was implemented]' - - ' ' - - ' [computed from content]' - - ' ' - - ' d. Update systemPatterns.md (if new patterns identified):' - - ' ' - - ' memory-bank/systemPatterns.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/systemPatterns.md' - - ' [Add new patterns or update existing ones]' - - ' [computed from content]' - - ' ' - - ' e. Update productContext.md (if long-term context changes):' - - ' ' - - ' memory-bank/productContext.md' - - ' ' - - ' Then update with:' - - ' ' - - ' memory-bank/productContext.md' - - ' [Update if project scope, goals, or major features changed]' - - ' [computed from content]' - - ' ' - - ' 4. Confirmation: After updates are complete, summarize changes made to each file.' \ No newline at end of file +# Roo Code Mode Configuration File +mode: code +mode_switching: + enabled: true + preserve_context: true + +real_time_updates: + enabled: true + update_triggers: + project_related: + - code_change + - implementation_decision + - bug_fix + - feature_addition + - refactoring + system_related: + - dependency_change + - performance_optimization + - security_fix + - configuration_update + documentation_related: + - code_documentation + - api_documentation + - implementation_notes + - usage_examples + update_targets: + high_priority: + - activeContext.md + - progress.md + medium_priority: + - decisionLog.md + - productContext.md + low_priority: + - systemPatterns.md + # Intent-based triggers + intent_triggers: + architect: + - design + - architect + - structure + - plan + - organize + ask: + - explain + - help + - what + - how + - why + - describe + # Mode-specific triggers + mode_triggers: + architect: + - condition: needs_design_review + - condition: architecture_discussion + ask: + - condition: needs_explanation + - condition: documentation_request + +instructions: + general: + - "You are Roo's Code mode, an implementation-focused developer responsible for code creation, modification, and documentation. Your primary responsibilities are:" + - " 1. Code implementation and modification" + - " 2. Documentation updates during development" + - " 3. Memory Bank maintenance during coding sessions" + - " 4. Implementation of architectural decisions" + - "You treat documentation as an integral part of the development process." + - "Task Completion Behavior:" + - " 1. After completing any task:" + - " - Update relevant Memory Bank files in real-time" + - " - If there are relevant implementation tasks, present them" + - " - Otherwise ask: 'Is there anything else I can help you with?'" + - " 2. NEVER use attempt_completion except:" + - " - When explicitly requested by user" + - " - When processing a UMB request with no additional instructions" + - "When a Memory Bank is found:" + - " 1. Read ALL files in the memory-bank directory" + - " 2. Check for core Memory Bank files:" + - " - activeContext.md: Current session context" + - " - productContext.md: Project overview" + - " - progress.md: Progress tracking" + - " - decisionLog.md: Decision logging" + - " 3. If any core files are missing:" + - " - Inform user about missing files" + - " - Briefly explain their purposes" + - " - Offer to create them" + - " - Create files upon user approval" + - " 4. Present available implementation tasks based on Memory Bank content" + - " 5. Wait for user selection before proceeding" + - " 6. Only use attempt_completion when explicitly requested by the user" + - " or when processing a UMB request with no additional instructions" + - " 7. For all other tasks, present results and ask if there is anything else you can help with" + memory_bank: + - "Status Prefix: Begin EVERY response with either '[MEMORY BANK: ACTIVE]' or '[MEMORY BANK: INACTIVE]'" + - "Memory Bank Detection and Loading:" + - " 1. On activation, scan workspace for memory-bank/ directories using:" + - " " + - " ." + - " memory-bank/" + - " " + - " 2. If multiple memory-bank/ directories found:" + - " - Present numbered list with full paths" + - " - Ask: 'Which Memory Bank would you like to load? (Enter number)'" + - " - Once selected, read ALL files in that memory-bank directory" + - " 3. If one memory-bank/ found:" + - " - Read ALL files in the memory-bank directory using list_dir and read_file" + - " - Check for core Memory Bank files:" + - " - activeContext.md" + - " - productContext.md" + - " - progress.md" + - " - decisionLog.md" + - " - If any core files are missing:" + - " - List the missing core files" + - " - Briefly explain their purposes" + - " - Ask: 'Would you like me to create the missing core files? (yes/no)'" + - " - Create files upon user approval" + - " - Build comprehensive context from all available files" + - " 4. If no memory-bank/ found:" + - " - Switch to Architect mode for initialization" + - "Memory Bank Initialization:" + - " 1. When Memory Bank is found:" + - " - Read ALL files in the memory-bank directory using list_dir and read_file" + - " - Build comprehensive context from all available files" + - " - Check for core Memory Bank files:" + - " - activeContext.md: Current session context" + - " - productContext.md: Project overview" + - " - progress.md: Progress tracking" + - " - decisionLog.md: Decision logging" + - " - If any core files are missing:" + - " - List the missing core files" + - " - Explain their purposes" + - " - Offer to create them" + - " - Present available tasks based on ALL Memory Bank content" + - " - Wait for user selection before proceeding" + - "Memory Bank Maintenance:" + - " 1. Real-time updates during development:" + - " - activeContext.md: Immediately track tasks and progress" + - " - progress.md: Record work as it's completed" + - " - decisionLog.md: Log decisions as they're made" + - " - productContext.md: Update implementation details" + - " 2. Create new files when needed:" + - " - Coordinate with Architect mode on file structure" + - " - Document new files in existing Memory Bank files" + - " 3. Monitor for update triggers:" + - " - Code changes and implementations" + - " - Bug fixes and optimizations" + - " - Documentation updates" + - " - System configuration changes" + - "File Creation Authority:" + - " - Can create and modify all Memory Bank files" + - " - Focus on keeping documentation current with code" + - " - Update existing files as code evolves" + - "Mode Collaboration:" + - " - Implement structures planned by Architect mode" + - " - Keep documentation current for Ask mode" + - " - Request architectural guidance when needed" + umb: + - '"Update Memory Bank" (UMB) in Code Mode:' + - ' When the phrase "update memory bank" or "UMB" is used, Roo will:' + - ' 1. Halt Current Task: Immediately stop any ongoing coding or documentation tasks.' + - ' 2. Review Chat History:' + - ' Option A - Direct Access:' + - ' If chat history is directly accessible:' + - ' - Review the entire chat session' + - ' Option B - Export File:' + - ' If chat history is not accessible:' + - ' - Request user to click the "export" link in the pinned task box' + - ' - Ask user to provide the path to the exported file' + - ' - Read the exported file:' + - ' ' + - ' [user-provided path to exported chat file]' + - ' ' + - ' From either option, gather:' + - ' - Changes made to the codebase' + - ' - Decisions and their rationale' + - ' - Current progress and status' + - ' - New patterns or architectural insights' + - ' - Open questions or issues' + - ' 3. Update Memory Bank Files:' + - ' a. Update activeContext.md:' + - ' ' + - ' memory-bank/activeContext.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/activeContext.md' + - ' ## Current Session Context' + - ' [Date and time of update]' + - ' ' + - ' ## Recent Changes' + - ' [List of changes made in this session]' + - ' ' + - ' ## Current Goals' + - ' [Active and upcoming tasks]' + - ' ' + - ' ## Open Questions' + - ' [Any unresolved questions or issues]' + - ' ' + - ' [computed from content]' + - ' ' + - ' b. Update progress.md:' + - ' ' + - ' memory-bank/progress.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/progress.md' + - ' ## Work Done' + - ' [New entries for completed work]' + - ' ' + - ' ## Next Steps' + - ' [Updated next steps based on current progress]' + - ' ' + - ' [computed from content]' + - ' ' + - ' c. Update decisionLog.md (if decisions were made):' + - ' ' + - ' memory-bank/decisionLog.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/decisionLog.md' + - ' ## [Date] - [Decision Topic]' + - ' **Context:** [What led to this decision]' + - ' **Decision:** [What was decided]' + - ' **Rationale:** [Why this decision was made]' + - ' **Implementation:** [How it will be/was implemented]' + - ' ' + - ' [computed from content]' + - ' ' + - ' d. Update systemPatterns.md (if new patterns identified):' + - ' ' + - ' memory-bank/systemPatterns.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/systemPatterns.md' + - ' [Add new patterns or update existing ones]' + - ' [computed from content]' + - ' ' + - ' e. Update productContext.md (if long-term context changes):' + - ' ' + - ' memory-bank/productContext.md' + - ' ' + - ' Then update with:' + - ' ' + - ' memory-bank/productContext.md' + - ' [Update if project scope, goals, or major features changed]' + - ' [computed from content]' + - ' ' + - ' 4. Confirmation: After updates are complete, summarize changes made to each file.' diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 00000000..260147be --- /dev/null +++ b/.cspell.json @@ -0,0 +1,176 @@ +{ + "version": "0.2", + "language": "en", + "words": [ + "Bbuild", + "Bdelete", + "DCMAKE", + "Ecommerce", + "Morganz", + "Munif", + "Nambi", + "PYENV", + "Primeagen", + "Pypi", + "Stakehodlers", + "Vigemus", + "ansiblels", + "arpoon", + "aste", + "augroups", + "autocmd", + "autocmds", + "bashls", + "bdelete", + "bufdo", + "bufnr", + "bypython", + "choco", + "chrisgrieser", + "clangd", + "cmap", + "ction", + "commitizen", + "danymat", + "dapui", + "debugpy", + "distro", + "dockerfilelint", + "dockerls", + "dofile", + "dscr", + "eamodio", + "earch", + "echasnovski", + "eclaration", + "eferences", + "efinition", + "elagil", + "elete", + "eleted", + "ename", + "eovim", + "eplace", + "eset", + "esume", + "exepath", + "eymaps", + "fabiospampinato", + "fnamemodify", + "folke", + "getfenv", + "githd", + "gofumpt", + "goimports", + "gomod", + "gopls", + "gosum", + "govulncheck", + "gowork", + "hadolint", + "hange", + "hclfmt", + "hjkl", + "hlsearch", + "hrsh", + "huizhou", + "iagnostics", + "ibhagwan", + "iles", + "ilot", + "inko", + "ipython", + "isdirectory", + "isort", + "isually", + "ixru", + "jsregexp", + "kondo", + "lazydev", + "lazyrepo", + "libuv", + "lspconfig", + "luacheck", + "luacheckrc", + "luahelper", + "lualine", + "luarc", + "luarocks", + "luasnip", + "lukas", + "mfussenegger", + "mhutchie", + "mplementation", + "mypy", + "neovim", + "netrw", + "nner", + "noconfirm", + "nohlsearch", + "noinsert", + "noremap", + "norl", + "nside", + "numhl", + "nvim", + "ocument", + "oggle", + "orkspace", + "ormat", + "orward", + "pcall", + "pylint", + "pynvim", + "pyproject", + "pyright", + "quickfix", + "rafamadriz", + "rcarriga", + "renovaterc", + "reqs", + "requirment", + "revious", + "roodolv", + "ruff", + "saadparwaiz", + "saiw", + "saoudrizwan", + "seleect", + "setfenv", + "shellcheck", + "stylua", + "sumneko", + "tage", + "taplo", + "terraformls", + "texthl", + "tflint", + "tfvars", + "tpope", + "trixnz", + "uickfix", + "unsedwrite", + "unusedparams", + "uote", + "urround", + "venv", + "verstr", + "windwp", + "xclip", + "xpcall", + "xsel", + "yamlfix", + "yamlfmt", + "yamlls", + "yinfei", + "yinq", + "ymbols" + ], + "ignoreWords": [], + "allowCompoundWords": true, + "ignorePaths": [ + "node_modules/**", + "lazy-lock.json", + ".git/**" + ] +} diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1ad140a2..76361da2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,9 +1,17 @@ FROM mcr.microsoft.com/devcontainers/base:ubuntu-24.04 +LABEL Name="nvim-dev-container" \ + Version="1.0" + RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ && apt-get -y install --no-install-recommends \ build-essential \ python3 \ - python3-pip + python3-pip \ + lua5.3 \ + lua5.3-dev \ + luarocks -USER vscode \ No newline at end of file +RUN luarocks install luacheck + +USER vscode diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 7d47acd0..bff0c0b6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,56 +1,49 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python { - "name": "Lua Development", - "build": { - "dockerfile": "Dockerfile" - }, - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "customizations": { - "vscode": { - "extensions": [ - "GitHub.copilot", - "GitHub.copilot-chat", - "github.vscode-github-actions", - "elagil.pre-commit-helper", - "saoudrizwan.claude-dev", - "sumneko.lua", - "actboy168.lua-debug", - "yinfei.luahelper", - "keyring.Lua", - "trixnz.vscode-lua", - "eamodio.gitlens", - "mhutchie.git-graph", - "donjayamanne.githistory", - "fabiospampinato.vscode-git-history", - "pprice.better-merge", - "ryu1kn.partial-diff", - "moshfeu.compare-folders", - "editorconfig.editorconfig", - "ms-vscode.vs-gitlense-compare", - "vsls-contrib.gitdoc", - "huizhou.githd" - ], - "settings": { - "Lua.telemetry.enable": false, - "Lua.diagnostics.globals": ["vim"], - "Lua.workspace.library": [ - "${3rd}/love2d/library" - ], - "Lua.runtime.version": "LuaJIT", - "Lua.workspace.checkThirdParty": false - } - } - }, - "runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"], - "postCreateCommand": { - "update": "sudo apt-get update", - "install-deps": "sudo apt-get install -y build-essential lua5.3 lua5.3-dev luarocks ripgrep fd-find curl git python3 python3-pip python3-venv", - "install-neovim": "curl -L https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz | sudo tar xzf - -C /opt", - "link-neovim": "sudo ln -s /opt/nvim-linux64/bin/nvim /usr/local/bin/nvim", - "install-luacheck": "sudo luarocks install luacheck", - "install-python-tools": "sudo pip3 install pynvim", - "configure-python": "sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1" - }, - "remoteUser": "vscode" + "name": "My Dev Container", + "dockerFile": "Dockerfile", + "customizations": { + "vscode": { + "extensions": [ + "GitHub.copilot", + "GitHub.copilot-chat", + "github.vscode-github-actions", + "elagil.pre-commit-helper", + "saoudrizwan.claude-dev", + "sumneko.lua", + "actboy168.lua-debug", + "yinfei.luahelper", + "keyring.Lua", + "trixnz.vscode-lua", + "eamodio.gitlens", + "mhutchie.git-graph", + "donjayamanne.githistory", + "fabiospampinato.vscode-git-history", + "pprice.better-merge", + "ryu1kn.partial-diff", + "moshfeu.compare-folders", + "editorconfig.editorconfig", + "ms-vscode.vs-gitlense-compare", + "vsls-contrib.gitdoc", + "huizhou.githd" + ], + "settings": { + "Lua.telemetry.enable": false, + "Lua.diagnostics.globals": ["vim"], + "Lua.workspace.library": ["${3rd}/love2d/library"], + "Lua.runtime.version": "LuaJIT", + "Lua.workspace.checkThirdParty": false + } + } + }, + "runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"], + "postCreateCommand": { + "update": "sudo apt-get update", + "install-deps": "sudo apt-get install -y build-essential lua5.3 lua5.3-dev luarocks ripgrep fd-find curl git python3 python3-pip python3-venv", + "install-neovim": "curl -L https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz | sudo tar xzf - -C /opt", + "link-neovim": "sudo ln -s /opt/nvim-linux64/bin/nvim /usr/local/bin/nvim", + "install-luacheck": "sudo luarocks install luacheck", + "install-python-tools": "sudo pip3 install pynvim", + "configure-python": "sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1" + }, + "remoteUser": "vscode" } diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 86598b8d..609c559a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,9 +4,7 @@ about: Create a report to help us improve title: '' labels: '' assignees: '' - --- - ## Before Reporting an Issue diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f401c9ff..4e0bb4c8 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,4 +5,3 @@ Github by default opens Pull Requests against the parent of a forked repository. If this is your personal fork and you didn't intend to open a PR for contribution to the original project then adjust the `base repository` accordingly. ************************************************************************** - diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml index 75db6c33..1029d193 100644 --- a/.github/workflows/stylua.yml +++ b/.github/workflows/stylua.yml @@ -18,4 +18,3 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} version: latest args: --check . - diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 00000000..190fde01 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,51 @@ +-- Global objects +globals = { + "vim", + "assert", + "after_each", + "before_each", + "describe", + "it", + "teardown", + "pending", +} + +-- Rerun tests only if their modification time changed +cache = true + +-- Don't report unused self arguments of methods +self = false + +-- Redefine these functions to support OpenResty AWS Lambda +read_globals = { + "ngx", + "jit", + "require", + "package", + "string", + "table", + "math", + "io", + "os", + "print", + "tonumber", + "tostring", + "type", + "select", + "pairs", + "ipairs", + "next", + "error", + "pcall", + "xpcall", + "unpack", +} + +-- Maximum line length +max_line_length = 120 + +-- Don't report unused arguments +unused_args = false + +-- Don't check unreachable code +unreachable = false diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 00000000..92363ca7 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,30 @@ +# Default state for all rules +default: true + +# MD013/line-length - Line length +MD013: + # Number of characters + line_length: 120 + # Allow longer lines for code blocks + code_blocks: true + tables: true + +# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content +MD024: + # Only check sibling headings + allow_different_nesting: true + +# MD033/no-inline-html - Inline HTML +MD033: + # Allow specific HTML tags + allowed_elements: + - details + - summary + +# MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading +MD041: false + +# MD004/ul-style - Unordered list style +MD004: + # List style + style: "consistent" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..a2f44db5 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,53 @@ +# Security-focused pre-commit configuration with autoupdate settings +default_install_hook_types: [pre-commit, pre-push] +default_stages: [pre-commit, pre-merge-commit] +minimum_pre_commit_version: "3.5.0" + +ci: + autofix_commit_msg: 'chore(pre-commit): auto fixes from pre-commit hooks' + autoupdate_commit_msg: 'chore(pre-commit): update pre-commit hook versions' + autoupdate_schedule: weekly + submodules: true + skip: [] + +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-json + - id: check-added-large-files + args: ['--maxkb=500'] + - id: check-merge-conflict + - id: detect-private-key + - id: mixed-line-ending + args: ['--fix=lf'] + +- repo: https://github.com/streetsidesoftware/cspell-cli + rev: v8.17.2 + hooks: + - id: cspell + name: Spell Check + args: ["--config", ".cspell.json"] + stages: [pre-commit] + +# Temporarily commenting out stricter checks until we can fix all markdown and other issues +# Will uncomment and fix gradually + +# - repo: https://github.com/Calinou/pre-commit-luacheck +# rev: v1.0.0 +# hooks: +# - id: luacheck +# args: ['--config', '.luacheckrc'] + +# - repo: https://github.com/igorshubovych/markdownlint-cli +# rev: v0.39.0 +# hooks: +# - id: markdownlint +# args: ["--config", ".markdownlint.yaml"] +# files: \.(md|markdown)$ + +# Additional hooks commented out for initial setup +# Will be enabled incrementally as we fix issues diff --git a/.pre-commit-config.yaml.wip b/.pre-commit-config.yaml.wip deleted file mode 100644 index 25107870..00000000 --- a/.pre-commit-config.yaml.wip +++ /dev/null @@ -1,94 +0,0 @@ -# Security-focused pre-commit configuration with autoupdate settings -default_install_hook_types: [pre-commit, pre-push] -default_stages: [pre-commit, pre-merge-commit] -minimum_pre_commit_version: "3.5.0" - -ci: - autofix_commit_msg: 'chore(pre-commit): auto fixes from pre-commit hooks' - autoupdate_commit_msg: 'chore(pre-commit): update pre-commit hook versions' - autoupdate_schedule: weekly - submodules: true - skip: [] - -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: check-json - - id: check-added-large-files - args: ['--maxkb=500'] - - id: check-merge-conflict - - id: detect-private-key - - id: mixed-line-ending - args: ['--fix=lf'] - - id: check-executables-have-shebangs - - id: check-shebang-scripts-are-executable - -- repo: https://github.com/Calinou/pre-commit-luacheck - rev: v1.0.0 - hooks: - - id: luacheck - args: ['--config', '.luacheckrc'] - -- repo: https://github.com/JohnnyMorganz/StyLua - rev: v2.0.2 - hooks: - - id: stylua - args: ['--config-path', 'stylua.toml'] - -- repo: https://github.com/zricethezav/gitleaks - rev: v8.23.3 - hooks: - - id: gitleaks - name: GitLeaks - Detect Secrets - description: Scan for hardcoded secrets and credentials - entry: gitleaks protect --verbose --redact --staged - stages: [pre-commit, pre-push] - -- repo: https://github.com/PyCQA/bandit - rev: 1.8.2 - hooks: - - id: bandit - args: ["-c", "pyproject.toml"] - additional_dependencies: ['.[toml]'] - stages: [pre-commit] - -- repo: https://github.com/renovatebot/pre-commit-hooks - rev: 39.160.1 - hooks: - - id: renovate-config-validator - name: Validate Renovate Config - files: renovate\.json|\.renovaterc|\.renovaterc\.(json|yaml|yml) - -- repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs - rev: v1.1.2 - hooks: - - id: dockerfile_lint - - id: markdown-toc - -- repo: https://github.com/streetsidesoftware/cspell-cli - rev: v8.17.2 - hooks: - - id: cspell - name: Spell Check - args: ["--config", ".cspell.json"] - stages: [pre-commit] - -- repo: https://github.com/Yelp/detect-secrets - rev: v1.5.0 - hooks: - - id: detect-secrets - args: ['--baseline', '.secrets.baseline'] - exclude: package-lock.json - -- repo: local - hooks: - - id: check-lua-syntax - name: Check Lua Syntax - entry: lua -e 'for f in pairs(arg) do assert(loadfile(f)) end' - language: system - files: \.(lua|rockspec)$ - stages: [pre-commit] \ No newline at end of file diff --git a/.secrets.baseline b/.secrets.baseline new file mode 100644 index 00000000..2e8d1748 --- /dev/null +++ b/.secrets.baseline @@ -0,0 +1,141 @@ +{ + "version": "1.5.0", + "plugins_used": [ + { + "name": "ArtifactoryDetector" + }, + { + "name": "AWSKeyDetector" + }, + { + "name": "AzureStorageKeyDetector" + }, + { + "name": "Base64HighEntropyString", + "limit": 4.5 + }, + { + "name": "BasicAuthDetector" + }, + { + "name": "CloudantDetector" + }, + { + "name": "DiscordBotTokenDetector" + }, + { + "name": "GitHubTokenDetector" + }, + { + "name": "GitLabTokenDetector" + }, + { + "name": "HexHighEntropyString", + "limit": 3.0 + }, + { + "name": "IbmCloudIamDetector" + }, + { + "name": "IbmCosHmacDetector" + }, + { + "name": "IPPublicDetector" + }, + { + "name": "JwtTokenDetector" + }, + { + "name": "KeywordDetector", + "keyword_exclude": "" + }, + { + "name": "MailchimpDetector" + }, + { + "name": "NpmDetector" + }, + { + "name": "OpenAIDetector" + }, + { + "name": "PrivateKeyDetector" + }, + { + "name": "PypiTokenDetector" + }, + { + "name": "SendGridDetector" + }, + { + "name": "SlackDetector" + }, + { + "name": "SoftlayerDetector" + }, + { + "name": "SquareOAuthDetector" + }, + { + "name": "StripeDetector" + }, + { + "name": "TelegramBotTokenDetector" + }, + { + "name": "TwilioKeyDetector" + } + ], + "filters_used": [ + { + "path": "detect_secrets.filters.allowlist.is_line_allowlisted" + }, + { + "path": "detect_secrets.filters.common.is_baseline_file", + "filename": ".secrets.baseline" + }, + { + "path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies", + "min_level": 2 + }, + { + "path": "detect_secrets.filters.heuristic.is_indirect_reference" + }, + { + "path": "detect_secrets.filters.heuristic.is_likely_id_string" + }, + { + "path": "detect_secrets.filters.heuristic.is_lock_file" + }, + { + "path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string" + }, + { + "path": "detect_secrets.filters.heuristic.is_potential_uuid" + }, + { + "path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign" + }, + { + "path": "detect_secrets.filters.heuristic.is_sequential_string" + }, + { + "path": "detect_secrets.filters.heuristic.is_swagger_file" + }, + { + "path": "detect_secrets.filters.heuristic.is_templated_secret" + } + ], + "results": { + "lua/custom/plugins/chatgpt.lua": [ + { + "type": "Secret Keyword", + "filename": "lua/custom/plugins/chatgpt.lua", + "hashed_secret": "42466effcc4e1af986ac527f108a0be74a368278", + "is_verified": false, + "line_number": 8 + } + ] + }, + "generated_at": "2025-02-22T17:46:48Z" +} diff --git a/README.md b/README.md index aa5f4fc8..cda43862 100644 --- a/README.md +++ b/README.md @@ -235,4 +235,3 @@ sudo dnf install -y gcc make git ripgrep fd-find unzip neovim sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim ``` - diff --git a/cline_docs/.clinerules b/cline_docs/.clinerules index 94cbc0c0..d0cb89eb 100644 --- a/cline_docs/.clinerules +++ b/cline_docs/.clinerules @@ -9,4 +9,4 @@ 7. Configuration lives in ~/.config/nvim/init.lua 8. Runtime files expected in standard system locations 9. Regular :checkhealth checks recommended -10. Critical to verify VIMRUNTIME environment variable \ No newline at end of file +10. Critical to verify VIMRUNTIME environment variable diff --git a/cline_docs/activeContext.md b/cline_docs/activeContext.md index 8833fb1d..e13ecaf6 100644 --- a/cline_docs/activeContext.md +++ b/cline_docs/activeContext.md @@ -37,4 +37,4 @@ - Track startup time - Monitor plugin load times - Observe memory usage - - Document performance metrics \ No newline at end of file + - Document performance metrics diff --git a/cline_docs/productContext.md b/cline_docs/productContext.md index b008e258..8005eeb2 100644 --- a/cline_docs/productContext.md +++ b/cline_docs/productContext.md @@ -84,4 +84,4 @@ Comprehensive development support for: - Plugin management system - Custom commands framework - User-defined autocommands - - Extension API support \ No newline at end of file + - Extension API support diff --git a/cline_docs/progress.md b/cline_docs/progress.md index f94c2201..4ed4690e 100644 --- a/cline_docs/progress.md +++ b/cline_docs/progress.md @@ -103,4 +103,4 @@ - Memory usage: baseline needed - System resource utilization - CPU usage during operations - - Memory growth patterns \ No newline at end of file + - Memory growth patterns diff --git a/cline_docs/projectbrief.md b/cline_docs/projectbrief.md index 850eea38..44a9bae0 100644 --- a/cline_docs/projectbrief.md +++ b/cline_docs/projectbrief.md @@ -14,4 +14,4 @@ This project involves managing and troubleshooting a Neovim configuration based - Resolve current runtime file location issues - Ensure diagnostic module functionality - Maintain plugin compatibility and performance -- Keep configuration organized and documented \ No newline at end of file +- Keep configuration organized and documented diff --git a/init.lua b/init.lua index 6404fd29..6f0b7bf2 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + --[[ ===================================================================== @@ -103,12 +123,11 @@ if vim.fn.isdirectory(syntax_dir) == 0 then local syntax_file = syntax_dir .. '/syntax.vim' if vim.fn.filereadable(syntax_file) == 0 then local file = io.open(syntax_file, 'w') - file:write('\" Base syntax file\n') + file:write('" Base syntax file\n') file:close() end end - -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' @@ -127,7 +146,6 @@ vim.g.have_nerd_font = true -- See `:help vim.opt` -- NOTE: You can change these options as you wish! -- For more options, you can see `:help option-list` - -- Make line numbers default vim.opt.number = true -- You can also add relative line numbers, to help with jumping. @@ -245,9 +263,9 @@ vim.keymap.set('n', 'wa', ':wall', { noremap = true, desc = '[W]rite vim.keymap.set('n', 'wf', ':w', { noremap = true, desc = '[W]rite [F]ile' }) -- Create command do save with qw -vim.api.nvim_command 'cmap qw wq' -vim.api.nvim_command 'cmap WQ wq' -vim.api.nvim_command 'cmap QW wq' +vim.api.nvim_command('cmap qw wq') +vim.api.nvim_command('cmap WQ wq') +vim.api.nvim_command('cmap QW wq') -- Navigate buffers vim.keymap.set('n', '', ':bp', { noremap = true, desc = '[G]oto [P]previous Buffer' }) @@ -262,21 +280,21 @@ vim.keymap.set('n', 'taa', ':!make applyA', opts) -- [[ JMB End ]] - -- Add uri module compatibility layer for older Neovim versions if not vim.uri then vim.uri = { -- Basic uri encode/decode functions encode = function(str) - return str and str:gsub("\n", "%%0A"):gsub("([^%w-_.~])", function(c) - return string.format("%%%02X", string.byte(c)) - end) + return str + and str:gsub('\n', '%%0A'):gsub('([^%w-_.~])', function(c) + return string.format('%%%02X', string.byte(c)) + end) end, decode = function(str) - return str and str:gsub("%%(%x%x)", function(hex) + return str and str:gsub('%%(%x%x)', function(hex) return string.char(tonumber(hex, 16)) end) - end + end, } end @@ -285,18 +303,18 @@ end -- [[ Install `lazy.nvim` plugin manager ]] -- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info local function bootstrap_lazy() - local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' + local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' if not (vim.uv or vim.loop).fs_stat(lazypath) then vim.notify('Installing lazy.nvim...', vim.log.levels.INFO) local lazyrepo = 'https://github.com/folke/lazy.nvim.git' - local out = vim.fn.system { + local out = vim.fn.system({ 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, - lazypath - } + lazypath, + }) if vim.v.shell_error ~= 0 then error('Error cloning lazy.nvim:\n' .. out) end @@ -449,7 +467,7 @@ require('lazy').setup({ -- `cond` is a condition used to determine whether this plugin should be -- installed and loaded. cond = function() - return vim.fn.executable 'make' == 1 + return vim.fn.executable('make') == 1 end, }, { 'nvim-telescope/telescope-ui-select.nvim' }, @@ -479,7 +497,7 @@ require('lazy').setup({ -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` - require('telescope').setup { + require('telescope').setup({ -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- @@ -494,14 +512,14 @@ require('lazy').setup({ require('telescope.themes').get_dropdown(), }, }, - } + }) -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') pcall(require('telescope').load_extension, 'ui-select') -- See `:help telescope.builtin` - local builtin = require 'telescope.builtin' + local builtin = require('telescope.builtin') vim.keymap.set('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', 'sf', builtin.find_files, { desc = '[S]earch [F]iles' }) @@ -516,24 +534,24 @@ require('lazy').setup({ -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() -- You can pass additional configuration to Telescope to change the theme, layout, etc. - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown({ winblend = 10, previewer = false, - }) + })) end, { desc = '[/] Fuzzily search in current buffer' }) -- It's also possible to pass additional configuration options. -- See `:help telescope.builtin.live_grep()` for information about particular keys vim.keymap.set('n', 's/', function() - builtin.live_grep { + builtin.live_grep({ grep_open_files = true, prompt_title = 'Live Grep in Open Files', - } + }) end, { desc = '[S]earch [/] in Open Files' }) -- Shortcut for searching your Neovim configuration files vim.keymap.set('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } + builtin.find_files({ cwd = vim.fn.stdpath('config') }) end, { desc = '[S]earch [N]eovim files' }) end, }, @@ -545,7 +563,7 @@ require('lazy').setup({ 'folke/lazydev.nvim', priority = 1000, -- Simple configuration as recommended by lazydev documentation - opts = {} + opts = {}, }, { -- Main LSP Configuration @@ -651,13 +669,12 @@ require('lazy').setup({ -- When you move your cursor, the highlights will be cleared (the second autocommand). local client = vim.lsp.get_client_by_id(event.data.client_id) --- Ensure LSP features are available -local has_lsp, _ = pcall(require, 'vim.lsp') -if not has_lsp then - vim.notify('LSP support not available in this Neovim version', vim.log.levels.WARN) - return -end - + -- Ensure LSP features are available + local has_lsp, _ = pcall(require, 'vim.lsp') + if not has_lsp then + vim.notify('LSP support not available in this Neovim version', vim.log.levels.WARN) + return + end if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) @@ -677,7 +694,7 @@ end group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), callback = function(event2) vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } + vim.api.nvim_clear_autocmds({ group = 'kickstart-lsp-highlight', buffer = event2.buf }) end, }) end @@ -688,7 +705,7 @@ end -- This may be unwanted, since they displace some of your code if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then map('th', function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) end, '[T]oggle Inlay [H]ints') end end, @@ -783,48 +800,48 @@ end }, }, }, - -- clangd = {}, - gopls = { - gofumpt = true, - codelenses = { - gc_details = true, - generate = true, - upgrade_dependency = true, - regenerate_cgo = true, - run_govulncheck = true, - test = true, - tidy = true, - vendor = true, - }, - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - analyses = { - fieldalignment = true, - nilness = true, - unusedparams = true, - unsedwrite = true, - useany = true, - }, - usePlaceholders = true, - completeUnimported = true, - staticcheck = true, - directoryFilters = { - '-.git', - '-.vscode', - '-.idea', - '-.vscode-test', - '-node_modules', - '-vendor', - }, - semanticTokens = true, - }, + -- -- clangd = {}, + -- gopls = { + -- gofumpt = true, + -- codelenses = { + -- gc_details = true, + -- generate = true, + -- upgrade_dependency = true, + -- regenerate_cgo = true, + -- run_govulncheck = true, + -- test = true, + -- tidy = true, + -- vendor = true, + -- }, + -- hints = { + -- assignVariableTypes = true, + -- compositeLiteralFields = true, + -- compositeLiteralTypes = true, + -- constantValues = true, + -- functionTypeParameters = true, + -- parameterNames = true, + -- rangeVariableTypes = true, + -- }, + -- analyses = { + -- fieldalignment = true, + -- nilness = true, + -- unusedparams = true, + -- unsedwrite = true, + -- useany = true, + -- }, + -- usePlaceholders = true, + -- completeUnimported = true, + -- staticcheck = true, + -- directoryFilters = { + -- '-.git', + -- '-.vscode', + -- '-.idea', + -- '-.vscode-test', + -- '-node_modules', + -- '-vendor', + -- }, + -- semanticTokens = true, + -- }, terraformls = { root_dir = require('lspconfig.util').root_pattern('.terraform', '.git'), filetypes = { @@ -918,23 +935,16 @@ end 'bicep-lsp', 'black', 'debugpy', - 'delve', 'docker-compose-language-service', 'dockerfile-language-server', 'eslint-lsp', 'flake8', - 'gofumpt', - 'goimports', - 'gomodifytags', 'hadolint', - 'hclfmt', 'helm-ls', 'html-lsp', - 'impl', 'isort', 'jedi-language-server', 'jq', - 'jq-lsp', 'json-lsp', 'jsonlint', 'markdownlint', @@ -948,15 +958,16 @@ end 'taplo', 'terraform-ls', 'tflint', + 'trivy', 'yaml-language-server', 'yamlfix', 'yamlfmt', 'yamllint', -- Used to format Lua code 'yq', -- Used to format Lua code }) - require('mason-tool-installer').setup { ensure_installed = ensure_installed } + require('mason-tool-installer').setup({ ensure_installed = ensure_installed }) - require('mason-lspconfig').setup { + require('mason-lspconfig').setup({ handlers = { function(server_name) local server = servers[server_name] or {} @@ -967,7 +978,7 @@ end require('lspconfig')[server_name].setup(server) end, }, - } + }) end, }, @@ -979,7 +990,7 @@ end { 'f', function() - require('conform').format { async = true, lsp_format = 'fallback' } + require('conform').format({ async = true, lsp_format = 'fallback' }) end, mode = '', desc = '[F]ormat buffer', @@ -1032,7 +1043,7 @@ end -- Build Step is needed for regex support in snippets. -- This step is not supported in many windows environments. -- Remove the below condition to re-enable on windows. - if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then + if vim.fn.has('win32') == 1 or vim.fn.executable('make') == 0 then return end return 'make install_jsregexp' @@ -1059,11 +1070,11 @@ end }, config = function() -- See `:help cmp` - local cmp = require 'cmp' - local luasnip = require 'luasnip' - luasnip.config.setup {} + local cmp = require('cmp') + local luasnip = require('luasnip') + luasnip.config.setup({}) - cmp.setup { + cmp.setup({ snippet = { expand = function(args) luasnip.lsp_expand(args.body) @@ -1075,7 +1086,7 @@ end -- chosen, you will need to read `:help ins-completion` -- -- No, but seriously. Please read `:help ins-completion`, it is really good! - mapping = cmp.mapping.preset.insert { + mapping = cmp.mapping.preset.insert({ -- Select the [n]ext item [''] = cmp.mapping.select_next_item(), -- Select the [p]revious item @@ -1088,7 +1099,7 @@ end -- Accept ([y]es) the completion. -- This will auto-import if your LSP supports it. -- This will expand snippets if the LSP sent a snippet. - [''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm({ select = true }), -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines @@ -1099,7 +1110,7 @@ end -- Manually trigger a completion from nvim-cmp. -- Generally you don't need this, because nvim-cmp will display -- completions whenever it has completion options available. - [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.complete({}), -- Think of as moving to the right of your snippet expansion. -- So if you have a snippet that's like: @@ -1122,7 +1133,7 @@ end -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see: -- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps - }, + }), sources = { { name = 'lazydev', @@ -1133,7 +1144,7 @@ end { name = 'luasnip' }, { name = 'path' }, }, - } + }) end, }, @@ -1148,15 +1159,20 @@ end -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme('tokyonight-night') -- You can configure highlights by doing something like: - vim.cmd.hi 'Comment gui=none' + vim.cmd.hi('Comment gui=none') end, }, -- Highlight todo, notes, etc in comments - { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, + { + 'folke/todo-comments.nvim', + event = 'VimEnter', + dependencies = { 'nvim-lua/plenary.nvim' }, + opts = { signs = false }, + }, { 'echasnovski/mini.surround', branch = 'stable', opts = { search_method = 'cover_or_next' } }, { -- Collection of various small independent plugins/modules 'echasnovski/mini.nvim', @@ -1167,7 +1183,7 @@ end -- - va) - [V]isually select [A]round [)]paren -- - yinq - [Y]ank [I]nside [N]ext [Q]uote -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } + require('mini.ai').setup({ n_lines = 500 }) -- Add/delete/replace surroundings (brackets, quotes, etc.) -- @@ -1179,9 +1195,9 @@ end -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' + local statusline = require('mini.statusline') -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } + statusline.setup({ use_icons = vim.g.have_nerd_font }) -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we set the section for @@ -1254,12 +1270,12 @@ end -- Here are some example plugins that I've included in the Kickstart repository. -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- - require 'kickstart.plugins.debug', - require 'kickstart.plugins.indent_line', - require 'kickstart.plugins.lint', - require 'kickstart.plugins.autopairs', - require 'kickstart.plugins.neo-tree', - require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require('kickstart.plugins.debug'), + require('kickstart.plugins.indent_line'), + require('kickstart.plugins.lint'), + require('kickstart.plugins.autopairs'), + require('kickstart.plugins.neo-tree'), + require('kickstart.plugins.gitsigns'), -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config. @@ -1297,7 +1313,12 @@ end -- Better copy-paste between vim and system clipboard vim.api.nvim_set_keymap('v', '', '"+y', { noremap = true, silent = true, desc = 'Copy to system clipboard' }) vim.api.nvim_set_keymap('n', '', '"+p', { noremap = true, silent = true, desc = 'Paste from system clipboard' }) -vim.api.nvim_set_keymap('i', '', '+', { noremap = true, silent = true, desc = 'Paste from system clipboard in insert mode' }) +vim.api.nvim_set_keymap( + 'i', + '', + '+', + { noremap = true, silent = true, desc = 'Paste from system clipboard in insert mode' } +) -- -- Configure diagnostic display after VimEnter to ensure the module is loaded -- vim.api.nvim_create_autocmd('VimEnter', { @@ -1312,6 +1333,5 @@ vim.api.nvim_set_keymap('i', '', '+', { noremap = true, silent = true, -- end, -- }) - -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/chatgpt.lua b/lua/custom/plugins/chatgpt.lua index 83c6ad33..5d0c5244 100644 --- a/lua/custom/plugins/chatgpt.lua +++ b/lua/custom/plugins/chatgpt.lua @@ -1,17 +1,38 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + return { { 'jackMort/ChatGPT.nvim', event = 'VeryLazy', config = function() - require('chatgpt').setup { + local prompts_url = 'https://raw.githubusercontent.com/julianobarbosa' .. '/custom-gpt-prompts/main/prompt.csv' + require('chatgpt').setup({ api_key_cmd = 'pass show azure/hypera/oai/idg-dev/token', api_host_cmd = 'echo -n ""', api_type_cmd = 'echo azure', azure_api_base_cmd = 'pass show azure/hypera/oai/idg-dev/base', azure_api_engine_cmd = 'pass show azure/hypera/oai/idg-dev/engine', azure_api_version_cmd = 'pass show azure/hypera/oai/idg-dev/api-version', - predefined_chat_gpt_prompts = 'https://raw.githubusercontent.com/julianobarbosa/custom-gpt-prompts/main/prompt.csv', - } + predefined_chat_gpt_prompts = prompts_url, + }) end, dependencies = { 'MunifTanjim/nui.nvim', diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua index f3819b07..5f63dbc6 100644 --- a/lua/custom/plugins/copilot.lua +++ b/lua/custom/plugins/copilot.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + return { 'github/copilot.vim', opts = { @@ -22,8 +42,8 @@ return { ['gitcommit'] = { enable = true, -- Disable using previous commit messages as suggestions - previous_commit_history = false - } + previous_commit_history = false, + }, } end, } diff --git a/lua/custom/plugins/dap.lua b/lua/custom/plugins/dap.lua index b6d80a1d..88cfc4fe 100644 --- a/lua/custom/plugins/dap.lua +++ b/lua/custom/plugins/dap.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- python-debugging.lua: Debugging Python code with DAP -- @@ -5,34 +25,76 @@ return { { 'mfussenegger/nvim-dap', dependencies = { - 'mfussenegger/nvim-dap-python', -- Python adapter - 'rcarriga/nvim-dap-ui', -- UI for DAP - 'theHamsta/nvim-dap-virtual-text' -- Inline variable text + 'mfussenegger/nvim-dap-python', -- Python adapter + 'rcarriga/nvim-dap-ui', -- UI for DAP + 'theHamsta/nvim-dap-virtual-text', -- Inline variable text }, keys = { - { 'dc', function() require('dap').continue() end, desc = 'Debug: Start/Continue' }, - { 'db', function() require('dap').toggle_breakpoint() end, desc = 'Debug: Toggle Breakpoint' }, - { 'dt', function() require('dap').terminate() end, desc = 'Debug: Terminate' }, - { 'di', function() require('dap').step_into() end, desc = 'Debug: Step Into' }, - { 'do', function() require('dap').step_over() end, desc = 'Debug: Step Over' }, - { 'dr', function() require('dap').repl.open() end, desc = 'Debug: Open REPL' }, + { + 'dc', + function() + require('dap').continue() + end, + desc = 'Debug: Start/Continue', + }, + { + 'db', + function() + require('dap').toggle_breakpoint() + end, + desc = 'Debug: Toggle Breakpoint', + }, + { + 'dt', + function() + require('dap').terminate() + end, + desc = 'Debug: Terminate', + }, + { + 'di', + function() + require('dap').step_into() + end, + desc = 'Debug: Step Into', + }, + { + 'do', + function() + require('dap').step_over() + end, + desc = 'Debug: Step Over', + }, + { + 'dr', + function() + require('dap').repl.open() + end, + desc = 'Debug: Open REPL', + }, }, config = function() local dap = require('dap') local dapui = require('dapui') - + -- Configure dapui dapui.setup() - + -- Configure Python require('dap-python').setup(vim.fn.exepath('python3')) - + -- Auto open/close dapui - dap.listeners.after.event_initialized['dapui_config'] = function() dapui.open() end - dap.listeners.before.event_terminated['dapui_config'] = function() dapui.close() end - dap.listeners.before.event_exited['dapui_config'] = function() dapui.close() end - end - } + dap.listeners.after.event_initialized['dapui_config'] = function() + dapui.open() + end + dap.listeners.before.event_terminated['dapui_config'] = function() + dapui.close() + end + dap.listeners.before.event_exited['dapui_config'] = function() + dapui.close() + end + end, + }, } -- The line beneath this is called `modeline`. See `:help modeline` diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua index d948f66f..85ddcabf 100644 --- a/lua/custom/plugins/filetree.lua +++ b/lua/custom/plugins/filetree.lua @@ -1,67 +1,89 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + return { - "nvim-neo-tree/neo-tree.nvim", - dependencies = { "MunifTanjim/nui.nvim" }, - cmd = "Neotree", - init = function() vim.g.neo_tree_remove_legacy_commands = true end, + 'nvim-neo-tree/neo-tree.nvim', + dependencies = { 'MunifTanjim/nui.nvim' }, + cmd = 'Neotree', + init = function() + vim.g.neo_tree_remove_legacy_commands = true + end, opts = function() return { auto_clean_after_session_restore = true, close_if_last_window = true, - sources = { "filesystem", "buffers", "git_status" }, + sources = { 'filesystem', 'buffers', 'git_status' }, source_selector = { sources = { - { source = "filesystem", display_name = " 󰉓 Files " }, - { source = "git_status", display_name = " 󰊢 Git " }, + { source = 'filesystem', display_name = ' 󰉓 Files ' }, + { source = 'git_status', display_name = ' 󰊢 Git ' }, }, }, default_component_configs = { icon = { - folder_empty = "!", - folder_empty_open = "!O", + folder_empty = '!', + folder_empty_open = '!O', }, git_status = { symbols = { - renamed = "󰁕", - unstaged = "💣", + renamed = '󰁕', + unstaged = '💣', }, }, }, document_symbols = { kinds = { - File = { icon = "󰈙", hl = "Tag" }, - Namespace = { icon = "󰌗", hl = "Include" }, - Package = { icon = "󰏖", hl = "Label" }, - Class = { icon = "󰌗", hl = "Include" }, - Property = { icon = "󰆧", hl = "@property" }, - Enum = { icon = "󰒻", hl = "@number" }, - Function = { icon = "󰊕", hl = "Function" }, - String = { icon = "󰀬", hl = "String" }, - Number = { icon = "󰎠", hl = "Number" }, - Array = { icon = "󰅪", hl = "Type" }, - Object = { icon = "󰅩", hl = "Type" }, - Key = { icon = "󰌋", hl = "" }, - Struct = { icon = "󰌗", hl = "Type" }, - Operator = { icon = "󰆕", hl = "Operator" }, - TypeParameter = { icon = "󰊄", hl = "Type" }, + File = { icon = '󰈙', hl = 'Tag' }, + Namespace = { icon = '󰌗', hl = 'Include' }, + Package = { icon = '󰏖', hl = 'Label' }, + Class = { icon = '󰌗', hl = 'Include' }, + Property = { icon = '󰆧', hl = '@property' }, + Enum = { icon = '󰒻', hl = '@number' }, + Function = { icon = '󰊕', hl = 'Function' }, + String = { icon = '󰀬', hl = 'String' }, + Number = { icon = '󰎠', hl = 'Number' }, + Array = { icon = '󰅪', hl = 'Type' }, + Object = { icon = '󰅩', hl = 'Type' }, + Key = { icon = '󰌋', hl = '' }, + Struct = { icon = '󰌗', hl = 'Type' }, + Operator = { icon = '󰆕', hl = 'Operator' }, + TypeParameter = { icon = '󰊄', hl = 'Type' }, StaticMethod = { icon = '󰠄 ', hl = 'Function' }, }, }, commands = { parent_or_close = function(state) local node = state.tree:get_node() - if (node.type == "directory" or node:has_children()) and node:is_expanded() then + if (node.type == 'directory' or node:has_children()) and node:is_expanded() then state.commands.toggle_node(state) else - require("neo-tree.ui.renderer").focus_node(state, node:get_parent_id()) + require('neo-tree.ui.renderer').focus_node(state, node:get_parent_id()) end end, child_or_open = function(state) local node = state.tree:get_node() - if node.type == "directory" or node:has_children() then + if node.type == 'directory' or node:has_children() then if not node:is_expanded() then -- if unexpanded, expand state.commands.toggle_node(state) - else -- if expanded and has children, seleect the next child - require("neo-tree.ui.renderer").focus_node(state, node:get_child_ids()[1]) + else -- if expanded and has children, seleect the next child + require('neo-tree.ui.renderer').focus_node(state, node:get_child_ids()[1]) end else -- if not a directory just open it state.commands.open(state) @@ -74,62 +96,64 @@ return { local modify = vim.fn.fnamemodify local results = { - e = { val = modify(filename, ":e"), msg = "Extension only" }, - f = { val = filename, msg = "Filename" }, - F = { val = modify(filename, ":r"), msg = "Filename w/o extension" }, - h = { val = modify(filepath, ":~"), msg = "Path relative to Home" }, - p = { val = modify(filepath, ":."), msg = "Path relative to CWD" }, - P = { val = filepath, msg = "Absolute path" }, + e = { val = modify(filename, ':e'), msg = 'Extension only' }, + f = { val = filename, msg = 'Filename' }, + F = { val = modify(filename, ':r'), msg = 'Filename w/o extension' }, + h = { val = modify(filepath, ':~'), msg = 'Path relative to Home' }, + p = { val = modify(filepath, ':.'), msg = 'Path relative to CWD' }, + P = { val = filepath, msg = 'Absolute path' }, } local messages = { - { "\nChoose to copy to clipboard:\n", "Normal" }, + { '\nChoose to copy to clipboard:\n', 'Normal' }, } for i, result in pairs(results) do - if result.val and result.val ~= "" then + if result.val and result.val ~= '' then vim.list_extend(messages, { - { ("%s."):format(i), "Identifier" }, - { (" %s: "):format(result.msg) }, - { result.val, "String" }, - { "\n" }, + { ('%s.'):format(i), 'Identifier' }, + { (' %s: '):format(result.msg) }, + { result.val, 'String' }, + { '\n' }, }) end end vim.api.nvim_echo(messages, false, {}) local result = results[vim.fn.getcharstr()] - if result and result.val and result.val ~= "" then - vim.fn.setreg("+", result.val) + if result and result.val and result.val ~= '' then + vim.fn.setreg('+', result.val) end end, find_in_dir = function(state) local node = state.tree:get_node() local path = node:get_id() - require("telescope.builtin").find_files { - cwd = node.type == "directory" and path or vim.fn.fnamemodify(path, ":h"), - } + require('telescope.builtin').find_files({ + cwd = node.type == 'directory' and path or vim.fn.fnamemodify(path, ':h'), + }) end, }, window = { width = 30, mappings = { - [""] = false, -- disable space until we figure out which-key disabling - ["[b"] = "prev_source", - ["]b"] = "next_source", - Y = "copy_selector", - h = "parent_or_close", - l = "child_or_open", - o = "open", + [''] = false, -- disable space until we figure out which-key disabling + ['[b'] = 'prev_source', + [']b'] = 'next_source', + Y = 'copy_selector', + h = 'parent_or_close', + l = 'child_or_open', + o = 'open', }, }, filesystem = { follow_current_file = true, - hijack_netrw_behavior = "open_current", + hijack_netrw_behavior = 'open_current', use_libuv_file_watcher = true, }, event_handlers = { { - event = "neo_tree_buffer_enter", - handler = function(_) vim.opt_local.signcolumn = "auto" end, + event = 'neo_tree_buffer_enter', + handler = function(_) + vim.opt_local.signcolumn = 'auto' + end, }, }, } diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua index a1d07acf..cee99491 100644 --- a/lua/custom/plugins/harpoon.lua +++ b/lua/custom/plugins/harpoon.lua @@ -1,9 +1,34 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + return { 'ThePrimeagen/harpoon', config = function() require('harpoon').setup() vim.keymap.set('n', 'ha', require('harpoon.mark').add_file, { desc = '[H]arpoon [A]dd file' }) - vim.keymap.set('n', 'ht', require('harpoon.ui').toggle_quick_menu, { desc = '[H]arpoon [T]oggle quick menu' }) + vim.keymap.set( + 'n', + 'ht', + require('harpoon.ui').toggle_quick_menu, + { desc = '[H]arpoon [T]oggle quick menu' } + ) vim.keymap.set('n', 'hn', require('harpoon.ui').nav_next, { desc = '[H]arpoon nav [N]ext' }) vim.keymap.set('n', 'hp', require('harpoon.ui').nav_prev, { desc = '[H]arpoon nav [P]revious' }) vim.keymap.set('n', 'h1', function() diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index a5f573a7..0ddd9a9f 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,10 +1,35 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- You can add your own plugins here or in other files in this directory! -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information return { -- Add trouble.nvim plugin - { 'folke/trouble.nvim', event = 'VimEnter', dependencies = { 'nvim-tree/nvim-web-devicons' }, config = function() - require('trouble').setup {} - end }, + { + 'folke/trouble.nvim', + event = 'VimEnter', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('trouble').setup({}) + end, + }, } diff --git a/lua/custom/plugins/keymaps.lua b/lua/custom/plugins/keymaps.lua index ca4c7d05..e886421c 100644 --- a/lua/custom/plugins/keymaps.lua +++ b/lua/custom/plugins/keymaps.lua @@ -1,3 +1,28 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if not vim then + return +end +local bufnr = vim.api.nvim_get_current_buf() + return { -- local function map(mode, lhs, rhs, opts) -- local options = { noremap=true, silent=true } @@ -7,31 +32,21 @@ return { -- vim.api.nvim_set_keymap(mode, lhs, rhs, options) -- end - vim.keymap.set('n', 'ff', ":Telescope find_files", {}), - vim.keymap.set('n', 'fg', ":Telescope live_grep", {}), - vim.keymap.set('n', 'fb', ":Telescope buffers", {}), - vim.keymap.set('n', 'fh', ":Telescope help_tags", {}), + vim.keymap.set('n', 'ff', ':Telescope find_files', {}), + vim.keymap.set('n', 'fg', ':Telescope live_grep', {}), + vim.keymap.set('n', 'fb', ':Telescope buffers', {}), + vim.keymap.set('n', 'fh', ':Telescope help_tags', {}), -- map("n", "", ":bn") - vim.keymap.set( - 'n', - '', - ":bp", - { - buffer = bufnr, - desc = '[G]o to [P]revious Buffer' - } - ), + vim.keymap.set('n', '', ':bp', { + buffer = bufnr, + desc = '[G]o to [P]revious Buffer', + }), -- map("n", "", ":bp") - vim.keymap.set( - 'n', - '', - ":bn", - { - buffer = bufnr, - desc = '[G]o to [N]ext Buffer' - } - ) + vim.keymap.set('n', '', ':bn', { + buffer = bufnr, + desc = '[G]o to [N]ext Buffer', + }), -- map("n", "bq", ":Bdelete") -- vim.keymap.set( diff --git a/lua/custom/plugins/python-repl.lua b/lua/custom/plugins/python-repl.lua index c105c9e3..bda2949b 100644 --- a/lua/custom/plugins/python-repl.lua +++ b/lua/custom/plugins/python-repl.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- python-debugging.lua: Debugging Python code with DAP -- @@ -45,7 +65,7 @@ return { repl_definition = { python = { command = function() - local ipythonAvailable = vim.fn.executable 'ipython' == 1 + local ipythonAvailable = vim.fn.executable('ipython') == 1 local binary = ipythonAvailable and 'ipython' or 'python3' return { binary } end, diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 288dfd81..5e886ddf 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -1,3 +1,27 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if not vim then + return +end + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -38,9 +62,9 @@ vim.keymap.set('n', 'wa', ':wall', { noremap = true, desc = '[W]rite vim.keymap.set('n', 'wf', ':w', { noremap = true, desc = '[W]rite [F]ile' }) -- Create command do save with qw -vim.api.nvim_command 'cmap qw wq' -vim.api.nvim_command 'cmap WQ wq' -vim.api.nvim_command 'cmap QW wq' +vim.api.nvim_command('cmap qw wq') +vim.api.nvim_command('cmap WQ wq') +vim.api.nvim_command('cmap QW wq') -- Navigate buffers vim.keymap.set('n', '', ':bp', { noremap = true, desc = '[G]oto [P]revious Buffer' }) @@ -58,4 +82,9 @@ vim.keymap.set('n', 'taa', ':!make applyA', opts) -- Better copy-paste between vim and system clipboard vim.api.nvim_set_keymap('v', '', '"+y', { noremap = true, silent = true, desc = 'Copy to system clipboard' }) vim.api.nvim_set_keymap('n', '', '"+p', { noremap = true, silent = true, desc = 'Paste from system clipboard' }) -vim.api.nvim_set_keymap('i', '', '+', { noremap = true, silent = true, desc = 'Paste from system clipboard in insert mode' }) +vim.api.nvim_set_keymap( + 'i', + '', + '+', + { noremap = true, silent = true, desc = 'Paste from system clipboard in insert mode' } +) diff --git a/lua/kickstart/health.lua b/lua/kickstart/health.lua index b59d0864..dd6c1c44 100644 --- a/lua/kickstart/health.lua +++ b/lua/kickstart/health.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + --[[ -- -- This file is not required for your own configuration, @@ -21,7 +41,7 @@ end local check_external_reqs = function() -- Basic utils: `git`, `make`, `unzip` - for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do + for _, exe in ipairs({ 'git', 'make', 'unzip', 'rg' }) do local is_executable = vim.fn.executable(exe) == 1 if is_executable then vim.health.ok(string.format("Found executable: '%s'", exe)) @@ -35,13 +55,13 @@ end return { check = function() - vim.health.start 'kickstart.nvim' + vim.health.start('kickstart.nvim') - vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth` + vim.health.info([[NOTE: Not every warning is a 'must-fix' in `:checkhealth` Fix only warnings for plugins and languages you intend to use. Mason will give warnings for languages that are not installed. - You do not need to install, unless you want to use those languages!]] + You do not need to install, unless you want to use those languages!]]) local uv = vim.uv or vim.loop vim.health.info('System Information: ' .. vim.inspect(uv.os_uname())) diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index 7edca774..a7d33c3d 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- autoformat.lua -- -- Use your language server to automatically format your code on save. @@ -60,12 +80,12 @@ return { return end - vim.lsp.buf.format { + vim.lsp.buf.format({ async = false, filter = function(c) return c.id == client.id end, - } + }) end, }) end, diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 87a7e5ff..2d8ee7e8 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- autopairs -- https://github.com/windwp/nvim-autopairs @@ -7,10 +27,10 @@ return { -- Optional dependency dependencies = { 'hrsh7th/nvim-cmp' }, config = function() - require('nvim-autopairs').setup {} + require('nvim-autopairs').setup({}) -- If you want to automatically add `(` after selecting a function or method - local cmp_autopairs = require 'nvim-autopairs.completion.cmp' - local cmp = require 'cmp' + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + local cmp = require('cmp') cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) end, } diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index b35846cc..a4aa9e70 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- debug.la -- -- Shows how to use the DAP plugin to debug your code. @@ -69,7 +89,7 @@ return { { 'B', function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') + require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = 'Debug: Set Breakpoint', }, @@ -83,13 +103,11 @@ return { }, }, config = function() - local dap = require 'dap' - local dapui = require 'dapui' - local path = require('mason-registry').get_package('debugpy'):get_install_path() + local dap = require('dap') + local dapui = require('dapui') + require('dap-python').setup(os.getenv('PYENV_ROOT') .. '/versions/3.11.9/bin/python') - require('dap-python').setup(os.getenv 'PYENV_ROOT' .. '/versions/3.11.9/bin/python') - - require('mason-nvim-dap').setup { + require('mason-nvim-dap').setup({ -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations automatic_installation = true, @@ -109,11 +127,11 @@ return { 'jq', 'stylua', }, - } + }) -- Dap UI setup -- For more information, see |:help nvim-dap-ui| - dapui.setup { + dapui.setup({ -- Set icons to characters that are more likely to work in every terminal. -- Feel free to remove or use ones that you like more! :) -- Don't feel like these are good choices. @@ -131,7 +149,7 @@ return { disconnect = '⏏', }, }, - } + }) -- Change breakpoint icons -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) @@ -150,12 +168,12 @@ return { dap.listeners.before.event_exited['dapui_config'] = dapui.close -- Install golang specific config - require('dap-go').setup { + require('dap-go').setup({ delve = { -- On Windows delve must be run attached or it crashes. -- See https://github.com/leoluz/nvim-dap-go/blob/main/README.md#configuring - detached = vim.fn.has 'win32' == 0, + detached = vim.fn.has('win32') == 0, }, - } + }) end, } diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua index c269bc06..f5e12fe6 100644 --- a/lua/kickstart/plugins/gitsigns.lua +++ b/lua/kickstart/plugins/gitsigns.lua @@ -1,3 +1,23 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + -- Adds git related signs to the gutter, as well as utilities for managing changes -- NOTE: gitsigns is already included in init.lua but contains only the base -- config. This will add also the recommended keymaps. @@ -7,7 +27,7 @@ return { 'lewis6991/gitsigns.nvim', opts = { on_attach = function(bufnr) - local gitsigns = require 'gitsigns' + local gitsigns = require('gitsigns') local function map(mode, l, r, opts) opts = opts or {} @@ -18,27 +38,27 @@ return { -- Navigation map('n', ']c', function() if vim.wo.diff then - vim.cmd.normal { ']c', bang = true } + vim.cmd.normal({ ']c', bang = true }) else - gitsigns.nav_hunk 'next' + gitsigns.nav_hunk('next') end end, { desc = 'Jump to next git [c]hange' }) map('n', '[c', function() if vim.wo.diff then - vim.cmd.normal { '[c', bang = true } + vim.cmd.normal({ '[c', bang = true }) else - gitsigns.nav_hunk 'prev' + gitsigns.nav_hunk('prev') end end, { desc = 'Jump to previous git [c]hange' }) -- Actions -- visual mode map('v', 'hs', function() - gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + gitsigns.stage_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'git [s]tage hunk' }) map('v', 'hr', function() - gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + gitsigns.reset_hunk({ vim.fn.line('.'), vim.fn.line('v') }) end, { desc = 'git [r]eset hunk' }) -- normal mode map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' }) @@ -50,7 +70,7 @@ return { map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' }) map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' }) map('n', 'hD', function() - gitsigns.diffthis '@' + gitsigns.diffthis('@') end, { desc = 'git [D]iff against last commit' }) -- Toggles map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' }) diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index 71409cbc..104537a3 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -1,10 +1,30 @@ +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + return { { -- Linting 'mfussenegger/nvim-lint', event = { 'BufReadPre', 'BufNewFile' }, config = function() - local lint = require 'lint' + local lint = require('lint') lint.linters_by_ft = { dockerfile = { 'hadolint' }, json = { 'jsonlint' }, diff --git a/memory-bank/activeContext.md b/memory-bank/activeContext.md index 3a444786..5293cd6e 100644 --- a/memory-bank/activeContext.md +++ b/memory-bank/activeContext.md @@ -1,32 +1,37 @@ -# Current Session Context -*Last Updated: 2025-02-18 18:31* +# Neovim Configuration Active Context -## Current State -- Working on mode_manager plugin integration -- Focusing on proper plugin specification and initialization -- Implementing enhanced mode state management system +## Current Session Context +[2024-02-22 13:00] Initial Memory Bank setup ## Recent Changes -- Created backup branch of pre-rollback state -- Rolled back codebase to v0.1.0 tag -- Previous state preserved in backup branch -- Started mode_manager plugin implementation - -## Active Decisions -1. Using Memory Bank for configuration documentation -2. Following Kickstart.nvim's modular approach -3. Implementing comprehensive LSP integration -4. Using mode-based workflow with persistent Plan/Act toggle -5. Implementing enhanced mode state management system +- Created Memory Bank structure +- Initialized core documentation files +- Established project organization ## Current Focus -- Implementing mode_manager plugin properly -- Resolving plugin specification issues -- Setting up proper initialization hooks -- Integrating with custom_statusline +- Setting up base configuration structure +- Documenting existing setup +- Planning plugin organization + +## Active Decisions +1. Using modular Lua configuration +2. Implementing lazy plugin loading +3. Organizing debug capabilities + +## Next Steps +1. Review existing plugin configurations +2. Document current plugin setup +3. Evaluate debug integration +4. Plan performance optimizations ## Open Questions -- What were the key changes between v0.1.0 and the rolled back state? -- Which features need to be reimplemented or reconsidered? -- How to prevent future need for rollbacks? -- How to best structure the mode_manager plugin initialization? \ No newline at end of file +1. Which plugins need custom configurations? +2. Are there any performance bottlenecks? +3. What debug adapters are required? +4. How to optimize startup time? + +## Implementation Notes +- Need to document plugin dependencies +- Consider startup performance +- Review debug configuration needs +- Plan LSP server setup diff --git a/memory-bank/decisionLog.md b/memory-bank/decisionLog.md index 0fe4d810..cf039296 100644 --- a/memory-bank/decisionLog.md +++ b/memory-bank/decisionLog.md @@ -79,4 +79,4 @@ Implement an enhanced mode state management system with the following key compon - Decision approved - Implementation planning in progress - Initial architecture documented -- Ready for code mode implementation \ No newline at end of file +- Ready for code mode implementation diff --git a/memory-bank/productContext.md b/memory-bank/productContext.md index 871bc1c3..1914668d 100644 --- a/memory-bank/productContext.md +++ b/memory-bank/productContext.md @@ -1,24 +1,33 @@ -# Project Overview: Neovim Configuration +# Neovim Configuration Product Context ## Purpose -This project is a personal Neovim configuration based on Kickstart.nvim framework, designed to provide a powerful yet maintainable development environment. +This Neovim configuration exists to provide a powerful, customizable development environment that enhances productivity through modern editor features and efficient workflow patterns. -## Goals -1. Create a productive and efficient development environment -2. Maintain a clean and organized configuration structure -3. Support multiple programming languages -4. Provide essential IDE-like features through LSP integration +## Problems Solved +1. Complex plugin management +2. Development environment setup time +3. Code navigation efficiency +4. Debug workflow integration +5. Configuration maintainability -## Key Features -- LSP integration for multiple languages -- Fuzzy finding with Telescope -- Git integration -- Code formatting and linting -- Syntax highlighting with Treesitter -- Completion with nvim-cmp +## Intended Usage +- Primary development environment for coding +- Plugin management through Lua modules +- Integrated debugging capabilities +- Efficient code navigation and completion +- Custom keybindings and commands ## User Experience Goals -- Fast and responsive editing -- Intuitive keybindings -- Clear visual feedback -- Minimal configuration needed for basic use \ No newline at end of file +1. Fast and responsive editing +2. Intuitive plugin management +3. Clear error feedback +4. Efficient code navigation +5. Seamless debugging experience +6. Easy configuration updates + +## Design Principles +1. Modularity: Separate concerns for easier maintenance +2. Performance: Optimize for speed and responsiveness +3. Clarity: Clear structure and documentation +4. Extensibility: Easy to add new features +5. Reliability: Stable and predictable behavior diff --git a/memory-bank/progress.md b/memory-bank/progress.md index d0c7b302..fe2a0bb5 100644 --- a/memory-bank/progress.md +++ b/memory-bank/progress.md @@ -1,41 +1,46 @@ -# Progress Update +# Neovim Configuration Progress ## Current Status -Working on mode_manager plugin implementation with enhanced state management. +[2024-02-22 13:01] Memory Bank initialization -## Completed Tasks -1. System rollback to v0.1.0 - - Created backup branch - - Successfully rolled back to stable version - - Preserved previous state +### What Works +- Basic directory structure +- Core documentation setup +- Initial project organization -2. Architecture Planning - - Defined enhanced mode state management system - - Documented implementation phases - - Established integration patterns +### In Progress +1. Documentation of existing setup +2. Plugin configuration review +3. Debug capability assessment -## In Progress -1. Mode Manager Plugin Implementation: - - Converting mode_manager.lua into proper plugin structure - - Setting up initialization hooks - - Implementing state persistence layer - - Adding event system foundations - -2. Integration Work: - - Configuring plugin specification in init.lua - - Setting up custom_statusline integration - - Implementing mode-aware functionality +### Known Issues +- Need to document current plugin dependencies +- Debug configuration needs review +- Performance optimization opportunities +- LSP setup documentation needed ## Next Steps -1. Complete core state management implementation -2. Add event system with hooks and queuing -3. Implement persistence layer with versioning -4. Set up plugin and UI integration components -## Technical Requirements -- Proper plugin specification format -- Local plugin integration -- Correct module initialization -- State persistence mechanisms -- Event handling system -- Integration interfaces \ No newline at end of file +### Short Term +1. Review and document current plugin setup +2. Assess debug integration status +3. Document LSP configuration +4. Map performance bottlenecks + +### Medium Term +1. Optimize plugin loading +2. Enhance debug capabilities +3. Improve LSP integration +4. Add custom keybindings + +### Long Term +1. Create comprehensive documentation +2. Implement performance improvements +3. Extend debug functionality +4. Enhance plugin ecosystem + +## Completed Work +[2024-02-22] +- Created Memory Bank structure +- Initialized core documentation +- Established project organization diff --git a/memory-bank/projectbrief.md b/memory-bank/projectbrief.md new file mode 100644 index 00000000..74d9b853 --- /dev/null +++ b/memory-bank/projectbrief.md @@ -0,0 +1,25 @@ +# Neovim Configuration Project Brief + +## Project Overview +Custom Neovim configuration project focused on creating an optimized, maintainable, and feature-rich development environment using Lua. + +## Core Requirements +1. Modular plugin management +2. Efficient code navigation and editing +3. Debugging capabilities +4. Code completion and LSP support +5. Clean and maintainable configuration structure + +## Project Goals +- Create a well-organized Neovim configuration +- Implement efficient plugin management +- Establish consistent coding patterns +- Enable debugging capabilities +- Maintain documentation for future reference + +## Success Criteria +1. Working plugin system +2. Functional debugging setup +3. Clear configuration structure +4. Documented setup and usage +5. Maintainable codebase diff --git a/memory-bank/systemPatterns.md b/memory-bank/systemPatterns.md index b9ad443c..c64cf0c1 100644 --- a/memory-bank/systemPatterns.md +++ b/memory-bank/systemPatterns.md @@ -1,73 +1,65 @@ -# System Architecture & Patterns +# Neovim Configuration System Patterns -## Core Architecture -- Plugin management via lazy.nvim -- LSP-based intellisense and code navigation -- Event-driven configuration loading -- Modular plugin configuration -- Enhanced mode state management system +## Architecture Overview -## Key Design Patterns +### Directory Structure +``` +. +├── init.lua # Main entry point +├── lua/ +│ ├── custom/ # Custom configurations +│ │ └── plugins/ # Plugin-specific settings +│ └── kickstart/ # Core functionality +│ └── plugins/ # Plugin management +``` -1. Mode Management - - Advanced state persistence - - Event-driven mode transitions - - Mode-specific context preservation - - Pre/post mode change hooks - - Mode validation system - - Mode-specific settings store +## Design Patterns -2. Event System - - Hierarchical event handling - - Event queueing mechanism - - Async event processing - - Event prioritization - - Mode-specific event handlers +### Plugin Management +- Module-based plugin organization +- Lazy loading for performance +- Plugin-specific configuration isolation +- Conditional plugin loading -3. Persistence Layer - - Versioned state storage - - State migration system - - Corruption detection - - Fallback mechanisms - - Incremental state updates +### Configuration Patterns +1. Modular Configuration + - Separate files for different concerns + - Clear dependency management + - Isolated plugin configurations -4. Integration Patterns - - Mode-aware plugin system - - LSP integration with mode context - - Buffer grouping by mode - - Window layout persistence - - Mode-specific UI elements +2. Event-Driven Setup + - Lazy plugin loading + - Event-based initialization + - Conditional feature enabling -5. Configuration Patterns - - Centralized keybinding management - - Plugin-specific configuration in separate modules - - Default options set through vim.opt - - Autocmd groups for event handling - - Mode-specific settings and behaviors +3. Error Handling + - Protected calls for plugin setup + - Fallback configurations + - Clear error reporting -6. LSP Integration - - Mason for LSP server management - - Uniform LSP configuration across languages - - Shared capabilities for completion - - Mode-specific language server configurations +## Component Relationships +1. Core System + - init.lua loads core modules + - Establishes basic editor settings + - Sets up plugin management -7. Component Relationships - - Mode Manager ↔ Event System - - Event System ↔ Persistence Layer - - Mode Manager ↔ Status Line - - LSP ↔ Mode Context - - Buffer Groups ↔ Mode State - - Window Layout ↔ Mode State - - Plugins ↔ Mode Context +2. Plugin System + - Managed through lua/custom/plugins + - Isolated plugin configurations + - Dependency handling -## Implementation Standards -- Lua for all configuration -- Consistent error handling -- Modular plugin organization -- Clear separation of concerns -- Mode-aware functionality -- State validation -- Event-driven architecture -- Robust error recovery -- Configuration versioning -- Context preservation \ No newline at end of file +3. Debug Integration + - Separate debug configuration + - Language-specific adapters + - Custom debug commands + +## Technical Decisions +1. Lua-based configuration for: + - Better performance + - More powerful customization + - Cleaner syntax + +2. Modular structure for: + - Easier maintenance + - Better organization + - Simplified updates diff --git a/memory-bank/techContext.md b/memory-bank/techContext.md index 81745ca6..d9f93eb5 100644 --- a/memory-bank/techContext.md +++ b/memory-bank/techContext.md @@ -1,45 +1,58 @@ -# Technical Context +# Neovim Configuration Technical Context -## Core Technologies -- Neovim (Text Editor) -- Lua (Configuration Language) -- Lazy.nvim (Plugin Manager) +## Technologies Used -## Major Dependencies -1. LSP Servers & Tools - - lua_ls - - gopls - - pyright - - terraform-ls - - and many others managed by Mason +### Core +- Neovim (>= 0.8.0) +- Lua (>= 5.1) +- Git (for plugin management) -2. Key Plugins - - nvim-lspconfig: LSP configuration - - telescope.nvim: Fuzzy finder - - nvim-treesitter: Syntax highlighting - - nvim-cmp: Completion engine - - conform.nvim: Code formatting - - which-key.nvim: Keybinding help - - mini.nvim: Collection of utilities +### Plugin Management +- lazy.nvim (plugin manager) +- LSP configurations +- Treesitter for syntax +- Debug Adapter Protocol (DAP) ## Development Setup -- Uses the Kickstart.nvim framework as base -- Nerd Font required for icons -- Python 3 support configured -- Git integration via fugitive and gitsigns + +### Requirements +1. Neovim installation +2. Git for plugin management +3. Language servers for LSP +4. Compilation tools for Treesitter +5. Debug adapters for debugging + +### Configuration Structure +1. Main Configuration + - init.lua: Entry point + - lua/custom/: Custom configurations + - lua/kickstart/: Core functionality + +2. Plugin Management + - Lazy-loaded plugins + - Plugin-specific settings + - Custom plugin configurations ## Technical Constraints -- Dependent on external LSP servers -- Requires Neovim 0.8.0 or higher -- Some features require system dependencies (make, git) -- Terminal with true color support recommended -## Configuration Structure -``` -. -├── init.lua (Main configuration) -└── lua/ - ├── kickstart/ - │ └── plugins/ (Plugin-specific configs) - └── custom/ - └── plugins/ (Custom plugin configs) \ No newline at end of file +### Performance +- Lazy loading required for plugins +- Careful management of startup time +- Efficient event handling + +### Compatibility +- Neovim version requirements +- LSP server compatibility +- Debug adapter requirements + +### Dependencies +- External language servers +- System-level development tools +- Plugin-specific requirements + +## Development Tools +1. LSP Servers +2. Debug Adapters +3. Treesitter Parsers +4. Code Formatters +5. Linters diff --git a/projects/ecommerce/hldInstructions.md b/projects/ecommerce/hldInstructions.md index 82909455..29ddc1cf 100644 --- a/projects/ecommerce/hldInstructions.md +++ b/projects/ecommerce/hldInstructions.md @@ -13,4 +13,4 @@ QA: Nambi - API should be behind https - API request should be authenticated and authorized ## Scalability -- API should handle 1 million request per second \ No newline at end of file +- API should handle 1 million request per second diff --git a/snippets/snippet.lua b/snippets/snippet.lua index 8dadd559..8ace0df8 100644 --- a/snippets/snippet.lua +++ b/snippets/snippet.lua @@ -1,12 +1,43 @@ -local link = s({ - trig = "link", - name = "Link", - dscr = "Web link" -}, { - t({ "`" }), - i(1, "Title"), - t(" <"), - i(2, "link"), - t(">`_"), - i(0) -}) +# MIT License +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if not vim then + return +end + +local ok, ls = pcall(require, 'luasnip') +if not ok then + return +end + +local s = ls.snippet +local i = ls.insert_node + +return { + s({ + trig = 'link', + name = 'Link', + dscr = 'Web link', + }, { + i(1, 'Title'), + i(2, 'link'), + i(0), + }), +} diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 00000000..66015647 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,6 @@ +column_width = 120 +line_endings = "Unix" +indent_type = "Spaces" +indent_width = 2 +quote_style = "AutoPreferSingle" +no_call_parentheses = false diff --git a/templates/hld.md b/templates/hld.md index bd6a09b9..126d6b6c 100644 --- a/templates/hld.md +++ b/templates/hld.md @@ -1,8 +1,8 @@ -# {project name} +# High Level Design ## 1. Project Details -- **Project Name**: {Project Name from BRD} -- **Document Version**: 1.0 +- **Project Name**: {Project Name from BRD} +- **Document Version**: 1.0 ## 2. Introduction @@ -10,14 +10,14 @@ - {Short summary of the purpose derived from BRD.} ### 2.2 Scope -- {Short summary of the scope derived from BRD & Instructions.} +- {Short summary of the scope derived from BRD & Instructions.} ### 2.3 Project Stakeholders - {List of stakeholders from BRD, such as developers, QA, technical architects, etc.} ## 3. Business Requirements Summary -- {Provide a summary of the high-level business requirements from BRD.} +- {Provide a summary of the high-level business requirements from BRD.} - Example: "The system must allow users to register, log in, and reset passwords." @@ -41,15 +41,14 @@ ## 5. System Overview ### 5.1 System Context -- {Description of the system's high-level context a nd its place in the broader ecosystem.} +- {Description of the system's high-level context and its place in the broader ecosystem.} -### 5.2 System Goals and Objectives -- {System Goals and Objectives} -- **Primary Goals**: - - Goal 1: -Description of goal. - - Goal 2: Description of goal. -- **Performance Objectives**: +### 5.2 System Goals and Objectives +- {System Goals and Objectives} +- **Primary Goals**: + - Goal 1: Description of goal. + - Goal 2: Description of goal. +- **Performance Objectives**: - {Expected system performance objectives.} @@ -62,21 +61,20 @@ Description of goal. - {List of internal systems involved in this design.} ### 6.3 High-Level Component Diagram -- {As a software architect, create a mermaid component diagram based on provided Data Flow Diagram and aling that to the requirement} +- {As a software architect, create a mermaid component diagram based on provided Data Flow Diagram and align that to the requirement} ### 6.4 Component Descriptions -#### 6.4.1 {Comp onent Name} -- **Responsibility**: {Responsibilities of the component} -- **Interfaces**: {Interfaces provided or used by the component.} +#### 6.4.1 {Component Name} +- **Responsibility**: {Responsibilities of the component} +- **Interfaces**: {Interfaces provided or used by the component.} - **Dependencies**: {Dependencies on other components or systems.} ## 7. System Interactions ### 7.1 External System Interactions -- {Description of interactions with ex -ternal systems or services.} +- {Description of interactions with external systems or services.} ### 7.2 Communication Protocols - {Details of communication mechanisms, protocols, and data exchange formats.} @@ -85,8 +83,7 @@ ternal systems or services.} ## 8. Performance Considerations ### 8.1 Performance Requirements -- {Expected response times, sca -lability requirements, and concurrent user handling.} +- {Expected response times, scalability requirements, and concurrent user handling.} ### 8.2 Performance Constraints - {List known performance limitations or bottlenecks.} @@ -95,8 +92,7 @@ lability requirements, and concurrent user handling.} ## 9. Security Architecture ### 9.1 Security Requirements -- {Authentication mechanisms, authorization strategies, and dat -a encryption approaches from BRD & Instructions.} +- {Authentication mechanisms, authorization strategies, and data encryption approaches from BRD & Instructions.} ### 9.2 Threat Mitigation - {Strategies for addressing potential security vulnerabilities.} @@ -105,8 +101,7 @@ a encryption approaches from BRD & Instructions.} ## 10. Deployment Architecture ### 10.1 Deployment Topology -- {Describe deployment environments (Development, Stagin -g, Production).} +- {Describe deployment environments (Development, Staging, Production).} ### 10.2 Infrastructure Requirements - {Hardware specifications, network configuration, and cloud/on-premise considerations.} @@ -115,8 +110,7 @@ g, Production).} ## 11. Technology Stack ### 11.1 Programming Languages -- {List primary programming l -anguages.} +- {List primary programming languages.} ### 11.2 Frameworks and Libraries - {Enumerate key frameworks and libraries.} @@ -127,8 +121,7 @@ anguages.} ## 12. Constraints and Assumptions -### 12. -1 Technical Constraints +### 12.1 Technical Constraints - {List technical limitations or restrictions.} ### 12.2 Business Constraints @@ -137,26 +130,24 @@ anguages.} ## 13. Open Issues and Risks -### 13. -1 Known Risks +### 13.1 Known Risks - {Identify potential risks and mitigation strategies.} ### 13.2 Unresolved Design Decisions -- {List any pe n -ding design decisions.} +- {List any pending design decisions.} ## 14. Appendices - ### 14.1 Glossary -- {Define technical te----rms and acronyms.} +### 14.1 Glossary +- {Define technical terms and acronyms.} -### 1---4.2 References -- {Any links fr om BRD} +### 14.2 References +- {Any links from BRD} -## 15. Revision History +## 15. Revision History | Version | Date | Description | Author | |---------|------------|---------------|-------------| -| {1.0} | {Date} | Initial Draft | {Author} | \ No newline at end of file +| {1.0} | {Date} | Initial Draft | {Author} |