mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
no more oil
This commit is contained in:
parent
285df2df53
commit
d360f0e701
7 changed files with 97 additions and 127 deletions
19
flake.lock
generated
19
flake.lock
generated
|
|
@ -394,30 +394,13 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oil-nvim": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1749076816,
|
|
||||||
"narHash": "sha256-fbRbRT9VJdppOs4hML1J113qLHdj7YRuSDQgZkt34cM=",
|
|
||||||
"owner": "stevearc",
|
|
||||||
"repo": "oil.nvim",
|
|
||||||
"rev": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "stevearc",
|
|
||||||
"repo": "oil.nvim",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"gen-luarc": "gen-luarc",
|
"gen-luarc": "gen-luarc",
|
||||||
"mini-nvim": "mini-nvim",
|
"mini-nvim": "mini-nvim",
|
||||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2"
|
||||||
"oil-nvim": "oil-nvim"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
|
|
|
||||||
20
flake.nix
20
flake.nix
|
|
@ -13,10 +13,6 @@
|
||||||
url = "github:echasnovski/mini.nvim";
|
url = "github:echasnovski/mini.nvim";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
oil-nvim = {
|
|
||||||
url = "github:stevearc/oil.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
# Add bleeding-edge plugins here.
|
# Add bleeding-edge plugins here.
|
||||||
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
|
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
|
||||||
# wf-nvim = {
|
# wf-nvim = {
|
||||||
|
|
@ -24,18 +20,22 @@
|
||||||
# flake = false;
|
# flake = false;
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
outputs = inputs @ {
|
outputs =
|
||||||
|
inputs@{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
systems = builtins.attrNames nixpkgs.legacyPackages;
|
systems = builtins.attrNames nixpkgs.legacyPackages;
|
||||||
|
|
||||||
# This is where the Neovim derivation is built.
|
# This is where the Neovim derivation is built.
|
||||||
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; };
|
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; };
|
||||||
in
|
in
|
||||||
flake-utils.lib.eachSystem systems (system: let
|
flake-utils.lib.eachSystem systems (
|
||||||
|
system:
|
||||||
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
|
|
@ -64,7 +64,8 @@
|
||||||
ln -Tfns $PWD/nvim ~/.config/nvim-dev
|
ln -Tfns $PWD/nvim ~/.config/nvim-dev
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
packages = rec {
|
packages = rec {
|
||||||
default = nvim;
|
default = nvim;
|
||||||
nvim = pkgs.nvim-pkg;
|
nvim = pkgs.nvim-pkg;
|
||||||
|
|
@ -74,7 +75,8 @@
|
||||||
devShells = {
|
devShells = {
|
||||||
default = shell;
|
default = shell;
|
||||||
};
|
};
|
||||||
})
|
}
|
||||||
|
)
|
||||||
// {
|
// {
|
||||||
overlays.default = neovim-overlay;
|
overlays.default = neovim-overlay;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,13 @@
|
||||||
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
|
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
|
||||||
{inputs}: final: prev:
|
{ inputs }:
|
||||||
with final.pkgs.lib; let
|
final: prev:
|
||||||
|
with final.pkgs.lib;
|
||||||
|
let
|
||||||
pkgs = final;
|
pkgs = final;
|
||||||
pkgs-wrapNeovim = prev;
|
pkgs-wrapNeovim = prev;
|
||||||
|
|
||||||
mkNvimPlugin = src: pname:
|
mkNvimPlugin =
|
||||||
|
src: pname:
|
||||||
pkgs.vimUtils.buildVimPlugin {
|
pkgs.vimUtils.buildVimPlugin {
|
||||||
inherit pname src;
|
inherit pname src;
|
||||||
version = src.lastModifiedDate;
|
version = src.lastModifiedDate;
|
||||||
|
|
@ -12,7 +15,6 @@ with final.pkgs.lib; let
|
||||||
mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; };
|
mkNeovim = pkgs.callPackage ./mkNeovim.nix { inherit pkgs-wrapNeovim; };
|
||||||
|
|
||||||
mini-nvim-git = mkNvimPlugin inputs.mini-nvim "mini.nvim";
|
mini-nvim-git = mkNvimPlugin inputs.mini-nvim "mini.nvim";
|
||||||
oil-nvim-git = mkNvimPlugin inputs.oil-nvim "oil.nvim";
|
|
||||||
|
|
||||||
all-plugins = with pkgs.vimPlugins; [
|
all-plugins = with pkgs.vimPlugins; [
|
||||||
blink-cmp
|
blink-cmp
|
||||||
|
|
@ -31,7 +33,6 @@ with final.pkgs.lib; let
|
||||||
nvim-treesitter-context
|
nvim-treesitter-context
|
||||||
nvim-treesitter-textobjects
|
nvim-treesitter-textobjects
|
||||||
nvim-treesitter.withAllGrammars
|
nvim-treesitter.withAllGrammars
|
||||||
oil-nvim-git
|
|
||||||
quicker-nvim
|
quicker-nvim
|
||||||
refactoring-nvim
|
refactoring-nvim
|
||||||
render-markdown-nvim
|
render-markdown-nvim
|
||||||
|
|
@ -62,7 +63,8 @@ with final.pkgs.lib; let
|
||||||
jujutsu
|
jujutsu
|
||||||
fd
|
fd
|
||||||
];
|
];
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
nvim-pkg = mkNeovim {
|
nvim-pkg = mkNeovim {
|
||||||
plugins = all-plugins;
|
plugins = all-plugins;
|
||||||
appName = "nvim";
|
appName = "nvim";
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ vim.opt.expandtab = true -- insert tabs as spaces
|
||||||
vim.o.foldenable = true
|
vim.o.foldenable = true
|
||||||
vim.o.foldmethod = 'expr' -- use tree-sitter for folding method
|
vim.o.foldmethod = 'expr' -- use tree-sitter for folding method
|
||||||
vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||||
|
vim.o.foldlevelstart = 99
|
||||||
vim.opt.inccommand = 'split' -- incremental live completion
|
vim.opt.inccommand = 'split' -- incremental live completion
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well
|
vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well
|
||||||
|
|
@ -62,12 +63,14 @@ vim.diagnostic.config {
|
||||||
|
|
||||||
-- Allow basic deletion in qflist
|
-- Allow basic deletion in qflist
|
||||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
||||||
pattern = "qf",
|
pattern = 'qf',
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.keymap.set({ "n", "i" }, 'dd', function()
|
vim.keymap.set({ 'n', 'i' }, 'dd', function()
|
||||||
local ln = vim.fn.line('.')
|
local ln = vim.fn.line('.')
|
||||||
local qf = vim.fn.getqflist()
|
local qf = vim.fn.getqflist()
|
||||||
if #qf == 0 then return end
|
if #qf == 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
table.remove(qf, ln)
|
table.remove(qf, ln)
|
||||||
vim.fn.setqflist(qf, 'r')
|
vim.fn.setqflist(qf, 'r')
|
||||||
vim.cmd('copen')
|
vim.cmd('copen')
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ return {
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
enabled = function()
|
enabled = function()
|
||||||
return not vim.tbl_contains({ 'snacks_picker_input', 'oil' }, vim.bo.filetype)
|
return not vim.tbl_contains({ 'snacks_picker_input' }, vim.bo.filetype)
|
||||||
end,
|
end,
|
||||||
fuzzy = {
|
fuzzy = {
|
||||||
sorts = {
|
sorts = {
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ return {
|
||||||
content = {
|
content = {
|
||||||
active = function()
|
active = function()
|
||||||
local mode, mode_hl = MiniStatusline.section_mode {}
|
local mode, mode_hl = MiniStatusline.section_mode {}
|
||||||
local filename = MiniStatusline.section_filename { trunc_width = 140 }
|
-- local filename = MiniStatusline.section_filename { trunc_width = 140 }
|
||||||
local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 }
|
local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 }
|
||||||
local lsp = MiniStatusline.section_lsp { trunc_width = 75 }
|
local lsp = MiniStatusline.section_lsp { trunc_width = 75 }
|
||||||
local search = MiniStatusline.section_searchcount { trunc_width = 75 }
|
local search = MiniStatusline.section_searchcount { trunc_width = 75 }
|
||||||
|
|
@ -60,7 +60,7 @@ return {
|
||||||
'%<', -- Mark general truncate point
|
'%<', -- Mark general truncate point
|
||||||
-- { hl = 'MiniStatuslineFilename', strings = { filename } },
|
-- { hl = 'MiniStatuslineFilename', strings = { filename } },
|
||||||
'%=', -- End left alignment
|
'%=', -- End left alignment
|
||||||
{ hl = 'MiniStatuslineDevinfo', strings = { rec, diagnostics, lsp } },
|
{ hl = 'MiniStatuslineDevinfo', strings = { diagnostics, lsp } },
|
||||||
{ hl = 'MiniStatuslineDevinfo', strings = { search } },
|
{ hl = 'MiniStatuslineDevinfo', strings = { search } },
|
||||||
{ hl = mode_hl, strings = { mode } },
|
{ hl = mode_hl, strings = { mode } },
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +93,7 @@ return {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
require('mini.align').setup()
|
require('mini.align').setup()
|
||||||
require('mini.bracketed').setup()
|
require('mini.bracketed').setup { file = { suffix = 'm' } }
|
||||||
require('mini.icons').setup()
|
require('mini.icons').setup()
|
||||||
require('mini.git').setup()
|
require('mini.git').setup()
|
||||||
require('mini.surround').setup()
|
require('mini.surround').setup()
|
||||||
|
|
@ -159,23 +159,28 @@ return {
|
||||||
miniclue.gen_clues.z(),
|
miniclue.gen_clues.z(),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
local files = require('mini.files')
|
||||||
local map = require('mini.map')
|
files.setup {
|
||||||
map.setup {
|
mappings = {
|
||||||
symbols = {
|
go_in_plus = '<CR>',
|
||||||
scroll_line = '┃',
|
|
||||||
scroll_view = '',
|
|
||||||
},
|
},
|
||||||
integrations = {
|
windows = {
|
||||||
map.gen_integration.builtin_search(),
|
preview = true,
|
||||||
map.gen_integration.diagnostic(),
|
width_focus = 30,
|
||||||
map.gen_integration.diff(),
|
width_preview = 50,
|
||||||
},
|
|
||||||
window = {
|
|
||||||
show_integration_count = false,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
vim.keymap.set('n', '<leader>nm', map.toggle, { noremap = true, desc = 'minimap open' })
|
vim.keymap.set('n', '<leader>nc', files.open, { noremap = true, desc = 'minifiles open' })
|
||||||
|
vim.api.nvim_create_autocmd('User', {
|
||||||
|
pattern = 'MiniFilesBufferCreate',
|
||||||
|
callback = function(args)
|
||||||
|
vim.keymap.set('n', '`', function()
|
||||||
|
local cur_entry_path = MiniFiles.get_fs_entry().path
|
||||||
|
local cur_directory = vim.fs.dirname(cur_entry_path)
|
||||||
|
vim.fn.chdir(cur_directory)
|
||||||
|
end, { buffer = args.data.buf_id })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
local multi = require('mini.keymap').map_multistep
|
local multi = require('mini.keymap').map_multistep
|
||||||
multi({ 'i' }, '<BS>', { 'minipairs_bs' })
|
multi({ 'i' }, '<BS>', { 'minipairs_bs' })
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,4 @@
|
||||||
return {
|
return {
|
||||||
{
|
|
||||||
'stevearc/oil.nvim',
|
|
||||||
opts = {
|
|
||||||
watch_for_changes = true,
|
|
||||||
columns = {
|
|
||||||
'permissions',
|
|
||||||
'size',
|
|
||||||
},
|
|
||||||
view_options = {
|
|
||||||
show_hidden = true,
|
|
||||||
},
|
|
||||||
keymaps = {
|
|
||||||
['wq'] = 'actions.close',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
'<leader>nc',
|
|
||||||
function()
|
|
||||||
require('oil').toggle_float()
|
|
||||||
end,
|
|
||||||
{ noremap = true, silent = true, desc = 'oil' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
'jinh0/eyeliner.nvim',
|
'jinh0/eyeliner.nvim',
|
||||||
event = 'VeryLazy',
|
event = 'VeryLazy',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue