feat: added initial configs for flutter, python and svelte

This commit is contained in:
Anup Sebastian 2025-10-29 21:07:26 -05:00
parent a92991b8e2
commit dd2e744f0b
8 changed files with 1044 additions and 31 deletions

307
SETUP-GUIDE.md Normal file
View File

@ -0,0 +1,307 @@
# VS Code-like Profile Setup for Neovim
This configuration implements a VS Code-like "profiles" system where language-specific plugins and tools only load when working with their respective file types.
## 🎯 Architecture
### File Structure
```
~/.config/nvim/
├── init.lua # Main config with shared LSP, Treesitter, etc.
└── lua/
└── custom/
└── plugins/
├── init.lua # Common plugins (Copilot, Neo-tree)
├── flutter.lua # Flutter/Dart profile
├── python.lua # Python profile
└── svelte.lua # Svelte/Web profile
```
### How It Works
- **lazy.nvim** loads plugins based on file types (`ft = { 'dart', 'python', 'svelte' }`)
- When you open a `.dart` file → Flutter tools load
- When you open a `.py` file → Python tools load
- When you open a `.svelte` file → Svelte tools load
- Common plugins (Copilot, Neo-tree) are always available
## 📦 What's Included
### Common (All Profiles)
- **GitHub Copilot**: AI pair programming
- **Neo-tree**: File explorer (commented out, enable if desired)
- **Telescope**: Fuzzy finder
- **Treesitter**: Syntax highlighting
- **blink.cmp**: Autocompletion engine
- **lua_ls**: LSP for Neovim config editing
### Flutter Profile (`flutter.lua`)
**Loads on**: `.dart` files
**Tools**:
- `flutter-tools.nvim`: Flutter development tools
- `dartls`: Dart LSP server
- Widget guides, closing tags, hot reload
**Keymaps** (under `<leader>f`):
- `<leader>fr` - Flutter run
- `<leader>fq` - Flutter quit
- `<leader>fR` - Flutter restart
- `<leader>fd` - Flutter devices
- `<leader>fe` - Flutter emulators
- `<leader>fo` - Flutter outline
- `<leader>fc` - Copy profiler URL
- `<leader>fl` - Restart LSP
### Python Profile (`python.lua`)
**Loads on**: `.py` files
**Tools**:
- `pyright`: Python LSP server with type checking
- `ruff_format`: Fast Python formatter
- `ruff_organize_imports`: Import sorting
- Alternative: `black` + `isort` (commented out)
**Format on save**: Enabled for Python files
### Svelte Profile (`svelte.lua`)
**Loads on**: `.svelte`, `.ts`, `.js` files
**Tools**:
- `svelte-language-server`: Svelte LSP
- `ts_ls`: TypeScript/JavaScript LSP
- `tailwindcss`: Tailwind CSS LSP with completions
- `prettier`: Code formatter for web files
- `emmet-vim`: HTML/CSS abbreviation expansion
**Keymaps**:
- `<C-e>,` - Expand Emmet abbreviation (e.g., `div.container` → full HTML)
**Treesitter parsers**: svelte, typescript, tsx, javascript, css, html, json
## 🚀 Installation Steps
### 1. Restart Neovim
```bash
nvim
```
### 2. Install Plugins
Once Neovim opens, lazy.nvim should automatically start installing plugins. If not:
```vim
:Lazy sync
```
Wait for all plugins to install. This may take a few minutes.
### 3. Install LSP Servers & Tools
```vim
:Mason
```
Press `g?` for help. Verify these are installed:
- **Flutter**: `dart-language-server` (dartls)
- **Python**: `pyright`, `ruff`, `black` (optional), `isort` (optional)
- **Svelte**: `svelte-language-server`, `typescript-language-server`, `tailwindcss-language-server`, `prettier`
- **Common**: `lua-language-server`, `stylua`
Mason will auto-install most of these via `mason-tool-installer`.
### 4. Install Treesitter Parsers
Parsers should auto-install when you open files. To manually install:
```vim
:TSInstall dart python svelte typescript tsx javascript css html json
```
Check status:
```vim
:TSInstallInfo
```
### 5. Test Each Profile
#### Test Flutter Profile
```bash
nvim test.dart
```
Inside Neovim:
- Type some Dart code (e.g., `void main() {`)
- Check LSP is active: `:LspInfo`
- Try hot reload keymaps if in a Flutter project: `<leader>fr`
#### Test Python Profile
```bash
nvim test.py
```
Inside Neovim:
- Type some Python code (e.g., `def hello():`)
- Check LSP is active: `:LspInfo`
- Save file to trigger auto-formatting
- Try hover: `K` on a function/variable
#### Test Svelte Profile
```bash
nvim test.svelte
```
Inside Neovim:
- Type Svelte component code
- Check LSP is active: `:LspInfo`
- Try Emmet: type `div.container>ul>li*3` then `<C-e>,`
- Save file to trigger prettier formatting
## 🔧 Configuration Details
### Node.js for Copilot
Node.js is configured via fnm (Fast Node Manager):
- **Path**: `~/.local/share/fnm/aliases/default/bin`
- **Version**: Currently v24.11.0 LTS
- **Auto-update**: Using fnm aliases, so updating Node.js via `fnm install --lts` will automatically work
To update Node.js:
```bash
fnm install --lts
fnm default lts-latest
```
### Shared LSP Capabilities
All language-specific LSPs use shared capabilities from `blink.cmp` for consistent completion behavior. This is configured automatically.
### Format on Save
Enabled by default for all languages except C/C++. Language-specific formatters are defined in their respective profile files.
To disable for a specific file type, edit `init.lua`:
```lua
local disable_filetypes = { c = true, cpp = true, python = true } -- example
```
## 📝 Customization
### Adding a New Language Profile
1. Create `lua/custom/plugins/mylang.lua`:
```lua
return {
{
'neovim/nvim-lspconfig',
ft = { 'mylang' }, -- file type trigger
config = function()
local capabilities = require('blink.cmp').get_lsp_capabilities()
require('lspconfig').mylang_ls.setup {
capabilities = capabilities,
}
end,
},
{
'stevearc/conform.nvim',
ft = { 'mylang' },
opts = {
formatters_by_ft = {
mylang = { 'my_formatter' },
},
},
},
{
'nvim-treesitter/nvim-treesitter',
ft = { 'mylang' },
opts = {
ensure_installed = { 'mylang' },
},
},
}
```
2. Restart Neovim and open a `.mylang` file
### Enabling Neo-tree
The file tree is currently commented out. To enable:
Edit `lua/custom/plugins/init.lua` and uncomment the Neo-tree section:
```lua
return {
{
'nvim-neo-tree/neo-tree.nvim',
-- ... (uncomment the entire block)
},
}
```
Then `:Lazy sync` and use `<leader>e` to toggle the file tree.
### Changing Keymaps
Edit the respective language file in `lua/custom/plugins/`.
Example: Change Flutter hot reload from `<leader>fr` to `<leader>h`:
```lua
-- In lua/custom/plugins/flutter.lua
vim.keymap.set('n', '<leader>h', '<cmd>FlutterRun<cr>', { desc = '[H]ot reload' })
```
## 🐛 Troubleshooting
### Plugins not loading
```vim
:Lazy check
:Lazy sync
```
### LSP not working
```vim
:LspInfo " Check if LSP is attached
:Mason " Verify servers are installed
:checkhealth lsp " Run LSP diagnostics
```
### Copilot not working
```vim
:Copilot setup " Initial setup (if not done)
:Copilot status " Check connection
```
If Node.js path issues:
```bash
# Verify Node.js is in fnm default alias
ls ~/.local/share/fnm/aliases/default/bin/node
```
### Formatter not running on save
Check if formatter is installed:
```vim
:Mason
```
Check if file type has formatter configured:
```vim
:ConformInfo
```
### Treesitter parsers missing
```vim
:TSInstall <parser_name>
# Or install all at once:
:TSInstall dart python svelte typescript tsx javascript css html json
```
## 📚 Resources
- **Neovim LSP**: `:help lsp`
- **lazy.nvim**: `:help lazy.nvim`
- **Telescope**: `:help telescope.nvim`
- **Treesitter**: `:help nvim-treesitter`
- **conform.nvim**: `:help conform.nvim`
- **Mason**: `:help mason.nvim`
## 🎉 What's Next?
Your setup is ready! Here are some next steps:
1. **Explore Copilot**: Try getting AI suggestions as you code
2. **Learn Flutter Tools**: Use `<leader>fr` to run Flutter apps with hot reload
3. **Try Emmet**: Speed up HTML/Svelte writing with abbreviations
4. **Customize**: Add more keymaps, plugins, or language profiles as needed
5. **Consider Neo-tree**: Uncomment if you prefer a file explorer sidebar
Enjoy your VS Code-like Neovim setup! 🚀

128
TESTING.md Normal file
View File

@ -0,0 +1,128 @@
# Profile Testing Instructions
## How to Test Each Profile
### 1. Flutter Profile (test.dart)
```bash
nvim test.dart
```
**What to check:**
- [ ] LSP loads automatically (check with `:LspInfo`)
- [ ] You see dartls in the LSP list
- [ ] Hover over `StatelessWidget` and press `K` - should show documentation
- [ ] Try completion: type `Theme.of(` and see suggestions
- [ ] Check Flutter keymaps work:
- Press `<leader>` (space by default) and wait - should see Flutter commands
- Try `<leader>fl` to restart LSP
- [ ] Widget guides should show (vertical lines for nested widgets)
- [ ] Closing tags should appear (e.g., `// MyApp` after closing brace)
### 2. Python Profile (test.py)
```bash
nvim test.py
```
**What to check:**
- [ ] LSP loads automatically (check with `:LspInfo`)
- [ ] You see pyright in the LSP list
- [ ] Hover over `calculate_fibonacci` and press `K` - should show type info
- [ ] Try completion: type `fib.` and see list methods
- [ ] **Test formatting on save:**
1. Add some messy code: `x=1+2+3+4+5`
2. Save the file (`:w`)
3. Should auto-format to: `x = 1 + 2 + 3 + 4 + 5`
- [ ] Add an unused import at the top: `import os`
- Save the file - ruff should remove it or flag it
- [ ] Lint errors should appear (the f-string and unused sys import)
### 3. Svelte Profile (test.svelte)
```bash
nvim test.svelte
```
**What to check:**
- [ ] LSP loads automatically (check with `:LspInfo`)
- [ ] You should see svelte-language-server
- [ ] Syntax highlighting works (script, template, style sections)
- [ ] **Test Emmet expansion:**
1. In the `<main>` section, type: `div.test>ul>li*3`
2. Press `<C-e>,` (Ctrl+e then comma)
3. Should expand to nested div/ul/li structure
- [ ] **Test formatting on save:**
1. Mess up some HTML: `<button class="btn" on:click={increment}>Text</button>`
2. Save the file (`:w`)
3. Should auto-format with prettier
- [ ] Try completion on Tailwind classes: type `class="bg-` and see suggestions
### 4. Test Lazy Loading
```bash
nvim test.lua # or init.lua
```
**What to check:**
- [ ] Open a Lua file
- [ ] Check `:LspInfo` - should only see lua_ls, NOT dartls, pyright, or svelte
- [ ] Check `:Lazy` - Flutter, Python, Svelte plugins should be "not loaded"
- [ ] Now open test.py in a split: `:split test.py`
- [ ] Check `:Lazy` again - Python plugins should now be "loaded"
### 5. Verify Mason Tools
```bash
nvim
```
Then run `:Mason`
**Tools that should be installed:**
- [x] lua-language-server (lua_ls)
- [x] stylua
- [ ] dart-language-server (dartls) # For Flutter
- [ ] pyright # For Python
- [ ] ruff # For Python
- [ ] svelte-language-server
- [ ] typescript-language-server (tsserver/ts_ls)
- [ ] tailwindcss-language-server
- [ ] prettier
**If any are missing:**
1. Highlight the missing tool in Mason
2. Press `i` to install
3. Or wait - mason-tool-installer should install them automatically
## Common Issues
### LSP not loading
```vim
:checkhealth lsp
:LspLog " Check for errors
```
### Formatter not working
```vim
:ConformInfo " Check formatter config
:Mason " Verify formatter is installed
```
### Plugins not loading
```vim
:Lazy check " Check plugin status
:Lazy sync " Re-sync plugins
```
### Node.js issues with Copilot
```vim
:echo $PATH " Should include fnm path
```
## Success Criteria
✅ All three language profiles should:
1. Load their respective LSP automatically on file open
2. Provide completions and hover info
3. Auto-format on save
4. NOT load when opening other file types (lazy loading works)
✅ Common plugins:
1. Copilot should work in all file types (`:Copilot status`)
2. Telescope should work (`:Telescope find_files`)
3. Which-key should show keymaps when pressing `<leader>`

View File

@ -93,6 +93,22 @@ vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = false vim.g.have_nerd_font = false
-- [[ Setup Node.js PATH for plugins like Copilot ]]
-- Add fnm's Node.js to PATH so Neovim can find it
-- This is required for GitHub Copilot and other Node.js based plugins
-- Uses fnm's alias resolution to always point to the default/latest version
local home = vim.env.HOME
local fnm_node_path = home .. '/.local/share/fnm/aliases/default/bin'
-- Fallback: also add the fnm multishell path if it exists
local fnm_multishell = home .. '/.local/state/fnm_multishells'
if vim.fn.isdirectory(fnm_node_path) == 1 then
vim.env.PATH = fnm_node_path .. ':' .. vim.env.PATH
elseif vim.fn.isdirectory(fnm_multishell) == 1 then
-- If multishell is being used, fnm will handle it via shell integration
-- We just need to ensure the PATH includes typical fnm locations
vim.env.PATH = home .. '/.local/share/fnm:' .. vim.env.PATH
end
-- [[ Setting options ]] -- [[ Setting options ]]
-- See `:help vim.o` -- See `:help vim.o`
-- NOTE: You can change these options as you wish! -- NOTE: You can change these options as you wish!
@ -102,7 +118,7 @@ vim.g.have_nerd_font = false
vim.o.number = true vim.o.number = true
-- You can also add relative line numbers, to help with jumping. -- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it! -- Experiment for yourself to see if you like it!
-- vim.o.relativenumber = true vim.o.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example! -- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a' vim.o.mouse = 'a'
@ -661,8 +677,9 @@ require('lazy').setup({
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers. -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
local capabilities = require('blink.cmp').get_lsp_capabilities() local capabilities = require('blink.cmp').get_lsp_capabilities()
-- Enable the following language servers -- Enable language servers that apply to all profiles (general editing)
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- Language-specific servers (Flutter, Python, Svelte, etc.) are configured
-- in their respective profile files in lua/custom/plugins/
-- --
-- Add any additional override configuration in the following tables. Available keys are: -- Add any additional override configuration in the following tables. Available keys are:
-- - cmd (table): Override the default command used to start the server -- - cmd (table): Override the default command used to start the server
@ -671,23 +688,8 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
-- clangd = {}, -- Lua LSP for Neovim configuration editing
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
-- Some languages (like typescript) have entire language plugins that can be useful:
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`ts_ls`) will work just fine
-- ts_ls = {},
--
lua_ls = { lua_ls = {
-- cmd = { ... },
-- filetypes = { ... },
-- capabilities = {},
settings = { settings = {
Lua = { Lua = {
completion = { completion = {
@ -698,6 +700,11 @@ require('lazy').setup({
}, },
}, },
}, },
-- Add other general-purpose LSP servers here that should always be available
-- (e.g., JSON, YAML, TOML, etc.)
-- jsonls = {},
-- yamlls = {},
} }
-- Ensure the servers and tools above are installed -- Ensure the servers and tools above are installed
@ -768,11 +775,9 @@ require('lazy').setup({
end, end,
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
-- Conform can also run multiple formatters sequentially -- Language-specific formatters (Python, Svelte, etc.) are configured
-- python = { "isort", "black" }, -- in their respective profile files in lua/custom/plugins/
-- -- This keeps formatting rules scoped to their language contexts
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
}, },
}, },
}, },
@ -944,7 +949,27 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Base parsers that are always installed
-- Language-specific parsers (dart, python, svelte, etc.) are installed
-- by their respective language profile files in lua/custom/plugins/
ensure_installed = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
-- Core web languages (used by multiple profiles)
'javascript',
'typescript',
'css',
'json',
},
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {
@ -977,14 +1002,14 @@ require('lazy').setup({
-- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.indent_line',
-- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree', require 'kickstart.plugins.neo-tree',
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- 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` -- 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. -- This is the easiest way to modularize your config.
-- --
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- { import = 'custom.plugins' }, { import = 'custom.plugins' },
-- --
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope! -- Or use telescope!

29
lazy-lock.json Normal file
View File

@ -0,0 +1,29 @@
{
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
"conform.nvim": { "branch": "master", "commit": "9fd3d5e0b689ec1bf400c53cbbec72c6fdf24081" },
"copilot.vim": { "branch": "release", "commit": "da369d90cfd6c396b1d0ec259836a1c7222fb2ea" },
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
"emmet-vim": { "branch": "master", "commit": "e98397144982d1e75b20d94d55a82de3ec8f648d" },
"fidget.nvim": { "branch": "main", "commit": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a" },
"flutter-tools.nvim": { "branch": "main", "commit": "69db9cdac65ce536e20a8fc9a83002f007cc049c" },
"gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" },
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
"lazy.nvim": { "branch": "main", "commit": "f0f5bbb9e5bfae5e6468f9359ffea3d151418176" },
"lazydev.nvim": { "branch": "main", "commit": "c2dfe354571a8255c5d3e96a9a4c297c89ce2347" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3590d66effccc7376d8c3dbe45e8291f9fed2843" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
"mini.nvim": { "branch": "main", "commit": "ee4a4a4abed25e3d108d985b0553c5271f2f71aa" },
"neo-tree.nvim": { "branch": "main", "commit": "8cdd6b1940f333c1dd085526a9c45b30fb2dbf50" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lspconfig": { "branch": "master", "commit": "87d30189b24caa496b54affd65594a309ac6d929" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"todo-comments.nvim": { "branch": "main", "commit": "411503d3bedeff88484de572f2509c248e499b38" },
"tokyonight.nvim": { "branch": "main", "commit": "2642dbb83333e0575d1c3436e1d837926871c5fb" },
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
}

View File

@ -0,0 +1,132 @@
-- ========================================================================
-- FLUTTER/DART PROFILE - Language-specific plugins and LSP configuration
-- ========================================================================
--
-- This file contains all Flutter and Dart-specific plugins and configurations.
-- These plugins will ONLY load when you open a .dart file, keeping your
-- startup time fast and avoiding conflicts with other languages.
--
-- Key features to configure here:
-- - Flutter tools (hot reload, device management, widget inspector)
-- - Dart LSP (dartls via flutter-tools)
-- - Dart-specific formatters and linters
-- - Flutter-specific keymaps (e.g., <leader>fr for Flutter Run)
--
-- Usage: Just open a .dart file and these plugins will automatically load!
-- ========================================================================
return {
-- ========================================================================
-- FLUTTER TOOLS - Complete Flutter development environment
-- ========================================================================
-- Provides Flutter-specific features like hot reload, device management,
-- widget inspector, and integrates the Dart LSP server.
--
-- Flutter-specific keymaps (available in .dart files):
-- <leader>fr - Flutter Run (start app)
-- <leader>fq - Flutter Quit (stop app)
-- <leader>fR - Flutter Hot Restart
-- <leader>fd - Flutter Devices (show connected devices)
-- <leader>fe - Flutter Emulators (launch emulator)
-- <leader>fo - Flutter Outline (toggle outline/widget tree)
-- <leader>fc - Flutter Copy Profile URL (for DevTools)
-- ========================================================================
{
'nvim-flutter/flutter-tools.nvim',
ft = 'dart', -- Only load when opening Dart files
dependencies = {
'nvim-lua/plenary.nvim',
'stevearc/dressing.nvim', -- Optional: better UI for Flutter commands
},
config = function()
-- Get shared LSP capabilities from blink.cmp
local capabilities = require('blink.cmp').get_lsp_capabilities()
require('flutter-tools').setup {
-- Flutter SDK path (usually auto-detected, but you can specify if needed)
-- flutter_path = '/path/to/flutter/bin/flutter',
lsp = {
capabilities = capabilities,
-- Settings passed to the Dart LSP
settings = {
-- Show TODOs in the problems pane
showTodos = true,
-- Completion settings
completeFunctionCalls = true,
-- Enable/disable specific lints
-- analysisExcludedFolders = {},
renameFilesWithClasses = 'prompt',
enableSnippets = true,
},
},
-- Flutter-specific settings
decorations = {
statusline = {
-- Set to true to show Flutter app info in statusline
app_version = false,
device = true, -- Show device name
},
},
widget_guides = {
enabled = true, -- Show visual guides for widget nesting
},
closing_tags = {
highlight = 'Comment', -- Highlight color for closing tags
prefix = '// ', -- Text to show before closing tag
enabled = true, -- Show closing tags for widgets
},
dev_log = {
enabled = true,
open_cmd = 'tabedit', -- Open logs in a new tab
},
debugger = {
enabled = true, -- Enable Flutter debugger integration
run_via_dap = false, -- Use Flutter tools debugger (not DAP)
},
}
-- ========================================================================
-- FLUTTER-SPECIFIC KEYMAPS
-- ========================================================================
-- These keymaps are only available when editing Dart files
-- They provide quick access to common Flutter commands
-- ========================================================================
vim.api.nvim_create_autocmd('FileType', {
pattern = 'dart',
callback = function()
local opts = { buffer = true, silent = true }
-- Flutter run/quit
vim.keymap.set('n', '<leader>fr', '<cmd>FlutterRun<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [R]un' }))
vim.keymap.set('n', '<leader>fq', '<cmd>FlutterQuit<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [Q]uit' }))
vim.keymap.set('n', '<leader>fR', '<cmd>FlutterRestart<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter Hot [R]estart' }))
-- Device management
vim.keymap.set('n', '<leader>fd', '<cmd>FlutterDevices<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [D]evices' }))
vim.keymap.set('n', '<leader>fe', '<cmd>FlutterEmulators<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [E]mulators' }))
-- Dev tools
vim.keymap.set('n', '<leader>fo', '<cmd>FlutterOutlineToggle<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [O]utline Toggle' }))
vim.keymap.set(
'n',
'<leader>fc',
'<cmd>FlutterCopyProfilerUrl<cr>',
vim.tbl_extend('force', opts, { desc = '[F]lutter [C]opy Profiler URL' })
)
vim.keymap.set('n', '<leader>fl', '<cmd>FlutterLspRestart<cr>', vim.tbl_extend('force', opts, { desc = '[F]lutter [L]SP Restart' }))
-- Register Flutter group with which-key
require('which-key').add {
{ '<leader>f', group = '[F]lutter', mode = 'n' },
}
end,
})
end,
},
}

View File

@ -1,5 +1,124 @@
-- 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 :) -- COMMON PLUGINS - Loaded for all filetypes/profiles
-- ========================================================================
--
-- This file contains plugins that are always loaded regardless of what
-- file type you're working with. These are your "core" plugins that
-- provide functionality across all your language profiles.
--
-- Examples: file explorers, git tools, common UI elements, copilot, etc.
-- --
-- See the kickstart.nvim README for more information -- See the kickstart.nvim README for more information
return {} -- ========================================================================
return {
-- ========================================================================
-- FILE EXPLORER - Neo-tree
-- ========================================================================
-- Neo-tree provides a modern file explorer sidebar similar to VS Code.
-- It's loaded for all profiles so you can browse files regardless of
-- what language you're working with.
--
-- Keybindings:
-- \ (backslash) - Toggle Neo-tree file explorer
-- Within Neo-tree:
-- a - Add file/folder
-- d - Delete
-- r - Rename
-- x - Cut
-- c - Copy
-- p - Paste
-- ? - Show help (see all keybindings)
--
-- Note: This references the existing neo-tree configuration from
-- kickstart/plugins/neo-tree.lua. We're just ensuring it's loaded.
-- ========================================================================
-- {
-- 'nvim-neo-tree/neo-tree.nvim',
-- version = '*',
-- dependencies = {
-- 'nvim-lua/plenary.nvim',
-- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
-- 'MunifTanjim/nui.nvim',
-- },
-- cmd = 'Neotree', -- Lazy load on command
-- keys = {
-- { '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
-- },
-- opts = {
-- filesystem = {
-- window = {
-- mappings = {
-- ['\\'] = 'close_window',
-- },
-- },
-- follow_current_file = {
-- enabled = true, -- Focus on the current file when opening
-- },
-- hijack_netrw_behavior = 'open_current', -- Use neo-tree instead of netrw
-- },
-- },
-- },
-- ========================================================================
-- GITHUB COPILOT - AI pair programming assistant
-- ========================================================================
-- GitHub Copilot provides AI-powered code completions and suggestions.
-- Works across all file types and integrates with your completion engine.
--
-- Setup:
-- 1. After installing, run :Copilot setup
-- 2. Follow the authentication flow
-- 3. You'll need an active GitHub Copilot subscription
--
-- Usage:
-- - Copilot suggestions appear automatically as you type
-- - Press Tab to accept a suggestion
-- - Press Ctrl+] to see next suggestion
-- - Press Ctrl+[ to see previous suggestion
-- - :Copilot panel - Open completion panel with multiple suggestions
--
-- Commands:
-- :Copilot setup - Authenticate with GitHub
-- :Copilot status - Check authentication status
-- :Copilot enable - Enable Copilot
-- :Copilot disable - Disable Copilot
-- ========================================================================
{
'github/copilot.vim',
lazy = false, -- Load immediately on startup (not lazy-loaded)
config = function()
-- Copilot keybindings (optional customization)
-- By default, Tab accepts suggestions, but this might conflict with completion
-- Uncomment below to use Ctrl+J to accept instead:
-- vim.keymap.set('i', '<C-J>', 'copilot#Accept("\\<CR>")', {
-- expr = true,
-- replace_keycodes = false,
-- })
-- vim.g.copilot_no_tab_map = true
-- Optional: Disable Copilot for certain filetypes
-- vim.g.copilot_filetypes = {
-- ['*'] = true,
-- ['markdown'] = false,
-- ['text'] = false,
-- }
end,
},
-- ========================================================================
-- ADDITIONAL COMMON PLUGINS
-- ========================================================================
-- You can add more common plugins here that should be available across
-- all language profiles. Examples:
--
-- - Better terminal integration
-- - Git integration enhancements (beyond gitsigns in init.lua)
-- - Session management
-- - Project management
-- - Alternative completion sources
-- - UI enhancements
--
-- Just add them to this return table following the same pattern as above.
-- ========================================================================
}

View File

@ -0,0 +1,105 @@
-- ========================================================================
-- PYTHON PROFILE - Language-specific plugins and LSP configuration
-- ========================================================================
--
-- This file contains all Python-specific plugins and configurations.
-- These plugins will ONLY load when you open a .py file, keeping your
-- startup time fast and avoiding conflicts with other languages.
--
-- Key features to configure here:
-- - Python LSP (pyright or pylsp)
-- - Python formatters (black, ruff, isort, etc.)
-- - Python linters and type checkers
-- - Debugger integration (debugpy)
-- - Testing tools (pytest)
-- - Virtual environment detection
-- - Python-specific keymaps
--
-- Usage: Just open a .py file and these plugins will automatically load!
-- ========================================================================
return {
-- ========================================================================
-- PYTHON LSP - Language Server Protocol for Python
-- ========================================================================
-- Provides intelligent code completion, go-to-definition, type checking,
-- and more for Python files using pyright (fast, feature-rich LSP)
-- ========================================================================
{
'neovim/nvim-lspconfig',
ft = 'python', -- Only load when opening Python files
dependencies = {
'WhoIsSethDaniel/mason-tool-installer.nvim', -- For installing pyright
},
config = function()
-- Get shared LSP capabilities from blink.cmp
local capabilities = require('blink.cmp').get_lsp_capabilities()
-- Setup pyright LSP server
require('lspconfig').pyright.setup {
capabilities = capabilities,
settings = {
python = {
analysis = {
-- Type checking mode: "off", "basic", or "strict"
typeCheckingMode = 'basic',
-- Auto-import completions
autoImportCompletions = true,
-- Automatically search for stubs
autoSearchPaths = true,
-- Use library code for types
useLibraryCodeForTypes = true,
-- Diagnostic mode: "openFilesOnly" or "workspace"
diagnosticMode = 'openFilesOnly',
},
},
},
}
-- Install Python tools via Mason
require('mason-tool-installer').setup {
ensure_installed = {
'pyright', -- LSP server for type checking and completions
'ruff', -- Fast formatter, linter, and import organizer (replaces black, isort, flake8)
},
}
end,
},
-- ========================================================================
-- PYTHON FORMATTERS - Auto-format Python code
-- ========================================================================
-- Uses Ruff for fast formatting and import organization
-- Ruff provides Black-compatible formatting + import sorting in one tool
-- ========================================================================
{
'stevearc/conform.nvim',
ft = 'python',
opts = function(_, opts)
-- Extend the existing formatters_by_ft table
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.formatters_by_ft.python = {
-- Ruff handles both formatting and import sorting (fast & modern)
'ruff_organize_imports', -- First: organize imports
'ruff_format', -- Then: format code (Black-compatible)
}
return opts
end,
},
-- ========================================================================
-- PYTHON-SPECIFIC KEYMAPS AND CONFIGURATION
-- ========================================================================
-- Additional Python-specific settings and keymaps
-- ========================================================================
{
'nvim-treesitter/nvim-treesitter',
ft = 'python',
opts = function(_, opts)
-- Ensure Python parser is installed
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { 'python' })
return opts
end,
},
}

View File

@ -0,0 +1,168 @@
-- ========================================================================
-- SVELTE PROFILE - Language-specific plugins and LSP configuration
-- ========================================================================
--
-- This file contains all Svelte-specific plugins and configurations.
-- These plugins will ONLY load when you open a .svelte file, keeping your
-- startup time fast and avoiding conflicts with other languages.
--
-- Key features to configure here:
-- - Svelte LSP (svelte-language-server)
-- - TypeScript/JavaScript support for Svelte components
-- - Tailwind CSS integration (if using Tailwind)
-- - Prettier formatting for Svelte files
-- - Emmet support for Svelte
-- - Svelte-specific keymaps
--
-- Note: You may also want to configure support for related web files:
-- - JavaScript/TypeScript (.js, .ts)
-- - HTML/CSS (.html, .css)
--
-- Usage: Just open a .svelte file and these plugins will automatically load!
-- ========================================================================
return {
-- ========================================================================
-- SVELTE LSP - Language Server Protocol for Svelte
-- ========================================================================
-- Provides intelligent code completion, diagnostics, and more for Svelte
-- components, including support for TypeScript, CSS, and HTML within .svelte files
-- ========================================================================
{
'neovim/nvim-lspconfig',
ft = { 'svelte', 'typescript', 'javascript' }, -- Load for web files
dependencies = {
'WhoIsSethDaniel/mason-tool-installer.nvim',
},
config = function()
-- Get shared LSP capabilities from blink.cmp
local capabilities = require('blink.cmp').get_lsp_capabilities()
-- Setup Svelte LSP server
require('lspconfig').svelte.setup {
capabilities = capabilities,
settings = {
svelte = {
plugin = {
html = { completions = { enable = true, emmet = true } },
svelte = { completions = { enable = true } },
css = { completions = { enable = true } },
typescript = { diagnostics = { enable = true } },
},
},
},
}
-- Optional: Setup TypeScript LSP for .ts/.js files in Svelte projects
require('lspconfig').ts_ls.setup {
capabilities = capabilities,
-- Configure to work well with Svelte
filetypes = {
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
},
}
-- Optional: Setup Tailwind CSS LSP if you're using Tailwind
require('lspconfig').tailwindcss.setup {
capabilities = capabilities,
filetypes = {
'svelte',
'html',
'css',
'scss',
'javascript',
'javascriptreact',
'typescript',
'typescriptreact',
},
}
-- Install web development tools via Mason
require('mason-tool-installer').setup {
ensure_installed = {
'svelte-language-server', -- Svelte LSP
'typescript-language-server', -- TypeScript/JavaScript LSP
'tailwindcss-language-server', -- Tailwind CSS LSP (optional)
'prettier', -- Code formatter for web files
'eslint_d', -- Fast ESLint for linting JS/TS
},
}
end,
},
-- ========================================================================
-- WEB FORMATTERS - Prettier for Svelte/JS/TS/CSS
-- ========================================================================
-- Configures prettier to format Svelte and related web files
-- ========================================================================
{
'stevearc/conform.nvim',
ft = { 'svelte', 'typescript', 'javascript', 'css', 'html', 'json' },
opts = function(_, opts)
-- Extend the existing formatters_by_ft table
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.formatters_by_ft.svelte = { 'prettier' }
opts.formatters_by_ft.javascript = { 'prettier' }
opts.formatters_by_ft.javascriptreact = { 'prettier' }
opts.formatters_by_ft.typescript = { 'prettier' }
opts.formatters_by_ft.typescriptreact = { 'prettier' }
opts.formatters_by_ft.css = { 'prettier' }
opts.formatters_by_ft.html = { 'prettier' }
opts.formatters_by_ft.json = { 'prettier' }
opts.formatters_by_ft.markdown = { 'prettier' }
return opts
end,
},
-- ========================================================================
-- TREESITTER PARSERS - Syntax highlighting for web languages
-- ========================================================================
-- Ensures Treesitter parsers are installed for better syntax highlighting
-- ========================================================================
{
'nvim-treesitter/nvim-treesitter',
ft = { 'svelte', 'typescript', 'javascript', 'css', 'html' },
opts = function(_, opts)
-- Ensure web language parsers are installed
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, {
'svelte',
'typescript',
'tsx',
'javascript',
'jsdoc',
'css',
'html',
'json',
})
return opts
end,
},
-- ========================================================================
-- EMMET - HTML/CSS abbreviation expansion
-- ========================================================================
-- Provides Emmet abbreviation support for faster HTML/CSS writing
-- Type abbreviations like `div.container>ul>li*3` and expand with <C-y>,
-- ========================================================================
{
'mattn/emmet-vim',
ft = { 'svelte', 'html', 'css', 'javascript', 'typescript' },
init = function()
-- Set Emmet leader key (default is <C-y>)
vim.g.user_emmet_leader_key = '<C-e>'
-- Enable only for specific file types
vim.g.user_emmet_install_global = 0
-- Enable Emmet for Svelte files
vim.api.nvim_create_autocmd('FileType', {
pattern = { 'html', 'css', 'svelte', 'javascript', 'typescript' },
callback = function()
vim.cmd 'EmmetInstall'
end,
})
end,
},
}