Skip to content

Commit c0c1148

Browse files
feat: phase 2 migration
1 parent fc1fcc0 commit c0c1148

File tree

20 files changed

+662
-2644
lines changed

20 files changed

+662
-2644
lines changed

init.lua

Lines changed: 38 additions & 163 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,53 @@
11
--[[
2-
3-
=====================================================================
4-
==================== READ THIS BEFORE CONTINUING ====================
5-
=====================================================================
6-
======== .-----. ========
7-
======== .----------------------. | === | ========
8-
======== |.-""""""""""""""""""-.| |-----| ========
9-
======== || || | === | ========
10-
======== || KICKSTART.NVIM || |-----| ========
11-
======== || || | === | ========
12-
======== || || |-----| ========
13-
======== ||:Tutor || |:::::| ========
14-
======== |'-..................-'| |____o| ========
15-
======== `"")----------------(""` ___________ ========
16-
======== /::::::::::| |::::::::::\ \ no mouse \ ========
17-
======== /:::========| |==hjkl==:::\ \ required \ ========
18-
======== '""""""""""""' '""""""""""""' '""""""""""' ========
19-
======== ========
202
=====================================================================
3+
NEOVIM CONFIGURATION
214
=====================================================================
5+
This configuration started from Kickstart.nvim and has been customized
6+
and reorganized into a modular structure.
227
23-
What is Kickstart?
24-
25-
Kickstart.nvim is *not* a distribution.
26-
27-
Kickstart.nvim is a starting point for your own configuration.
28-
The goal is that you can read every line of code, top-to-bottom, understand
29-
what your configuration is doing, and modify it to suit your needs.
30-
31-
Once you've done that, you can start exploring, configuring and tinkering to
32-
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
33-
or immediately breaking it into modular pieces. It's up to you!
34-
35-
If you don't know anything about Lua, I recommend taking some time to read through
36-
a guide. One possible example which will only take 10-15 minutes:
37-
- https://learnxinyminutes.com/docs/lua/
38-
39-
After understanding a bit more about Lua, you can use `:help lua-guide` as a
40-
reference for how Neovim integrates Lua.
41-
- :help lua-guide
42-
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
43-
44-
Kickstart Guide:
45-
46-
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
47-
48-
If you don't know what this means, type the following:
49-
- <escape key>
50-
- :
51-
- Tutor
52-
- <enter key>
53-
54-
(If you already know the Neovim basics, you can skip this step.)
55-
56-
Once you've completed that, you can continue working through **AND READING** the rest
57-
of the kickstart init.lua.
58-
59-
Next, run AND READ `:help`.
60-
This will open up a help window with some basic information
61-
about reading, navigating and searching the builtin help documentation.
62-
63-
This should be the first place you go to look when you're stuck or confused
64-
with something. It's one of my favorite Neovim features.
65-
66-
MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
67-
which is very useful when you're not exactly sure of what you're looking for.
68-
69-
I have left several `:help X` comments throughout the init.lua
70-
These are hints about where to find more information about the relevant settings,
71-
plugins or Neovim features used in Kickstart.
8+
For help:
9+
- Run `:Tutor` to learn Neovim basics
10+
- Run `:help` to access built-in documentation
11+
- Press `<space>sh` to search help with Telescope
12+
- Run `:checkhealth` to diagnose issues
13+
- See ORGANIZATION.md for structure details
7214
73-
NOTE: Look for lines like this
74-
75-
Throughout the file. These are for you, the reader, to help you understand what is happening.
76-
Feel free to delete them once you know what you're doing, but they should serve as a guide
77-
for when you are first encountering a few different constructs in your Neovim config.
78-
79-
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
80-
81-
I hope you enjoy your Neovim journey,
82-
- TJ
83-
84-
P.S. You can delete this when you're done too. It's your config now! :)
15+
This is YOUR config now! Customize it to your needs.
16+
=====================================================================
8517
--]]
8618

8719
-- ========================================================================
88-
-- MODULAR CONFIGURATION
20+
-- MODULAR NEOVIM CONFIGURATION
8921
-- ========================================================================
90-
-- This init.lua has been split into modular pieces for better organization.
91-
-- Each module is responsible for a specific aspect of the configuration:
22+
-- This configuration has been organized into modular pieces for clarity
23+
-- and maintainability. Each module handles a specific aspect:
9224
--
93-
-- lua/config/options.lua - Vim options (set, opt)
94-
-- lua/config/keymaps.lua - Global keymaps
95-
-- lua/config/autocmds.lua - Global autocommands
96-
-- lua/config/lazy.lua - Plugin manager and all plugins
25+
-- lua/config/
26+
-- ├── options.lua - Vim settings (leader, mouse, clipboard, etc.)
27+
-- ├── keymaps.lua - Global keymaps (window navigation, quit, etc.)
28+
-- ├── autocmds.lua - Global autocommands (highlight yank, etc.)
29+
-- └── lazy.lua - Plugin manager bootstrap (~50 lines)
9730
--
98-
-- Language-specific configurations are in:
99-
-- lua/custom/plugins/ - Custom plugins (Flutter, Python, etc.)
100-
-- lua/kickstart/plugins/ - Kickstart default plugins
31+
-- lua/plugins/
32+
-- ├── core/ - Always loaded plugins
33+
-- │ ├── ui.lua - Colorscheme, statusline, treesitter
34+
-- │ ├── editor.lua - Telescope, which-key
35+
-- │ ├── git.lua - Gitsigns
36+
-- │ ├── completion.lua - Blink.cmp, snippets
37+
-- │ ├── session.lua - Auto-session
38+
-- │ ├── extras.lua - Mini.animate, trouble, noice
39+
-- │ └── neo-tree.lua - File explorer
40+
--
41+
-- ├── lsp/ - LSP infrastructure
42+
-- │ └── init.lua - LSP config, mason, conform
43+
--
44+
-- └── lang/ - Language-specific (lazy-loaded by filetype)
45+
-- ├── flutter.lua - Dart/Flutter (ft='dart')
46+
-- ├── python.lua - Python (ft='python')
47+
-- └── svelte.lua - Svelte (ft='svelte')
10148
--
102-
-- See ORGANIZATION.md for more details on the structure.
49+
-- See ORGANIZATION.md for detailed information about the structure.
50+
-- See MIGRATION.md for the migration guide from monolithic to modular.
10351
-- ========================================================================
10452

10553
-- Load core configuration modules
@@ -108,78 +56,5 @@ require 'config.keymaps' -- Global keymaps
10856
require 'config.autocmds' -- Global autocommands
10957
require 'config.lazy' -- Plugin manager and plugins
11058

111-
-- ========================================================================
112-
-- LANGUAGE-SPECIFIC LSP SETUP (for lazy-loaded profiles)
113-
-- ========================================================================
114-
-- Python LSP - starts when opening .py files
115-
vim.api.nvim_create_autocmd('FileType', {
116-
pattern = 'python',
117-
once = false,
118-
callback = function(args)
119-
-- Check if pyright is already attached
120-
local clients = vim.lsp.get_clients { bufnr = args.buf, name = 'pyright' }
121-
if #clients > 0 then
122-
return
123-
end
124-
125-
-- Get capabilities from blink.cmp
126-
local capabilities = require('blink.cmp').get_lsp_capabilities()
127-
128-
local root_dir = vim.fs.root(args.buf, {
129-
'pyproject.toml',
130-
'setup.py',
131-
'setup.cfg',
132-
'requirements.txt',
133-
'Pipfile',
134-
'pyrightconfig.json',
135-
'.git',
136-
})
137-
138-
-- Find Python interpreter (prioritize virtual environments)
139-
local function find_python()
140-
if not root_dir then
141-
return nil
142-
end
143-
144-
-- Check common venv locations relative to project root
145-
local venv_paths = {
146-
root_dir .. '/.venv/bin/python',
147-
root_dir .. '/venv/bin/python',
148-
root_dir .. '/.env/bin/python',
149-
root_dir .. '/env/bin/python',
150-
}
151-
152-
for _, path in ipairs(venv_paths) do
153-
if vim.fn.executable(path) == 1 then
154-
return path
155-
end
156-
end
157-
158-
return nil
159-
end
160-
161-
local python_path = find_python()
162-
163-
vim.lsp.start {
164-
name = 'pyright',
165-
cmd = { vim.fn.stdpath 'data' .. '/mason/bin/pyright-langserver', '--stdio' },
166-
root_dir = root_dir or vim.fn.getcwd(),
167-
capabilities = capabilities,
168-
settings = {
169-
python = {
170-
pythonPath = python_path, -- Tell pyright which Python to use
171-
analysis = {
172-
typeCheckingMode = 'basic',
173-
autoImportCompletions = true,
174-
autoSearchPaths = true,
175-
useLibraryCodeForTypes = true,
176-
diagnosticMode = 'openFilesOnly',
177-
},
178-
},
179-
},
180-
}
181-
end,
182-
})
183-
18459
-- The line beneath this is called `modeline`. See `:help modeline`
18560
-- vim: ts=2 sts=2 sw=2 et

0 commit comments

Comments
 (0)