1
0
Fork 0

Compare commits

...

3 commits

Author SHA1 Message Date
2f7d8ba9f4
Update deps
All checks were successful
Build / build-arm64-linux (push) Successful in 9m25s
Build / build-amd64-linux (push) Successful in 34m1s
2023-10-17 10:10:04 +02:00
f034a84bf8
nvim: Layz-load REPL and shell exes 2023-10-16 00:46:09 +02:00
3a430aaf62
nvim: Replace toggleterm with wezterm splits 2023-10-15 22:10:19 +02:00
10 changed files with 70 additions and 139 deletions

View file

@ -109,11 +109,11 @@
]
},
"locked": {
"lastModified": 1697230660,
"narHash": "sha256-Faw7qTLNVZYxW1nBHKhfrKY0lOicJaxxHh5u/Gq4M3Q=",
"lastModified": 1697419184,
"narHash": "sha256-eRPjCyjdcqaME/baecZHyTQTn3k0AYFzN/S+u351FcE=",
"owner": "nix-community",
"repo": "disko",
"rev": "6ad5c9c17cbd5514ce0cc2692dd82dd6d8e5d879",
"rev": "325e1f7f2e0eea44c27e5e8a3946c2461ec095f2",
"type": "github"
},
"original": {
@ -282,11 +282,11 @@
]
},
"locked": {
"lastModified": 1697371398,
"narHash": "sha256-Tn5feZ5SoYHQM9BTjw5e06DuNu8wc21gC9+bq/kXA8Y=",
"lastModified": 1697526467,
"narHash": "sha256-xX+XzphGlGsNybVPIZHQXzEKCE3aBa/cafeEhHuyk3Q=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "3b67ae3f665379c06999641f99d94dba75b53876",
"rev": "b25161c6a2c3b7cabb9cfdc70c35007c8ecb7241",
"type": "github"
},
"original": {
@ -325,11 +325,11 @@
},
"locked": {
"dir": "contrib",
"lastModified": 1697369779,
"narHash": "sha256-Ly+a5kmzmFmmTIHr+Tx8L8MtWM8F98Wp7m8vGvqiP4M=",
"lastModified": 1697507496,
"narHash": "sha256-C8u6Y5YJ8F2uobXpBbhOu3CY3gyxKTTqLBv/S5jpnAw=",
"owner": "neovim",
"repo": "neovim",
"rev": "0818d655288ebd70de728b13fabcfd01a0e2e2ec",
"rev": "35f475d0a51aad03abfc005a0224d315c45ffd67",
"type": "github"
},
"original": {
@ -350,11 +350,11 @@
]
},
"locked": {
"lastModified": 1697378750,
"narHash": "sha256-cq/nsNWqLZXA+cIQLGfD2GFGOjiEk2od7dvsLtnMcxM=",
"lastModified": 1697530088,
"narHash": "sha256-pF4o29+PP4zbb2eCXcYj8oIFMs436gzWNNgP+a0wxHg=",
"ref": "refs/heads/master",
"rev": "4d1a6b78dd5f920b0975db5b41ffb05cb2bcfbb6",
"revCount": 529,
"rev": "f8d84f0d0a2e803cf665002d45c7b8dc6b6a6714",
"revCount": 531,
"type": "git",
"url": "https://git.kempkens.io/daniel/nix-overlay"
},
@ -417,11 +417,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1697009197,
"narHash": "sha256-viVRhBTFT8fPJTb1N3brQIpFZnttmwo3JVKNuWRVc3s=",
"lastModified": 1697379843,
"narHash": "sha256-RcnGuJgC2K/UpTy+d32piEoBXq2M+nVFzM3ah/ZdJzg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "01441e14af5e29c9d27ace398e6dd0b293e25a54",
"rev": "12bdeb01ff9e2d3917e6a44037ed7df6e6c3df9d",
"type": "github"
},
"original": {

View file

@ -12,8 +12,7 @@
(usercmd :FormatEnableBuffer mod.enable-for-buffer
{:desc "Enable Formatting for the current buffer"})
(aucmd :BufWritePre
{:pattern "*"
:callback #(mod.maybe-format-buffer $1.buf)
{:callback #(mod.maybe-format-buffer $1.buf)
:group augroup
:desc "Run Formatter before saving"})))
@ -42,6 +41,7 @@
(conform.format {: bufnr
:async false
:timeout_ms 1000
:lsp_fallback (format-with-lsp? ft)}))))
:lsp_fallback (format-with-lsp? ft)}))
nil))
mod)

View file

@ -4,7 +4,6 @@
telescope-builtin (require :telescope.builtin)
telescope-themes (require :telescope.themes)
telescope-nifoc (require :nifoc.telescope)
telescope-toggleterm (require :telescope-toggleterm)
telescope-ivy (telescope-themes.get_ivy)
telescope-dropdown (telescope-themes.get_dropdown)
gitsigns (require :gitsigns)
@ -20,10 +19,8 @@
(keymap.set :n :<leader>u "<cmd>UrlView buffer<CR>" {:desc "Open UrlView"})
(keymap.set :n :<leader>ut "<cmd>Telescope undo<CR>"
{:desc "Toggle Undotree"})
(keymap.set :n :<leader>c repl.toggle-shell {:desc "Toggle Shell"})
(keymap.set :n :<leader>cs #(telescope-toggleterm.open telescope-dropdown)
{:desc "Select Terminal"})
(keymap.set :n :<leader>r repl.toggle-repl {:desc "Toggle REPL"})
(keymap.set :n :<leader>c repl.open-shell {:desc "Open Shell"})
(keymap.set :n :<leader>r repl.open-repl {:desc "Open REPL"})
(keymap.set :n :<leader>bl #(telescope-builtin.buffers telescope-dropdown)
{:desc "List Buffers"})
(keymap.set :n :<leader>bf
@ -40,8 +37,6 @@
{:desc "List VCS Branches"})
(keymap.set :n :<leader>vl #(gitsigns.blame_line {:full true})
{:desc "Blame Line"})
(keymap.set :n :<leader>vc #(repl.toggle-specific-shell :vcs)
{:desc "Toggle VCS Shell"})
(keymap.set :n :<leader>lk telescope-builtin.keymaps
{:desc "Show Keymappings"})
(keymap.set :n :<leader>ld #(telescope-builtin.diagnostics telescope-ivy)

View file

@ -1,55 +1,42 @@
(let [mod {}
terminal-class (require :toggleterm.terminal)
terminal terminal-class.Terminal]
(fn repl-setup []
(set vim.b.nifoc_shell_mode :REPL))
wezterm (require :wezterm)]
(fn exe [bin] (vim.fn.exepath bin))
(fn generic-setup [label]
(set vim.b.nifoc_shell_mode label))
(fn open-split [program-fn]
(let [args [:cli :split-pane :--bottom :--percent :30 "--"]
program (program-fn)]
(each [_ value (ipairs program)]
(table.insert args value))
(wezterm.exec args)))
(local elixir (terminal:new {:cmd :iex
:on_open repl-setup
:close_on_exit true}))
(local erlang (terminal:new {:cmd :erl
:on_open repl-setup
:close_on_exit true}))
(local fennel (terminal:new {:cmd "fennel --repl"
:on_open repl-setup
:close_on_exit true}))
(local fish (terminal:new {:cmd :fish
:on_open #(generic-setup :SHELL)
:close_on_exit true}))
(local javascript (terminal:new {:cmd :node
:on_open repl-setup
:close_on_exit true}))
(local nix (terminal:new {:cmd "nix repl"
:on_open repl-setup
:close_on_exit true}))
(local ruby
(terminal:new {:cmd :irb :on_open repl-setup :close_on_exit true}))
(local elixir #[(exe :iex)])
(local erlang #[(exe :erl)])
(local fennel #[(exe :fennel) :--repl])
(local fish #[(exe :fish)])
(local java #[(exe :jshell)])
(local javascript #[(exe :node)])
(local nix #[(exe :nix) :repl])
(local ruby #[(exe :irb)])
(local typescript #[(exe :node)])
;; Map filetype to REPL
(local repl-map {: elixir : erlang : fennel : fish : javascript : nix : ruby})
;; Various specific shell windows
(local specific-shell
{:vcs (terminal:new {:cmd :fish
:on_open #(generic-setup :VCS)
:direction :float
:close_on_exit true
:float_opts {:border :rounded}})})
(local repl-map {: elixir
: erlang
: fennel
: fish
: java
: javascript
: nix
: ruby
: typescript})
(fn mod.toggle-shell []
(fn mod.open-shell []
(let [shell (. repl-map :fish)]
(shell:toggle)))
(open-split shell)))
(fn mod.toggle-repl []
(fn mod.open-repl []
(let [ft vim.bo.filetype
repl (. repl-map ft)]
(when (not= repl nil)
(repl:toggle))))
(fn mod.toggle-specific-shell [name]
(let [shell (. specific-shell name)]
(shell:toggle)))
(open-split repl))))
mod)

View file

@ -31,7 +31,6 @@
:case_mode :smart_case}}})
(telescope.load_extension :fzf)
(telescope.load_extension :ui-select)
(telescope.load_extension :toggleterm)
(telescope.load_extension :yank_history)
(telescope.load_extension :undo)
(let [augroup (vim.api.nvim_create_augroup :NifocTelescope {:clear true})
@ -47,4 +46,3 @@
(set vim.opt_local.relativenumber false)
(set vim.opt_local.wrap true))
:group augroup})))

View file

@ -1,17 +0,0 @@
(let [toggleterm (require :toggleterm)]
(toggleterm.setup {:shell vim.o.shell
:open_mapping :<C-t>
:close_on_exit true})
(let [augroup (vim.api.nvim_create_augroup :NifocTerm {:clear true})
aucmd vim.api.nvim_create_autocmd
keymap (require :nifoc.keymap)]
(aucmd :TermOpen {:pattern "term://*toggleterm#*"
:callback (fn [opts]
(set vim.opt_local.number false)
(set vim.opt_local.relativenumber false)
(set vim.opt_local.cursorline false)
(vim.api.nvim_buf_set_var opts.buf
:toggle_line_style 0)
(keymap.terminal-open opts.buf))
:group augroup})))

View file

@ -182,7 +182,6 @@ in
}
telescope-ui-select-nvim
telescope-toggleterm-nvim
telescope-undo-nvim
# Completion
@ -259,12 +258,6 @@ in
type = "fennel";
}
{
plugin = toggleterm-nvim;
config = builtins.readFile ../../config/nvim/plugins/toggleterm.fnl;
type = "fennel";
}
{
plugin = urlview-nvim;
config = builtins.readFile ../../config/nvim/plugins/urlview.fnl;

View file

@ -2,7 +2,6 @@
{ pkgs, ... }:
let
inherit (pkgs) fetchFromGitHub;
inherit (pkgs) fetchFromSourcehut;
inherit (pkgs.vimUtils) buildVimPlugin;
in
{
@ -30,12 +29,12 @@ in
};
mini-nvim = buildVimPlugin {
pname = "mini.nvim";
version = "2023-10-14";
version = "2023-10-16";
src = fetchFromGitHub {
owner = "echasnovski";
repo = "mini.nvim";
rev = "0f93724569ebf27b6b3bc7130d8044a9020a8cc5";
sha256 = "16alghaa7xkkbzs1ai80shf44yy3w60zzkxjzk2frlkhjnk34w4i";
rev = "22f3f4396b4ec90c4c83b69f47e14d71b4c6c69f";
sha256 = "1gvdzljf74ji9q8x0ach0rsp1c5a93lp3i6dx9g9gca94m5phwbq";
fetchSubmodules = false;
};
};
@ -52,12 +51,12 @@ in
};
wezterm-nvim = buildVimPlugin {
pname = "wezterm.nvim";
version = "2023-10-15";
version = "2023-10-16";
src = fetchFromGitHub {
owner = "willothy";
repo = "wezterm.nvim";
rev = "0ad5ebde070de79ac77fe613e55ac0f632340561";
sha256 = "10g2saspf6a5skcsjmr92q2x7h2jwaxjbvk778snwg58vass93cc";
rev = "1e10db8f29fb68e871e337b2b18331806f5586b8";
sha256 = "00gafc350z8vmsk04psvk265g82bns4maq9ayj7p8x2466jh833y";
fetchSubmodules = false;
};
};
@ -118,12 +117,12 @@ in
};
nvim-treesitter = buildVimPlugin {
pname = "nvim-treesitter";
version = "2023-10-15";
version = "2023-10-17";
src = fetchFromGitHub {
owner = "nvim-treesitter";
repo = "nvim-treesitter";
rev = "f8fcb0da0618be551560a57fa1457dc6f889e568";
sha256 = "0nalh47rqfqhrhbpn6v2x9yijfln1kvxd2m676lr2mwf8362ppjc";
rev = "9c4fc86b67c1d68141cef57846d24cbee9b74fb0";
sha256 = "1ydmsvhl01s76qx0a10ipp7fkqazm1p19hspwj7cwlxvls952xfm";
fetchSubmodules = false;
};
};
@ -207,17 +206,6 @@ in
fetchSubmodules = false;
};
};
telescope-toggleterm-nvim = buildVimPlugin {
pname = "telescope-toggleterm.nvim";
version = "2022-02-10";
src = fetchFromSourcehut {
owner = "~havi";
repo = "telescope-toggleterm.nvim";
rev = "5c1402507f0ad01711196e5d27e9f0606f78b7d0";
sha256 = "04vn8807gmhahhap55xjbabarlmqf05ygwqycsfkdcbm5jpcxdnw";
fetchSubmodules = false;
};
};
telescope-undo-nvim = buildVimPlugin {
pname = "telescope-undo.nvim";
version = "2023-06-03";
@ -231,12 +219,12 @@ in
};
nvim-lspconfig = buildVimPlugin {
pname = "nvim-lspconfig";
version = "2023-10-15";
version = "2023-10-16";
src = fetchFromGitHub {
owner = "neovim";
repo = "nvim-lspconfig";
rev = "2a101fb00e6f6eb29c230736b99f05c3b3192b94";
sha256 = "1xyxy2qb1h8va74w0ldzh40z7mpqwrvav4qr139f0hmvgrzd0xgq";
rev = "e49b1e90c1781ce372013de3fa93a91ea29fc34a";
sha256 = "0pb33c3dgv6pvn6avc6zrbfrzr63wd9hxkz5rz6y05w633d61mc8";
fetchSubmodules = false;
};
};
@ -286,12 +274,12 @@ in
};
conform-nvim = buildVimPlugin {
pname = "conform.nvim";
version = "2023-10-15";
version = "2023-10-16";
src = fetchFromGitHub {
owner = "stevearc";
repo = "conform.nvim";
rev = "ea44a6f0a5b8f3924537b004a76e8aef26f2b22a";
sha256 = "193kcwqsvls6hlw04ibr8n8zhldff30sdn0kf85vvk63jgk0585r";
rev = "1281e26948fc06994e0e0cdcaafdd9bbd28929e7";
sha256 = "0drm8jfnfw5p2g3g69akgjyz5nkx72lnx6fc4b8s2ycvzn89zj3x";
fetchSubmodules = false;
};
};
@ -319,12 +307,12 @@ in
};
indent-blankline-nvim = buildVimPlugin {
pname = "indent-blankline.nvim";
version = "2023-10-12";
version = "2023-10-17";
src = fetchFromGitHub {
owner = "lukas-reineke";
repo = "indent-blankline.nvim";
rev = "0fe34b4c1b926e106d105d3ae88ef6cbf6743572";
sha256 = "06vqg7kq94190vzi8gs1n9a7mjkzhnjfp061xa8bc02qjbi2gj3v";
rev = "9301e434dd41154ffe5c3d5b8a5c9acd075ebeff";
sha256 = "1m27krw7zdlbnnip046acnndkniif2a6kg7aj61mf6l1ikbzy9x2";
fetchSubmodules = false;
};
};
@ -339,17 +327,6 @@ in
fetchSubmodules = false;
};
};
toggleterm-nvim = buildVimPlugin {
pname = "toggleterm.nvim";
version = "2023-10-02";
src = fetchFromGitHub {
owner = "akinsho";
repo = "toggleterm.nvim";
rev = "c80844fd52ba76f48fabf83e2b9f9b93273f418d";
sha256 = "19rbq39m7c1v9yrfmlwmfmxgv5d9bwcjbgjdp3cin409fnl4rv6b";
fetchSubmodules = false;
};
};
urlview-nvim = buildVimPlugin {
pname = "urlview.nvim";
version = "2023-09-19";

View file

@ -23,7 +23,6 @@
make
- src: ahmedkhalf/project.nvim
- src: nvim-telescope/telescope-ui-select.nvim
- src: "https://git.sr.ht/~havi/telescope-toggleterm.nvim"
- src: debugloop/telescope-undo.nvim
# LSP
- src: neovim/nvim-lspconfig
@ -40,7 +39,6 @@
- src: rebelot/heirline.nvim
- src: lukas-reineke/indent-blankline.nvim
- src: lukas-reineke/virt-column.nvim
- src: akinsho/toggleterm.nvim
- src: axieax/urlview.nvim
- src: lewis6991/gitsigns.nvim
- src: rcarriga/nvim-notify

View file

@ -22,7 +22,7 @@ rm -f "$nix_new_file"
echo '{ pkgs, ... }:'
echo 'let'
echo 'inherit (pkgs) fetchFromGitHub;'
echo 'inherit (pkgs) fetchFromSourcehut;'
# echo 'inherit (pkgs) fetchFromSourcehut;'
echo 'inherit (pkgs.vimUtils) buildVimPlugin;'
echo 'in'
echo '{'