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-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
"['<CR>']" = 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, })";
"['<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, }, { 'i', 'c' })";
"['<Esc>']" = dsl.rawLua ''
function(_)
cmp.mapping({
@ -44,7 +44,7 @@
vim.cmd("stopinsert") --- Abort and leave insert mode
end
'';
"['<C-l>']" = dsl.rawLua ''
"['<C-k>']" = dsl.rawLua ''
cmp.mapping(function(_)
if require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()

View File

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

View File

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