Skip to content

Commit 7b82def

Browse files
committed
feat:
fixxed linting problems
1 parent a7f5b81 commit 7b82def

File tree

9 files changed

+197
-267
lines changed

9 files changed

+197
-267
lines changed

README.md

Lines changed: 63 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
<!-- markdownlint-disable MD013 MD033 MD045 -->
2+
13
# Nvim UI+
24

35
<a href="https://marketplace.visualstudio.com/items?itemName=wrath-codes.nvim_ui_plus" target="__blank"><img src="https://img.shields.io/visual-studio-marketplace/v/wrath-codes.nvim_ui_plus.svg?color=eee&amp;label=VS%20Code%20Marketplace&logo=visual-studio-code" alt="Visual Studio Marketplace Version" /></a>
@@ -44,9 +46,9 @@ local function notify_vscode_mode()
4446
elseif mode == "v" then
4547
mode_name = "visual"
4648
elseif mode == "V" then
47-
mode_name = "visual"
48-
elseif mode == "\22" then
49-
mode_name = "visual"
49+
mode_name = "visual"
50+
elseif mode == "\22" then
51+
mode_name = "visual"
5052
elseif mode == "c" then
5153
mode_name = "cmdline"
5254
elseif mode == "R" then
@@ -77,26 +79,28 @@ vim.api.nvim_create_autocmd({ "VimEnter" }, {
7779
You can customize everything through VSCode settings:
7880

7981
```json
80-
"nvim_ui_plus.enabled": true,
81-
"nvim_ui_plus.uiElements": {
82-
"editorCursor": true,
83-
"inputValidation": true,
84-
"panelTitle": true,
85-
"peekView": true,
86-
"tabs": true,
87-
"activityBar": true,
88-
"titleBar": true,
89-
"statusBar": true,
90-
"editor": true,
91-
"suggestWidget": true,
92-
"lineNumbers": true
93-
},
94-
"nvim_ui_plus.colors": {
95-
"normal": "#94E2D5", // Catppuccin teal
96-
"insert": "#74C7EC", // Catppuccin sapphire
97-
"visual": "#CBA6F7", // Catppuccin mauve
98-
"replace": "#EBA0AC", // Catppuccin maroon
99-
"cmdline": "#FAB387" // Catppuccin peach
82+
{
83+
"nvim_ui_plus.enabled": true,
84+
"nvim_ui_plus.uiElements": {
85+
"editorCursor": true,
86+
"inputValidation": true,
87+
"panelTitle": true,
88+
"peekView": true,
89+
"tabs": true,
90+
"activityBar": true,
91+
"titleBar": true,
92+
"statusBar": true,
93+
"editor": true,
94+
"suggestWidget": true,
95+
"lineNumbers": true
96+
},
97+
"nvim_ui_plus.colors": {
98+
"normal": "#94E2D5", // Catppuccin teal
99+
"insert": "#74C7EC", // Catppuccin sapphire
100+
"visual": "#CBA6F7", // Catppuccin mauve
101+
"replace": "#EBA0AC", // Catppuccin maroon
102+
"cmdline": "#FAB387" // Catppuccin peach
103+
}
100104
}
101105
```
102106

@@ -123,42 +127,42 @@ Set your own colors for each mode (defaults to Catppuccin colors):
123127
<details>
124128
<summary>🎨 Catppuccin Mocha Colors</summary>
125129
<table>
126-
<tr>
127-
<th>Mode</th>
128-
<th>Color</th>
129-
<th>Hex</th>
130-
<th>Preview</th>
131-
</tr>
132-
<tr>
133-
<td>Normal</td>
134-
<td>Teal</td>
135-
<td><code>#94E2D5</code></td>
136-
<td><img src="assets/mocha_teal.png" width="23"/></td>
137-
</tr>
138-
<tr>
139-
<td>Insert</td>
140-
<td>Sapphire</td>
141-
<td><code>#74C7EC</code></td>
142-
<td><img src="assets/mocha_sapphire.png" width="23"/></td>
143-
</tr>
144-
<tr>
145-
<td>Visual</td>
146-
<td>Mauve</td>
147-
<td><code>#CBA6F7</code></td>
148-
<td><img src="assets/mocha_mauve.png" width="23"/></td>
149-
</tr>
150-
<tr>
151-
<td>Replace</td>
152-
<td>Maroon</td>
153-
<td><code>#EBA0AC</code></td>
154-
<td><img src="assets/mocha_maroon.png" width="23"/></td>
155-
</tr>
156-
<tr>
157-
<td>Command</td>
158-
<td>Peach</td>
159-
<td><code>#FAB387</code></td>
160-
<td><img src="assets/mocha_peach.png" width="23"/></td>
161-
</tr>
130+
<tr>
131+
<th>Mode</th>
132+
<th>Color</th>
133+
<th>Hex</th>
134+
<th>Preview</th>
135+
</tr>
136+
<tr>
137+
<td>Normal</td>
138+
<td>Teal</td>
139+
<td><code>#94E2D5</code></td>
140+
<td><img src="assets/mocha_teal.png" width="23"/></td>
141+
</tr>
142+
<tr>
143+
<td>Insert</td>
144+
<td>Sapphire</td>
145+
<td><code>#74C7EC</code></td>
146+
<td><img src="assets/mocha_sapphire.png" width="23"/></td>
147+
</tr>
148+
<tr>
149+
<td>Visual</td>
150+
<td>Mauve</td>
151+
<td><code>#CBA6F7</code></td>
152+
<td><img src="assets/mocha_mauve.png" width="23"/></td>
153+
</tr>
154+
<tr>
155+
<td>Replace</td>
156+
<td>Maroon</td>
157+
<td><code>#EBA0AC</code></td>
158+
<td><img src="assets/mocha_maroon.png" width="23"/></td>
159+
</tr>
160+
<tr>
161+
<td>Command</td>
162+
<td>Peach</td>
163+
<td><code>#FAB387</code></td>
164+
<td><img src="assets/mocha_peach.png" width="23"/></td>
165+
</tr>
162166
</table>
163167
</details>
164168

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"publisher": "wrath-codes",
33
"name": "nvim_ui_plus",
44
"displayName": "Nvim UI+",
5-
"version": "0.0.0",
5+
"version": "0.0.1",
66
"private": true,
77
"packageManager": "[email protected]+sha512.cdf928fca20832cd59ec53826492b7dc25dc524d4370b6b4adbf65803d32efaa6c1c88147c0ae4e8d579a6c9eec715757b50d4fa35eea179d868eada4ed043af",
88
"description": "Enhance your VS Code Neovim experience with dynamic UI theming based on Neovim modes",
@@ -40,7 +40,7 @@
4040
{
4141
"command": "nvim_ui_plus.setMode",
4242
"title": "Set Neovim Mode",
43-
"when": "false"
43+
"when": "false"
4444
},
4545
{
4646
"command": "nvim_ui_plus.showCurrentMode",
@@ -113,30 +113,30 @@
113113
"description": "Apply mode color to active line numbers"
114114
},
115115
"nvim_ui_plus.colors.normal": {
116-
"type": "string",
117-
"default": "#94E2D5",
118-
"description": "Color for normal mode (Catppuccin teal)"
119-
},
120-
"nvim_ui_plus.colors.insert": {
121-
"type": "string",
122-
"default": "#74C7EC",
123-
"description": "Color for insert mode (Catppuccin sapphire)"
124-
},
125-
"nvim_ui_plus.colors.visual": {
126-
"type": "string",
127-
"default": "#CBA6F7",
128-
"description": "Color for visual mode (Catppuccin mauve)"
129-
},
130-
"nvim_ui_plus.colors.replace": {
131-
"type": "string",
132-
"default": "#EBA0AC",
133-
"description": "Color for replace mode (Catppuccin maroon)"
134-
},
135-
"nvim_ui_plus.colors.cmdline": {
136-
"type": "string",
137-
"default": "#FAB387",
138-
"description": "Color for command line mode (Catppuccin peach)"
139-
}
116+
"type": "string",
117+
"default": "#94E2D5",
118+
"description": "Color for normal mode (Catppuccin teal)"
119+
},
120+
"nvim_ui_plus.colors.insert": {
121+
"type": "string",
122+
"default": "#74C7EC",
123+
"description": "Color for insert mode (Catppuccin sapphire)"
124+
},
125+
"nvim_ui_plus.colors.visual": {
126+
"type": "string",
127+
"default": "#CBA6F7",
128+
"description": "Color for visual mode (Catppuccin mauve)"
129+
},
130+
"nvim_ui_plus.colors.replace": {
131+
"type": "string",
132+
"default": "#EBA0AC",
133+
"description": "Color for replace mode (Catppuccin maroon)"
134+
},
135+
"nvim_ui_plus.colors.cmdline": {
136+
"type": "string",
137+
"default": "#FAB387",
138+
"description": "Color for command line mode (Catppuccin peach)"
139+
}
140140
}
141141
}
142142
},

src/commands.ts

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,23 @@
1-
2-
// import { useCommand } from 'reactive-vscode'
3-
// import { window } from 'vscode'
4-
// import { logger } from './utils'
5-
// import { currentMode } from './neovimModeManager'
6-
7-
// export function registerCommands() {
8-
// // Register a command to receive mode updates from Neovim
9-
// const setModeCommand = useCommand('nvim_ui_plus.setMode', (args: { mode: string }) => {
10-
// if (!args || typeof args.mode !== 'string') {
11-
// logger.warn(`Received invalid args:`, args)
12-
// return false
13-
// }
14-
15-
// logger.info(`Mode changed to: ${args.mode} (via Neovim autocommand)`)
16-
// currentMode.value = args.mode
17-
// return true
18-
// })
19-
20-
// // Add a command to check the current mode
21-
// const showModeCommand = useCommand('nvim_ui_plus.showCurrentMode', () => {
22-
// window.showInformationMessage(`Current Neovim mode: ${currentMode.value}`)
23-
// })
24-
25-
// // Return a cleanup function (though this may be handled by the framework)
26-
// return () => {
27-
// // The framework likely handles command disposal automatically
28-
// }
29-
// }
30-
//
31-
321
import { useCommand } from 'reactive-vscode'
332
import { window } from 'vscode'
34-
import { logger } from './utils'
353
import { currentMode } from './neovimModeManager'
4+
import { logger } from './utils'
365

376
export function registerCommands() {
387
// Register a command to receive mode updates from Neovim
39-
const setModeCommand = useCommand('nvim_ui_plus.setMode', (args: { mode: string }) => {
8+
useCommand('nvim_ui_plus.setMode', (args: { mode: string }) => {
409
if (!args || typeof args.mode !== 'string') {
4110
logger.warn(`Received invalid args:`, args)
4211
return false
4312
}
44-
13+
4514
logger.info(`Mode changed to: ${args.mode} (via Neovim autocommand)`)
4615
currentMode.value = args.mode
4716
return true
4817
})
49-
18+
5019
// Add a command to check the current mode
51-
const showModeCommand = useCommand('nvim_ui_plus.showCurrentMode', () => {
20+
useCommand('nvim_ui_plus.showCurrentMode', () => {
5221
window.showInformationMessage(`Current Neovim mode: ${currentMode.value}`)
5322
})
54-
}
23+
}

src/config.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,33 @@ import * as Meta from './generated/meta'
33

44
// Define the interface for our configuration
55
interface NvimUiPlusConfig {
6-
enabled: { value: boolean };
6+
enabled: { value: boolean }
77
uiElements: {
8-
editorCursor: { value: boolean };
9-
inputValidation: { value: boolean };
10-
panelTitle: { value: boolean };
11-
peekView: { value: boolean };
12-
tabs: { value: boolean };
13-
activityBar: { value: boolean };
14-
titleBar: { value: boolean };
15-
statusBar: { value: boolean };
16-
editor: { value: boolean };
17-
suggestWidget: { value: boolean };
18-
lineNumbers: { value: boolean };
19-
};
8+
editorCursor: { value: boolean }
9+
inputValidation: { value: boolean }
10+
panelTitle: { value: boolean }
11+
peekView: { value: boolean }
12+
tabs: { value: boolean }
13+
activityBar: { value: boolean }
14+
titleBar: { value: boolean }
15+
statusBar: { value: boolean }
16+
editor: { value: boolean }
17+
suggestWidget: { value: boolean }
18+
lineNumbers: { value: boolean }
19+
}
2020
colors: {
21-
normal: { value: string };
22-
insert: { value: string };
23-
visual: { value: string };
24-
replace: { value: string };
25-
cmdline: { value: string };
26-
};
21+
normal: { value: string }
22+
insert: { value: string }
23+
visual: { value: string }
24+
replace: { value: string }
25+
cmdline: { value: string }
26+
}
2727
}
2828

2929
// Define our UI configuration with the proper type
3030
export const nvimUiConfig = defineConfigObject('nvim_ui_plus', {
3131
enabled: Boolean,
32-
32+
3333
uiElements: {
3434
editorCursor: Boolean,
3535
inputValidation: Boolean,
@@ -41,20 +41,20 @@ export const nvimUiConfig = defineConfigObject('nvim_ui_plus', {
4141
statusBar: Boolean,
4242
editor: Boolean,
4343
suggestWidget: Boolean,
44-
lineNumbers: Boolean
44+
lineNumbers: Boolean,
4545
},
46-
46+
4747
colors: {
4848
normal: String,
4949
insert: String,
5050
visual: String,
5151
replace: String,
52-
cmdline: String
53-
}
54-
}) as unknown as NvimUiPlusConfig; // Type assertion
52+
cmdline: String,
53+
},
54+
}) as unknown as NvimUiPlusConfig // Type assertion
5555

5656
// Keep the original config for the rest of the extension
5757
export const config = defineConfigObject<Meta.ScopedConfigKeyTypeMap>(
5858
Meta.scopedConfigs.scope,
59-
Meta.scopedConfigs.defaults
59+
Meta.scopedConfigs.defaults,
6060
)

0 commit comments

Comments
 (0)