Skip to content

Commit

Permalink
Merge pull request #52 from redyf/dev
Browse files Browse the repository at this point in the history
Sidebar
  • Loading branch information
redyf authored Feb 8, 2024
2 parents 45e1d3d + e98b892 commit 572191b
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 6 deletions.
1 change: 1 addition & 0 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
./utils/persistence.nix
./utils/plenary.nix
./utils/project-nvim.nix
./utils/sidebar.nix
./utils/tmux-navigator.nix
./utils/todo-comments.nix
./utils/toggleterm.nix
Expand Down
10 changes: 7 additions & 3 deletions config/utils/oil.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
};
float = {
padding = 2;
maxWidth = 0;
maxHeight = 0;
maxWidth.__raw = ''
math.ceil(vim.o.lines * 0.8 - 4)
'';
maxHeight.__raw = ''
math.ceil(vim.o.columns * 0.8)
'';
border = "rounded"; # 'single' | 'double' | 'shadow' | 'curved' | ... other options supported by win open
winOptions = {
winblend = 0;
Expand Down Expand Up @@ -41,7 +45,7 @@
[
{
mode = "n";
key = "<leader>e";
key = "<leader>o";
action = ":Oil --float<CR>";
options = {
desc = "Open parent directory";
Expand Down
55 changes: 55 additions & 0 deletions config/utils/sidebar.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{ pkgs, ... }: {
extraPlugins = with pkgs.vimPlugins; [
(pkgs.vimUtils.buildVimPlugin {
pname = "sidebar.nvim";
version = "2024-02-07";
src = pkgs.fetchFromGitHub {
owner = "sidebar-nvim";
repo = "sidebar.nvim";
rev = "5695712eef6288fff667343c4ae77c54911bdb1b";
sha256 = "1p12189367x0x26cys9wxipzwr3i0bmz4lb0s79ki0a49d6zja2c";
};
})
];
extraConfigLua = ''
local sidebar = require("sidebar-nvim")
sidebar.setup({
disable_default_keybindings = 0,
bindings = nil,
open = false,
side = "left",
initial_width = 32,
hide_statusline = false,
update_interval = 1000,
sections = { "git", "containers" },
section_separator = {"", "-----", ""},
section_title_separator = {""},
containers = {
attach_shell = "/bin/sh", show_all = true, interval = 5000,
},
datetime = { format = "%a %b %d, %H:%M", clocks = { { name = "local" } } },
todos = { ignored_paths = {} },
["git"] = {
icon = "", -- 
},
})
cmd = {
"SidebarNvimToggle",
"SidebarNvimOpen",
"SidebarNvimFocus",
"SidebarNvimUpdate",
},
'';

keymaps = [
{
mode = "n";
key = "<leader>e";
action = ":SidebarNvimToggle<CR>";
options = {
desc = "Toggle Explorer";
silent = true;
};
}
];
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 572191b

Please sign in to comment.