idk some bullshit about amp

This commit is contained in:
Anish Lakhwara 2025-09-17 17:11:23 -07:00
parent 440ed69398
commit 1177e076b0
10 changed files with 129 additions and 28 deletions

View file

@ -90,10 +90,10 @@ alt-slash = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical' alt-comma = 'layout accordion horizontal vertical'
# See: https://nikitabobko.github.io/AeroSpace/commands#focus # See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = 'focus left' # alt-h = 'focus left'
alt-j = 'focus down' # alt-j = 'focus down'
alt-k = 'focus up' # alt-k = 'focus up'
alt-l = 'focus right' # alt-l = 'focus right'
# See: https://nikitabobko.github.io/AeroSpace/commands#move # See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = 'move left' alt-shift-h = 'move left'

View file

@ -249,8 +249,8 @@
tree = "ls --tree --icons"; tree = "ls --tree --icons";
cat = "bat"; cat = "bat";
unzip = "aunpack"; unzip = "aunpack";
copy = "xclip -selection clipboard"; copy = if pkgs.stdenv.isDarwin then "pbcopy" else "xclip -selection clipboard";
paste = "xclip -selection clipboard -o"; paste = if pkgs.stdenv.isDarwin then "pbpaste" else "xclip -selection clipboard -o";
rm = "echo USE TRASH, FOOL: trash "; rm = "echo USE TRASH, FOOL: trash ";
trash = "trash-put"; trash = "trash-put";
make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;"; make-secret = "< /dev/urandom \\tr -dc _A-Za-z0-9 | head -c \${1:-32};echo;";
@ -303,7 +303,7 @@
orch = "ns override"; orch = "ns override";
nrb = '' nrb = ''
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
cd ~/usr/helm && sudo darwin-rebuild switch --flake ".#Anishs-MacBook-Pro" && cd $OLDPWD cd ~/usr/helm && sudo darwin-rebuild switch --impure --flake ".#Anishs-MacBook-Pro" && cd $OLDPWD
else else
cd /tmp && sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve' && cd $OLDPWD cd /tmp && sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve' && cd $OLDPWD
fi fi

View file

@ -9,6 +9,7 @@ mouse_map left click ungrabbed mouse_click_url_or_select
confirm_os_window_close 0 confirm_os_window_close 0
enable_audio_bell no enable_audio_bell no
hide_window_decorations titlebar-only hide_window_decorations titlebar-only
macos_option_as_alt left
-- Allows zen-mode.nvim to increase font size -- Allows zen-mode.nvim to increase font size
-- allow_remote_control socket-only -- allow_remote_control socket-only
-- listen_on unix:/tmp/kitty -- listen_on unix:/tmp/kitty

View file

@ -0,0 +1,9 @@
{ pkgs }:
if pkgs.stdenv.isDarwin && builtins.pathExists /Users/anishlakhwara/usr/amp.nvim then
pkgs.vimUtils.buildVimPlugin {
pname = "amp-nvim";
version = "unstable";
src = /Users/anishlakhwara/usr/amp.nvim;
}
else null

View file

@ -0,0 +1,5 @@
-- amp.nvim configuration
require('amp').setup({
auto_start = true,
log_level = "info"
})

View file

@ -29,24 +29,6 @@ let
sha256 = "gMaS5YFi3+gmUIfkCMEt9vhm8XSgv54Cquv5+WCWeTo="; sha256 = "gMaS5YFi3+gmUIfkCMEt9vhm8XSgv54Cquv5+WCWeTo=";
}; };
}; };
leap = pkgs.vimUtils.buildVimPlugin {
name = "leap";
src = pkgs.fetchFromGitHub {
owner = "ggandor";
repo = "leap.nvim";
rev = "1bb1fec369b1e9ae96e6ff1b829ea9272c51f844";
sha256 = "dH0v1D5q5OlMLA/omTDMb/taKyIgQ5VfVMYXJ609k/k=";
};
};
nvim-navic = pkgs.vimUtils.buildVimPlugin {
name = "nvim-navic";
src = pkgs.fetchFromGitHub {
owner = "SmiteshP";
repo = "nvim-navic";
rev = "096b23e73c84a653fd317c0c10261875fa573a6d";
sha256 = "vX7ZVJxgatIicmijehtaRvyHxk1i4gFfXrbPM/+VoFc=";
};
};
my-which-key-nvim = pkgs.vimUtils.buildVimPlugin { my-which-key-nvim = pkgs.vimUtils.buildVimPlugin {
pname = "which-key.nvim"; pname = "which-key.nvim";
version = "2022-05-04"; version = "2022-05-04";
@ -108,6 +90,20 @@ let
sha256 = "czKjJgCpvRSdtR7rNGlJrluDgPIdx94KUyx33op5gdY="; sha256 = "czKjJgCpvRSdtR7rNGlJrluDgPIdx94KUyx33op5gdY=";
}; };
}; };
gh-addressed = pkgs.vimUtils.buildVimPlugin {
pname = "gh-addressed";
version = "2024-09-17";
src = pkgs.fetchFromGitHub {
owner = "dlvhdr";
repo = "gh-addressed.nvim";
rev = "64c12f0f2a1d28afe53220da5fb86e1adb79be07";
sha256 = "0pxzq9jllw7rfspyy6j8dr464g0ph7xvh317l4iyva26ld8889mp";
};
doCheck = false;
doInstallCheck = false;
nvimRequireCheck = "none";
};
amp-nvim = import ./amp-plugin.nix { inherit pkgs; };
}; };
my-python-packages = python-packages: with python-packages; [ my-python-packages = python-packages: with python-packages; [
@ -842,6 +838,14 @@ in
require("which-key").setup{} require("which-key").setup{}
require('leap').set_default_keymaps() require('leap').set_default_keymaps()
${lib.optionalString (customPlugins.amp-nvim != null) ''
-- Setup amp.nvim
require('amp').setup({
auto_start = true,
log_level = "info"
})
''}
-- supercollider -- supercollider
local scnvim = require 'scnvim' local scnvim = require 'scnvim'
local map = scnvim.map local map = scnvim.map
@ -967,7 +971,7 @@ in
vim.keymap.set({'n', 't'}, '<M-l>', '<CMD>NavigatorRight<CR>') vim.keymap.set({'n', 't'}, '<M-l>', '<CMD>NavigatorRight<CR>')
-- Disable Ctrl+V in nvim so Kitty can handle paste -- Disable Ctrl+V in nvim so Kitty can handle paste
vim.keymap.set({'n', 'v', 'i'}, '<C-v>', '<Nop>', {noremap = true, silent = true}) vim.keymap.set({'v', 'i'}, '<C-v>', '<Nop>', {noremap = true, silent = true})
-- Pane resizing with Alt+Shift+hjkl (to match tmux) -- Pane resizing with Alt+Shift+hjkl (to match tmux)
vim.keymap.set('n', '<M-S-h>', '<Cmd>vertical resize -2<CR>', {silent = true}) vim.keymap.set('n', '<M-S-h>', '<Cmd>vertical resize -2<CR>', {silent = true})
@ -1083,8 +1087,9 @@ in
# experimental # experimental
nvim-luapad nvim-luapad
gh-addressed
scnvim scnvim
leap leap-nvim
Navigator-nvim Navigator-nvim
vim-beancount vim-beancount
# vimtex # vimtex
@ -1095,6 +1100,8 @@ in
] ++ lib.optionals pkgs.stdenv.isLinux [ ] ++ lib.optionals pkgs.stdenv.isLinux [
# Linux-only plugins # Linux-only plugins
vim-tidal # requires SuperCollider which is Linux-only vim-tidal # requires SuperCollider which is Linux-only
] ++ lib.optionals (customPlugins.amp-nvim != null) [
customPlugins.amp-nvim
]; ];
withPython3 = true; withPython3 = true;
extraPython3Packages = pkgs: with pkgs; [ tasklib six packaging ]; extraPython3Packages = pkgs: with pkgs; [ tasklib six packaging ];

View file

@ -1,3 +1,68 @@
-- Autocmds are automatically loaded on the VeryLazy event -- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua -- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here -- Add any additional autocmds here
-- Aggressive fugitive auto-reload with polling
local function setup_fugitive_aggressive_reload()
local timer = nil
local function refresh_fugitive()
-- Check all files for changes
vim.cmd("silent! checktime")
-- Force refresh any open fugitive buffers
for _, win in ipairs(vim.api.nvim_list_wins()) do
local buf = vim.api.nvim_win_get_buf(win)
if vim.api.nvim_buf_get_option(buf, "filetype") == "fugitive" then
vim.api.nvim_buf_call(buf, function()
pcall(vim.cmd, "silent! edit")
end)
end
end
end
local function start_polling()
if timer then vim.fn.timer_stop(timer) end
-- Poll every 2 seconds
timer = vim.fn.timer_start(2000, function()
refresh_fugitive()
end, { ["repeat"] = -1 })
end
local function stop_polling()
if timer then
vim.fn.timer_stop(timer)
timer = nil
end
end
local augroup = vim.api.nvim_create_augroup("FugitiveAggressiveReload", { clear = true })
-- Start polling when fugitive buffer opens
vim.api.nvim_create_autocmd("FileType", {
group = augroup,
pattern = "fugitive",
callback = start_polling,
})
-- Stop polling when no fugitive buffers are open
vim.api.nvim_create_autocmd("BufDelete", {
group = augroup,
callback = function()
-- Check if any fugitive buffers remain
local has_fugitive = false
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
if vim.api.nvim_buf_is_valid(buf) and vim.api.nvim_buf_get_option(buf, "filetype") == "fugitive" then
has_fugitive = true
break
end
end
if not has_fugitive then
stop_polling()
end
end,
})
end
-- Set up aggressive reload
setup_fugitive_aggressive_reload()

View file

@ -1,3 +1,6 @@
-- 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
-- Enable autoread to detect external file changes
vim.opt.autoread = true

View file

@ -0,0 +1,8 @@
return {
{
"sourcegraph/amp.nvim",
branch = "main",
lazy = false,
opts = { auto_start = true, log_level = "info" },
},
}

View file

@ -9,6 +9,9 @@ set-environment -g COLORTERM "truecolor"
# Mouse works as expected # Mouse works as expected
set-option -g mouse on set-option -g mouse on
# Enable focus events for vim/neovim autoread
set -g focus-events on
# easy-to-remember split pane commands # easy-to-remember split pane commands
bind | split-window -h -c "#{pane_current_path}" bind | split-window -h -c "#{pane_current_path}"
bind - split-window -v -c "#{pane_current_path}" bind - split-window -v -c "#{pane_current_path}"