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"
|
||||
}
|
||||
},
|
||||
"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": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"gen-luarc": "gen-luarc",
|
||||
"mini-nvim": "mini-nvim",
|
||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"oil-nvim": "oil-nvim"
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
|
|
|
|||
22
flake.nix
22
flake.nix
|
|
@ -13,10 +13,6 @@
|
|||
url = "github:echasnovski/mini.nvim";
|
||||
flake = false;
|
||||
};
|
||||
oil-nvim = {
|
||||
url = "github:stevearc/oil.nvim";
|
||||
flake = false;
|
||||
};
|
||||
# Add bleeding-edge plugins here.
|
||||
# They can be updated with `nix flake update` (make sure to commit the generated flake.lock)
|
||||
# wf-nvim = {
|
||||
|
|
@ -24,18 +20,22 @@
|
|||
# flake = false;
|
||||
# };
|
||||
};
|
||||
outputs = inputs @ {
|
||||
outputs =
|
||||
inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
systems = builtins.attrNames nixpkgs.legacyPackages;
|
||||
|
||||
# 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
|
||||
flake-utils.lib.eachSystem systems (system: let
|
||||
flake-utils.lib.eachSystem systems (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
|
|
@ -64,7 +64,8 @@
|
|||
ln -Tfns $PWD/nvim ~/.config/nvim-dev
|
||||
'';
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
packages = rec {
|
||||
default = nvim;
|
||||
nvim = pkgs.nvim-pkg;
|
||||
|
|
@ -74,7 +75,8 @@
|
|||
devShells = {
|
||||
default = shell;
|
||||
};
|
||||
})
|
||||
}
|
||||
)
|
||||
// {
|
||||
overlays.default = neovim-overlay;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,18 +1,20 @@
|
|||
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
|
||||
{inputs}: final: prev:
|
||||
with final.pkgs.lib; let
|
||||
{ inputs }:
|
||||
final: prev:
|
||||
with final.pkgs.lib;
|
||||
let
|
||||
pkgs = final;
|
||||
pkgs-wrapNeovim = prev;
|
||||
|
||||
mkNvimPlugin = src: pname:
|
||||
mkNvimPlugin =
|
||||
src: pname:
|
||||
pkgs.vimUtils.buildVimPlugin {
|
||||
inherit pname src;
|
||||
version = src.lastModifiedDate;
|
||||
};
|
||||
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";
|
||||
oil-nvim-git = mkNvimPlugin inputs.oil-nvim "oil.nvim";
|
||||
|
||||
all-plugins = with pkgs.vimPlugins; [
|
||||
blink-cmp
|
||||
|
|
@ -31,7 +33,6 @@ with final.pkgs.lib; let
|
|||
nvim-treesitter-context
|
||||
nvim-treesitter-textobjects
|
||||
nvim-treesitter.withAllGrammars
|
||||
oil-nvim-git
|
||||
quicker-nvim
|
||||
refactoring-nvim
|
||||
render-markdown-nvim
|
||||
|
|
@ -62,7 +63,8 @@ with final.pkgs.lib; let
|
|||
jujutsu
|
||||
fd
|
||||
];
|
||||
in {
|
||||
in
|
||||
{
|
||||
nvim-pkg = mkNeovim {
|
||||
plugins = all-plugins;
|
||||
appName = "nvim";
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ vim.opt.expandtab = true -- insert tabs as spaces
|
|||
vim.o.foldenable = true
|
||||
vim.o.foldmethod = 'expr' -- use tree-sitter for folding method
|
||||
vim.o.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.o.foldlevelstart = 99
|
||||
vim.opt.inccommand = 'split' -- incremental live completion
|
||||
vim.opt.list = true
|
||||
vim.opt.nrformats:append('alpha') -- let Ctrl-a do letters as well
|
||||
|
|
@ -62,12 +63,14 @@ vim.diagnostic.config {
|
|||
|
||||
-- Allow basic deletion in qflist
|
||||
vim.api.nvim_create_autocmd({ 'FileType' }, {
|
||||
pattern = "qf",
|
||||
pattern = 'qf',
|
||||
callback = function()
|
||||
vim.keymap.set({ "n", "i" }, 'dd', function()
|
||||
vim.keymap.set({ 'n', 'i' }, 'dd', function()
|
||||
local ln = vim.fn.line('.')
|
||||
local qf = vim.fn.getqflist()
|
||||
if #qf == 0 then return end
|
||||
if #qf == 0 then
|
||||
return
|
||||
end
|
||||
table.remove(qf, ln)
|
||||
vim.fn.setqflist(qf, 'r')
|
||||
vim.cmd('copen')
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ return {
|
|||
},
|
||||
opts = {
|
||||
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,
|
||||
fuzzy = {
|
||||
sorts = {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ return {
|
|||
content = {
|
||||
active = function()
|
||||
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 lsp = MiniStatusline.section_lsp { trunc_width = 75 }
|
||||
local search = MiniStatusline.section_searchcount { trunc_width = 75 }
|
||||
|
|
@ -60,7 +60,7 @@ return {
|
|||
'%<', -- Mark general truncate point
|
||||
-- { hl = 'MiniStatuslineFilename', strings = { filename } },
|
||||
'%=', -- End left alignment
|
||||
{ hl = 'MiniStatuslineDevinfo', strings = { rec, diagnostics, lsp } },
|
||||
{ hl = 'MiniStatuslineDevinfo', strings = { diagnostics, lsp } },
|
||||
{ hl = 'MiniStatuslineDevinfo', strings = { search } },
|
||||
{ hl = mode_hl, strings = { mode } },
|
||||
}
|
||||
|
|
@ -93,7 +93,7 @@ return {
|
|||
},
|
||||
}
|
||||
require('mini.align').setup()
|
||||
require('mini.bracketed').setup()
|
||||
require('mini.bracketed').setup { file = { suffix = 'm' } }
|
||||
require('mini.icons').setup()
|
||||
require('mini.git').setup()
|
||||
require('mini.surround').setup()
|
||||
|
|
@ -159,23 +159,28 @@ return {
|
|||
miniclue.gen_clues.z(),
|
||||
},
|
||||
}
|
||||
|
||||
local map = require('mini.map')
|
||||
map.setup {
|
||||
symbols = {
|
||||
scroll_line = '┃',
|
||||
scroll_view = '',
|
||||
local files = require('mini.files')
|
||||
files.setup {
|
||||
mappings = {
|
||||
go_in_plus = '<CR>',
|
||||
},
|
||||
integrations = {
|
||||
map.gen_integration.builtin_search(),
|
||||
map.gen_integration.diagnostic(),
|
||||
map.gen_integration.diff(),
|
||||
},
|
||||
window = {
|
||||
show_integration_count = false,
|
||||
windows = {
|
||||
preview = true,
|
||||
width_focus = 30,
|
||||
width_preview = 50,
|
||||
},
|
||||
}
|
||||
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
|
||||
multi({ 'i' }, '<BS>', { 'minipairs_bs' })
|
||||
|
|
|
|||
|
|
@ -1,29 +1,4 @@
|
|||
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',
|
||||
event = 'VeryLazy',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue