Skip to content

Commit 631e88b

Browse files
committed
refactor
1 parent ab58d1a commit 631e88b

File tree

15 files changed

+122
-366
lines changed

15 files changed

+122
-366
lines changed

CLAUDE.md

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,23 @@ The configuration is organized into three main directories:
2121
│ │ ├── keymaps.lua # Global key mappings
2222
│ │ └── autocommands.lua # Autocommands (highlight on yank, etc.)
2323
│ ├── plugins/ # Plugin specifications (auto-loaded by lazy.nvim)
24+
│ │ ├── autopairs.lua # Auto-close brackets and quotes
25+
│ │ ├── claude-code.lua # Claude Code integration
2426
│ │ ├── colorscheme.lua # Color scheme (kanso.nvim + alternatives)
25-
│ │ ├── treesitter.lua # Syntax highlighting & parsing
26-
│ │ ├── lsp.lua # LSP configuration & Mason
2727
│ │ ├── completion.lua # blink.cmp & LuaSnip
28+
│ │ ├── flash.lua # Rapid cursor movement
29+
│ │ ├── formatting.lua # conform.nvim for code formatting
30+
│ │ ├── gitsigns.lua # Git signs and operations
31+
│ │ ├── harpoon.lua # File bookmarking
32+
│ │ ├── lsp.lua # LSP configuration & Mason
33+
│ │ ├── lualine.lua # Status line
34+
│ │ ├── oil.lua # File browser
35+
│ │ ├── snacks.lua # Utility plugin
2836
│ │ ├── telescope.lua # Fuzzy finder
29-
│ │ ├── navigation.lua # Harpoon, Flash, Oil, tmux-navigator
30-
│ │ ├── formatting.lua # conform.nvim
31-
│ │ ├── ui.lua # which-key, lualine
32-
│ │ ├── utils.lua # vim-sleuth, gitsigns, autopairs, snacks
33-
│ │ ├── claude-code.lua # Claude Code integration
37+
│ │ ├── treesitter.lua # Syntax highlighting & parsing
38+
│ │ ├── vim-sleuth.lua # Auto-detect indentation
39+
│ │ ├── vim-tmux-navigator.lua # Tmux/Vim navigation
40+
│ │ ├── which-key.lua # Keybinding hints
3441
│ │ └── optional/ # Optional plugins (not loaded by default)
3542
│ │ ├── README.md # Instructions for enabling optional plugins
3643
│ │ ├── debug.lua # DAP debugger for Go
@@ -46,34 +53,26 @@ The configuration is organized into three main directories:
4653
- **Auto-Loading**: All files in `lua/plugins/*.lua` are automatically loaded
4754
- **Custom Plugins**: Add your own in `lua/custom/plugins/init.lua` or create new files there
4855

49-
### Key Plugin Categories
50-
51-
1. **LSP Configuration** (`lua/plugins/lsp.lua`)
52-
- Mason for LSP installation
53-
- Configured servers: `pyright`, `zls`, `rust_analyzer`, `ts_ls`, `lua_ls`
54-
- LSP capabilities enhanced by blink.cmp
55-
- Autocommands for LSP attach events setup keymaps and highlighting
56-
57-
2. **Completion** (`lua/plugins/completion.lua`)
58-
- blink.cmp for autocompletion
59-
- LuaSnip for snippet expansion
60-
- Default keymap preset uses `<c-y>` to accept
61-
62-
3. **Telescope** (`lua/plugins/telescope.lua`)
63-
- Fuzzy finder with vertical layout
64-
- Extensions: fzf, ui-select
65-
- Leader-based keymaps for searching files, grep, diagnostics, etc.
66-
67-
4. **Navigation & Movement** (`lua/plugins/navigation.lua`)
68-
- Harpoon2 for file bookmarking
69-
- Flash.nvim for rapid cursor movement
70-
- Oil.nvim for file browsing
71-
- vim-tmux-navigator for seamless tmux/vim navigation
72-
73-
5. **Formatting** (`lua/plugins/formatting.lua`)
74-
- conform.nvim handles formatting
75-
- Format on save enabled (except for C/C++)
76-
- Configured formatters: stylua (Lua), prettier (JS/TS/CSS/HTML/JSON)
56+
### Key Plugins
57+
58+
Each plugin is in its own file for easy management:
59+
60+
- **lsp.lua** - LSP configuration with Mason, servers: `pyright`, `zls`, `rust_analyzer`, `ts_ls`, `lua_ls`
61+
- **completion.lua** - blink.cmp autocompletion with LuaSnip snippets
62+
- **telescope.lua** - Fuzzy finder with vertical layout, fzf and ui-select extensions
63+
- **harpoon.lua** - Quick file bookmarking and navigation
64+
- **flash.lua** - Rapid cursor movement with `s`, `S`, `r`, `R` keys
65+
- **oil.lua** - File browser with `-` key binding
66+
- **vim-tmux-navigator.lua** - Seamless tmux/vim split navigation
67+
- **formatting.lua** - conform.nvim with format-on-save (stylua, prettier)
68+
- **gitsigns.lua** - Git signs in gutter with staging/diffing keymaps
69+
- **which-key.lua** - Keybinding hints popup
70+
- **lualine.lua** - Status line with base16 theme
71+
- **treesitter.lua** - Syntax highlighting for multiple languages
72+
- **autopairs.lua** - Auto-close brackets and quotes
73+
- **vim-sleuth.lua** - Auto-detect indentation
74+
- **snacks.lua** - Utility plugin collection
75+
- **colorscheme.lua** - Multiple color schemes (kanso active)
7776

7877
## Common Commands
7978

@@ -205,9 +204,9 @@ Currently using kanso.nvim. Several commented-out alternatives available (gruvbo
205204

206205
### Plugin Organization Philosophy
207206

208-
- **Separation by Function**: Each file in `lua/plugins/` represents a logical category
209-
- **Easy Discovery**: Find all plugins of a type in one file
210-
- **Modular**: Add/remove entire categories by managing single files
207+
- **One Plugin Per File**: Each plugin has its own dedicated file in `lua/plugins/` (except colorscheme.lua which contains theme options)
208+
- **Easy Discovery**: Plugin files are named after the plugin they configure
209+
- **Modular**: Add/remove individual plugins by managing single files
211210
- **Custom Additions**: Use `lua/custom/plugins/` for your personal plugins without modifying core structure
212211

213212
### Optional Plugins

lua/plugins/autopairs.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
return {
2+
{
3+
'windwp/nvim-autopairs',
4+
event = 'InsertEnter',
5+
config = true,
6+
-- use opts = {} for passing setup options
7+
-- this is equivalent to setup({}) function
8+
},
9+
}

lua/plugins/flash.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
return {
2+
{
3+
'folke/flash.nvim',
4+
event = 'VeryLazy',
5+
---@type Flash.Config
6+
opts = {},
7+
-- stylua: ignore
8+
keys = {
9+
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
10+
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
11+
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
12+
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
13+
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
14+
},
15+
},
16+
}
Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
return {
2-
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
3-
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
4-
52
{ -- Adds git related signs to the gutter, as well as utilities for managing changes
63
'lewis6991/gitsigns.nvim',
74
opts = {
@@ -64,16 +61,4 @@ return {
6461
end,
6562
},
6663
},
67-
{
68-
'windwp/nvim-autopairs',
69-
event = 'InsertEnter',
70-
config = true,
71-
-- use opts = {} for passing setup options
72-
-- this is equivalent to setup({}) function
73-
},
74-
{
75-
'folke/snacks.nvim',
76-
priority = 1000,
77-
lazy = false,
78-
},
7964
}
Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,4 @@
11
return {
2-
{
3-
'christoomey/vim-tmux-navigator',
4-
cmd = {
5-
'TmuxNavigateLeft',
6-
'TmuxNavigateDown',
7-
'TmuxNavigateUp',
8-
'TmuxNavigateRight',
9-
'TmuxNavigatePrevious',
10-
'TmuxNavigatorProcessList',
11-
},
12-
keys = {
13-
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
14-
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
15-
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
16-
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
17-
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
18-
},
19-
},
20-
{
21-
'folke/flash.nvim',
22-
event = 'VeryLazy',
23-
---@type Flash.Config
24-
opts = {},
25-
-- stylua: ignore
26-
keys = {
27-
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
28-
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
29-
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
30-
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
31-
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
32-
},
33-
},
342
{
353
'ThePrimeagen/harpoon',
364
branch = 'harpoon2',
@@ -91,20 +59,4 @@ return {
9159
end, { desc = 'Open harpoon window' })
9260
end,
9361
},
94-
{
95-
'stevearc/oil.nvim',
96-
---@module 'oil'
97-
---@type oil.SetupOpts
98-
opts = {},
99-
-- Optional dependencies
100-
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
101-
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
102-
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
103-
lazy = false,
104-
config = function()
105-
require('oil').setup {
106-
vim.keymap.set('n', '-', '<CMD>Oil<CR>', { desc = 'Open parent directory' }),
107-
}
108-
end,
109-
},
11062
}

lua/plugins/lualine.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
return {
2+
{
3+
'nvim-lualine/lualine.nvim',
4+
dependencies = { 'nvim-tree/nvim-web-devicons' },
5+
config = function()
6+
require('lualine').setup {
7+
theme = 'base16',
8+
}
9+
end,
10+
},
11+
}

lua/plugins/oil.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
return {
2+
{
3+
'stevearc/oil.nvim',
4+
---@module 'oil'
5+
---@type oil.SetupOpts
6+
opts = {},
7+
-- Optional dependencies
8+
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
9+
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
10+
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
11+
lazy = false,
12+
config = function()
13+
require('oil').setup {
14+
vim.keymap.set('n', '-', '<CMD>Oil<CR>', { desc = 'Open parent directory' }),
15+
}
16+
end,
17+
},
18+
}

lua/plugins/optional/README.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)