diff --git a/DankMaterialShell/firefox.css b/DankMaterialShell/firefox.css index 04625d3..5d83551 100644 --- a/DankMaterialShell/firefox.css +++ b/DankMaterialShell/firefox.css @@ -1,60 +1,63 @@ @media -moz-pref("userChrome.theme-material") { :root { - --md-sys-color-primary: #34618e; - --md-sys-color-surface-tint: #34618e; + --md-sys-color-primary: #216487; + --md-sys-color-surface-tint: #216487; --md-sys-color-on-primary: #ffffff; - --md-sys-color-primary-container: #d1e4ff; - --md-sys-color-on-primary-container: #001d35; - --md-sys-color-secondary: #535f70; + --md-sys-color-primary-container: #c6e7ff; + --md-sys-color-on-primary-container: #001e2d; + --md-sys-color-secondary: #4f616e; --md-sys-color-on-secondary: #ffffff; - --md-sys-color-secondary-container: #d6e4f7; - --md-sys-color-on-secondary-container: #0f1c2b; - --md-sys-color-tertiary: #6a5779; + --md-sys-color-secondary-container: #d2e5f4; + --md-sys-color-on-secondary-container: #0b1d28; + --md-sys-color-tertiary: #62597c; --md-sys-color-on-tertiary: #ffffff; - --md-sys-color-tertiary-container: #f1daff; - --md-sys-color-on-tertiary-container: #241432; + --md-sys-color-tertiary-container: #e8ddff; + --md-sys-color-on-tertiary-container: #1e1635; --md-sys-color-error: #ba1a1a; --md-sys-color-on-error: #ffffff; --md-sys-color-error-container: #ffdad6; --md-sys-color-on-error-container: #410002; - --md-sys-color-background: #f8f9ff; - --md-sys-color-on-background: #191c20; - --md-sys-color-surface: #f8f9ff; - --md-sys-color-on-surface: #191c20; - --md-sys-color-surface-variant: #dfe3eb; - --md-sys-color-on-surface-variant: #42474e; - --md-sys-color-outline: #73777f; - --md-sys-color-outline-variant: #c3c7cf; + --md-sys-color-background: #f6fafe; + --md-sys-color-on-background: #181c1f; + --md-sys-color-surface: #f6fafe; + --md-sys-color-on-surface: #181c1f; + --md-sys-color-surface-variant: #dde3ea; + --md-sys-color-on-surface-variant: #41484d; + --md-sys-color-outline: #71787e; + --md-sys-color-outline-variant: #c1c7ce; --md-sys-color-shadow: #000000; --md-sys-color-scrim: #000000; - --md-sys-color-inverse-surface: #2e3135; - --md-sys-color-inverse-on-surface: #eff0f7; - --md-sys-color-inverse-primary: #9fcafc; - --md-sys-color-primary-fixed: #d1e4ff; - --md-sys-color-on-primary-fixed: #001d35; - --md-sys-color-primary-fixed-dim: #9fcafc; - --md-sys-color-on-primary-fixed-variant: #174974; - --md-sys-color-secondary-fixed: #d6e4f7; - --md-sys-color-on-secondary-fixed: #0f1c2b; - --md-sys-color-secondary-fixed-dim: #bac8db; - --md-sys-color-on-secondary-fixed-variant: #3b4858; - --md-sys-color-tertiary-fixed: #f1daff; - --md-sys-color-on-tertiary-fixed: #241432; - --md-sys-color-tertiary-fixed-dim: #d6bee5; - --md-sys-color-on-tertiary-fixed-variant: #524060; - --md-sys-color-surface-dim: #d8dae0; - --md-sys-color-surface-bright: #f8f9ff; + --md-sys-color-inverse-surface: #2d3135; + --md-sys-color-inverse-on-surface: #eef1f6; + --md-sys-color-inverse-primary: #92cef5; + --md-sys-color-primary-fixed: #c6e7ff; + --md-sys-color-on-primary-fixed: #001e2d; + --md-sys-color-primary-fixed-dim: #92cef5; + --md-sys-color-on-primary-fixed-variant: #004c6b; + --md-sys-color-secondary-fixed: #d2e5f4; + --md-sys-color-on-secondary-fixed: #0b1d28; + --md-sys-color-secondary-fixed-dim: #b6c9d8; + --md-sys-color-on-secondary-fixed-variant: #374955; + --md-sys-color-tertiary-fixed: #e8ddff; + --md-sys-color-on-tertiary-fixed: #1e1635; + --md-sys-color-tertiary-fixed-dim: #ccc1e9; + --md-sys-color-on-tertiary-fixed-variant: #4a4263; + --md-sys-color-surface-dim: #d7dadf; + --md-sys-color-surface-bright: #f6fafe; --md-sys-color-surface-container-lowest: #ffffff; - --md-sys-color-surface-container-low: #f2f3f9; - --md-sys-color-surface-container: #f8f9ff; - --md-sys-color-surface-container-high: #f8f9ff; - --md-sys-color-surface-container-highest: #f8f9ff; + --md-sys-color-surface-container-low: #f0f4f8; + --md-sys-color-surface-container: #f6fafe; + --md-sys-color-surface-container-high: #f6fafe; + --md-sys-color-surface-container-highest: #f6fafe; --m3-radius: 12px; --m3-radius-sm: 10px; --m3-elev-0: none; - --m3-elev-1: 0 1px 2px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06); - --m3-elev-2: 0 2px 6px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06); + --m3-elev-1: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 8%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 6%, transparent); + --m3-elev-2: 0 2px 6px color-mix(in srgb, var(--md-sys-color-shadow) 10%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 6%, transparent); + --m3-elev-3: 0 11px 7px color-mix(in srgb, var(--md-sys-color-shadow) 19%, transparent), 0 13px 25px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent); + --m3-elev-4: 0 14px 12px color-mix(in srgb, var(--md-sys-color-shadow) 17%, transparent), 0 20px 40px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent); + --m3-elev-5: 0 17px 17px color-mix(in srgb, var(--md-sys-color-shadow) 15%, transparent), 0 27px 55px color-mix(in srgb, var(--md-sys-color-shadow) 30%, transparent); --tab-height: 34px; --urlbar-height: 38px; @@ -68,58 +71,61 @@ @media (prefers-color-scheme: dark) { :root { - --md-sys-color-primary: #9fcafc; - --md-sys-color-surface-tint: #9fcafc; - --md-sys-color-on-primary: #003257; - --md-sys-color-primary-container: #174974; - --md-sys-color-on-primary-container: #d1e4ff; - --md-sys-color-secondary: #bac8db; - --md-sys-color-on-secondary: #253140; - --md-sys-color-secondary-container: #3b4858; - --md-sys-color-on-secondary-container: #d6e4f7; - --md-sys-color-tertiary: #d6bee5; - --md-sys-color-on-tertiary: #3a2948; - --md-sys-color-tertiary-container: #524060; - --md-sys-color-on-tertiary-container: #f1daff; + --md-sys-color-primary: #92cef5; + --md-sys-color-surface-tint: #92cef5; + --md-sys-color-on-primary: #00344b; + --md-sys-color-primary-container: #004c6b; + --md-sys-color-on-primary-container: #c6e7ff; + --md-sys-color-secondary: #b6c9d8; + --md-sys-color-on-secondary: #21323e; + --md-sys-color-secondary-container: #374955; + --md-sys-color-on-secondary-container: #d2e5f4; + --md-sys-color-tertiary: #ccc1e9; + --md-sys-color-on-tertiary: #332b4b; + --md-sys-color-tertiary-container: #4a4263; + --md-sys-color-on-tertiary-container: #e8ddff; --md-sys-color-error: #ffb4ab; --md-sys-color-on-error: #690005; --md-sys-color-error-container: #93000a; --md-sys-color-on-error-container: #ffdad6; - --md-sys-color-background: #101418; - --md-sys-color-on-background: #e1e2e8; - --md-sys-color-surface: #101418; - --md-sys-color-on-surface: #e1e2e8; - --md-sys-color-surface-variant: #42474e; - --md-sys-color-on-surface-variant: #c3c7cf; - --md-sys-color-outline: #8c9199; - --md-sys-color-outline-variant: #42474e; + --md-sys-color-background: #101417; + --md-sys-color-on-background: #dfe3e7; + --md-sys-color-surface: #101417; + --md-sys-color-on-surface: #dfe3e7; + --md-sys-color-surface-variant: #41484d; + --md-sys-color-on-surface-variant: #c1c7ce; + --md-sys-color-outline: #8b9198; + --md-sys-color-outline-variant: #41484d; --md-sys-color-shadow: #000000; --md-sys-color-scrim: #000000; - --md-sys-color-inverse-surface: #e1e2e8; - --md-sys-color-inverse-on-surface: #2e3135; - --md-sys-color-inverse-primary: #34618e; - --md-sys-color-primary-fixed: #d1e4ff; - --md-sys-color-on-primary-fixed: #001d35; - --md-sys-color-primary-fixed-dim: #9fcafc; - --md-sys-color-on-primary-fixed-variant: #174974; - --md-sys-color-secondary-fixed: #d6e4f7; - --md-sys-color-on-secondary-fixed: #0f1c2b; - --md-sys-color-secondary-fixed-dim: #bac8db; - --md-sys-color-on-secondary-fixed-variant: #3b4858; - --md-sys-color-tertiary-fixed: #f1daff; - --md-sys-color-on-tertiary-fixed: #241432; - --md-sys-color-tertiary-fixed-dim: #d6bee5; - --md-sys-color-on-tertiary-fixed-variant: #524060; - --md-sys-color-surface-dim: #101418; - --md-sys-color-surface-bright: #36393e; - --md-sys-color-surface-container-lowest: #0b0e13; - --md-sys-color-surface-container-low: #191c20; - --md-sys-color-surface-container: #1d2024; - --md-sys-color-surface-container-high: #272a2f; - --md-sys-color-surface-container-highest: #32353a; + --md-sys-color-inverse-surface: #dfe3e7; + --md-sys-color-inverse-on-surface: #2d3135; + --md-sys-color-inverse-primary: #216487; + --md-sys-color-primary-fixed: #c6e7ff; + --md-sys-color-on-primary-fixed: #001e2d; + --md-sys-color-primary-fixed-dim: #92cef5; + --md-sys-color-on-primary-fixed-variant: #004c6b; + --md-sys-color-secondary-fixed: #d2e5f4; + --md-sys-color-on-secondary-fixed: #0b1d28; + --md-sys-color-secondary-fixed-dim: #b6c9d8; + --md-sys-color-on-secondary-fixed-variant: #374955; + --md-sys-color-tertiary-fixed: #e8ddff; + --md-sys-color-on-tertiary-fixed: #1e1635; + --md-sys-color-tertiary-fixed-dim: #ccc1e9; + --md-sys-color-on-tertiary-fixed-variant: #4a4263; + --md-sys-color-surface-dim: #101417; + --md-sys-color-surface-bright: #353a3d; + --md-sys-color-surface-container-lowest: #0a0f12; + --md-sys-color-surface-container-low: #181c1f; + --md-sys-color-surface-container: #1c2024; + --md-sys-color-surface-container-high: #262a2e; + --md-sys-color-surface-container-highest: #313539; - --m3-elev-1: 0 1px 2px rgba(0,0,0,.50), 0 1px 3px rgba(0,0,0,.35); - --m3-elev-2: 0 4px 10px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.35); + --m3-elev-1: 0 1px 2px color-mix(in srgb, var(--md-sys-color-shadow) 50%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 35%, transparent); + --m3-elev-2: 0 4px 10px color-mix(in srgb, var(--md-sys-color-shadow) 55%, transparent), 0 1px 3px color-mix(in srgb, var(--md-sys-color-shadow) 35%, transparent); + --m3-elev-3: 0 11px 7px color-mix(in srgb, var(--md-sys-color-shadow) 45%, transparent), 0 13px 25px color-mix(in srgb, var(--md-sys-color-shadow) 55%, transparent); + --m3-elev-4: 0 14px 12px color-mix(in srgb, var(--md-sys-color-shadow) 42%, transparent), 0 20px 40px color-mix(in srgb, var(--md-sys-color-shadow) 55%, transparent); + --m3-elev-5: 0 17px 17px color-mix(in srgb, var(--md-sys-color-shadow) 40%, transparent), 0 27px 55px color-mix(in srgb, var(--md-sys-color-shadow) 55%, transparent); --state-hover: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, transparent); --state-press: color-mix(in srgb, var(--md-sys-color-on-surface) 10%, transparent); diff --git a/DankMaterialShell/settings.json b/DankMaterialShell/settings.json index e137bb5..d56646c 100644 --- a/DankMaterialShell/settings.json +++ b/DankMaterialShell/settings.json @@ -4,11 +4,14 @@ "customThemeFile": "", "registryThemeVariants": {}, "matugenScheme": "scheme-tonal-spot", + "matugenContrast": 0, "runUserMatugenTemplates": true, "matugenTargetMonitor": "", "popupTransparency": 1, "dockTransparency": 1, "widgetBackgroundColor": "sch", + "widgetBackgroundCustomColor": "#6750A4", + "widgetBackgroundCustomStrength": 0.5, "widgetColorMode": "default", "controlCenterTileColorMode": "primary", "buttonColorMode": "primary", @@ -17,12 +20,19 @@ "niriLayoutRadiusOverride": -1, "niriLayoutBorderSize": -1, "hyprlandLayoutGapsOverride": -1, + "hyprlandLayoutGapsOutOverride": -1, "hyprlandLayoutRadiusOverride": -1, "hyprlandLayoutBorderSize": -1, + "hyprlandResizeOnBorder": false, "mangoLayoutGapsOverride": -1, + "mangoLayoutGapsOutOverride": -1, "mangoLayoutRadiusOverride": -1, "mangoLayoutBorderSize": -1, - "use24HourClock": true, + "mangoTrackpadNaturalScrolling": true, + "firstDayOfWeek": -1, + "showWeekNumber": false, + "calendarBackend": "auto", + "clockFormat": "24h", "showSeconds": false, "padHours12Hour": false, "useFahrenheit": false, @@ -36,6 +46,17 @@ "modalAnimationSpeed": 1, "modalCustomAnimationDuration": 150, "enableRippleEffects": true, + "animationVariant": 0, + "motionEffect": 0, + "m3ElevationEnabled": true, + "m3ElevationIntensity": 12, + "m3ElevationOpacity": 30, + "m3ElevationColorMode": "default", + "m3ElevationLightDirection": "top", + "m3ElevationCustomColor": "#000000", + "modalElevationEnabled": true, + "popoutElevationEnabled": true, + "barElevationEnabled": false, "blurEnabled": false, "blurForegroundLayers": true, "blurLayerOutlineOpacity": 0.12, @@ -45,6 +66,8 @@ "wallpaperFillMode": "Fill", "blurredWallpaperLayer": false, "blurWallpaperOnOverview": true, + "wallpaperBackgroundColorMode": "black", + "wallpaperBackgroundCustomColor": "#000000", "showLauncherButton": true, "showWorkspaceSwitcher": true, "showFocusedWindow": true, @@ -64,6 +87,12 @@ "showClock": true, "showNotificationButton": true, "showBattery": true, + "showBatteryPercent": true, + "showBatteryPercentOnlyOnBattery": false, + "showBatteryTime": false, + "showBatteryTimeOnlyOnBattery": false, + "batteryPillStyle": false, + "batteryPillPercentSign": false, "showControlCenterButton": true, "showCapsLockIndicator": true, "controlCenterShowNetworkIcon": true, @@ -78,6 +107,8 @@ "controlCenterShowBatteryIcon": false, "controlCenterShowPrinterIcon": false, "controlCenterShowScreenSharingIcon": true, + "controlCenterShowIdleInhibitorIcon": false, + "controlCenterShowDoNotDisturbIcon": false, "showPrivacyButton": true, "privacyShowMicIcon": false, "privacyShowCameraIcon": false, @@ -143,29 +174,58 @@ "maxWorkspaceIcons": 1, "workspaceAppIconSizeOffset": 0, "groupWorkspaceApps": true, + "groupActiveWorkspaceApps": false, "workspaceFollowFocus": false, "showOccupiedWorkspacesOnly": false, "reverseScrolling": false, "dwlShowAllTags": false, + "workspaceActiveAppHighlightEnabled": false, "workspaceColorMode": "default", + "workspaceFocusedCustomColor": "#6750A4", "workspaceOccupiedColorMode": "none", + "workspaceOccupiedCustomColor": "#625B71", "workspaceUnfocusedColorMode": "default", + "workspaceUnfocusedCustomColor": "#49454E", "workspaceUrgentColorMode": "default", + "workspaceUrgentCustomColor": "#B3261E", "workspaceFocusedBorderEnabled": false, "workspaceFocusedBorderColor": "primary", + "workspaceFocusedBorderCustomColor": "#6750A4", "workspaceFocusedBorderThickness": 2, + "workspaceUnfocusedMonitorSeparateAppearance": false, + "workspaceUnfocusedMonitorColorMode": "default", + "workspaceUnfocusedMonitorFocusedCustomColor": "#6750A4", + "workspaceUnfocusedMonitorOccupiedColorMode": "none", + "workspaceUnfocusedMonitorOccupiedCustomColor": "#625B71", + "workspaceUnfocusedMonitorUnfocusedColorMode": "default", + "workspaceUnfocusedMonitorUnfocusedCustomColor": "#49454E", + "workspaceUnfocusedMonitorUrgentColorMode": "default", + "workspaceUnfocusedMonitorUrgentCustomColor": "#B3261E", + "workspaceUnfocusedMonitorBorderEnabled": false, + "workspaceUnfocusedMonitorBorderColor": "primary", + "workspaceUnfocusedMonitorBorderCustomColor": "#6750A4", + "workspaceUnfocusedMonitorBorderThickness": 2, "workspaceNameIcons": {}, "waveProgressEnabled": true, "scrollTitleEnabled": true, + "mediaAdaptiveWidthEnabled": true, "audioVisualizerEnabled": true, + "mediaUseAlbumArtAccent": false, "audioScrollMode": "volume", "audioWheelScrollAmount": 5, + "audioDeviceScrollVolumeEnabled": false, + "mediaExcludePlayers": [], "clockCompactMode": false, "focusedWindowCompactMode": false, + "focusedWindowSize": 1, + "focusedWindowShowIcon": true, "runningAppsCompactMode": true, "barMaxVisibleApps": 0, "barMaxVisibleRunningApps": 0, "barShowOverflowBadge": true, + "trayAutoOverflow": true, + "trayPopupSingleLine": true, + "trayMaxVisibleItems": 0, "appsDockHideIndicators": false, "appsDockColorizeActive": false, "appsDockActiveColorMode": "primary", @@ -173,6 +233,7 @@ "appsDockEnlargePercentage": 125, "appsDockIconSizePercentage": 100, "keyboardLayoutNameCompactMode": false, + "keyboardLayoutNameShowIcon": false, "runningAppsCurrentWorkspace": true, "runningAppsGroupByApp": false, "runningAppsCurrentMonitor": false, @@ -208,17 +269,24 @@ "lockDateFormat": "", "greeterRememberLastSession": true, "greeterRememberLastUser": true, + "greeterAutoLogin": false, "greeterEnableFprint": false, "greeterEnableU2f": false, "greeterWallpaperPath": "", + "greeterLockDateFormat": "", + "greeterFontFamily": "", + "greeterWallpaperFillMode": "", + "greeterPamExternallyManaged": false, + "greeterSyncPending": false, + "greeterSyncBaseline": {}, "mediaSize": 1, "appLauncherViewMode": "list", "spotlightModalViewMode": "list", "browserPickerViewMode": "list", "browserUsageHistory": { "firefox": { - "count": 7, - "lastUsed": 1782706566185, + "count": 9, + "lastUsed": 1784131326254, "name": "Firefox" } }, @@ -227,21 +295,56 @@ "sortAppsAlphabetically": false, "appLauncherGridColumns": 4, "spotlightCloseNiriOverview": true, + "rememberLastQuery": false, + "rememberLastMode": true, "spotlightSectionViewModes": { "apps": "list" }, "appDrawerSectionViewModes": {}, "niriOverviewOverlayEnabled": true, + "niriOverviewLauncherStyle": "full", "dankLauncherV2Size": "compact", + "dankLauncherV2ShowSourceBadges": true, "dankLauncherV2BorderEnabled": false, "dankLauncherV2BorderThickness": 2, "dankLauncherV2BorderColor": "primary", "dankLauncherV2ShowFooter": true, "dankLauncherV2UnloadOnClose": true, + "dankLauncherV2IncludeFilesInAll": false, + "dankLauncherV2IncludeFoldersInAll": false, + "launcherUseOverlayLayer": false, + "launcherStyle": "full", + "spotlightBarShowModeChips": false, + "keybindsFloatingWindow": false, "useAutoLocation": true, "weatherEnabled": true, + "dashTabs": [ + { + "id": "overview", + "enabled": true + }, + { + "id": "media", + "enabled": true + }, + { + "id": "wallpaper", + "enabled": true + }, + { + "id": "weather", + "enabled": true + }, + { + "id": "settings", + "enabled": true + } + ], "networkPreference": "wifi", - "iconTheme": "System Default", + "iconThemeDark": "Adwaita", + "iconThemeLight": "System Default", + "iconThemePerMode": false, + "lastAppliedIconTheme": "Adwaita", "cursorSettings": { "theme": "breeze_cursors", "size": 24, @@ -269,28 +372,50 @@ "monoFontFamily": "Maple Mono NF CN", "fontWeight": 400, "fontScale": 1, + "textRenderType": 0, + "textRenderQuality": 0, "notepadUseMonospace": true, "notepadFontFamily": "", "notepadFontSize": 14, + "notificationSummaryFontSize": 0, + "notificationBodyFontSize": 0, "notepadShowLineNumbers": false, + "notepadAutoSave": false, + "notepadSlideoutSide": "right", + "notepadDefaultMode": "slideout", "notepadTransparencyOverride": -1, "notepadLastCustomTransparency": 0.7, + "notepadUseCompositorGap": false, + "notepadEdgeGap": 0, "soundsEnabled": true, "useSystemSoundTheme": true, + "soundLogin": false, "soundNewNotification": true, "soundVolumeChanged": true, "soundPluggedIn": true, + "muteSoundsWhenMediaPlaying": true, "acMonitorTimeout": 1200, "acLockTimeout": 900, "acSuspendTimeout": 3600, "acSuspendBehavior": 0, "acProfileName": "1", + "acPostLockMonitorTimeout": 0, "batteryMonitorTimeout": 0, "batteryLockTimeout": 0, "batterySuspendTimeout": 0, "batterySuspendBehavior": 0, "batteryProfileName": "", + "batteryPostLockMonitorTimeout": 0, "batteryChargeLimit": 100, + "batteryNotifyChargeLimit": false, + "batteryCriticalThreshold": 10, + "batteryNotifyCritical": true, + "batteryLowThreshold": 20, + "batteryNotifyLow": false, + "batteryChargeLimitNotificationType": 0, + "batteryLowNotificationType": 0, + "batteryCriticalNotificationType": 1, + "batteryAutoPowerSaver": false, "lockBeforeSuspend": true, "loginctlLockIntegration": true, "fadeToLockEnabled": true, @@ -300,7 +425,11 @@ "launchPrefix": "", "brightnessDevicePins": {}, "wifiNetworkPins": {}, - "bluetoothDevicePins": {}, + "bluetoothDevicePins": { + "preferredDevice": [ + "08:F0:B6:12:DE:C2" + ] + }, "audioInputDevicePins": {}, "audioOutputDevicePins": {}, "gtkThemingEnabled": false, @@ -322,6 +451,7 @@ "matugenTemplatePywalfox": true, "matugenTemplateZenBrowser": true, "matugenTemplateVesktop": true, + "matugenTemplateVencord": true, "matugenTemplateEquibop": true, "matugenTemplateGhostty": true, "matugenTemplateKitty": true, @@ -334,10 +464,23 @@ "matugenTemplateVscode": true, "matugenTemplateEmacs": true, "matugenTemplateZed": true, + "matugenTemplateNeovimSettings": { + "dark": { + "baseTheme": "github_dark", + "harmony": 0.5 + }, + "light": { + "baseTheme": "github_light", + "harmony": 0.5 + } + }, + "matugenTemplateNeovimSetBackground": true, "showDock": true, "dockAutoHide": false, "dockSmartAutoHide": true, + "dockUseOverlayLayer": false, "dockGroupByApp": false, + "dockRestoreSpecialWorkspaceOnClick": false, "dockOpenOnOverview": false, "dockPosition": 1, "dockSpacing": 4, @@ -360,6 +503,9 @@ "dockMaxVisibleApps": 0, "dockMaxVisibleRunningApps": 0, "dockShowOverflowBadge": true, + "dockShowTrash": false, + "dockTrashFileManager": "default", + "dockTrashCustomCommand": "", "notificationOverlayEnabled": false, "notificationPopupShadowEnabled": true, "notificationPopupPrivacyMode": false, @@ -377,14 +523,24 @@ "maxFprintTries": 15, "enableU2f": false, "u2fMode": "or", - "lockScreenActiveMonitor": "all", + "lockPamPath": "", + "lockPamInlineFprint": false, + "lockPamInlineU2f": false, "lockScreenInactiveColor": "#000000", "lockScreenNotificationMode": 0, + "lockScreenVideoEnabled": false, + "lockScreenVideoPath": "", + "lockScreenVideoCycling": false, + "lockScreenWallpaperPath": "", + "lockScreenWallpaperFillMode": "", + "lockScreenFontFamily": "", "hideBrightnessSlider": false, "notificationTimeoutLow": 5000, "notificationTimeoutNormal": 5000, "notificationTimeoutCritical": 0, "notificationCompactMode": false, + "notificationShowTimeoutBar": false, + "notificationDedupeEnabled": true, "notificationPopupPosition": 0, "notificationAnimationSpeed": 1, "notificationCustomAnimationDuration": 400, @@ -395,6 +551,7 @@ "notificationHistorySaveNormal": true, "notificationHistorySaveCritical": true, "notificationRules": [], + "notificationFocusedMonitor": false, "osdAlwaysShowValue": false, "osdPosition": 4, "osdVolumeEnabled": true, @@ -425,11 +582,20 @@ "customPowerActionReboot": "", "customPowerActionPowerOff": "", "updaterHideWidget": false, + "updaterCheckOnStart": false, "updaterUseCustomCommand": false, "updaterCustomCommand": "", "updaterTerminalAdditionalParams": "", + "updaterIntervalSeconds": 1800, + "updaterIncludeFlatpak": true, + "updaterAllowAUR": true, + "updaterIgnoredPackages": [], "displayNameMode": "system", - "screenPreferences": {}, + "screenPreferences": { + "wallpaper": [ + "all" + ] + }, "showOnLastDisplay": {}, "niriOutputSettings": {}, "hyprlandOutputSettings": {}, @@ -438,6 +604,7 @@ "displayProfileAutoSelect": false, "displayShowDisconnected": false, "displaySnapToEdge": true, + "connectedFrameBarStyleBackups": {}, "barConfigs": [ { "id": "default", @@ -474,7 +641,11 @@ } ], "centerWidgets": [ - "music", + { + "id": "music", + "enabled": true, + "mediaSize": 1 + }, { "id": "weather", "enabled": true @@ -489,10 +660,6 @@ "id": "clipboard", "enabled": true }, - { - "id": "battery", - "enabled": true - }, { "id": "controlCenterButton", "enabled": true @@ -502,15 +669,23 @@ "enabled": true, "clockCompactMode": false }, + { + "id": "battery", + "enabled": true, + "showBatteryTime": false, + "showBatteryTimeOnlyOnBattery": false, + "batteryPillStyle": true, + "batteryPillPercentSign": true + }, { "id": "powerMenuButton", "enabled": true } ], - "spacing": 4, - "innerPadding": -2, - "bottomGap": 0, - "transparency": 0.76, + "spacing": 0, + "innerPadding": 0, + "bottomGap": -4, + "transparency": 0, "widgetTransparency": 1, "squareCorners": false, "noBackground": false, @@ -519,14 +694,14 @@ "removeWidgetPadding": false, "widgetPadding": 8, "gothCornersEnabled": false, - "gothCornerRadiusOverride": false, - "gothCornerRadiusValue": 12, + "gothCornerRadiusOverride": true, + "gothCornerRadiusValue": 43, "borderEnabled": false, "borderColor": "surfaceText", "borderOpacity": 1, "borderThickness": 1, "widgetOutlineEnabled": false, - "widgetOutlineColor": "primary", + "widgetOutlineColor": "surfaceText", "widgetOutlineOpacity": 1, "widgetOutlineThickness": 1, "fontScale": 1, @@ -546,7 +721,8 @@ "shadowOpacity": 60, "shadowColorMode": "text", "shadowCustomColor": "#000000", - "clickThrough": false + "clickThrough": false, + "barInsetPadding": 4 } ], "desktopClockEnabled": false, @@ -625,8 +801,35 @@ "trigger": "?" } }, + "clipboardClickToPaste": false, "clipboardEnterToPaste": false, + "clipboardRememberTypeFilter": false, + "clipboardTypeFilter": "all", + "clipboardVisibleEntryActions": [ + "pin", + "edit", + "delete" + ], "launcherPluginVisibility": {}, "launcherPluginOrder": [], - "configVersion": 5 + "frameEnabled": false, + "frameThickness": 16, + "frameRounding": 23, + "frameColor": "", + "frameOpacity": 1, + "frameScreenPreferences": [ + "all" + ], + "frameBarSize": 40, + "frameShowOnOverview": false, + "frameBlurEnabled": true, + "frameCloseGaps": true, + "frameLauncherEmergeSide": "bottom", + "frameLauncherArcExtender": false, + "frameLauncherEdgeHover": false, + "frameMode": "connected", + "barInsetPaddingShared": -1, + "barInsetPaddingSyncAll": false, + "frameBarInsetPadding": -1, + "configVersion": 12 } \ No newline at end of file diff --git a/kitty/dank-tabs.conf b/kitty/dank-tabs.conf index 9d55bc0..292854b 100644 --- a/kitty/dank-tabs.conf +++ b/kitty/dank-tabs.conf @@ -5,16 +5,16 @@ tab_bar_align left tab_bar_min_tabs 2 tab_bar_margin_width 0.0 tab_bar_margin_height 2.5 1.5 -tab_bar_margin_color #101418 +tab_bar_margin_color #101417 -tab_bar_background #101418 +tab_bar_background #101417 -active_tab_foreground #003257 -active_tab_background #9fcafc +active_tab_foreground #00344b +active_tab_background #92cef5 active_tab_font_style bold -inactive_tab_foreground #c3c7cf -inactive_tab_background #101418 +inactive_tab_foreground #c1c7ce +inactive_tab_background #101417 inactive_tab_font_style normal tab_activity_symbol " ● " diff --git a/kitty/dank-theme.conf b/kitty/dank-theme.conf index c0ce07d..df38d5e 100644 --- a/kitty/dank-theme.conf +++ b/kitty/dank-theme.conf @@ -1,25 +1,25 @@ -cursor #e1e2e8 -cursor_text_color #c3c7cf +cursor #dfe3e7 +cursor_text_color #c1c7ce -foreground #e1e2e8 -background #101418 -selection_foreground #253140 -selection_background #bac8db -url_color #9fcafc +foreground #dfe3e7 +background #101417 +selection_foreground #21323e +selection_background #b6c9d8 +url_color #92cef5 -color0 #101418 -color1 #ff729c -color2 #7efc8f -color3 #fff772 -color4 #85b6ef -color5 #254a74 -color6 #9fcafc -color7 #eff6ff -color8 #979da3 -color9 #ff9fbb -color10 #a5ffb1 -color11 #fffaa5 -color12 #afd3ff -color13 #bddbff -color14 #d4e8ff -color15 #f8fbff +color0 #101417 +color1 #ff729e +color2 #7af589 +color3 #fff672 +color4 #77bce8 +color5 #1d5071 +color6 #92cef5 +color7 #eff8ff +color8 #939a9f +color9 #ff9fbd +color10 #a5ffb0 +color11 #fff9a5 +color12 #a7dcff +color13 #b6e2ff +color14 #d0ecff +color15 #f8fcff diff --git a/kitty/kitty.conf b/kitty/kitty.conf index e5a3487..304be62 100644 --- a/kitty/kitty.conf +++ b/kitty/kitty.conf @@ -2,14 +2,15 @@ font_size 12.0 # Window Configuration -window_padding_width 12 -background_opacity 1.0 +window_padding_width 0 +background_opacity 0.85 background_blur 32 hide_window_decorations yes # Cursor Configuration cursor_shape block cursor_blink_interval 1 +cursor_trail 3 # Scrollback scrollback_lines 3000 @@ -36,10 +37,9 @@ shell_integration enabled include dank-tabs.conf include dank-theme.conf - # BEGIN_KITTY_FONTS font_family family="Maple Mono NF CN" bold_font auto italic_font auto bold_italic_font auto -# END_KITTY_FONTS +# END_KITTY_FONTS \ No newline at end of file diff --git a/niri/config.kdl b/niri/config.kdl index fb1d5c7..4117f5f 100644 --- a/niri/config.kdl +++ b/niri/config.kdl @@ -8,7 +8,7 @@ config-notification { // Outputs from existing configuration output "eDP-1" { - mode "2560x1600@165.004" + mode "2560x1600@180" scale 1.5 transform "normal" position x=0 y=0 @@ -196,6 +196,12 @@ overview { // This line starts waybar, a commonly used bar for Wayland compositors. environment { XDG_CURRENT_DESKTOP "niri" + // 输入法环境变量(解决 Linux QQ 等应用无法输入中文) + GTK_IM_MODULE "fcitx5" + QT_IM_MODULE "fcitx5" + XMODIFIERS "@im=fcitx5" + SDL_IM_MODULE "fcitx5" + GLFW_IM_MODULE "ibus" } hotkey-overlay { skip-at-startup @@ -203,35 +209,54 @@ hotkey-overlay { prefer-no-csd screenshot-path "~/Pictures/Screenshots/Screenshot from %Y-%m-%d %H-%M-%S.png" animations { + // macOS 风格动画配置:流畅、自然、无震荡 + + // 工作区切换:轻微弹性,更自然 workspace-switch { - spring damping-ratio=0.80 stiffness=523 epsilon=0.0001 + spring damping-ratio=0.95 stiffness=850 epsilon=0.0001 } + + // 窗口打开:柔和适中 window-open { - duration-ms 150 - curve "ease-out-expo" - } - window-close { - duration-ms 150 - curve "ease-out-quad" - } - horizontal-view-movement { - spring damping-ratio=0.85 stiffness=423 epsilon=0.0001 - } - window-movement { - spring damping-ratio=0.75 stiffness=323 epsilon=0.0001 - } - window-resize { - spring damping-ratio=0.85 stiffness=423 epsilon=0.0001 - } - config-notification-open-close { - spring damping-ratio=0.65 stiffness=923 epsilon=0.001 - } - screenshot-ui-open { duration-ms 200 - curve "ease-out-quad" + curve "ease-out-cubic" } + + // 窗口关闭:柔和适中 + window-close { + duration-ms 180 + curve "ease-out-cubic" + } + + // 水平视图移动:平滑的弹簧效果 + horizontal-view-movement { + spring damping-ratio=1.0 stiffness=600 epsilon=0.0001 + } + + // 窗口移动:平滑自然 + window-movement { + spring damping-ratio=1.0 stiffness=600 epsilon=0.0001 + } + + // 窗口调整大小:跟随手势,物理感 + window-resize { + spring damping-ratio=1.0 stiffness=600 epsilon=0.0001 + } + + // 配置通知:快速弹出 + config-notification-open-close { + spring damping-ratio=1.0 stiffness=1000 epsilon=0.001 + } + + // 截图界面 + screenshot-ui-open { + duration-ms 250 + curve "ease-out-cubic" + } + + // 概览界面:快速响应 overview-open-close { - spring damping-ratio=0.85 stiffness=800 epsilon=0.0001 + spring damping-ratio=1.0 stiffness=700 epsilon=0.0001 } } // Window rules let you adjust behavior for individual windows. diff --git a/niri/dms/alttab.kdl b/niri/dms/alttab.kdl index 091ea07..5f9bdcd 100644 --- a/niri/dms/alttab.kdl +++ b/niri/dms/alttab.kdl @@ -1,10 +1,10 @@ // ! DO NOT EDIT ! - // ! AUTO-GENERATED BY DMS ! - // ! CHANGES WILL BE OVERWRITTEN ! - // ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! - recent-windows { - highlight { +recent-windows { + highlight { corner-radius 12 - } - } + } +} diff --git a/niri/dms/colors.kdl b/niri/dms/colors.kdl index da63544..908ee1f 100644 --- a/niri/dms/colors.kdl +++ b/niri/dms/colors.kdl @@ -5,14 +5,14 @@ layout { background-color "transparent" focus-ring { - active-color "#9fcafc" - inactive-color "#8c9199" + active-color "#92cef5" + inactive-color "#8b9198" urgent-color "#ffb4ab" } border { - active-color "#9fcafc" - inactive-color "#8c9199" + active-color "#92cef5" + inactive-color "#8b9198" urgent-color "#ffb4ab" } @@ -21,19 +21,19 @@ layout { } tab-indicator { - active-color "#9fcafc" - inactive-color "#8c9199" + active-color "#92cef5" + inactive-color "#8b9198" urgent-color "#ffb4ab" } insert-hint { - color "#9fcafc80" + color "#92cef580" } } recent-windows { highlight { - active-color "#174974" + active-color "#004c6b" urgent-color "#ffb4ab" } } diff --git a/niri/dms/layout.kdl b/niri/dms/layout.kdl index 431afbf..44dd0f5 100644 --- a/niri/dms/layout.kdl +++ b/niri/dms/layout.kdl @@ -1,22 +1,23 @@ // ! DO NOT EDIT ! - // ! AUTO-GENERATED BY DMS ! - // ! CHANGES WILL BE OVERWRITTEN ! - // ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! +// ! AUTO-GENERATED BY DMS ! +// ! CHANGES WILL BE OVERWRITTEN ! +// ! PLACE YOUR CUSTOM CONFIGURATION ELSEWHERE ! - layout { - gaps 4 +layout { + gaps 4 - border { + border { width 2 - } + } - focus-ring { + focus-ring { width 2 - } - } - window-rule { - geometry-corner-radius 12 - clip-to-geometry true - tiled-state true - draw-border-with-background false - } + } +} + +window-rule { + geometry-corner-radius 12 + clip-to-geometry true + tiled-state true + draw-border-with-background false +} diff --git a/nvim/init.lua b/nvim/init.lua index 2eddfc1..6e7a2d5 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -1,73 +1,9 @@ --- ============================================================================ --- Neovim 入口配置 --- ============================================================================ - --- Leader 键 -vim.g.mapleader = " " - --- --------------------------------------------------------------------------- --- 编辑器选项 --- --------------------------------------------------------------------------- -local opt = vim.opt - -opt.number = true -- 行号 -opt.relativenumber = true -- 相对行号 -opt.tabstop = 4 -- Tab 宽度 -opt.shiftwidth = 4 -- 缩进宽度 -opt.expandtab = true -- Tab 转空格 -opt.smartindent = true -- 智能缩进 -opt.wrap = false -- 不自动换行 -opt.cursorline = true -- 高亮当前行 -opt.signcolumn = "yes" -- 始终显示符号列 -opt.updatetime = 250 -- 快速更新 -opt.timeoutlen = 300 -- 快捷键超时 -opt.splitright = true -- 垂直分屏在右侧 -opt.splitbelow = true -- 水平分屏在下方 -opt.undofile = true -- 持久化撤销 -opt.ignorecase = true -- 搜索忽略大小写 -opt.smartcase = true -- 智能大小写 -opt.wildmenu = true -- 命令行补全增强 -opt.wildmode = "longest:full,full" -opt.pumheight = 10 -- 补全菜单最大高度 -opt.clipboard = "unnamedplus" -- 系统剪贴板 -opt.termguicolors = true -- 真彩色支持 -opt.foldlevel = 99 -- 默认展开所有折叠 - --- 全局浮动窗口圆角边框(与 blink.cmp 补全菜单一致) -vim.o.winborder = "rounded" - --- --------------------------------------------------------------------------- --- 基础键位 --- --------------------------------------------------------------------------- -local keymap = vim.keymap.set - --- 编辑器操作 -keymap("n", "w", "w", { desc = "保存" }) -keymap("n", "q", "q", { desc = "退出" }) -keymap("n", "/", "noh", { desc = "清除搜索高亮" }) - --- 窗口导航 -keymap("n", "", "h", { desc = "跳到左边窗口" }) -keymap("n", "", "j", { desc = "跳到下面窗口" }) -keymap("n", "", "k", { desc = "跳到上面窗口" }) -keymap("n", "", "l", { desc = "跳到右边窗口" }) - --- --------------------------------------------------------------------------- --- lazy.nvim 插件管理器 --- --------------------------------------------------------------------------- -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.uv.fs_stat(lazypath) then - vim.fn.system({ - "git", "clone", "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - spec = { { import = "plugins" } }, - defaults = { lazy = true }, - install = { colorscheme = { "default" } }, - checker = { enabled = false }, -}) +-- ============================================================================= +-- init.lua — Neovim 入口文件 +-- ============================================================================= +-- 【结构变更】原 init.lua 中 options + keymaps + lazy 全部内联, +-- 现拆分为 config/options.lua + config/keymaps.lua + config/lazy.lua 三层, +-- 更利于 :Lazy reload 和后续维护。 +require("config.options") +require("config.keymaps") +require("config.lazy") diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 111e47a..b0de0c0 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,25 +1,47 @@ { + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, + "bufdelete.nvim": { "branch": "master", "commit": "f6bcea78afb3060b198125256f897040538bcb81" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "cmake-tools.nvim": { "branch": "master", "commit": "22859d754b5de738cfe9945e0910729f63deefd0" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, + "dashboard-nvim": { "branch": "master", "commit": "f787e3462c2ee2b6117b17c1aa4ddf66cb6f57fe" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" }, + "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, + "flash.nvim": { "branch": "main", "commit": "b6346946d10d07998efee029fb0f7a593806d0cd" }, + "gitsigns.nvim": { "branch": "main", "commit": "31d6fb2d618bca1482b9f274751ead5f03461408" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "50bf3871b539896bd0650b882f6e6b467cc1c1eb" }, + "lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" }, + "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a4068c3ebd4cb335b25239e5ea35c22ee6007962" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "7b9923abad60b903ece7c52940e1321d39eccc79" }, "nvim-dap": { "branch": "master", "commit": "9e848e09a697ee95302a3ef2dd43fd6eb709e570" }, - "nvim-dap-ui": { "branch": "master", "commit": "1a66cabaa4a4da0be107d5eda6d57242f0fe7e49" }, - "nvim-lspconfig": { "branch": "master", "commit": "3371bf298c1f56efc26771ee961f461176958fb5" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, + "nvim-dap-ui": { "branch": "master", "commit": "cc9dd33aade7f20bae414d0cba163bc60d4d4b43" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6" }, + "nvim-lspconfig": { "branch": "master", "commit": "b386c50cd7816f8c8a2b13b298a218af1f5a75c6" }, + "nvim-nio": { "branch": "master", "commit": "edcc181a875301dd21840189aa2f2f9ad69fc172" }, + "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, + "nvim-surround": { "branch": "main", "commit": "2e93e154de9ff326def6480a4358bfc149d5da2c" }, + "nvim-tree.lua": { "branch": "master", "commit": "4213bd6eabac38b16dd6615002b6243b23cf3bf6" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, - "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, + "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, + "nvim-web-devicons": { "branch": "master", "commit": "0ca28b61a04fe7426cefbdd52c2647ef0e335b5f" }, "oil.nvim": { "branch": "master", "commit": "b73018b75affd13fa38e2fc94ef753b465f770d7" }, + "persistent-breakpoints.nvim": { "branch": "main", "commit": "d1656221836207787b8a7969cc2dc72668c4742a" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, - "rustaceanvim": { "branch": "main", "commit": "88575b98bb9937fb9983ddec5e532b67e75ce677" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "a798325b7f36acc62741d1029930a7b96d4dd4bf" }, + "rustaceanvim": { "branch": "main", "commit": "614a3e30e6e94c5aee204fe5d5b6a50cdaac4be6" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" }, "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, + "vim-illuminate": { "branch": "master", "commit": "91313e598ca62e110bc71535c49069b66b9883c9" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua new file mode 100644 index 0000000..deee9c6 --- /dev/null +++ b/nvim/lua/config/keymaps.lua @@ -0,0 +1,74 @@ +-- ============================================================================= +-- keymaps.lua — 基础键位映射 +-- ============================================================================= + +local keymap = vim.keymap.set + +-- Leader 键 +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- 编辑器操作 +keymap("n", "w", "w", { desc = "保存" }) + +-- 关闭当前 buffer / 窗口(VSCode 风格) +-- - quickfix 窗口:cclose(cmake-tools 输出窗口) +-- - 普通文件:统计文件 buffer 数量 +-- - 只剩 1 个文件 buffer → 退出 nvim(不留下 "no name" 空白) +-- - 多个文件 buffer → Bdelete 关闭当前标签 +-- - 其他特殊 buffer(终端等):直接关闭窗口 +keymap("n", "q", function() + local bt = vim.bo.buftype + local ft = vim.bo.filetype + + if bt == "quickfix" then + vim.cmd("cclose") + return + end + + if bt ~= "" then + vim.cmd("close") + return + end + + -- 统计文件 buffer 数量(排除 nvim-tree/dashboard/quickfix/terminal 等) + local file_bufs = 0 + for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_is_loaded(bufnr) then + local b = vim.bo[bufnr] + if b.buftype == "" and b.filetype ~= "" then + file_bufs = file_bufs + 1 + end + end + end + + if file_bufs <= 1 then + vim.cmd("qa") + else + vim.cmd("Bdelete") + end +end, { desc = "关闭当前 buffer/窗口" }) + +keymap("n", "/", "noh", { desc = "清除搜索高亮" }) + +-- 窗口导航 +keymap("n", "", "h", { desc = "跳到左边窗口" }) +keymap("n", "", "j", { desc = "跳到下面窗口" }) +keymap("n", "", "k", { desc = "跳到上面窗口" }) +keymap("n", "", "l", { desc = "跳到右边窗口" }) + +-- 窗口操作 +keymap("n", "sv", "vsplit", { desc = "垂直分屏" }) +keymap("n", "sh", "split", { desc = "水平分屏" }) +keymap("n", "sc", "close", { desc = "关闭窗口" }) + +-- Buffer 导航 +keymap("n", "", "bnext", { desc = "下一个 buffer" }) +keymap("n", "", "bprevious", { desc = "上一个 buffer" }) + +-- 文件树 +keymap("n", "e", "NvimTreeToggle", { desc = "文件树" }) + +-- 终端 +keymap("n", "", "ToggleTerm", { desc = "终端" }) +keymap("t", "", "ToggleTerm", { desc = "终端" }) \ No newline at end of file diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua new file mode 100644 index 0000000..081fc74 --- /dev/null +++ b/nvim/lua/config/lazy.lua @@ -0,0 +1,61 @@ +-- ============================================================================= +-- lazy.lua — 插件管理器初始化 +-- ============================================================================= +-- 【来源】从原 init.lua 提取。 +-- 【修改】🔧 install.colorscheme 改为 tokyonight(你的主题); +-- 🔧 添加 ui.border = "rounded" 统一圆角; +-- 🔧 添加 performance.rtp 禁用内置插件提升启动速度。 +-- 【修复】🔧 defaults.lazy = true(保留你的原设置),但 UI 核心插件不懒加载。 + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.uv.fs_stat(lazypath) then + vim.fn.system({ + "git", "clone", "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = { + { import = "plugins" }, + }, + + -- 🔧 修复:保留你的 defaults.lazy = true + defaults = { + lazy = true, + }, + + -- 🔧 修改:安装时尝试加载你的主题 + install = { + colorscheme = { "tokyonight", "habamax" }, + }, + + -- 🔧 修改:关闭自动检查更新(你的原设置),但保留手动 :Lazy check + checker = { + enabled = false, + notify = false, + }, + + -- 🔧 修改:统一 UI 圆角边框 + ui = { + border = "rounded", + }, + + -- ✅ 新增:禁用内置插件提升启动速度 + performance = { + rtp = { + disabled_plugins = { + "gzip", + "matchit", + "matchparen", + "netrwPlugin", + "tarPlugin", + "tohtml", + "tutor", + "zipPlugin", + }, + }, + }, +}) diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua new file mode 100644 index 0000000..fbd072e --- /dev/null +++ b/nvim/lua/config/options.lua @@ -0,0 +1,91 @@ +-- ============================================================================= +-- options.lua — 编辑器基础选项 +-- ============================================================================= +-- 【来源】从原 init.lua 提取,补充了参考配置中缺失的选项。 +-- 【新增项】已用 ✅ 标注,【修改项】已用 🔧 标注。 + +local opt = vim.opt + +-- ───────────────────────────────────────────── +-- 行号 +-- ───────────────────────────────────────────── +opt.number = true -- 当前行绝对行号 +opt.relativenumber = true -- 相对行号(保留你的设置,方便 5j/5k 跳转) + +-- ───────────────────────────────────────────── +-- 缩进 +-- ───────────────────────────────────────────── +opt.tabstop = 4 -- Tab 宽度 4(保留你的设置,适配 C/C++) +opt.shiftwidth = 4 -- 缩进宽度 4 +opt.expandtab = true -- Tab 转空格 +opt.autoindent = true -- ✅ 新增:新行继承上一行缩进 +opt.smartindent = true -- 智能缩进 + +-- ───────────────────────────────────────────── +-- 搜索 +-- ───────────────────────────────────────────── +opt.ignorecase = true -- 搜索忽略大小写 +opt.smartcase = true -- 含大写字母时区分大小写 +opt.hlsearch = true -- ✅ 新增:高亮搜索匹配 +opt.incsearch = true -- ✅ 新增:实时预览搜索 + +-- ───────────────────────────────────────────── +-- 显示 & 界面 +-- ───────────────────────────────────────────── +opt.termguicolors = true -- 真彩色 +opt.cursorline = true -- 高亮当前行 +opt.signcolumn = "yes" -- 始终显示符号列 +opt.wrap = false -- 不自动换行 +opt.scrolloff = 8 -- ✅ 新增:光标距上下边缘保持 8 行 +opt.sidescrolloff = 8 -- ✅ 新增:光标距左右边缘保持 8 列 +opt.showmode = false -- ✅ 新增:隐藏 --INSERT--(状态栏会显示) +opt.pumheight = 10 -- 补全菜单最大高度 +opt.winborder = "rounded" -- 全局浮动窗口圆角(保留你的设置) + +-- ───────────────────────────────────────────── +-- 分割窗口 +-- ───────────────────────────────────────────── +opt.splitright = true -- 垂直分割在右侧 +opt.splitbelow = true -- 水平分割在下方 + +-- ───────────────────────────────────────────── +-- 文件 & 编码 +-- ───────────────────────────────────────────── +opt.encoding = "utf-8" -- ✅ 新增:显式指定 UTF-8 +opt.fileencoding = "utf-8" -- ✅ 新增 +opt.swapfile = false -- ✅ 新增:关闭交换文件 +opt.backup = false -- ✅ 新增:关闭备份文件 +opt.undofile = true -- 持久化撤销 + +-- ───────────────────────────────────────────── +-- 鼠标 & 剪贴板 +-- ───────────────────────────────────────────── +opt.mouse = "a" -- ✅ 新增:所有模式启用鼠标 +opt.clipboard = "unnamedplus" -- 系统剪贴板 + +-- ───────────────────────────────────────────── +-- 性能 +-- ───────────────────────────────────────────── +opt.updatetime = 250 -- LSP 悬浮提示触发延迟 +opt.timeoutlen = 300 -- 快捷键序列超时 +opt.wildmenu = true -- 命令行补全增强 +opt.wildmode = "longest:full,full" + +-- ───────────────────────────────────────────── +-- 补全 +-- ───────────────────────────────────────────── +-- 🔧 修改:completeopt 改为 blink.cmp 推荐的配置 +opt.completeopt = { "menuone", "noselect" } + +-- ───────────────────────────────────────────── +-- 折叠(为 nvim-ufo 准备) +-- ───────────────────────────────────────────── +opt.foldlevel = 99 +opt.foldlevelstart = 99 -- ✅ 新增:启动时展开所有折叠 +opt.foldenable = true -- ✅ 新增:启用折叠 + +-- ───────────────────────────────────────────── +-- 其他 +-- ───────────────────────────────────────────── +opt.conceallevel = 0 -- ✅ 新增:不隐藏特殊字符 +opt.isfname:append("@-@") -- ✅ 新增:文件名识别 @ 符号 diff --git a/nvim/lua/plugins/autopairs.lua b/nvim/lua/plugins/autopairs.lua index 7da088c..b261f2c 100644 --- a/nvim/lua/plugins/autopairs.lua +++ b/nvim/lua/plugins/autopairs.lua @@ -1,11 +1,15 @@ --- ============================================================================ --- 自动括号补全 (nvim-autopairs) --- ============================================================================ +-- ============================================================================= +-- autopairs.lua — 自动括号补全 +-- ============================================================================= +-- 【保留】你的配置。 +-- 【修改】🔧 添加 check_ts = true 让括号补全感知 Treesitter 语法。 return { - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = {}, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + opts = { + check_ts = true, -- 🔧 新增:Treesitter 感知,避免在字符串/注释里自动配对 }, + }, } diff --git a/nvim/lua/plugins/cmake-tools.lua b/nvim/lua/plugins/cmake-tools.lua index 299619e..553f38e 100644 --- a/nvim/lua/plugins/cmake-tools.lua +++ b/nvim/lua/plugins/cmake-tools.lua @@ -1,49 +1,50 @@ --- ============================================================================ --- CMake 工具 (cmake-tools.nvim) --- CMake 项目全流程:生成、构建、运行、调试 --- ============================================================================ +-- ============================================================================= +-- cmake-tools.lua — CMake 工具 +-- ============================================================================= +-- 【保留】你的完整 cmake-tools 配置。 +-- 【无修改】不改动任何已有逻辑。 return { - { - "Civitasv/cmake-tools.nvim", - dependencies = { "nvim-lua/plenary.nvim" }, - ft = { "cmake", "c", "cpp" }, + { + "Civitasv/cmake-tools.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + ft = { "cmake", "c", "cpp" }, + opts = { + cmake_command = "cmake", + ctest_command = "ctest", + cmake_use_preset = true, + cmake_regenerate_on_save = true, + cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, + cmake_build_directory = "build", + cmake_soft_link_compile_commands = true, + cmake_dap_configuration = { + name = "cpp", + type = "codelldb", + request = "launch", + stopOnEntry = false, + runInTerminal = true, + console = "integratedTerminal", + }, + cmake_executor = { + name = "quickfix", opts = { - cmake_command = "cmake", - ctest_command = "ctest", - cmake_use_preset = true, - cmake_regenerate_on_save = true, - cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" }, - cmake_build_directory = "build", - cmake_soft_link_compile_commands = true, - cmake_dap_configuration = { - name = "cpp", - type = "codelldb", - request = "launch", - stopOnEntry = false, - runInTerminal = true, - console = "integratedTerminal", - }, - cmake_executor = { - name = "quickfix", - opts = { - show = "always", - position = "belowright", - size = 10, - auto_close_when_success = true, - }, - }, - }, - keys = { - { "cg", "CMakeGenerate", desc = "CMake 生成" }, - { "cb", "CMakeBuild", desc = "CMake 构建" }, - { "cr", "CMakeRun", desc = "CMake 运行" }, - { "cd", "CMakeDebug", desc = "CMake 调试" }, - { "cc", "CMakeClean", desc = "CMake 清理" }, - { "cs", "CMakeSelectBuildType", desc = "选择构建类型" }, - { "ct", "CMakeSelectBuildTarget", desc = "选择构建目标" }, - { "cl", "CMakeSelectLaunchTarget", desc = "选择运行目标" }, - { "ck", "CMakeSelectKit", desc = "选择编译器" }, + show = "always", + position = "belowright", + size = 10, + auto_close_when_success = true, }, + }, }, + keys = { + { "cg", "CMakeGenerate", desc = "CMake 生成" }, + { "cb", "CMakeBuild", desc = "CMake 构建" }, + { "cr", "CMakeRun", desc = "CMake 运行" }, + { "cd", "CMakeDebug", desc = "CMake 调试" }, + { "cc", "CMakeClean", desc = "CMake 清理" }, + { "cs", "CMakeSelectBuildType", desc = "选择构建类型" }, + { "ct", "CMakeSelectBuildTarget", desc = "选择构建目标" }, + { "cl", "CMakeSelectLaunchTarget", desc = "选择运行目标" }, + { "ck", "CMakeSelectKit", desc = "选择编译器" }, + }, + }, } diff --git a/nvim/lua/plugins/colorscheme.lua b/nvim/lua/plugins/colorscheme.lua index 152ba55..59fb7e5 100644 --- a/nvim/lua/plugins/colorscheme.lua +++ b/nvim/lua/plugins/colorscheme.lua @@ -1,42 +1,45 @@ --- ============================================================================ --- 主题 (tokyonight) --- 透明背景,与终端透明效果融合 --- ============================================================================ +-- ============================================================================= +-- colorscheme.lua — 主题 +-- ============================================================================= return { - { - "folke/tokyonight.nvim", - lazy = false, - priority = 1000, - opts = { - style = "night", - transparent = true, - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, - config = function(_, opts) - require("tokyonight").setup(opts) - vim.cmd.colorscheme("tokyonight") - - -- inlay hints 去掉背景,融入透明主题 - vim.api.nvim_create_autocmd("ColorScheme", { - pattern = "tokyonight", - callback = function() - vim.api.nvim_set_hl(0, "LspInlayHint", { - bg = "NONE", - fg = "#565f89", - italic = true, - }) - end, - }) - -- 立即生效一次 - vim.api.nvim_set_hl(0, "LspInlayHint", { - bg = "NONE", - fg = "#565f89", - italic = true, - }) - end, + { + "folke/tokyonight.nvim", + lazy = false, + priority = 1000, + opts = { + style = "night", + transparent = true, + styles = { + sidebars = "transparent", + floats = "transparent", + }, + on_highlights = function(hl, c) + -- bufferline 标签栏背景透明 + hl.BufferLineFill = { bg = "NONE" } + hl.BufferLineBackGround = { bg = "NONE", fg = c.fg_gutter } + hl.BufferLineBackGroundVisible = { bg = "NONE", fg = c.fg } + hl.BufferLineBackGroundSelected = { bg = c.bg_highlight, fg = c.fg, bold = true } + hl.BufferLineSeparator = { fg = c.fg_gutter } + hl.BufferLineSeparatorSelected = { fg = c.blue } + end, }, -} + config = function(_, opts) + require("tokyonight").setup(opts) + vim.cmd.colorscheme("tokyonight") + + -- inlay hints 去掉背景 + vim.api.nvim_create_autocmd("ColorScheme", { + pattern = "tokyonight", + callback = function() + vim.api.nvim_set_hl(0, "LspInlayHint", { + bg = "NONE", fg = "#565f89", italic = true, + }) + end, + }) + vim.api.nvim_set_hl(0, "LspInlayHint", { + bg = "NONE", fg = "#565f89", italic = true, + }) + end, + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 9ed4570..def94cd 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -1,56 +1,55 @@ --- ============================================================================ --- 智能补全 (blink.cmp) --- ============================================================================ +-- ============================================================================= +-- completion.lua — 智能补全 +-- ============================================================================= return { - { - "saghen/blink.cmp", - version = "*", - lazy = false, -- 立即加载,确保 LSP capabilities 可用 - opts = { - keymap = { - preset = "super-tab", - [""] = { "select_next" }, - [""] = { "select_prev" }, - [""] = { "scroll_documentation_up" }, - [""] = { "scroll_documentation_down" }, - -- 命令行模式:Enter 确认补全而非执行命令 - [""] = { "accept", "fallback" }, - }, - appearance = { - use_nvim_cmp_as_default = true, - nerd_font_variant = "normal", - }, - sources = { - default = { "lsp", "path", "buffer", "snippets" }, - }, - cmdline = { - enabled = true, - sources = function() - if vim.fn.getcmdline():find("/") then - return { "buffer" } - end - return { "cmdline" } - end, - completion = { menu = { auto_show = true } }, - }, - completion = { - menu = { - border = "rounded", - -- scrollbar = false, - draw = { - columns = { - { "label", "label_description", gap = 1 }, - { "source_name" }, - }, - }, - }, - documentation = { - auto_show = true, - auto_show_delay_ms = 500, - window = { border = "rounded" }, - }, + { + "saghen/blink.cmp", + version = "*", + event = "InsertEnter", + opts = { + keymap = { + preset = "super-tab", + [""] = { "select_next" }, + [""] = { "select_prev" }, + [""] = { "scroll_documentation_up" }, + [""] = { "scroll_documentation_down" }, + -- Tab 接受补全,回车仅用于确认输入(避免 nvim-tree 文件操作误触发) + [""] = { "accept", "fallback" }, + }, + appearance = { + use_nvim_cmp_as_default = true, + nerd_font_variant = "normal", + }, + sources = { + default = { "lsp", "path", "buffer", "snippets" }, + }, + cmdline = { + enabled = true, + sources = function() + if vim.fn.getcmdline():find("/") then + return { "buffer" } + end + return { "cmdline" } + end, + completion = { menu = { auto_show = true } }, + }, + completion = { + menu = { + border = "rounded", + draw = { + columns = { + { "label", "label_description", gap = 1 }, + { "source_name" }, }, + }, }, + documentation = { + auto_show = true, + auto_show_delay_ms = 500, + window = { border = "rounded" }, + }, + }, }, -} + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/conform.lua b/nvim/lua/plugins/conform.lua index fe7586b..092e17b 100644 --- a/nvim/lua/plugins/conform.lua +++ b/nvim/lua/plugins/conform.lua @@ -1,32 +1,46 @@ --- ============================================================================ --- 自动格式化 (conform.nvim) --- 保存时自动格式化,手动 cf 触发 --- ============================================================================ +-- ============================================================================= +-- conform.lua — 自动格式化 +-- ============================================================================= +-- 【保留】你的完整 conform 配置。 +-- 【修改】🔧 键位从 cf 改为 lf(与 LSP 格式化键统一); +-- ✅ 新增更多语言的 formatter。 return { - { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { "cf", function() require("conform").format({ async = true }) end, desc = "格式化" }, - }, - opts = { - format_on_save = { - timeout_ms = 500, - lsp_fallback = true, - }, - formatters_by_ft = { - rust = { "rustfmt" }, - lua = { "stylua" }, - c = { "clang-format" }, - cpp = { "clang-format" }, - }, - formatters = { - ["clang-format"] = { - args = { "--style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never, ColumnLimit: 0}" }, - }, - }, - }, + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + -- 🔧 修改:cf → lf,与 keymaps.lua 中的 LSP 格式化键一致 + { "lf", function() require("conform").format({ async = true, lsp_fallback = true }) end, desc = "格式化" }, }, + opts = { + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + formatters_by_ft = { + rust = { "rustfmt" }, + lua = { "stylua" }, + c = { "clang-format" }, + cpp = { "clang-format" }, + -- ✅ 新增:更多语言 + python = { "black", "isort" }, + javascript = { "prettier" }, + typescript = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + html = { "prettier" }, + css = { "prettier" }, + go = { "gofmt", "goimports" }, + sh = { "shfmt" }, + }, + formatters = { + ["clang-format"] = { + args = { "--style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never, ColumnLimit: 0}" }, + }, + }, + }, + }, } diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua index f82cc72..5dd74e4 100644 --- a/nvim/lua/plugins/dap.lua +++ b/nvim/lua/plugins/dap.lua @@ -1,94 +1,89 @@ --- ============================================================================ --- DAP 调试器 --- ============================================================================ +-- ============================================================================= +-- dap.lua — DAP 调试器 +-- ============================================================================= return { - { - "mfussenegger/nvim-dap", - dependencies = { - "rcarriga/nvim-dap-ui", - "nvim-neotest/nvim-nio", - "williamboman/mason.nvim", - }, - config = function() - local dap = require("dap") - local dapui = require("dapui") - - -- 断点图标 - vim.fn.sign_define("DapBreakpoint", - { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" }) - vim.fn.sign_define("DapBreakpointCondition", - { text = "◆", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }) - vim.fn.sign_define("DapStopped", - { text = "▶", texthl = "DapStopped", linehl = "CursorLine", numhl = "" }) - - -- dap-ui 布局 - dapui.setup({ - layouts = { - { - elements = { - { id = "stacks", size = 0.25 }, - { id = "scopes", size = 0.25 }, - { id = "breakpoints", size = 0.25 }, - { id = "watches", size = 0.25 }, - }, - position = "left", - size = 40, - }, - { - elements = { - { id = "repl", size = 0.5 }, - { id = "console", size = 0.5 }, - }, - position = "bottom", - size = 10, - }, - }, - }) - - -- 调试会话自动打开/关闭 UI - dap.listeners.before.attach.dapui_config = function() dapui.open() end - dap.listeners.before.launch.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 - - -- codelldb 适配器(Mason 安装路径) - dap.adapters.codelldb = { - type = "server", - port = "${port}", - executable = { - command = vim.fn.stdpath("data") .. "/mason/bin/codelldb", - args = { "--port", "${port}" }, - }, - } - - -- C/C++ 调试配置(非 CMake 项目,CMake 项目用 rd) - dap.configurations.c = { - { - name = "Launch", - type = "codelldb", - request = "launch", - program = function() - return vim.fn.input("可执行文件路径: ", vim.fn.getcwd() .. "/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - args = {}, - }, - } - dap.configurations.cpp = dap.configurations.c - end, + { + "mfussenegger/nvim-dap", + dependencies = { + "rcarriga/nvim-dap-ui", + "nvim-neotest/nvim-nio", + "williamboman/mason.nvim", + { "theHamsta/nvim-dap-virtual-text", opts = {} }, + { "Weissle/persistent-breakpoints.nvim", opts = { load_breakpoints_event = { "BufReadPost" } } }, }, + config = function() + local dap = require("dap") + local dapui = require("dapui") - -- Mason DAP 自动安装 - -- lazy = false: defaults = { lazy = true } 会使此插件无触发器而永不加载, - -- 导致 ensure_installed 不执行、codelldb 不安装 - { - "jay-babu/mason-nvim-dap.nvim", - dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, - lazy = false, - opts = { - ensure_installed = { "codelldb" }, + -- 断点图标 + vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DapBreakpoint", linehl = "", numhl = "" }) + vim.fn.sign_define("DapBreakpointCondition", { text = "◆", texthl = "DapBreakpointCondition", linehl = "", numhl = "" }) + vim.fn.sign_define("DapStopped", { text = "▶", texthl = "DapStopped", linehl = "CursorLine", numhl = "" }) + + -- dap-ui 布局 + dapui.setup({ + layouts = { + { + elements = { + { id = "stacks", size = 0.25 }, + { id = "scopes", size = 0.25 }, + { id = "breakpoints", size = 0.25 }, + { id = "watches", size = 0.25 }, + }, + position = "left", + size = 40, + }, + { + elements = { + { id = "repl", size = 0.5 }, + { id = "console", size = 0.5 }, + }, + position = "bottom", + size = 10, + }, }, - }, -} + }) + + -- 调试会话自动打开/关闭 UI + dap.listeners.before.attach.dapui_config = function() dapui.open() end + dap.listeners.before.launch.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 + + -- codelldb 适配器 + dap.adapters.codelldb = { + type = "server", + port = "${port}", + executable = { + command = vim.fn.stdpath("data") .. "/mason/bin/codelldb", + args = { "--port", "${port}" }, + }, + } + + -- C/C++ 调试配置 + dap.configurations.c = { + { + name = "Launch", + type = "codelldb", + request = "launch", + program = function() + return vim.fn.input("可执行文件路径: ", vim.fn.getcwd() .. "/", "file") + end, + cwd = "${workspaceFolder}", + stopOnEntry = false, + args = {}, + }, + } + dap.configurations.cpp = dap.configurations.c + end, + }, + + -- Mason DAP 自动安装 + { + "jay-babu/mason-nvim-dap.nvim", + dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, + event = "BufReadPost", + opts = { ensure_installed = { "codelldb" } }, + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/devicons.lua b/nvim/lua/plugins/devicons.lua index ecda9ae..1130f7d 100644 --- a/nvim/lua/plugins/devicons.lua +++ b/nvim/lua/plugins/devicons.lua @@ -1,16 +1,13 @@ --- ============================================================================ --- 图标支持 (nvim-web-devicons) --- 为 oil、telescope、状态栏等提供文件类型图标 --- ============================================================================ +-- ============================================================================= +-- devicons.lua — 文件图标 +-- ============================================================================= return { - { - "nvim-tree/nvim-web-devicons", - lazy = true, - opts = { - override = { - rs = { icon = "󱘗", color = "#dea584", name = "Rust" }, - }, - }, + { + "nvim-tree/nvim-web-devicons", + lazy = true, + opts = { + color_icons = true, }, -} + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/diffview.lua b/nvim/lua/plugins/diffview.lua deleted file mode 100644 index dadd636..0000000 --- a/nvim/lua/plugins/diffview.lua +++ /dev/null @@ -1,35 +0,0 @@ --- ============================================================================ --- Git diff 视图 (diffview) --- 仓库级 diff 总览 + 提交历史对比,补充 gitsigns 的行内能力 --- ============================================================================ - -return { - { - "sindrets/diffview.nvim", - cmd = "DiffviewOpen", - keys = { - -- 只保留 3 个核心键位:打开/关闭 diff 视图、查看历史 - { "go", "DiffviewOpen", desc = "查看改动" }, - { "gq", "DiffviewClose", desc = "关闭 diff" }, - { "gl", "DiffviewFileHistory %", desc = "文件历史" }, - }, - opts = { - file_panel = { - listing_style = "tree", - tree_options = { - flatten_dirs = true, - folder_statuses = "only_folded", - }, - }, - keymaps = { - view = { - -- 覆盖全局 q:在 diffview 里关闭整个 diffview,而非单个窗口 - { "n", "q", "DiffviewClose", { desc = "关闭 diffview" } }, - }, - file_panel = { - { "n", "q", "DiffviewClose", { desc = "关闭 diffview" } }, - }, - }, - }, - }, -} diff --git a/nvim/lua/plugins/editor.lua b/nvim/lua/plugins/editor.lua new file mode 100644 index 0000000..7d06ac8 --- /dev/null +++ b/nvim/lua/plugins/editor.lua @@ -0,0 +1,110 @@ +-- ============================================================================= +-- editor.lua — 编辑器增强插件 +-- ============================================================================= + +return { + -- Comment.nvim: 注释快捷键 gcc / gc + { + "numToStr/Comment.nvim", + event = { "BufReadPre", "BufNewFile" }, + opts = {}, + }, + + -- nvim-surround: 环绕操作 ysiw" / cs"' / ds" + { + "kylechui/nvim-surround", + event = { "BufReadPre", "BufNewFile" }, + version = "*", + opts = {}, + }, + + -- vim-illuminate: 高亮光标下相同单词 + { + "RRethy/vim-illuminate", + event = { "BufReadPre", "BufNewFile" }, + opts = { + delay = 200, + large_file_cutoff = 2000, + }, + config = function(_, opts) + require("illuminate").configure(opts) + end, + }, + + -- toggleterm.nvim: 集成终端 + { + "akinsho/toggleterm.nvim", + version = "*", + keys = { + { "", "ToggleTerm", mode = { "n", "t" }, desc = "终端" }, + { "tg", "ToggleTerm direction=float", desc = "浮动终端" }, + { "th", "ToggleTerm direction=horizontal", desc = "水平终端" }, + { "tv", "ToggleTerm direction=vertical", desc = "垂直终端" }, + }, + opts = { + size = function(term) + if term.direction == "horizontal" then + return vim.o.lines * 0.3 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end, + direction = "horizontal", + float_opts = { border = "curved", winblend = 0 }, + shell = vim.o.shell, + }, + }, + + -- flash.nvim: 快速跳转 + { + "folke/flash.nvim", + event = "VeryLazy", + opts = {}, + }, + + -- indent-blankline: 缩进参考线 + { + "lukas-reineke/indent-blankline.nvim", + event = { "BufReadPost", "BufNewFile" }, + main = "ibl", + opts = { + indent = { char = "│" }, + scope = { enabled = true }, + }, + }, + + -- nvim-ufo: 代码折叠 + { + "kevinhwang91/nvim-ufo", + dependencies = { "kevinhwang91/promise-async" }, + event = { "BufReadPost", "BufNewFile" }, + config = function() + vim.o.foldmethod = "expr" + vim.o.foldexpr = "v:lua.vim.treesitter.foldexpr()" + vim.o.foldlevel = 99 + vim.o.foldlevelstart = 99 + + require('ufo').setup({ + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter", "indent" } + end, + }) + + vim.keymap.set('n', 'zM', require('ufo').closeAllFolds, { desc = "关闭所有折叠" }) + vim.keymap.set('n', 'zR', require('ufo').openAllFolds, { desc = "展开所有折叠" }) + end, + }, + + -- rainbow-delimiters: 彩虹括号 + { + "HiPhish/rainbow-delimiters.nvim", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = function() + local rainbow_delimiters = require("rainbow-delimiters") + vim.g.rainbow_delimiters = { + strategy = { [''] = rainbow_delimiters.strategy.global }, + query = { [''] = 'rainbow-delimiters' }, + } + end, + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/filetree.lua b/nvim/lua/plugins/filetree.lua new file mode 100644 index 0000000..62fc559 --- /dev/null +++ b/nvim/lua/plugins/filetree.lua @@ -0,0 +1,64 @@ +-- ============================================================================= +-- filetree.lua — 文件树 +-- ============================================================================= + +return { + { + "nvim-tree/nvim-tree.lua", + version = "*", + lazy = false, + keys = { + { "e", "NvimTreeToggle", desc = "侧边文件树" }, + }, + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + -- 禁用 netrw + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + require("nvim-tree").setup({ + sort_by = "case_sensitive", + view = { + width = 30, + side = "left", + relativenumber = false, + adaptive_size = false, + }, + renderer = { + group_empty = true, + icons = { + show = { + file = true, + folder = true, + folder_arrow = true, + git = false, + }, + glyphs = { + folder = { + arrow_closed = "▶", + arrow_open = "▼", + }, + }, + }, + }, + filters = { + dotfiles = false, + custom = { "^.git$" }, + }, + git = { + enable = false, + ignore = false, + }, + actions = { + open_file = { + quit_on_open = false, + window_picker = { enable = true }, + }, + }, + on_attach = function(bufnr) + require("nvim-tree.api").config.mappings.default_on_attach(bufnr) + end, + }) + end, + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/git.lua b/nvim/lua/plugins/git.lua new file mode 100644 index 0000000..3806dcf --- /dev/null +++ b/nvim/lua/plugins/git.lua @@ -0,0 +1,91 @@ +-- ============================================================================= +-- git.lua — Git 集成 +-- ============================================================================= +-- 【保留】你的 gitsigns + diffview 配置完整保留。 +-- 【新增】✅ lazygit 集成(参考配置有,你缺的)。 + +return { + + -- gitsigns: 行内 diff 标记 + { + "lewis6991/gitsigns.nvim", + event = "BufReadPre", + opts = { + signs = { + add = { text = "▍" }, + change = { text = "▍" }, + delete = { text = "▍" }, + topdelete = { text = "▍" }, + changedelete = { text = "▍" }, + }, + on_attach = function(bufnr) + local gs = require("gitsigns") + + -- 导航 + vim.keymap.set("n", "]h", function() gs.nav_hunk("next") end, { buffer = bufnr, desc = "下一个修改块" }) + vim.keymap.set("n", "[h", function() gs.nav_hunk("prev") end, { buffer = bufnr, desc = "上一个修改块" }) + + -- Hunk 操作 + vim.keymap.set("n", "hs", gs.stage_hunk, { buffer = bufnr, desc = "暂存修改块" }) + vim.keymap.set("n", "hr", gs.reset_hunk, { buffer = bufnr, desc = "撤销修改块" }) + vim.keymap.set("n", "hp", gs.preview_hunk, { buffer = bufnr, desc = "预览修改块" }) + + -- 文件操作 + vim.keymap.set("n", "hS", gs.stage_buffer, { buffer = bufnr, desc = "暂存文件" }) + vim.keymap.set("n", "hR", gs.reset_buffer, { buffer = bufnr, desc = "撤销文件修改" }) + + -- Blame + vim.keymap.set("n", "hb", gs.blame_line, { buffer = bufnr, desc = "查看行 blame" }) + vim.keymap.set("n", "hl", gs.toggle_current_line_blame, { buffer = bufnr, desc = "切换行 blame" }) + + -- 其他 + vim.keymap.set("n", "hw", gs.setqflist, { buffer = bufnr, desc = "列出所有 hunk" }) + vim.keymap.set("n", "hd", gs.toggle_word_diff, { buffer = bufnr, desc = "切换行内 diff" }) + end, + }, + config = function(_, opts) + require("gitsigns").setup(opts) + vim.api.nvim_set_hl(0, "GitSignsAdd", { fg = "#4CAF50" }) + vim.api.nvim_set_hl(0, "GitSignsChange", { fg = "#2196F3" }) + vim.api.nvim_set_hl(0, "GitSignsDelete", { fg = "#F44336" }) + end, + }, + + -- diffview: Git diff 视图 + { + "sindrets/diffview.nvim", + cmd = "DiffviewOpen", + keys = { + { "go", "DiffviewOpen", desc = "查看改动" }, + { "gq", "DiffviewClose", desc = "关闭 diff" }, + { "gl", "DiffviewFileHistory %", desc = "文件历史" }, + }, + opts = { + file_panel = { + listing_style = "tree", + tree_options = { + flatten_dirs = true, + folder_statuses = "only_folded", + }, + }, + keymaps = { + view = { + { "n", "q", "DiffviewClose", { desc = "关闭 diffview" } }, + }, + file_panel = { + { "n", "q", "DiffviewClose", { desc = "关闭 diffview" } }, + }, + }, + }, + }, + + -- ✅ 新增:lazygit 集成 + { + "kdheepak/lazygit.nvim", + cmd = { "LazyGit", "LazyGitCurrentFile" }, + keys = { + { "gg", ":LazyGit", desc = "LazyGit" }, + }, + dependencies = { "nvim-lua/plenary.nvim" }, + }, +} diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua deleted file mode 100644 index e7a66cf..0000000 --- a/nvim/lua/plugins/gitsigns.lua +++ /dev/null @@ -1,51 +0,0 @@ --- ============================================================================ --- Git 集成 (gitsigns) --- 行内 diff 标记 + hunk 操作 --- ============================================================================ - -return { - { - "lewis6991/gitsigns.nvim", - event = "BufReadPre", - opts = { - signs = { - add = { text = "▍" }, - change = { text = "▍" }, - delete = { text = "▍" }, - topdelete = { text = "▍" }, - changedelete = { text = "▍" }, - }, - on_attach = function(bufnr) - local gs = require("gitsigns") - - -- 导航 - vim.keymap.set("n", "]h", function() gs.nav_hunk("next") end, { buffer = bufnr, desc = "下一个修改块" }) - vim.keymap.set("n", "[h", function() gs.nav_hunk("prev") end, { buffer = bufnr, desc = "上一个修改块" }) - - -- Hunk 操作 - vim.keymap.set("n", "hs", gs.stage_hunk, { buffer = bufnr, desc = "暂存修改块" }) - vim.keymap.set("n", "hr", gs.reset_hunk, { buffer = bufnr, desc = "撤销修改块" }) - vim.keymap.set("n", "hp", gs.preview_hunk, { buffer = bufnr, desc = "预览修改块" }) - - -- 文件操作 - vim.keymap.set("n", "hS", gs.stage_buffer, { buffer = bufnr, desc = "暂存文件" }) - vim.keymap.set("n", "hR", gs.reset_buffer, { buffer = bufnr, desc = "撤销文件修改" }) - - -- Blame - vim.keymap.set("n", "hb", gs.blame_line, { buffer = bufnr, desc = "查看行 blame" }) - vim.keymap.set("n", "hl", gs.toggle_current_line_blame, { buffer = bufnr, desc = "切换行 blame" }) - - -- 其他 - vim.keymap.set("n", "hw", gs.setqflist, { buffer = bufnr, desc = "列出所有 hunk" }) - vim.keymap.set("n", "hd", gs.toggle_word_diff, { buffer = bufnr, desc = "切换行内 diff" }) - end, - }, - config = function(_, opts) - require("gitsigns").setup(opts) - -- 自定义颜色 - vim.api.nvim_set_hl(0, "GitSignsAdd", { fg = "#4CAF50" }) - vim.api.nvim_set_hl(0, "GitSignsChange", { fg = "#2196F3" }) - vim.api.nvim_set_hl(0, "GitSignsDelete", { fg = "#F44336" }) - end, - }, -} diff --git a/nvim/lua/plugins/lsp.lua b/nvim/lua/plugins/lsp.lua index dd146b1..a7983b5 100644 --- a/nvim/lua/plugins/lsp.lua +++ b/nvim/lua/plugins/lsp.lua @@ -100,41 +100,8 @@ return { }, } - -- Rust (rust-analyzer) - vim.lsp.config['rust_analyzer'] = { - cmd = { 'rust-analyzer' }, -- 使用 rustup 的版本,更稳定 - filetypes = { 'rust' }, - root_markers = { 'Cargo.toml', '.git' }, - capabilities = caps, - settings = { - ["rust-analyzer"] = { - cargo = { - allFeatures = true, - loadOutDirsFromCheck = true, - buildScripts = { - enable = true, - }, - }, - checkOnSave = true, - diagnostics = { - enable = true, - }, - procMacro = { - enable = true, - }, - files = { - exclude = { - ".direnv", ".git", ".jj", ".github", ".gitlab", - "bin", "node_modules", "target", "venv", ".venv", - }, - watcher = "client", - }, - }, - }, - } - - -- 启用所有 LSP - vim.lsp.enable({ 'lua_ls', 'bashls', 'clangd', 'neocmake', 'rust_analyzer' }) + -- 启用所有 LSP(Rust 由 rustaceanvim 管理) + vim.lsp.enable({ 'lua_ls', 'bashls', 'clangd', 'neocmake' }) end, }, } diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua index 767842a..8a59249 100644 --- a/nvim/lua/plugins/oil.lua +++ b/nvim/lua/plugins/oil.lua @@ -1,36 +1,37 @@ --- ============================================================================ --- 文件浏览器 (oil.nvim) --- 缓冲区编辑模式,像编辑文本一样管理文件 --- ============================================================================ +-- ============================================================================= +-- oil.lua — 文件浏览器 +-- ============================================================================= +-- 【保留】你的完整 oil.nvim 配置。 +-- 【无修改】oil 作为默认文件浏览器不变。 return { - { - "stevearc/oil.nvim", - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - opts = { - default_file_explorer = true, - keymaps = { - [""] = "actions.select", - [""] = "actions.preview", - [""] = "actions.close", - [""] = "actions.refresh", - [""] = "actions.toggle_hidden", - ["g?"] = "actions.show_help", - }, - view_options = { - show_hidden = true, - }, - float = { - padding = 2, - max_width = 90, - border = "rounded", - }, - }, - keys = { - { "-", "Oil", desc = "打开父目录" }, - { "fe", "Oil", desc = "文件浏览器" }, - }, + { + "stevearc/oil.nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", }, + opts = { + default_file_explorer = true, + keymaps = { + [""] = "actions.select", + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + [""] = "actions.toggle_hidden", + ["g?"] = "actions.show_help", + }, + view_options = { + show_hidden = true, + }, + float = { + padding = 2, + max_width = 90, + border = "rounded", + }, + }, + keys = { + { "-", "Oil", desc = "打开父目录" }, + { "fe", "Oil", desc = "文件浏览器" }, + }, + }, } diff --git a/nvim/lua/plugins/runner.lua b/nvim/lua/plugins/runner.lua index e74b666..bda3cb7 100644 --- a/nvim/lua/plugins/runner.lua +++ b/nvim/lua/plugins/runner.lua @@ -1,25 +1,27 @@ --- ============================================================================ --- 统一构建/运行/调试键位 --- 所有语言共用同一组键位,由 runner.lua 自动分发 --- ============================================================================ +-- ============================================================================= +-- runner.lua — 统一构建/运行/调试分发器 +-- ============================================================================= +-- 【保留】你的 runner.lua 配置和 keymap 完整保留。 +-- 【无修改】这是你的优秀设计,不需要改动。 return { - { - "mfussenegger/nvim-dap", - keys = { - -- 调试控制 - { "", function() require("dap").continue() end, desc = "继续调试" }, - { "", function() require("dap").step_over() end, desc = "单步跳过" }, - { "", function() require("dap").step_into() end, desc = "单步进入" }, - { "", function() require("dap").step_out() end, desc = "单步跳出" }, - { "b", function() require("dap").toggle_breakpoint() end, desc = "断点" }, - { "du", function() require("dapui").toggle() end, desc = "调试界面" }, + { + "mfussenegger/nvim-dap", + keys = { + -- 调试控制 + { "", function() require("dap").continue() end, desc = "继续调试" }, + { "", function() require("dap").step_over() end, desc = "单步跳过" }, + { "", function() require("dap").step_into() end, desc = "单步进入" }, + { "", function() require("dap").step_out() end, desc = "单步跳出" }, + -- 🔧 修改:断点键位从 b 改为 db(避免与 buffer 分组冲突) + { "db", function() require("dap").toggle_breakpoint() end, desc = "断点" }, + { "du", function() require("dapui").toggle() end, desc = "调试界面" }, - -- 统一构建/运行/调试/测试 - { "rb", function() require("runner").build() end, desc = "构建" }, - { "rr", function() require("runner").run() end, desc = "运行" }, - { "rd", function() require("runner").debug() end, desc = "调试" }, - { "rt", function() require("runner").test() end, desc = "测试" }, - }, + -- 统一构建/运行/调试/测试 + { "rb", function() require("runner").build() end, desc = "构建" }, + { "rr", function() require("runner").run() end, desc = "运行" }, + { "rd", function() require("runner").debug() end, desc = "调试" }, + { "rt", function() require("runner").test() end, desc = "测试" }, }, + }, } diff --git a/nvim/lua/plugins/rustaceanvim.lua b/nvim/lua/plugins/rustaceanvim.lua index 27a3de5..1d40818 100644 --- a/nvim/lua/plugins/rustaceanvim.lua +++ b/nvim/lua/plugins/rustaceanvim.lua @@ -1,5 +1,12 @@ --- ============================================================================ --- Rust 工具(通过 Mason + nvim-lspconfig 管理) --- ============================================================================ +-- ============================================================================= +-- rustaceanvim.lua — Rust 开发增强 +-- ============================================================================= +-- rustaceanvim 自动管理 rust-analyzer,提供调试、测试等功能 +-- 依赖:rustup 安装的 rust-analyzer(不要用 Mason 安装,避免冲突) +-- 安装:rustup component add rust-analyzer -return {} +return { + "mrcjkb/rustaceanvim", + ft = { "rust" }, + version = "^6", +} diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index 23d0ff3..cf57acf 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,47 +1,53 @@ --- ============================================================================ --- 模糊搜索 (telescope) --- ============================================================================ +-- ============================================================================= +-- telescope.lua — 模糊搜索 +-- ============================================================================= return { - { - "nvim-telescope/telescope.nvim", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-telescope/telescope-ui-select.nvim", - }, - cmd = "Telescope", - keys = { - { "ff", "Telescope find_files", desc = "查找文件" }, - { "fg", "Telescope live_grep", desc = "全局搜索" }, - { "fb", "Telescope buffers", desc = "切换缓冲区" }, - { "fh", "Telescope help_tags", desc = "帮助文档" }, - { "fk", "Telescope keymaps", desc = "查找键位" }, - { "fr", "Telescope oldfiles", desc = "最近文件" }, - }, - -- 启动即加载:ui-select 扩展需要全局接管 vim.ui.select, - -- 懒加载会导致未触发 :Telescope 时(如 rr)回退到原生 UI - lazy = false, - opts = { - defaults = { - prompt_prefix = " > ", - selection_caret = " > ", - layout_strategy = "flex", - }, - }, - config = function(_, opts) - local telescope = require("telescope") - - -- extensions 需要 require telescope.themes,必须在 config 里构造 - opts.extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown({}), - }, - } - - telescope.setup(opts) - -- 用 pcall 保护,避免 ui-select 扩展未安装时崩溃 - pcall(telescope.load_extension, "ui-select") - end, + { + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope-ui-select.nvim", + { + "nvim-telescope/telescope-fzf-native.nvim", + build = "make", + cond = function() return vim.fn.executable("make") == 1 end, + }, }, -} + cmd = "Telescope", + keys = { + { "ff", "Telescope find_files", desc = "查找文件" }, + { "fg", "Telescope live_grep", desc = "全局搜索" }, + { "fb", "Telescope buffers", desc = "切换缓冲区" }, + { "fh", "Telescope help_tags", desc = "帮助文档" }, + { "fk", "Telescope keymaps", desc = "查找键位" }, + { "fr", "Telescope oldfiles", desc = "最近文件" }, + { "fc", "Telescope current_buffer_fuzzy_find", desc = "当前文件搜索" }, + { "fd", "Telescope diagnostics", desc = "诊断信息" }, + }, + opts = { + defaults = { + prompt_prefix = " > ", + selection_caret = " > ", + layout_strategy = "flex", + file_ignore_patterns = { + "node_modules", ".git/", "dist/", "build/", "%.lock", + }, + }, + }, + config = function(_, opts) + local telescope = require("telescope") + + opts.extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({}), + }, + } + + telescope.setup(opts) + pcall(telescope.load_extension, "ui-select") + pcall(telescope.load_extension, "fzf") + end, + }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua index 148f1fe..7374ddf 100644 --- a/nvim/lua/plugins/treesitter.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,31 +1,24 @@ --- ============================================================================ --- 语法高亮 (Tree-sitter) --- ============================================================================ +-- ============================================================================= +-- treesitter.lua — 语法高亮 +-- ============================================================================= +-- 【保留】你的完整 ensure_installed 列表。 +-- 【新增】✅ fold 配置让 nvim-ufo 可以使用 treesitter 折叠。 return { - { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPre", "BufNewFile" }, - build = ":TSUpdate", - opts = { - ensure_installed = { - "lua", -- Lua - "bash", -- Bash - "rust", -- Rust - "c", -- C - "cpp", -- C++ - "cmake", -- CMake - "python", -- Python - "java", -- Java - "go", -- Go - "json", -- JSON - "toml", -- TOML - "markdown", -- Markdown - "regex", -- 正则 - "vim", -- Vimscript - }, - highlight = { enable = true }, - indent = { enable = true }, - }, + { + "nvim-treesitter/nvim-treesitter", + event = { "BufReadPre", "BufNewFile" }, + build = ":TSUpdate", + opts = { + ensure_installed = { + "lua", "bash", "rust", "c", "cpp", "cmake", + "python", "java", "go", "json", "toml", + "markdown", "regex", "vim", + }, + highlight = { enable = true }, + indent = { enable = true }, + -- ✅ 新增:启用 treesitter 折叠(nvim-ufo 依赖) + fold = { enable = true }, }, + }, } diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua new file mode 100644 index 0000000..06f0361 --- /dev/null +++ b/nvim/lua/plugins/ui.lua @@ -0,0 +1,177 @@ +-- ============================================================================= +-- ui.lua — UI 美化套件 +-- ============================================================================= + +return { + -- bufferline: 顶部标签栏 + { + "akinsho/bufferline.nvim", + version = "*", + event = "BufAdd", + dependencies = { + "nvim-tree/nvim-web-devicons", + "famiu/bufdelete.nvim", + }, + config = function() + require("bufferline").setup({ + options = { + mode = "buffers", + style_preset = require("bufferline").style_preset.default, + themable = true, + numbers = "none", + close_command = "Bdelete!", + right_mouse_command = "Bdelete!", + indicator = { style = "icon", icon = "▎" }, + buffer_close_icon = "󰅖", + modified_icon = "●", + close_icon = "", + left_trunc_marker = "", + right_trunc_marker = "", + max_name_length = 18, + max_prefix_length = 15, + truncate_names = true, + tab_size = 18, + diagnostics = "nvim_lsp", + diagnostics_update_in_insert = false, + offsets = { + { filetype = "oil", text = "文件浏览器", highlight = "Directory", text_align = "left" }, + { filetype = "NvimTree", text = "文件树", highlight = "Directory", text_align = "left" }, + }, + color_icons = true, + show_buffer_icons = true, + show_buffer_close_icons = true, + show_close_icon = false, + show_tab_indicators = true, + persist_buffer_sort = true, + separator_style = "thin", + enforce_regular_tabs = false, + always_show_bufferline = true, + hover = { enabled = true, delay = 200, reveal = { "close" } }, + -- 隐藏非文件 buffer(quickfix/终端/help 等),避免 cmake 输出污染标签栏 + custom_filter = function(bufnr) + return vim.bo[bufnr].buftype == "" + end, + }, + }) + end, + }, + + -- lualine: 底部状态栏 + { + "nvim-lualine/lualine.nvim", + event = "BufAdd", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { + options = { + component_separators = "|", + section_separators = "", + globalstatus = true, + theme = "tokyonight", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", "diff", "diagnostics" }, + lualine_c = { { "filename", path = 1 } }, + lualine_x = { "encoding", "fileformat", "filetype" }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + }, + }, + + -- noice.nvim: 命令行美化 + { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + cmdline = { + view = "cmdline_popup", + format = { + search_down = { icon = " " }, + search_up = { icon = " " }, + }, + }, + messages = { + enabled = true, + view = "notify", + view_error = "notify", + view_warn = "notify", + }, + popupmenu = { enabled = true, backend = "nui" }, + presets = { + bottom_search = false, + command_palette = true, + long_message_to_split = true, + inc_rename = true, + lsp_doc_border = true, + }, + -- 禁用 vim.ui.input 的补全,避免 nvim-tree 文件操作时回车误触发补全 + input = { + enabled = false, + }, + }, + dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" }, + }, + + -- nvim-notify: 通知美化 + { + "rcarriga/nvim-notify", + event = "BufAdd", + opts = { + timeout = 3000, + max_width = 50, + render = "compact", + stages = "fade", + }, + config = function(_, opts) + local notify = require("notify") + notify.setup(opts) + vim.notify = notify + end, + }, + + -- dressing.nvim: 输入框美化 + { + "stevearc/dressing.nvim", + event = "VeryLazy", + opts = {}, + }, + + -- dashboard-nvim: 启动首页 + { + "nvimdev/dashboard-nvim", + lazy = false, + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + require("dashboard").setup({ + theme = "doom", + config = { + header = { + "", + " ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗ ██╗██╗███╗ ███╗", + " ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║ ██║██║████╗ ████║", + " ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║ ██║██║██╔████╔██║", + " ██║╚██╗██║██╔════╝██║ ██║╚██╗ ██╔╝╚██╗ ██╔╝██║██║╚██╔╝██║", + " ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║", + " ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═══╝ ╚═╝╚═╝ ╚═╝", + "", + }, + center = { + { icon = " ", key = "f", desc = "f 查找文件", action = "Telescope find_files" }, + { icon = " ", key = "r", desc = "r 最近文件", action = "Telescope oldfiles" }, + { icon = " ", key = "g", desc = "g 全局搜索", action = "Telescope live_grep" }, + { icon = " ", key = "l", desc = "l 插件管理", action = "Lazy" }, + { icon = " ", key = "m", desc = "m LSP 管理", action = "Mason" }, + { icon = " ", key = "q", desc = "q 退出", action = "qa" }, + }, + footer = { " type :help for help · :q to exit" }, + vertical_center = true, -- 官方垂直居中选项 + }, + }) + end, + }, + + -- 通用依赖 + { "nvim-lua/plenary.nvim", lazy = true }, + { "MunifTanjim/nui.nvim", lazy = true }, +} \ No newline at end of file diff --git a/nvim/lua/plugins/whichkey.lua b/nvim/lua/plugins/whichkey.lua index 0bc19ef..7d51faa 100644 --- a/nvim/lua/plugins/whichkey.lua +++ b/nvim/lua/plugins/whichkey.lua @@ -1,16 +1,66 @@ --- ============================================================================ --- 键位提示 (which-key) --- ============================================================================ +-- ============================================================================= +-- whichkey.lua — 键位提示 +-- ============================================================================= +-- 【修复】原配置 enabled = false 直接禁用了,现在启用。 +-- 【修改】🔧 enabled 改为 true; +-- 🔧 更完善的分组和图标配置。 return { - { - "folke/which-key.nvim", - enabled = false, - event = "VeryLazy", - opts = { - delay = 300, - icons = { breadcrumb = ">", separator = "->", group = "+" }, - spec = { { "z", hidden = true } }, + { + "folke/which-key.nvim", + event = "VeryLazy", + opts = { + preset = "modern", + delay = 200, + icons = { + breadcrumb = "»", + separator = "➜", + group = "+", + }, + win = { + border = "rounded", + padding = { 1, 1 }, + wo = { winblend = 0 }, + }, + plugins = { + spelling = { enabled = true, suggestions = 20 }, + presets = { + operators = false, + motions = false, + text_objects = false, + windows = false, + nav = false, + z = true, + g = true, }, + }, }, + config = function(_, opts) + local wk = require("which-key") + wk.setup(opts) + + -- ✅ 新增:键位分组提示 + wk.add({ + { "e", group = "文件树" }, + { "f", group = "搜索" }, + { "g", group = "Git" }, + { "h", group = "Hunk 操作" }, + { "l", group = "LSP" }, + { "r", group = "运行/调试" }, + { "c", group = "CMake/C++" }, + { "b", group = "标签操作" }, + { "bc", desc = "关闭标签" }, + { "bo", desc = "关闭其他标签" }, + { "d", group = "调试操作" }, + { "db", desc = "切换断点" }, + { "du", desc = "调试界面" }, + { "dd", desc = "行诊断" }, + { "W", group = "窗口操作" }, + { "e", group = "文件浏览" }, + { "z", group = "折叠" }, + { "zM", desc = "关闭所有折叠" }, + { "zR", desc = "展开所有折叠" }, + }) + end, + }, } diff --git a/nvim/lua/runner.lua b/nvim/lua/runner.lua index 95bf071..f79a9cb 100644 --- a/nvim/lua/runner.lua +++ b/nvim/lua/runner.lua @@ -1,7 +1,8 @@ --- ============================================================================ --- 统一构建/运行/调试分发器 --- 根据项目类型自动选择正确的工具 --- ============================================================================ +-- ============================================================================= +-- runner.lua — 统一构建/运行/调试分发器 +-- ============================================================================= +-- 【保留】你的完整 runner.lua 模块。 +-- 【修改】使用 quickfix 窗口显示输出,与 CMake 保持一致 local M = {} @@ -19,38 +20,77 @@ function M.detect() return "unknown" end ---- 构建 +-- 存储终端实例 +local terminals = {} + +--- 在底部终端运行命令(保留颜色,复用已有终端) +---@param cmd string 要运行的命令 +---@param title string 窗口标题 +local function run_in_terminal(cmd, title) + local Terminal = require("toggleterm.terminal").Terminal + + -- 检查是否已有同名终端 + if terminals[title] and vim.api.nvim_buf_is_valid(terminals[title].bufnr) then + -- 复用已有终端,先关闭再重新打开(会执行新命令) + terminals[title]:close() + terminals[title] = nil + end + + -- 创建新终端 + local term = Terminal:new({ + cmd = cmd, + direction = "horizontal", + close_on_exit = false, + on_open = function(t) + pcall(vim.api.nvim_buf_set_name, t.bufnr, title) + end, + on_exit = function(t, _, exit_code) + vim.schedule(function() + -- 退出终端模式 + vim.api.nvim_buf_call(t.bufnr, function() + vim.cmd("stopinsert") + end) + -- 显示结果 + if exit_code == 0 then + vim.notify(title .. " 成功", vim.log.levels.INFO) + else + vim.notify(title .. " 失败 (退出码: " .. exit_code .. ")", vim.log.levels.WARN) + end + end) + end, + }) + + terminals[title] = term + term:toggle() +end + +--- 构建(使用底部终端) function M.build() local project = M.detect() if project == "rust" then - vim.cmd("terminal cargo build") + run_in_terminal("cargo build", "Cargo Build") elseif project == "cmake" then vim.cmd("CMakeBuild") elseif project == "go" then - local result = vim.fn.system("go build ./...") - if vim.v.shell_error == 0 then - vim.notify("go build 成功", vim.log.levels.INFO) - else - vim.notify("go build 失败:\n" .. result, vim.log.levels.ERROR) - end + run_in_terminal("go build ./...", "Go Build") else vim.notify("未识别的项目类型,无法自动构建", vim.log.levels.WARN) end end ---- 运行 +--- 运行(使用底部终端) function M.run() local project = M.detect() if project == "rust" then - vim.cmd("terminal cargo run") + run_in_terminal("cargo run", "Cargo Run") elseif project == "cmake" then vim.cmd("CMakeRun") elseif project == "go" then - vim.cmd("terminal go run .") + run_in_terminal("go run .", "Go Run") elseif project == "python" then - vim.cmd("terminal python " .. vim.fn.expand("%")) + run_in_terminal("python " .. vim.fn.expand("%"), "Python Run") else vim.notify("未识别的项目类型,无法自动运行", vim.log.levels.WARN) end @@ -69,22 +109,22 @@ function M.debug() end end ---- 测试 +--- 测试(使用底部终端) function M.test() local project = M.detect() if project == "rust" then - vim.cmd("terminal cargo test") + run_in_terminal("cargo test", "Cargo Test") elseif project == "cmake" then vim.cmd("CMakeBuild") - vim.cmd("terminal ctest --test-dir build") + run_in_terminal("ctest --test-dir build", "CTest") elseif project == "go" then - vim.cmd("terminal go test ./...") + run_in_terminal("go test ./...", "Go Test") elseif project == "python" then - vim.cmd("terminal pytest") + run_in_terminal("pytest", "Pytest") else vim.notify("未识别的项目类型,无法自动测试", vim.log.levels.WARN) end end -return M +return M \ No newline at end of file diff --git a/wallpaper/1776164.jpg b/wallpaper/1776164.jpg new file mode 100644 index 0000000..b1eb720 Binary files /dev/null and b/wallpaper/1776164.jpg differ diff --git a/wallpaper/Wallpaper Alchemy - Arch Linux 4K 壁纸.png b/wallpaper/Wallpaper Alchemy - Arch Linux 4K 壁纸.png new file mode 100644 index 0000000..097ee5c Binary files /dev/null and b/wallpaper/Wallpaper Alchemy - Arch Linux 4K 壁纸.png differ diff --git a/wallpaper/Wallpaper Alchemy - Arch Linux 官方标志深色 4K 壁纸.png b/wallpaper/Wallpaper Alchemy - Arch Linux 官方标志深色 4K 壁纸.png new file mode 100644 index 0000000..b2f2447 Binary files /dev/null and b/wallpaper/Wallpaper Alchemy - Arch Linux 官方标志深色 4K 壁纸.png differ