Skip to content

Instantly share code, notes, and snippets.

@carlwhittick
Created March 11, 2025 21:51
Show Gist options
  • Select an option

  • Save carlwhittick/e9a01b33bcac51186900f5c0afe77e68 to your computer and use it in GitHub Desktop.

Select an option

Save carlwhittick/e9a01b33bcac51186900f5c0afe77e68 to your computer and use it in GitHub Desktop.
include /nix/store/9h9hqgk17203mlz9zwdm9akzpyf1gfvr-sway-c072ada/catppuccin-mocha
font pango:monospace 8.000000
floating_modifier Mod4
default_border pixel 4
default_floating_border normal 2
hide_edge_borders none
focus_wrapping no
focus_follows_mouse yes
focus_on_window_activation smart
mouse_warping output
workspace_layout default
workspace_auto_back_and_forth no
client.focused #4c7899 #285577 #ffffff #2e9ef4 #285577
client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a
client.unfocused #333333 #222222 #888888 #292d2e #222222
client.urgent #2f343a #900000 #ffffff #900000 #900000
client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c
client.background #ffffff
bindsym Mod4+0 workspace number 10
bindsym Mod4+1 workspace number 1
bindsym Mod4+2 workspace number 2
bindsym Mod4+3 workspace number 3
bindsym Mod4+4 workspace number 4
bindsym Mod4+5 workspace number 5
bindsym Mod4+6 workspace number 6
bindsym Mod4+7 workspace number 7
bindsym Mod4+8 workspace number 8
bindsym Mod4+9 workspace number 9
bindsym Mod4+Down focus down
bindsym Mod4+Escape exec steam-run systemctl suspend
bindsym Mod4+Left focus left
bindsym Mod4+Return exec kitty
bindsym Mod4+Right focus right
bindsym Mod4+Shift+0 move container to workspace number 10
bindsym Mod4+Shift+1 move container to workspace number 1
bindsym Mod4+Shift+2 move container to workspace number 2
bindsym Mod4+Shift+3 move container to workspace number 3
bindsym Mod4+Shift+4 move container to workspace number 4
bindsym Mod4+Shift+5 move container to workspace number 5
bindsym Mod4+Shift+6 move container to workspace number 6
bindsym Mod4+Shift+7 move container to workspace number 7
bindsym Mod4+Shift+8 move container to workspace number 8
bindsym Mod4+Shift+9 move container to workspace number 9
bindsym Mod4+Shift+Down move down
bindsym Mod4+Shift+Left move left
bindsym Mod4+Shift+Right move right
bindsym Mod4+Shift+Up move up
bindsym Mod4+Shift+c reload
bindsym Mod4+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
bindsym Mod4+Shift+h move left
bindsym Mod4+Shift+j move down
bindsym Mod4+Shift+k move up
bindsym Mod4+Shift+l move right
bindsym Mod4+Shift+minus move scratchpad
bindsym Mod4+Shift+q kill
bindsym Mod4+Shift+r reload
bindsym Mod4+Shift+space floating toggle
bindsym Mod4+Up focus up
bindsym Mod4+a focus parent
bindsym Mod4+alt+h exec /nix/store/g2sz808xw5hf88hf21hcw58c0pgb95wi-kitty-0.37.0/bin/kitty --class 'smsearch' --detach home-manager switch --flake ~/nixos#carlw@desktop
bindsym Mod4+alt+n exec /nix/store/g2sz808xw5hf88hf21hcw58c0pgb95wi-kitty-0.37.0/bin/kitty --class 'smsearch' --detach sudo nixos-rebuild switch --flake ~/nixos#desktop && home-manager switch --flake ~/nixos#carlw@desktop
bindsym Mod4+b exec librewolf
bindsym Mod4+c kill
bindsym Mod4+d exec bemenu-run --fb "#1e1e2e" --ff "#cdd6f4" --nb "#1e1e2e" --nf "#cdd6f4" --tb "#1e1e2e" --hb "#1e1e2e" --tf "#f38ba8" --hf "#f9e2af" --af "#cdd6f4" --ab "#1e1e2e" --hp 10
bindsym Mod4+e layout toggle split
bindsym Mod4+f fullscreen toggle
bindsym Mod4+h focus left
bindsym Mod4+j focus down
bindsym Mod4+k focus up
bindsym Mod4+l focus right
bindsym Mod4+m exec mullvad reconnect
bindsym Mod4+minus scratchpad show
bindsym Mod4+q exec /nix/store/g2sz808xw5hf88hf21hcw58c0pgb95wi-kitty-0.37.0/bin/kitty
bindsym Mod4+r mode resize
bindsym Mod4+s layout stacking
bindsym Mod4+space focus mode_toggle
bindsym Mod4+v splitv
bindsym Mod4+w layout tabbed
bindsym Mod4+y exec /nix/store/g2sz808xw5hf88hf21hcw58c0pgb95wi-kitty-0.37.0/bin/kitty --class 'smsearch' --detach yazi ~
input "*" {
xkb_layout gb
}
output "*" {
bg #303446 solid_color
}
output "DP-1" {
pos 0 1234
res 1920x1080
}
output "DP-2" {
pos 1920 1234
res 1920x1080
}
output "DP-3" {
pos 3840 1234
res 1920x1080
}
output "HDMI-A-1" {
pos 1782 0
res 3840x2160
scale 1.75
}
mode "resize" {
bindsym Down resize grow height 10 px
bindsym Escape mode default
bindsym Left resize shrink width 10 px
bindsym Return mode default
bindsym Right resize grow width 10 px
bindsym Up resize shrink height 10 px
bindsym h resize shrink width 10 px
bindsym j resize grow height 10 px
bindsym k resize shrink height 10 px
bindsym l resize grow width 10 px
}
bar {
font pango:monospace 8.000000
mode dock
hidden_state hide
position bottom
status_command /nix/store/27zz8a5pphz6rqmxhi1zrgnwrb611hmv-i3status-2.15/bin/i3status
swaybar_command /nix/store/i19h43d8r7m5844hlfs6j23zyn2zhi5w-sway-1.10/bin/swaybar
workspace_buttons yes
strip_workspace_numbers no
tray_output primary
colors {
background #000000
statusline #ffffff
separator #666666
focused_workspace #4c7899 #285577 #ffffff
active_workspace #333333 #5f676a #ffffff
inactive_workspace #333333 #222222 #888888
urgent_workspace #2f343a #900000 #ffffff
binding_mode #2f343a #900000 #ffffff
}
}
gaps inner 10
smart_gaps on
smart_borders on
exec librewolf
exec kitty
exec mullvad connect
workspace "1:1" output "DP-1"
workspace "1:2" output "DP-1"
workspace "2:1" output "DP-2"
workspace "2:2" output "DP-2"
workspace "3:1" output "DP-3"
workspace "4:1" output "HDMI-A-1"
workspace "4:2" output "HDMI-A-1"
workspace "4:3" output "HDMI-A-1"
workspace "4:4" output "HDMI-A-1"
exec "/nix/store/d5bki4k0jpnw5897kbnaclzmxrhdxc8c-dbus-1.14.10/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target"
-- Nixvim's internal module table
-- Can be used to share code throughout init.lua
local _M = {}
-- Set up globals {{{
do
local nixvim_globals = { mapleader = " " }
for k, v in pairs(nixvim_globals) do
vim.g[k] = v
end
end
-- }}}
-- Set up options {{{
do
local nixvim_options = {
autoread = true,
backup = false,
breakindent = true,
clipboard = "unnamedplus",
cmdheight = 0,
completeopt = { "menuone", "noselect", "noinsert" },
cursorline = true,
encoding = "utf-8",
expandtab = true,
fileencoding = "utf-8",
hlsearch = true,
ignorecase = true,
inccommand = "split",
list = true,
listchars = { nbsp = "␣", tab = "» ", trail = "·" },
mouse = "a",
number = true,
relativenumber = true,
scrolloff = 10,
showmode = false,
showtabline = 0,
signcolumn = "yes",
smartcase = true,
softtabstop = 2,
spell = false,
splitbelow = true,
splitright = true,
swapfile = false,
tabstop = 2,
termguicolors = true,
timeoutlen = 200,
undofile = true,
updatetime = 250,
wrap = true,
}
for k, v in pairs(nixvim_options) do
vim.opt[k] = v
end
end
-- }}}
require("catppuccin").setup({})
-- Formatting function for conform
_G.format_with_conform = function()
local conform = require("conform")
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = 2000,
})
end
vim.cmd([[let $BAT_THEME = 'catppuccin'
colorscheme catppuccin
]])
require("nvim-web-devicons").setup({})
require("mini.clue").setup({
triggers = {
{ keys = "<Leader>", mode = "n" },
{ keys = "<Leader>", mode = "x" },
{ keys = "<C-x>", mode = "i" },
{ keys = "g", mode = "n" },
{ keys = "g", mode = "x" },
{ keys = '"', mode = "n" },
{ keys = "`", mode = "n" },
{ keys = '"', mode = "x" },
{ keys = "`", mode = "x" },
{ keys = '"', mode = "n" },
{ keys = '"', mode = "x" },
{ keys = "<C-r>", mode = "i" },
{ keys = "<C-r>", mode = "c" },
{ keys = "<C-w>", mode = "n" },
{ keys = "z", mode = "n" },
{ keys = "z", mode = "x" },
},
})
require("mini.diff").setup({ view = { style = "sign" } })
require("mini.notify").setup({})
require("mini.sessions").setup({ autoread = true, autowrite = true })
require("mini.surround").setup({
mappings = {
add = "gsa",
delete = "gsd",
find = "gsf",
find_left = "gsF",
highlight = "gsh",
replace = "gsr",
update_n_lines = "gsn",
},
})
-- LSP {{{
do
local __lspServers = {
{ name = "volar" },
{
extraOptions = {
filetypes = {
"vue",
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
"vue",
},
init_options = {
plugins = {
{
languages = { "vue" },
location = "/nix/store/5wiqv0qg2kxss57lmi61qgnb1kl39g9b-vue-language-server-2.2.0/lib/node_modules/@vue/language-server",
name = "@vue/typescript-plugin",
},
},
},
},
name = "ts_ls",
},
{ name = "tailwindcss" },
{ name = "nixd" },
{ name = "intelephense" },
{ name = "html" },
}
-- Adding lspOnAttach function to nixvim module lua table so other plugins can hook into it.
_M.lspOnAttach = function(client, bufnr)
require("lsp-format").on_attach(client)
end
local __lspCapabilities = function()
capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities())
return capabilities
end
local __setup = {
on_attach = _M.lspOnAttach,
capabilities = __lspCapabilities(),
}
for i, server in ipairs(__lspServers) do
if type(server) == "string" then
require("lspconfig")[server].setup(__setup)
else
local options = server.extraOptions
if options == nil then
options = __setup
else
options = vim.tbl_extend("keep", options, __setup)
end
require("lspconfig")[server.name].setup(options)
end
end
end
-- }}}
local cmp = require("cmp")
cmp.setup({
completion = { completeopt = "menu,menuone,noinsert" },
mapping = cmp.mapping.preset.insert({}),
sources = {
{ name = "nvim_lsp" },
{ name = "treesitter" },
{ name = "path" },
{ name = "calc" },
{ name = "emoji" },
{ name = "cmp_yanky" },
},
})
require("yazi").setup({ open_for_directories = true })
do
local utils = require("yanky.utils")
local mapping = require("yanky.telescope.mapping")
require("yanky").setup({ highlight = { timer = 100 } })
end
vim.opt.runtimepath:prepend(vim.fs.joinpath(vim.fn.stdpath("data"), "site"))
require("nvim-treesitter.configs").setup({ parser_install_dir = vim.fs.joinpath(vim.fn.stdpath("data"), "site") })
require("telescope").setup({})
local __telescopeExtensions = { "yank_history" }
for i, extension in ipairs(__telescopeExtensions) do
require("telescope").load_extension(extension)
end
require("tailwind-tools").setup({})
require("lualine").setup({
extensions = { "fzf" },
globalstatus = true,
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = {
"filename",
function()
local statusline = require("arrow.statusline")
return " " .. statusline.text_for_statusline_with_icons()
end,
"diff",
function()
local recording_register = vim.fn.reg_recording()
if recording_register == "" then
return ""
else
return "Recording @" .. recording_register
end
end,
},
lualine_x = { "diagnostics", "encoding", "fileformat", "filetype" },
},
})
require("lsp-format").setup({})
require("indent-o-matic").setup({})
require("ibl").setup({})
require("gitsigns").setup({
signs = {
add = { text = "▎" },
change = { text = "▎" },
changedelete = { text = "▎" },
delete = { text = "▎" },
topdelete = { text = "▎" },
},
})
require("fzf-lua").setup({})
require("flash").setup({})
require("conform").setup({
format_on_save = { lsp_fallback = true, timeout_ms = 2000 },
formatters_by_ft = { nix = { "nixfmt" }, php = { "pint" } },
})
require("Comment").setup({})
require("better_escape").setup({})
require("autoclose").setup({})
require("arrow").setup({
index_keys = "hjkl;asdfg1234567890",
leader_key = "'",
mappings = {
clear_all_items = "C",
delete_mode = "d",
edit = "e",
next_item = "]",
open_horizontal = "-",
open_vertical = "v",
prev_item = "[",
quit = "q",
remove = "x",
toggle = "a",
},
separate_save_and_remove = true,
show_icons = true,
})
require("lspsaga").setup({})
-- Set up keybinds {{{
do
local __nixvim_binds = {
{ action = "<Cmd>Yazi<CR>", key = "<leader>o", mode = "" },
{ action = "<Cmd>enew<CR>", key = "<leader>n", mode = "", options = { desc = "New File" } },
{ action = "<Cmd>FzfLua files<CR>", key = "<leader>ff", mode = "", options = { desc = "Find file" } },
{ action = "<Cmd>FzfLua grep_project<CR>", key = "<leader>fw", mode = "", options = { desc = "Find file" } },
{ action = "<Cmd>noh<CR>", key = "<C-l>", mode = "" },
{
action = function()
require("telescope").extensions.yank_history.yank_history()
end,
key = "<Leader>c",
mode = "",
options = { desc = "Clipboard" },
},
{ action = "<cmd>LazyGit<cr>", key = "<leader>g", mode = "", options = { desc = "LazyGit" } },
{
action = "<cmd>Lspsaga goto_definition<cr>",
key = "gd",
mode = "n",
options = { desc = "Goto definition of highlighted item", silent = true },
},
{
action = "<cmd>Lspsaga goto_type_definition<cr>",
key = "gD",
mode = "n",
options = { desc = "Goto type definition of highlighted item", silent = true },
},
{
action = "<cmd>Lspsaga hover_doc<CR>",
key = "K",
mode = "n",
options = { desc = "Show docs for hovered item.", silent = true },
},
{
action = "<cmd>Lspsaga code_action<cr>",
key = "<leader>lc",
mode = "n",
options = { desc = "Code Action", silent = true },
},
{
action = "<cmd>Lspsaga finder<cr>",
key = "<leader>lff",
mode = "n",
options = { desc = "Finder", silent = true },
},
{
action = "<cmd>Lspsaga finder imp<cr>",
key = "<leader>lfi",
mode = "n",
options = { desc = "Find Implementation", silent = true },
},
{
action = "<cmd>Lspsaga incoming_calls<cr>",
key = "<leader>lfI",
mode = "n",
options = { desc = "Find Incoming Calls", silent = true },
},
{
action = "<cmd>Lspsaga outgoing_calls<cr>",
key = "<leader>lfo",
mode = "n",
options = { desc = "Find Outgoing Calls", silent = true },
},
{ action = "<cmd>Navbuddy<cr>", key = "<leader>ln", mode = "n", options = { desc = "Navbuddy", silent = true } },
{
action = "<cmd>Lspsaga rename<cr>",
key = "<leader>lr",
mode = "n",
options = { desc = "Rename", silent = true },
},
{
action = "<cmd>Lspsaga peek_definition<cr>",
key = "<leader>lpd",
mode = "n",
options = { desc = "Peek Definition", silent = true },
},
{
action = "<cmd>Lspsaga peek_type_definition<cr>",
key = "<leader>lpt",
mode = "n",
options = { desc = "Peek Type Definition", silent = true },
},
{
action = "<cmd>Outline<cr>",
key = "<leader>lo",
mode = "n",
options = { desc = "LSP Outline", silent = true },
},
{
action = "<CMD>lua require('Comment.api').locked('toggle.linewise')()<CR>",
key = "<Leader>/",
mode = "n",
options = { desc = "Comment" },
},
{
action = "<ESC><CMD>lua require('Comment.api').locked('toggle.linewise')(vim.fn.visualmode())<CR>",
key = "<Leader>/",
mode = "v",
options = { desc = "Comment" },
},
{
action = "<cmd>Laravel artisan<cr>",
key = "<leader>la",
mode = "n",
options = { desc = "Commands", silent = true },
},
{
action = "<cmd>Laravel routes<cr>",
key = "<leader>Lr",
mode = "n",
options = { desc = "Routes", silent = true },
},
{ action = "<cmd>Laravel make<cr>", key = "<leader>Lm", mode = "n", options = { desc = "Make", silent = true } },
{
action = "<cmd>Laravel resources<cr>",
key = "<leader>Lo",
mode = "n",
options = { desc = "Resources", silent = true },
},
}
for i, map in ipairs(__nixvim_binds) do
vim.keymap.set(map.mode, map.key, map.action, map.options)
end
end
-- }}}
vim.filetype.add({ pattern = { [".*%.blade%.php"] = "html" } })
require("laravel").setup({ lsp_server = "intelephense" })
-- Set up autogroups {{
do
local __nixvim_autogroups = { nixvim_binds_LspAttach = { clear = true } }
for group_name, options in pairs(__nixvim_autogroups) do
vim.api.nvim_create_augroup(group_name, options)
end
end
-- }}
-- Set up autocommands {{
do
local __nixvim_autocommands = {
{
callback = function(args)
do
local __nixvim_binds = {}
for i, map in ipairs(__nixvim_binds) do
local options = vim.tbl_extend("keep", map.options or {}, { buffer = args.buf })
vim.keymap.set(map.mode, map.key, map.action, options)
end
end
end,
desc = "Load keymaps for LspAttach",
event = "LspAttach",
group = "nixvim_binds_LspAttach",
},
}
for _, autocmd in ipairs(__nixvim_autocommands) do
vim.api.nvim_create_autocmd(autocmd.event, {
group = autocmd.group,
pattern = autocmd.pattern,
buffer = autocmd.buffer,
desc = autocmd.desc,
callback = autocmd.callback,
command = autocmd.command,
once = autocmd.once,
nested = autocmd.nested,
})
end
end
-- }}
# ============================================= #
# Start with defaults from the Sensible plugin #
# --------------------------------------------- #
run-shell /nix/store/kag8pr950cgdzwcw7r17frcbj46ypf9s-tmuxplugin-sensible-unstable-2017-09-05/share/tmux-plugins/sensible/sensible.tmux
# ============================================= #
set -g default-terminal "kitty"
set -g base-index 1
setw -g pane-base-index 1
# We need to set default-shell before calling new-session
set -g default-shell "/nix/store/bql1zb7kzp707ibdwmra9dcxvvxv5s00-fish-3.7.1/bin/fish"
set -g status-keys vi
set -g mode-keys vi
# rebind main key: C-Space
unbind C-b
set -g prefix C-Space
bind -N "Send the prefix key through to the application" \
C-Space send-prefix
set -g mouse on
setw -g aggressive-resize off
setw -g clock-mode-style 12
set -s escape-time 500
set -g history-limit 2000
# ============================================= #
# Load plugins with Home Manager #
# --------------------------------------------- #
# tmuxplugin-catppuccin
# ---------------------
set -g @catppuccin_flavor 'mocha'
run-shell /nix/store/s94ci8n602qi0v7a6kwhac81ffgkkik0-tmuxplugin-catppuccin-2c4cb5a/share/tmux-plugins/catppuccin/catppuccin.tmux
# ============================================= #
bind C-o display-popup -E "tms"
bind C-j display-popup -E "tms switch"
bind C-w display-popup -E "tms windows"
bind -r '(' switch-client -p\; refresh-client -S
bind -r ')' switch-client -n\; refresh-client -S
set -g status-right " #(tms sessions)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment