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

View file

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

View file

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

View file

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

View file

@ -31,7 +31,6 @@
:case_mode :smart_case}}}) :case_mode :smart_case}}})
(telescope.load_extension :fzf) (telescope.load_extension :fzf)
(telescope.load_extension :ui-select) (telescope.load_extension :ui-select)
(telescope.load_extension :toggleterm)
(telescope.load_extension :yank_history) (telescope.load_extension :yank_history)
(telescope.load_extension :undo) (telescope.load_extension :undo)
(let [augroup (vim.api.nvim_create_augroup :NifocTelescope {:clear true}) (let [augroup (vim.api.nvim_create_augroup :NifocTelescope {:clear true})
@ -47,4 +46,3 @@
(set vim.opt_local.relativenumber false) (set vim.opt_local.relativenumber false)
(set vim.opt_local.wrap true)) (set vim.opt_local.wrap true))
:group augroup}))) :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-ui-select-nvim
telescope-toggleterm-nvim
telescope-undo-nvim telescope-undo-nvim
# Completion # Completion
@ -259,12 +258,6 @@ in
type = "fennel"; type = "fennel";
} }
{
plugin = toggleterm-nvim;
config = builtins.readFile ../../config/nvim/plugins/toggleterm.fnl;
type = "fennel";
}
{ {
plugin = urlview-nvim; plugin = urlview-nvim;
config = builtins.readFile ../../config/nvim/plugins/urlview.fnl; config = builtins.readFile ../../config/nvim/plugins/urlview.fnl;

View file

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

View file

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

View file

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