no more oil

This commit is contained in:
iofq 2025-07-05 20:36:06 -05:00
parent 285df2df53
commit d360f0e701
No known key found for this signature in database
GPG key ID: ECF3B2DA38BF7183
7 changed files with 97 additions and 127 deletions

19
flake.lock generated
View file

@ -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": {

110
flake.nix
View file

@ -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,57 +20,63 @@
# flake = false;
# };
};
outputs = inputs @ {
self,
nixpkgs,
flake-utils,
...
}: let
systems = builtins.attrNames nixpkgs.legacyPackages;
outputs =
inputs@{
self,
nixpkgs,
flake-utils,
...
}:
let
systems = builtins.attrNames nixpkgs.legacyPackages;
# This is where the Neovim derivation is built.
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
in
flake-utils.lib.eachSystem systems (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
inputs.neovim-nightly-overlay.overlays.default
neovim-overlay
# This adds a function can be used to generate a .luarc.json
# containing the Neovim API all plugins in the workspace directory.
# The generated file can be symlinked in the devShell's shellHook.
inputs.gen-luarc.overlays.default
];
};
shell = pkgs.mkShell {
name = "nvim-devShell";
buildInputs = with pkgs; [
lua-language-server
nil
stylua
luajitPackages.luacheck
alejandra
];
shellHook = ''
# symlink the .luarc.json generated in the overlay
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
# allow quick iteration of lua configs
ln -Tfns $PWD/nvim ~/.config/nvim-dev
'';
};
in {
packages = rec {
default = nvim;
nvim = pkgs.nvim-pkg;
nvim-min = pkgs.nvim-min-pkg;
nvim-dev = pkgs.nvim-dev;
};
devShells = {
default = shell;
};
})
# This is where the Neovim derivation is built.
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; };
in
flake-utils.lib.eachSystem systems (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
inputs.neovim-nightly-overlay.overlays.default
neovim-overlay
# This adds a function can be used to generate a .luarc.json
# containing the Neovim API all plugins in the workspace directory.
# The generated file can be symlinked in the devShell's shellHook.
inputs.gen-luarc.overlays.default
];
};
shell = pkgs.mkShell {
name = "nvim-devShell";
buildInputs = with pkgs; [
lua-language-server
nil
stylua
luajitPackages.luacheck
alejandra
];
shellHook = ''
# symlink the .luarc.json generated in the overlay
ln -fs ${pkgs.nvim-luarc-json} .luarc.json
# allow quick iteration of lua configs
ln -Tfns $PWD/nvim ~/.config/nvim-dev
'';
};
in
{
packages = rec {
default = nvim;
nvim = pkgs.nvim-pkg;
nvim-min = pkgs.nvim-min-pkg;
nvim-dev = pkgs.nvim-dev;
};
devShells = {
default = shell;
};
}
)
// {
overlays.default = neovim-overlay;
};

View file

@ -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";

View file

@ -4,10 +4,11 @@ vim.opt.confirm = true
vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
vim.opt.cmdheight = 1
vim.opt.diffopt = 'internal,filler,closeoff,inline:char'
vim.opt.expandtab = true -- insert tabs as spaces
vim.opt.expandtab = true -- insert tabs as spaces
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.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')

View file

@ -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 = {

View file

@ -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' })

View file

@ -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',