Neovide copy and paste and a based Python LSP

ew python
those darn snake charmers (that's practically a slur for python devs,
right?)
This commit is contained in:
foreverpyrite
2025-10-05 17:56:58 -05:00
parent afce2ca400
commit 05d7845b60
7 changed files with 73 additions and 401 deletions

View File

@@ -1,121 +0,0 @@
let {
$workspaces = {
type = "workspaces"
all_monitors = false
// name_map = {
// 1 = "󰙯"
// 2 = "icon:firefox"
// 3 = ""
// Games = "icon:steam"
// Code = ""
// }
}
$focused = { type = "focused" }
$launcher = {
type = "launcher"
// favorites = ["firefox" "discord" "steam"]
show_names = false
show_icons = true
}
$mpris = {
type = "music"
player_type = "mpris"
on_click_middle = "playerctl play-pause"
on_scroll_up = "playerctl volume +5"
on_scroll_down = "playerctl volume -5"
}
$notifications = {
type = "notifications"
show_count = true
icons.closed_none = "󰍥"
icons.closed_some = "󱥂"
icons.closed_dnd = "󱅯"
icons.open_none = "󰍡"
icons.open_some = "󱥁"
icons.open_dnd = "󱅮"
}
$sys_info = {
type = "sys_info"
interval.memory = 15
interval.cpu = 1
// interval.temps = 5
// interval.disks = 300
interval.networks = 3
format = [
" {cpu_percent}% "
" {memory_used} / {memory_total} GB"
// "󰋊 {disk_used#T@/:.1} / {disk_total#T@/:.1} TB ({disk_percent@/}%) | {disk_read} / {disk_write} MB/s"
"󰓢 {net_down@wlan0} / {net_up@wlan0} Mbps"
// "󰖡 {load_average1} | {load_average5} | {load_average15}"
// "󰥔 {uptime}"
]
}
$tray = { type = "tray" }
$clock = { type = "clock" }
$clipboard = { type = "clipboard" max_items = 75 truncate.mode = "end" truncate.length = 50 }
$volume = {
type = "volume"
format = "{icon} {percentage}%"
max_volume = 100
icons.volume_high = "󰕾"
icons.volume_medium = "󰖀"
icons.volume_low = "󰕿"
icons.muted = "󰝟"
}
// -- begin custom --
$button = { type = "button" name="power-btn" label = "" on_click = "popup:toggle" }
$popup = {
type = "box"
orientation = "vertical"
widgets = [
{ type = "label" name = "header" label = "Power menu" }
{
type = "box"
widgets = [
{ type = "button" class="power-btn" label = "<span font-size='40pt'></span>" on_click = "!shutdown now" }
{ type = "button" class="power-btn" label = "<span font-size='40pt'></span>" on_click = "!reboot" }
]
}
{ type = "label" name = "uptime" label = "Uptime: {{30000:uptime -p | cut -d ' ' -f2-}}" }
]
}
$power_menu = {
type = "custom"
class = "power-menu"
bar = [ $button ]
popup = [ $popup ]
tooltip = "Up: {{30000:uptime -p | cut -d ' ' -f2-}}"
}
// -- end custom --
$left = [ $workspaces $launcher ]
$right = [ $sys_info $clipboard $power_menu $clock $notifications ]
}
in {
anchor_to_edges = true
position = "top"
icon_theme = "Paper"
height = 32
start = $left
end = $right
}

View File

@@ -1,276 +0,0 @@
@define-color color_bg #2d2d2d;
@define-color color_bg_dark #1c1c1c;
@define-color color_border #424242;
@define-color color_border_active #6699cc;
@define-color color_text #ffffff;
@define-color color_urgent #8f0a0a;
/* -- base styles -- */
* {
font-family: NimbusSansDOT Nerd Font;
font-size: 16px;
border: none;
border-radius: 0;
}
box, menubar, button {
background-color: @color_bg;
background-image: none;
box-shadow: none;
}
button, label {
color: @color_text;
}
button:hover {
background-color: @color_bg_dark;
}
scale trough {
min-width: 1px;
min-height: 2px;
}
#bar {
border-top: 1px solid @color_border;
}
.popup {
border: 1px solid @color_border;
padding: 1em;
}
.container {
height: 0px;
}
/* -- bluetooth -- */
.popup-bluetooth {
min-height: 14em;
min-width: 24em;
}
.popup-bluetooth .header {
padding-bottom: 1.0em;
margin-bottom: 0.6em;
border-bottom: 1px solid @color_border;
}
.popup-bluetooth .header .label {
margin-left: 0.5em;
}
.popup-bluetooth .disabled .spinner {
min-width: 2.0em;
min-height: 2.0em;
padding: 0.4em;
}
.popup-bluetooth .devices .box .device {
margin-bottom: 0.4em;
}
.popup-bluetooth .devices .icon {
min-width: 2.5em;
min-height: 2.5em;
margin-right: 0.8em;
}
.popup-bluetooth .devices .box .device .status .footer-label {
font-size: 0.8em;
}
.popup-bluetooth .devices .box .device .spinner {
min-width: 1.5em;
min-height: 1.5em;
margin: 0.5em;
}
/* -- clipboard -- */
.clipboard {
margin-left: 5px;
font-size: 1.1em;
}
.popup-clipboard .item {
padding-bottom: 0.3em;
border-bottom: 1px solid @color_border;
}
/* -- clock -- */
.clock {
font-weight: bold;
margin-left: 5px;
}
.popup-clock .calendar-clock {
color: @color_text;
font-size: 2.5em;
padding-bottom: 0.1em;
}
.popup-clock .calendar {
background-color: @color_bg;
color: @color_text;
}
.popup-clock .calendar .header {
padding-top: 1em;
border-top: 1px solid @color_border;
font-size: 1.5em;
}
.popup-clock .calendar:selected {
background-color: @color_border_active;
}
/* -- launcher -- */
.launcher .item {
margin-right: 4px;
}
.launcher .ifix examtem:not(.focused):hover {
background-color: @color_bg_dark;
}
.launcher .open {
border-bottom: 1px solid @color_text;
}
.launcher .focused {
border-bottom: 1px solid @color_border_active;
}
.launcher .urgent {
border-bottom-color: @color_urgent;
}
.popup-launcher {
padding: 0;
}
.popup-launcher .popup-item:not(:first-child) {
border-top: 1px solid @color_border;
}
/* -- music -- */
.music:hover * {
background-color: @color_bg_dark;
}
.popup-music .album-art {
margin-right: 1em;
}
.popup-music .icon-box {
margin-right: 0.4em;
}
.popup-music .title .icon, .popup-music .title .label {
font-size: 1.7em;
}
.popup-music .controls *:disabled {
color: @color_border;
}
.popup-music .volume .slider slider {
border-radius: 100%;
}
.popup-music .volume .icon {
margin-left: 4px;
}
.popup-music .progress .slider slider {
border-radius: 100%;
}
/* notifications */
.notifications .count {
font-size: 0.6rem;
background-color: @color_text;
color: @color_bg;
border-radius: 100%;
margin-right: 3px;
margin-top: 3px;
padding-left: 4px;
padding-right: 4px;
opacity: 0.7;
}
/* -- script -- */
.script {
padding-left: 10px;
}
/* -- sys_info -- */
.sysinfo {
margin-left: 10px;
}
.sysinfo .item {
margin-left: 5px;
}
/* -- tray -- */
.tray {
margin-left: 10px;
}
/* -- volume -- */
.popup-volume .device-box {
border-right: 1px solid @color_border;
}
/* -- workspaces -- */
.workspaces .item.focused {
box-shadow: inset 0 -3px;
background-color: @color_bg_dark;
}
.workspaces .item.urgent {
background-color: @color_urgent;
}
.workspaces .item:hover {
box-shadow: inset 0 -3px;
}
/* -- custom: power menu -- */
.popup-power-menu #header {
font-size: 1.4em;
padding-bottom: 0.4em;
margin-bottom: 0.6em;
border-bottom: 1px solid @color_border;
}
.popup-power-menu .power-btn {
border: 1px solid @color_border;
padding: 0.6em 1em;
}
.popup-power-menu #buttons > *:nth-child(1) .power-btn {
margin-right: 1em;
}

View File

@@ -1,10 +1,30 @@
-- bootstrap lazy.nvim, LazyVim and your plugins -- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy") require("config.lazy")
-- Unfortunately, the file paths are too long and break things
vim.loader.enable(false)
-- Clipboard (hopefully, right now my clipboard provider is tmux ig so...)
vim.o.clipboard = "unnamedplus"
vim.api.nvim_set_keymap("", "<D-v>", "+p<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("!", "<D-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("t", "<D-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", "<D-v>", "<C-R>+", { noremap = true, silent = true })
-- Is there a way I can set these in neovide config? -- Is there a way I can set these in neovide config?
if vim.g.neovide then if vim.g.neovide then
-- Neovide copy & pasting
vim.keymap.set("n", "<D-s>", ":w<CR>") -- Save
vim.keymap.set("v", "<D-c>", '"+y') -- Copy
vim.keymap.set("n", "<D-v>", '"+P') -- Paste normal mode
vim.keymap.set("v", "<D-v>", '"+P') -- Paste visual mode
vim.keymap.set("c", "<D-v>", "<C-R>+") -- Paste command mode
vim.keymap.set("i", "<D-v>", '<ESC>l"+Pli') -- Paste insert mode
-- Neovide Scaling support -- Neovide Scaling support
vim.g.neovide_scale_factor = 1.0 vim.g.neovide_scale_factor = 1.0
local set_scale_factor = function(value)
vim.g.nevoide_scale_factor = value
end
local change_scale_factor = function(delta) local change_scale_factor = function(delta)
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
end end
@@ -14,10 +34,10 @@ if vim.g.neovide then
vim.keymap.set("n", "<C-->", function() vim.keymap.set("n", "<C-->", function()
change_scale_factor(1 / 1.25) change_scale_factor(1 / 1.25)
end) end)
-- Neovide vim.keymap.set("n", "<C-0>", function()
set_scale_factor(1.0)
end)
-- General Neovide settings
vim.g.neovide_detach_on_quit = "always_detach" vim.g.neovide_detach_on_quit = "always_detach"
vim.g.neovide_fullscreen = true vim.g.neovide_fullscreen = true
end end
-- Unfortunately, the file paths are too long and break things
vim.loader.enable(false)

View File

@@ -1,3 +1,8 @@
-- Options are automatically loaded before lazy.nvim startup -- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here -- Add any additional options here
-- LSP Server to use for Python.
vim.g.lazyvim_python_lsp = "basedpyright"
-- Set to "ruff_lsp" to use the old LSP implementation version.
vim.g.lazyvim_python_ruff = "ruff"

View File

@@ -0,0 +1,16 @@
return {
"neovim/nvim-lspconfig",
opts = {
servers = {
basedpyright = {
settings = {
basedpyright = {
analysis = {
typeCheckingMode = "strict",
},
},
},
},
},
},
}

View File

@@ -0,0 +1,25 @@
return {
"andweeb/presence.nvim",
opts = {
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
neovim_image_text = "certifiably NOT getting laid", -- Text displayed when hovered over the Neovim image
main_image = "neovim", -- Main image display (either "neovim" or "file")
client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
enable_line_number = false, -- Displays the current line number instead of the current project
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
show_time = true, -- Show the timer
-- Rich Presence text options
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
},
}

View File

@@ -11,6 +11,9 @@ set-option -g prefix C-a
unbind C-b unbind C-b
bind-key C-a send-prefix bind-key C-a send-prefix
# Clipboard lol
set -g allow-passthrough on
# Start windows and panes at 1, not 0 # Start windows and panes at 1, not 0
set -g base-index 1 set -g base-index 1
setw -g pane-base-index 1 setw -g pane-base-index 1