1
0
Fork 0

Compare commits

..

No commits in common. "2f7d8ba9f4d69dbefb6ba098639a93fac5530604" and "f2e0c24cda402267a22b297b6465c0f8a00ca62a" have entirely different histories.

10 changed files with 139 additions and 70 deletions

View file

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

View file

@ -12,7 +12,8 @@
(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
{:callback #(mod.maybe-format-buffer $1.buf) {:pattern "*"
:callback #(mod.maybe-format-buffer $1.buf)
:group augroup :group augroup
:desc "Run Formatter before saving"}))) :desc "Run Formatter before saving"})))
@ -41,7 +42,6 @@
(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,6 +4,7 @@
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)
@ -19,8 +20,10 @@
(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.open-shell {:desc "Open Shell"}) (keymap.set :n :<leader>c repl.toggle-shell {:desc "Toggle Shell"})
(keymap.set :n :<leader>r repl.open-repl {:desc "Open REPL"}) (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>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
@ -37,6 +40,8 @@
{: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,42 +1,55 @@
(let [mod {} (let [mod {}
wezterm (require :wezterm)] terminal-class (require :toggleterm.terminal)
(fn exe [bin] (vim.fn.exepath bin)) terminal terminal-class.Terminal]
(fn repl-setup []
(set vim.b.nifoc_shell_mode :REPL))
(fn open-split [program-fn] (fn generic-setup [label]
(let [args [:cli :split-pane :--bottom :--percent :30 "--"] (set vim.b.nifoc_shell_mode label))
program (program-fn)]
(each [_ value (ipairs program)]
(table.insert args value))
(wezterm.exec args)))
(local elixir #[(exe :iex)]) (local elixir (terminal:new {:cmd :iex
(local erlang #[(exe :erl)]) :on_open repl-setup
(local fennel #[(exe :fennel) :--repl]) :close_on_exit true}))
(local fish #[(exe :fish)]) (local erlang (terminal:new {:cmd :erl
(local java #[(exe :jshell)]) :on_open repl-setup
(local javascript #[(exe :node)]) :close_on_exit true}))
(local nix #[(exe :nix) :repl]) (local fennel (terminal:new {:cmd "fennel --repl"
(local ruby #[(exe :irb)]) :on_open repl-setup
(local typescript #[(exe :node)]) :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}))
;; Map filetype to REPL ;; Map filetype to REPL
(local repl-map {: elixir (local repl-map {: elixir : erlang : fennel : fish : javascript : nix : ruby})
: erlang ;; Various specific shell windows
: fennel (local specific-shell
: fish {:vcs (terminal:new {:cmd :fish
: java :on_open #(generic-setup :VCS)
: javascript :direction :float
: nix :close_on_exit true
: ruby :float_opts {:border :rounded}})})
: typescript})
(fn mod.open-shell [] (fn mod.toggle-shell []
(let [shell (. repl-map :fish)] (let [shell (. repl-map :fish)]
(open-split shell))) (shell:toggle)))
(fn mod.open-repl [] (fn mod.toggle-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)
(open-split repl)))) (repl:toggle))))
(fn mod.toggle-specific-shell [name]
(let [shell (. specific-shell name)]
(shell:toggle)))
mod) mod)

View file

@ -31,6 +31,7 @@
: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})
@ -46,3 +47,4 @@
(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

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