about summary refs log tree commit diff stats
path: root/modules/by-name/nv/nvim/plgs/lf-nvim/default.nix
blob: e652a60d1c899fd80b34be19c35d107fe4b747b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# nixos-config - My current NixOS configuration
#
# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# This file is part of my nixos-config.
#
# You should have received a copy of the License along with this program.
# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
{
  lib,
  config,
  ...
}: let
  cfg = config.soispha.programs.nvim;
in {
  # TODO: change the nvim path, when I change the path with lf
  home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable {
    plugins.lf = {
      enable = true;

      settings = {
        default_actions = {
          "<C-o>" = "tab drop";
          "<C-t>" = "tabedit";
          "<C-v>" = "vsplit";
          "<C-x>" = "split";
        };

        default_action = "drop";

        winblend = 10;
        dir = "";
        direction = "float";
        border = "rounded";
        height.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.lines))";
        width.__raw = "vim.fn.float2nr(vim.fn.round(0.75 * vim.o.columns))";
        escape_quit = true;
        focus_on_open = true;
        mappings = true;
        tmux = false;
        default_file_manager = true;
        disable_netrw_warning = true;
        highlights = {
          Normal = {link = "Normal";};
          NormalFloat = {link = "Normal";};
          FloatBorder = {
            guifg = "#cdcbe0";
            guibg = "#191726";
          };
        };

        layout_mapping = "<M-u>";
        views = [
          {
            width = 0.800;
            height = 0.800;
          }
          {
            width = 0.600;
            height = 0.600;
          }
          {
            width = 0.950;
            height = 0.950;
          }
          {
            width = 0.500;
            height = 0.500;
            col = 0;
            row = 0;
          }
          {
            width = 0.500;
            height = 0.500;
            col = 0;
            row = 0.5;
          }
          {
            width = 0.500;
            height = 0.500;
            col = 0.5;
            row = 0;
          }
          {
            width = 0.500;
            height = 0.500;
            col = 0.5;
            row = 0.5;
          }
        ];
      };
    };
  };
}