work on neovim configuration
This commit is contained in:
parent
5e89baa6c4
commit
87673019ab
3 changed files with 60 additions and 1 deletions
54
nixos/nvim/nnn.nix
Normal file
54
nixos/nvim/nnn.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [ tmux ];
|
||||
environment.variables = {
|
||||
NNN_FIFO = "$XDG_RUNTIME_DIR/nnn.fifo";
|
||||
NNN_ICONLOOKUP = 1;
|
||||
};
|
||||
|
||||
programs.nixvim = {
|
||||
extraPlugins = [
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
# https://github.com/luukvbaal/nnn.nvim
|
||||
name = "nnn.nvim";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "luukvbaal";
|
||||
repo = "nnn.nvim";
|
||||
rev = "662034c73718885ee599ad9fb193ab1ede70fbcb";
|
||||
sha256 = "sha256-8+ax8n1fA4jgJugvWtRXkad4YM7TmAAsAopzalmGu/4=";
|
||||
};
|
||||
})
|
||||
];
|
||||
extraConfigLua = ''
|
||||
local builtin = require("nnn").builtin
|
||||
require("nnn").setup({
|
||||
explorer = {
|
||||
cmd = "nnn -G -Pp",
|
||||
},
|
||||
picker = {
|
||||
cmd = "tmux new-session nnn -G -Pp",
|
||||
style = { border = "rounded" },
|
||||
session = "shared",
|
||||
},
|
||||
auto_open = {
|
||||
setup = "explorer",
|
||||
tabpage = "explorer",
|
||||
ft_ignore = {
|
||||
"gitcommit",
|
||||
},
|
||||
},
|
||||
replace_netrw = "picker",
|
||||
offset = true,
|
||||
mappings = {
|
||||
{ "<C-t>", builtin.open_in_tab }, -- open file(s) in tab
|
||||
{ "<C-s>", builtin.open_in_split }, -- open file(s) in split
|
||||
{ "<C-v>", builtin.open_in_vsplit }, -- open file(s) in vertical split
|
||||
{ "<C-p>", builtin.open_in_preview }, -- open file in preview split keeping nnn focused
|
||||
{ "<C-y>", builtin.copy_to_clipboard }, -- copy file(s) to clipboard
|
||||
{ "<C-w>", builtin.cd_to_path }, -- cd to file directory
|
||||
{ "<C-e>", builtin.populate_cmdline }, -- populate cmdline (:) with file(s)
|
||||
},
|
||||
})
|
||||
'';
|
||||
};
|
||||
}
|
24
nixos/nvim/nvim.nix
Executable file
24
nixos/nvim/nvim.nix
Executable file
|
@ -0,0 +1,24 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./nnn.nix
|
||||
];
|
||||
|
||||
programs.nixvim = {
|
||||
extraPackages = with pkgs; [ fd ];
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
colorschemes.catppuccin.enable = true;
|
||||
plugins = {
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
};
|
||||
treesitter.enable = true;
|
||||
cmp.enable = true;
|
||||
cmp-nvim-lsp.enable = true;
|
||||
lsp.enable = true;
|
||||
bufferline.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue