Compare commits

..

3 Commits

Author SHA1 Message Date
Noah Masur
8b1032ebda
gh watch keybind for neovim toggleterm 2024-06-05 13:54:13 -04:00
Noah Masur
e55ee05c5c
use separate keybinds for neovim completion features 2024-06-05 13:54:13 -04:00
Noah Masur
0cdae3569e
remove flake-utils from poetry template 2024-06-05 13:54:13 -04:00
3 changed files with 54 additions and 35 deletions

View File

@ -33,8 +33,8 @@
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)"; "['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)"; "['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()"; "['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
"['<CR>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })"; "['<C-y>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Insert, select = true, }, { 'i', 'c' })";
"['<C-r>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })"; "['<C-r>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, }, { 'i', 'c' })";
"['<Esc>']" = dsl.rawLua '' "['<Esc>']" = dsl.rawLua ''
function(_) function(_)
cmp.mapping({ cmp.mapping({
@ -44,7 +44,7 @@
vim.cmd("stopinsert") --- Abort and leave insert mode vim.cmd("stopinsert") --- Abort and leave insert mode
end end
''; '';
"['<C-l>']" = dsl.rawLua '' "['<C-k>']" = dsl.rawLua ''
cmp.mapping(function(_) cmp.mapping(function(_)
if require("luasnip").expand_or_jumpable() then if require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump() require("luasnip").expand_or_jump()

View File

@ -2,8 +2,11 @@
vim.keymap.set("n", "<Leader>gr", ":!gh browse %<CR><CR>", { silent = true }) vim.keymap.set("n", "<Leader>gr", ":!gh browse %<CR><CR>", { silent = true })
-- Pop a terminal to watch the current run -- Pop a terminal to watch the current run
local gitwatch = local gitwatch = require("toggleterm.terminal").Terminal:new({
require("toggleterm.terminal").Terminal:new({ cmd = "fish --interactive --init-command 'gh run watch'" }) cmd = "fish --interactive --init-command 'gh run watch'",
hidden = true,
direction = "float",
})
-- Set a toggle for this terminal -- Set a toggle for this terminal
function GITWATCH_TOGGLE() function GITWATCH_TOGGLE()
@ -11,4 +14,4 @@ function GITWATCH_TOGGLE()
end end
-- Keymap to toggle the run -- Keymap to toggle the run
vim.keymap.set("n", "<Leader>gw", GITWATCH_TOGGLE) vim.keymap.set("n", "<Leader>W", GITWATCH_TOGGLE)

View File

@ -1,29 +1,44 @@
{ {
description = "Python project flake"; description = "Python project flake";
inputs = {
inputs.flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:NixOS/nixpkgs";
inputs.nixpkgs.url = "github:NixOS/nixpkgs"; poetry2nix.url = "github:nix-community/poetry2nix";
inputs.poetry2nix.url = "github:nix-community/poetry2nix"; };
outputs = outputs =
{ nixpkgs, poetry2nix, ... }:
let
projectDir = ./.;
supportedSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in
{ {
self, packages = forAllSystems (
nixpkgs,
flake-utils,
poetry2nix,
}:
flake-utils.lib.eachDefaultSystem (
system: system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ poetry2nix.overlay ]; overlays = [ poetry2nix.overlays.default ];
}; };
projectDir = ./.;
in in
{ {
defaultPackage = pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; }; default = pkgs.poetry2nix.mkPoetryApplication { inherit projectDir; };
devShells.default = pkgs.mkShell { }
);
devShells = forAllSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ poetry2nix.overlays.default ];
};
in
{
default = pkgs.mkShell {
buildInputs = [ buildInputs = [
(pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; }) (pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; })
pkgs.poetry pkgs.poetry
@ -31,4 +46,5 @@
}; };
} }
); );
};
} }