98e5968
Branches > main > 98e5968 > files
Add nvim
Commit: 98e5968a0ddd1f6f40967b43596ce1e6991ef1ed
Parent: 0112da8
85 changed files:
.gitignore view file
@@ -1,2 +1,2 @@-*+/* !nvim/nvim/init.lua view file
@@ -0,0 +1,35 @@+vim.loader.enable()++require("colors")+require("ui")+require("center")++require("opts")+vim.schedule(function() require("keybindings") end)+++--- Still to do:+--- REPL (Conjure)+--- Parens (Parinfer)+--- Undotree+--- LSP+--- Formatting (better formatting anyway :p)+--- Surround?++--- Also:+--- Looking at java stuff (where does that come from and how could I improve it?)+--- Fuzzy finder (full screen like oil):+--- Fuzzy find file names+--- Fuzzy find inside files+--- Fuzzy find code actions++--- Paren Editing:+--- Could use s for bindings!++--- Bindings I'd want:+--- drag elements (or map pairs)+--- drag forms+--- Text object around form+--- Text object inner form+--- (insert?) before form+--- (insert?) after formnvim/lua/center.lua view file
@@ -0,0 +1,65 @@+--- Keeps the current line centered on the screen always,+--- including when at the top of a buffer.+--- It does this by adding a bunch of fake virtual lines above the first line of the buf,+--- and scrolling the screen to the correct place+local api = vim.api+local ac = vim.api.nvim_create_autocmd+local ag = vim.api.nvim_create_augroup+local fn = vim.fn++local ns = api.nvim_create_namespace("dev.grahp.nvim.padding_lines")++local function set_padding_lines(lines)+ api.nvim_buf_clear_namespace(0, ns, 0, -1)+ api.nvim_buf_set_extmark(0, ns, 0, 0, {+ virt_lines = lines,+ virt_lines_above = true+ })+end++--- Needed for first paint otherwise it'd be in utils :p+local function replicate(n, x)+ local tbl = {}+ if n > 0 then+ for i = 1, n do+ table.insert(tbl, x)+ end+ end+ return tbl+end++--- Centers the cursor on the screen+--- Normally, the screen cannot go above the first line of the buffer,+--- so this adds enough virtual lines above the top of the buffer to allow you to scroll past the top of the buffer+--- Centers the screen, and then feeds enough <C-y>s to scroll the cursor to the very center of the screen+--- If you're completely past the top of the buffer, just `zz` works and it won't scroll anything.+local function center()+ local win_height = api.nvim_win_get_height(0)+ local padding_lines = math.ceil(win_height / 2)++ local blank_line = {{""}}++ set_padding_lines(replicate(win_height, blank_line))++ local _, lnum, col, off, curswant = unpack(fn.getcurpos())+ --- TODO explain this schedule+ vim.schedule(function()+ vim.cmd("norm! zz")++ local line_number = fn.line(".")+ local offset = padding_lines - line_number + 1+ if offset > 0 then+ vim.cmd("norm! " .. offset .. "")+ end++ -- Reset cursor back to the column it was at before+ fn.cursor({vim.fn.getcurpos()[2], col, off, curswant})+ end)+end++--- When moving the cursor, entering a buffer, etc., center the screen+ag("TopPad", {clear = true})+ac({ "BufWinEnter", "BufEnter", "WinResized", "WinScrolled", "CursorMoved", "CursorMovedI"}, {+ group = "TopPad",+ callback = center,+})nvim/lua/colors.lua view file
@@ -0,0 +1,138 @@+--- Grahp's colorscheme+--- Colors from https://github.com/bluz71/vim-moonfly-colors :).++local hl = vim.api.nvim_set_hl+--- Colorscheme++--- Comments: Yellow+--- Punctuation: Gray+--- Globals: Blue+--- Strings: Green+--- Numbers: Orange+--- Identifiers: Pink+--- Booleans: Red+--- Also special: Red?++local red = "#ff5d5d"+local orange = "#de935f"+--- Less tanny more greeny I think?+local yellow = "#c6c684"+local blue = "#74b2ff"+--- Slightly darker+local green = "#36c692"+local pink = "#cf87e8"++local black = "#000000"+local gray = "#4e4e4e"+local white = "#ffffff"++local bg = black+local highlight_bg = "#323437"++hl(0, "Red", {fg = red, bg = bg})+hl(0, "Orange", {fg = orange, bg = bg})+hl(0, "Blue", {fg = blue, bg = bg})+hl(0, "Green", {fg = green, bg = bg})+hl(0, "Pink", {fg = pink, bg = bg})+hl(0, "Yellow", {fg = yellow, bg = bg})++hl(0, "White", {fg = white, bg = bg})+hl(0, "Gray", {fg = gray, bg = bg})++hl(0, "Punctuation", {link = "Gray"})+hl(0, "Delimiter", {link = "Punctuation"})++hl(0, "Comment", {link = "Yellow"})+hl(0, "String", {link = "Green"})+hl(0, "Boolean", {link = "Red"})+hl(0, "Function", {link = "Blue"})+hl(0, "Number", {link = "Orange"})+++hl(0, "Special", {link = "White"})++hl(0, "Statement", {link = "Pink"})+hl(0, "Identifier", {link = "Pink"})+hl(0, "Type", {link = "Green"})++--- Vim stuff++-- Background color+hl(0, "Normal", {bg = bg})+hl(0, "NormalFloat", {link = "Normal"})++hl(0, "Search", {bg = highlight_bg})+hl(0, "CurSearch", {link = "Search"})+hl(0, "IncSearch", {link = "Search"})++hl(0, "StatusLine", {bg = highlight_bg, fg = white})+hl(0, "StatusLineNC", {link = "StatusLine"})+hl(0, "StatusLineTerm", {link = "StatusLine"})+hl(0, "StatusLineTermNC", {link = "StatusLine"})+hl(0, "TabLine", {link = "StatusLine"})+hl(0, "TabLineSel", {bg = gray, fg = white})+hl(0, "TabLineSelSymbol", {link = "TablineSel"})+hl(0, "TabLineFill", {link = "DarkGray"})++hl(0, "Visual", {bg = highlight_bg})+hl(0, "MatchParen", {link = "Visual"})++hl(0, "Error", {link = "Red"})+hl(0, "ErrorMsg", {link = "Red"})+hl(0, "WarningMsg", {link = "Yellow"})++hl(0, "VertSplit", {fg = gray, bg = gray})+hl(0, "VisualNOS", {link = "Visual"})+hl(0, "VisualNonText", {bg = gray, fg = gray})+hl(0, "Pmenu", {link = "White"})+hl(0, "PmenuSel", {link = "Visual"})+hl(0, "PmenuSbar", {link = "Gray"})+hl(0, "PmenuThumb", {link = "Gray"})+hl(0, "WildMenu", {link = "White"})+hl(0, "SpellBad", {bg = "NONE", undercurl = true, sp = red})+hl(0, "SpellCap", {bg = "NONE", undercurl = true, sp = yellow})+hl(0, "SpellRare", {bg = "NONE", undercurl = true, sp = green})+hl(0, "SpellLocal", {bg = "NONE", undercurl = true, sp = blue})+hl(0, "Question", {link = "Lime"})+hl(0, "MoreMsg", {link = "Red"})+hl(0, "Cursor", {fg = bg, bg = gray})+hl(0, "lCursor", {link = "Cursor"})nvim/lua/format.lua view file
@@ -0,0 +1,12 @@+local ac = vim.api.nvim_create_autocmd+local ag = vim.api.nvim_create_augroup++local function format(cmd)+ vim.schedule(function() vim.cmd("silent !" .. cmd .. " %") end)+end++local format_group = ag("Format", {clear = true})+ac("BufWritePost",+ {callback = function() format("cljfmt fix") end,+ group = format_group,+ pattern = "*.clj"})nvim/lua/jump.lua view file
@@ -0,0 +1,229 @@+local ns = vim.api.nvim_create_namespace("dev.grahp.nvim.jump")+local utils = require("utils")++--- Name meanings:+--- Jump target: Somewhere you can jump to - Union of Match and table of optional Disambiguator+--- Disambiguator: A third character used to differentiate jump targets when there are multiple+--- Match: Union Pos and a table of Char+--- Row: The number of lines into the buffer line is? (0-based?) TODO rename?+--- Col: The number of characters into the line? (1-based?)+--- Pos: table of row, col+--- Char: A character used for jumping, entered by the user+--- Label: A hint painted to the screen to show where jump targets are, and what disambiguator you might need to press++--- ALL CAPS++--- Blocks and reads one char of user input.+--- Returns the char or nil+local function read_char()+ local char = vim.fn.getcharstr()+ if char == "" then+ return nil+ else+ return char+ end+end++local function smart_case_find_index(s, pattern, pos)+ if not pattern:match("%u") then+ s = s:lower()+ end++ local match_start, match_end = string.find(s, pattern, pos, true)+ if match_start and match_end then+ return match_end+ end+end++local function string_get(s, i)+ return s:sub(i, i)+end+++local function lines()+ local bufnr = vim.api.nvim_get_current_buf()+ return vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)+end++--- Returns all matches on the screen that start with "char".+local function find_matches(char)+ local lines = lines()++ local out = {}++ local start_line = vim.fn.line("w0")+ local end_line = vim.fn.line("w$")++ for row, line in ipairs(lines) do+ -- I miss filter lol+ if row >= start_line and row <= end_line then+ local i = 1++ while true do+ local pos = smart_case_find_index(line, char, i)+ if not pos then+ break+ end++ local char = string_get(line, pos + 1)+ if char then+ table.insert(out, {row = row,+ col = pos,+ char = char})+ end++ i = pos + 1+ end+ end+ end++ return out+end++--- Returns a table of chars to the number of times those chars appear in the entire table of matches+--- All matches will map to at least 1 and will not be nil.+local function char_counts(matches)+ local counts = {}+ for _, m in ipairs(matches) do+ local char = m.char:lower()+ counts[char] = (counts[char] or 0) + 1+ end+ return counts+end++--- Takes a table of matches and adds a unique disambiguator to each match+--- If a match's char is unique across the entire matches table,+--- the match will have no diambiguator, otherwise it will be picked from 'disambiguators' (a table of disambiguators)+--- May return fewer matches than provided if all disambiguators are exhausted+local function assign_disambiguators(matches, disambiguators)+ local next_disambiguator = utils.seq_iterator(disambiguators)nvim/lua/keybindings.lua view file
@@ -0,0 +1,85 @@+local keymap = vim.keymap.set++keymap("n", "<C-h>", "<C-w><C-h>")+keymap("n", "<C-l>", "<C-w><C-l>")+keymap("n", "<C-j>", "<C-w><C-j>")+keymap("n", "<C-k>", "<C-w><C-k>")++keymap("n", "U", "<C-r>")++keymap({"n", "v"}, "<C-left>", "b")+keymap({"n", "v"}, "<C-right>", "w")++keymap({"n", "v", "o"}, "H", "_")+keymap({"n", "v", "o"}, "L", "$")++keymap({"n", "v"}, "<Space>y", "\"+y")+keymap({"n", "v"}, "<Space>p", "\"+p")+keymap({"n", "v"}, "<Space>P", "\"+P")+keymap({"n", "v"}, "<Space>d", "\"+d")++keymap({"n", "v", "o"}, "J", "<C-d>")+keymap({"n", "v", "o"}, "K", "<C-u>")++keymap({"n", "v"}, "<C-d>", "<Nop>")+keymap({"n", "v"}, "<C-u>", "<Nop>")++keymap({"n", "v"}, "j", "gj")+keymap({"n", "v"}, "k", "gk")++keymap({"n", "v"}, "<Space>j", "J")++keymap("n", "<Esc>", "<CMD>noh<CR>")++keymap("n", "<Space>u", function()+ vim.cmd("packadd oil.nvim")+ require("oil").setup({skip_confirm_for_simple_edits = true,+ default_file_explorer = true,+ watch_for_changes = true,+ view_options = {show_hidden = true}})+ vim.cmd("Oil")+ keymap("n", "<Space>u", "<cmd>Oil<cr>")+end)++keymap("n", ";", function() require("jump").jump() end)++--- Either nil, "f/t", or "space"+local last_n_type = nil++vim.api.nvim_create_autocmd("CmdlineLeave", {+ callback = function()+ local t = vim.fn.getcmdtype()+ if t == "/" or t == "?" then+ last_n_type = "search"+ end+ end})++for _, key in ipairs({"f", "F", "t", "T"}) do+ vim.keymap.set({"n", "x", "o"}, key, function()+ last_n_type = "f/t"+ return key+ end, {expr = true, noremap = true})+end+++local function smart_n(reverse)+ if last_n_type == nil then+ return ""+ elseif last_n_type == "f/t" then+ local cs = vim.fn.getcharsearch()+ if reverse then+ return cs.forward == 1 and "," or ";"+ else+ return cs.forward == 1 and ";" or ","+ end+ elseif last_n_type == "search" then+ if reverse then+ return vim.v.searchforward == 1 and "N" or "n"+ else+ return vim.v.searchforward == 1 and "n" or "N"+ end+ end+end++vim.keymap.set({"n", "v", "o"}, "n", function() return smart_n(false) end, {expr = true, noremap = true})+vim.keymap.set({"n", "v", "o"}, "N", function() return smart_n(true) end, {expr = true, noremap = true})nvim/lua/opts.lua view file
@@ -0,0 +1,28 @@+local o = vim.opt+local g = vim.g+local ac = vim.api.nvim_create_autocmd+local ag = vim.api.nvim_create_augroup++g.loaded_netrw = 1+g.loaded_netrwPlugin = 1++o.shiftwidth = 2+o.tabstop = 2+o.softtabstop = 2+o.expandtab = true++o.swapfile = false+o.backup = false+o.undofile = true++--- Prevents o/<CR> on comments from starting a new comment+ac("Filetype", {pattern = "*", callback = function()+ o.formatoptions = ""+end})++--- Completion+o.completeopt = {"menu", "menuone", "fuzzy"}++--- Loads shada after initialization :p+o.shada = ""+vim.schedule(function() vim.cmd("rshada") end)nvim/lua/ui.lua view file
@@ -0,0 +1,25 @@+o = vim.opt++--- Disables the welcome screen :p+o.shortmess:append("I")++--- Turns the command line into 0 ch tall and only shows on ':'+o.laststatus = 0+o.cmdheight = 0+o.showcmd = false++o.signcolumn = "no"+o.ruler = false+--- Search+o.hlsearch = false+o.incsearch = true+o.ignorecase = true+o.smartcase = true++o.list = true+o.listchars = {tab = "» ", nbsp = "␣"}++o.wrap = false+o.inccommand = "split"++o.fillchars = {eob = " "}nvim/lua/utils.lua view file
@@ -0,0 +1,9 @@+local function seq_iterator(t)+ local i = 0+ return function()+ i = i + 1+ return t[i]+ end+end++return {seq_iterator = seq_iterator}nvim/pack/plugins/opt/oil.nvim/.envrc view file
@@ -0,0 +1,3 @@+export VIRTUAL_ENV=venv+layout python+python -c 'import pyparsing' 2>/dev/null || pip install -r scripts/requirements.txtnvim/pack/plugins/opt/oil.nvim/.luacheckrc view file
@@ -0,0 +1,19 @@+max_comment_line_length = false+codes = true++exclude_files = {+ "tests/treesitter",+}++ignore = {+ "212", -- Unused argument+ "631", -- Line is too long+ "122", -- Setting a readonly global+ "542", -- Empty if branch+}++read_globals = {+ "vim",+ "a",+ "assert",+}nvim/pack/plugins/opt/oil.nvim/.luarc.json view file
@@ -0,0 +1,9 @@+{+ "runtime": {+ "version": "LuaJIT",+ "pathStrict": true+ },+ "type": {+ "checkTableShape": true+ }+}nvim/pack/plugins/opt/oil.nvim/.stylua.toml view file
@@ -0,0 +1,5 @@+column_width = 100+indent_type = "Spaces"+indent_width = 2+[sort_requires]+enabled = truenvim/pack/plugins/opt/oil.nvim/CHANGELOG.md view file
@@ -0,0 +1,530 @@+# Changelog++## [2.15.0](https://github.com/stevearc/oil.nvim/compare/v2.14.0...v2.15.0) (2025-02-13)+++### Features++* add support for bufnr in column rendering functions ([#575](https://github.com/stevearc/oil.nvim/issues/575)) ([8abc58b](https://github.com/stevearc/oil.nvim/commit/8abc58b038f84078121ab1cac6ecad0163fe1635))+* API to automatically open preview window after opening oil ([#339](https://github.com/stevearc/oil.nvim/issues/339)) ([57528bf](https://github.com/stevearc/oil.nvim/commit/57528bf9c58080ca891e8d362d0a578895c136ce))+* can selectively add entries to quickfix ([#564](https://github.com/stevearc/oil.nvim/issues/564)) ([b594b9a](https://github.com/stevearc/oil.nvim/commit/b594b9a9052618669ccf6520b2d0c0d942eb8118))+* floating window max width/height can be percentages ([#553](https://github.com/stevearc/oil.nvim/issues/553)) ([1df90fa](https://github.com/stevearc/oil.nvim/commit/1df90faf927e78f5aacf278abd0bfdcb5f45e825))+* most moves and copies will copy the undofile ([#583](https://github.com/stevearc/oil.nvim/issues/583)) ([32dd3e3](https://github.com/stevearc/oil.nvim/commit/32dd3e378d47673679e76a773451f82f971a66df))+* pass oil bufnr to custom filename highlight function ([#552](https://github.com/stevearc/oil.nvim/issues/552)) ([f5c563a](https://github.com/stevearc/oil.nvim/commit/f5c563a074a38cee5a09f98e98b74dcd2c322490))+++### Bug Fixes++* crash in preview on nvim 0.8 ([81b2c5f](https://github.com/stevearc/oil.nvim/commit/81b2c5f04ae24a8c83b20ecbd017fecac15faca0))+* directory rendering with custom highlights ([#551](https://github.com/stevearc/oil.nvim/issues/551)) ([a6a4f48](https://github.com/stevearc/oil.nvim/commit/a6a4f48b14b4a51fded531c86f6c04b4503a2ef8))+* disable_preview respected when preview_method != "load" ([#577](https://github.com/stevearc/oil.nvim/issues/577)) ([7cde5aa](https://github.com/stevearc/oil.nvim/commit/7cde5aab10f564408e9ac349d457d755422d58cd))+* error when non-current oil buffer has validation errors ([#561](https://github.com/stevearc/oil.nvim/issues/561)) ([8d11a2a](https://github.com/stevearc/oil.nvim/commit/8d11a2abf3039b1974d4acd65fbc83ada2ca1084))+* gracefully handle fs_stat failures ([#558](https://github.com/stevearc/oil.nvim/issues/558)) ([7c26a59](https://github.com/stevearc/oil.nvim/commit/7c26a59ac0061b199bf9f44b19d45cfadd9b14f5))+* guard against nil metadata values ([#548](https://github.com/stevearc/oil.nvim/issues/548)) ([254bc66](https://github.com/stevearc/oil.nvim/commit/254bc6635cb3f77e6e9a89155652f368e5535160))+* more consistent cursor position when entering a new directory ([#536](https://github.com/stevearc/oil.nvim/issues/536)) ([c80fa5c](https://github.com/stevearc/oil.nvim/commit/c80fa5c415b882c1c694a32748cea09b7dafc2c5))+* more robust parsing of custom column timestamp formats ([#582](https://github.com/stevearc/oil.nvim/issues/582)) ([5313690](https://github.com/stevearc/oil.nvim/commit/5313690956d27cc6b53d5a2583df05e717c59b16))+* open files in correct window from floating oil ([#560](https://github.com/stevearc/oil.nvim/issues/560)) ([83ac518](https://github.com/stevearc/oil.nvim/commit/83ac5185f79ab8d869bccea792dc516ad02ad06e))+* preview sometimes causes oil buffers to be stuck in unloaded state ([#563](https://github.com/stevearc/oil.nvim/issues/563)) ([1488f0d](https://github.com/stevearc/oil.nvim/commit/1488f0d96b1cb820dd12f05a7bf5283a631a7c4d))+* stat files if fs_readdir doesn't provide a type ([#543](https://github.com/stevearc/oil.nvim/issues/543)) ([c6a39a6](https://github.com/stevearc/oil.nvim/commit/c6a39a69b2df7c10466f150dde0bd23e49c1fba3))+* support permissions checks on windows and virtual filesystems ([#555](https://github.com/stevearc/oil.nvim/issues/555)) ([7041528](https://github.com/stevearc/oil.nvim/commit/7041528bdedb350ad66e650684deec8456e053cc))+* work around incorrect link detection on windows ([#557](https://github.com/stevearc/oil.nvim/issues/557)) ([09fa1d2](https://github.com/stevearc/oil.nvim/commit/09fa1d22f5edf0730824d2b222d726c8c81bbdc9))++## [2.14.0](https://github.com/stevearc/oil.nvim/compare/v2.13.0...v2.14.0) (2024-12-21)+++### Features++* add `win_options` to `preview_win` ([#514](https://github.com/stevearc/oil.nvim/issues/514)) ([bbeed86](https://github.com/stevearc/oil.nvim/commit/bbeed86bde134da8d09bed64b6aa0d65642e6b23))+* add highlight group for orphaned links ([#502](https://github.com/stevearc/oil.nvim/issues/502)) ([740b8fd](https://github.com/stevearc/oil.nvim/commit/740b8fd425a2b77f7f40eb5ac155ebe66ff9515c))+* better merging of action desc when overriding keymaps ([f2b3249](https://github.com/stevearc/oil.nvim/commit/f2b324933f4d505cff6f7d445fd61fad02dcd9ae))+* config option to customize filename highlight group ([#508](https://github.com/stevearc/oil.nvim/issues/508)) ([99ce32f](https://github.com/stevearc/oil.nvim/commit/99ce32f4a2ecf76263b72fcc31efb163faa1a941))+* config option to disable previewing a file ([3fa3161](https://github.com/stevearc/oil.nvim/commit/3fa3161aa9515ff6a7cf7e44458b6a2114262870))+* disable preview for large files ([#511](https://github.com/stevearc/oil.nvim/issues/511)) ([c23fe08](https://github.com/stevearc/oil.nvim/commit/c23fe08e0546d9efc242e19f0d829efa7e7b2743))+* highlight groups for hidden files ([#459](https://github.com/stevearc/oil.nvim/issues/459)) ([60e6896](https://github.com/stevearc/oil.nvim/commit/60e68967e51ff1ecd264c29e3de0d52bfff22df3))+* option to quite vim if oil is closed as last buffer ([#491](https://github.com/stevearc/oil.nvim/issues/491)) ([81cc9c3](https://github.com/stevearc/oil.nvim/commit/81cc9c3f62ddbef3687931d119e505643496fa0a))+* use scratch buffer for file previews ([#467](https://github.com/stevearc/oil.nvim/issues/467)) ([21705a1](https://github.com/stevearc/oil.nvim/commit/21705a1debe6d85a53c138ab944484b685432b2b))+++### Bug Fixes++* cursor sometimes does not hover previous file ([8ea40b5](https://github.com/stevearc/oil.nvim/commit/8ea40b5506115b6d355e304dd9ee5089f7d78601))+* don't take over the preview window until it's opened for oil ([#532](https://github.com/stevearc/oil.nvim/issues/532)) ([78ab7ca](https://github.com/stevearc/oil.nvim/commit/78ab7ca1073731ebdf82efa474202defa028d5a4))+* handle files with newlines in the name ([#534](https://github.com/stevearc/oil.nvim/issues/534)) ([dba0375](https://github.com/stevearc/oil.nvim/commit/dba037598843973b8c54bc5ce0318db4a0da439d))+* image.nvim previews with preview_method=scratch ([5acab3d](https://github.com/stevearc/oil.nvim/commit/5acab3d8a9bc85a571688db432f2702dd7d901a4))+* improper file name escaping ([#530](https://github.com/stevearc/oil.nvim/issues/530)) ([7a55ede](https://github.com/stevearc/oil.nvim/commit/7a55ede5e745e31ea8e4cb5483221524922294bf))+* set alternate when using floating windows ([#526](https://github.com/stevearc/oil.nvim/issues/526)) ([c5f7c56](https://github.com/stevearc/oil.nvim/commit/c5f7c56644425e2b77e71904da98cda0331b3342))+* work around performance issue with treesitter, folds, and large directories ([da93d55](https://github.com/stevearc/oil.nvim/commit/da93d55e32d73a17c447067d168d80290ae96590))+++### Performance Improvements++* change default view_options.natural_order behavior to disable on large directories ([01b0b9d](https://github.com/stevearc/oil.nvim/commit/01b0b9d8ef79b7b631e92f6b5fed1c639262d570))+* only sort entries after we have them all ([792f0db](https://github.com/stevearc/oil.nvim/commit/792f0db6ba8b626b14bc127e1ce7247185b3be91))+* optimize rendering cadence ([c96f93d](https://github.com/stevearc/oil.nvim/commit/c96f93d894cc97e76b0871bec4058530eee8ece4))+* replace vim.endswith and vim.startswith with string.match ([4de3025](https://github.com/stevearc/oil.nvim/commit/4de30256c32cd272482bc6df0c6de78ffc389153))++## [2.13.0](https://github.com/stevearc/oil.nvim/compare/v2.12.2...v2.13.0) (2024-11-11)+++### Features++* config option to customize floating window title ([#482](https://github.com/stevearc/oil.nvim/issues/482)) ([5d2dfae](https://github.com/stevearc/oil.nvim/commit/5d2dfae655b9b689bd4017b3bdccd52cbee5b92f))+* config option to disable lsp file methods ([#477](https://github.com/stevearc/oil.nvim/issues/477)) ([f60bb7f](https://github.com/stevearc/oil.nvim/commit/f60bb7f793477d99ef1acf39e920bf2ca4e644de))+++### Bug Fixes++* actions.preview accepts options ([#497](https://github.com/stevearc/oil.nvim/issues/497)) ([cca1631](https://github.com/stevearc/oil.nvim/commit/cca1631d5ea450c09ba72f3951a9e28105a3632c))+* add trailing slash to directories on yank_entry ([#504](https://github.com/stevearc/oil.nvim/issues/504)) ([42333bb](https://github.com/stevearc/oil.nvim/commit/42333bb46e34dd47e13927010b1dcd30e6e4ca96))+* don't deep merge keymaps ([#510](https://github.com/stevearc/oil.nvim/issues/510)) ([709403c](https://github.com/stevearc/oil.nvim/commit/709403ccd6f22d859c2e42c780ab558ae89284d9))+* guard against nil keymaps ([621f8ba](https://github.com/stevearc/oil.nvim/commit/621f8ba4fa821724e9b646732a26fb2e795fe008))+* only map ~ for normal mode ([#484](https://github.com/stevearc/oil.nvim/issues/484)) ([ccab9d5](https://github.com/stevearc/oil.nvim/commit/ccab9d5e09e2d0042fbbe5b6bd05e82426247067))+* sort keymap help entries by description ([#506](https://github.com/stevearc/oil.nvim/issues/506)) ([52cc8a1](https://github.com/stevearc/oil.nvim/commit/52cc8a1fb35ea6ce1df536143add7ce7215c63c0)), closes [#376](https://github.com/stevearc/oil.nvim/issues/376)++## [2.12.2](https://github.com/stevearc/oil.nvim/compare/v2.12.1...v2.12.2) (2024-09-10)+++### Bug Fixes++* ensure win_options are being set on correct window ([#469](https://github.com/stevearc/oil.nvim/issues/469)) ([30e0438](https://github.com/stevearc/oil.nvim/commit/30e0438ff08f197d7ce4a417445ab97ee72efe2d))+* wrap git rm callback in schedule_wrap ([#475](https://github.com/stevearc/oil.nvim/issues/475)) ([b053744](https://github.com/stevearc/oil.nvim/commit/b05374428e5136d9b6c8e1e8e62a75f82283b1f8))+++### Performance Improvements+nvim/pack/plugins/opt/oil.nvim/LICENSE view file
@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2022 Steven Arcangeli++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.nvim/pack/plugins/opt/oil.nvim/Makefile view file
@@ -0,0 +1,66 @@+## help: print this help message+.PHONY: help+help:+ @echo 'Usage:'+ @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'++## all: generate docs, lint, and run tests+.PHONY: all+all: doc lint test++venv:+ python3 -m venv venv+ venv/bin/pip install -r scripts/requirements.txt++## doc: generate documentation+.PHONY: doc+doc: scripts/nvim_doc_tools venv+ venv/bin/python scripts/main.py generate+ venv/bin/python scripts/main.py lint++## test: run tests+.PHONY: test+test:+ ./run_tests.sh++## lint: run linters and LuaLS typechecking+.PHONY: lint+lint: scripts/nvim-typecheck-action fastlint+ ./scripts/nvim-typecheck-action/typecheck.sh --workdir scripts/nvim-typecheck-action lua++## fastlint: run only fast linters+.PHONY: fastlint+fastlint: scripts/nvim_doc_tools venv+ venv/bin/python scripts/main.py lint+ luacheck lua tests --formatter plain+ stylua --check lua tests++## profile: use LuaJIT profiler to profile the plugin+.PHONY: profile+profile: scripts/benchmark.nvim+ nvim --clean -u perf/bootstrap.lua -c 'lua jit_profile()'++## flame_profile: create a trace in the chrome profiler format+.PHONY: flame_profile+flame_profile: scripts/benchmark.nvim+ nvim --clean -u perf/bootstrap.lua -c 'lua flame_profile()'++## benchmark: benchmark performance opening directory with many files+.PHONY: benchmark+benchmark: scripts/benchmark.nvim+ nvim --clean -u perf/bootstrap.lua -c 'lua benchmark()'+ @cat perf/tmp/benchmark.txt++scripts/nvim_doc_tools:+ git clone https://github.com/stevearc/nvim_doc_tools scripts/nvim_doc_tools++scripts/nvim-typecheck-action:+ git clone https://github.com/stevearc/nvim-typecheck-action scripts/nvim-typecheck-action++scripts/benchmark.nvim:+ git clone https://github.com/stevearc/benchmark.nvim scripts/benchmark.nvim++## clean: reset the repository to a clean state+.PHONY: clean+clean:+ rm -rf scripts/nvim_doc_tools scripts/nvim-typecheck-action venv .testenv perf/tmp profile.jsonnvim/pack/plugins/opt/oil.nvim/README.md view file
@@ -0,0 +1,448 @@+# oil.nvim++A [vim-vinegar](https://github.com/tpope/vim-vinegar) like file explorer that lets you edit your filesystem like a normal Neovim buffer.++https://user-images.githubusercontent.com/506791/209727111-6b4a11f4-634a-4efa-9461-80e9717cea94.mp4++<!-- TOC -->++- [Requirements](#requirements)+- [Installation](#installation)+- [Quick start](#quick-start)+- [Options](#options)+- [Adapters](#adapters)+- [Recipes](#recipes)+- [Third-party extensions](#third-party-extensions)+- [API](#api)+- [FAQ](#faq)++<!-- /TOC -->++## Requirements++- Neovim 0.8++- Icon provider plugin (optional)+ - [mini.icons](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-icons.md) for file and folder icons+ - [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) for file icons++## Installation++oil.nvim supports all the usual plugin managers++<details>+ <summary>lazy.nvim</summary>++```lua+{+ 'stevearc/oil.nvim',+ ---@module 'oil'+ ---@type oil.SetupOpts+ opts = {},+ -- Optional dependencies+ dependencies = { { "nvim-mini/mini.icons", opts = {} } },+ -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons+ -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.+ lazy = false,+}+```++</details>++<details>+ <summary>Packer</summary>++```lua+require("packer").startup(function()+ use({+ "stevearc/oil.nvim",+ config = function()+ require("oil").setup()+ end,+ })+end)+```++</details>++<details>+ <summary>Paq</summary>++```lua+require("paq")({+ { "stevearc/oil.nvim" },+})+```++</details>++<details>+ <summary>vim-plug</summary>++```vim+Plug 'stevearc/oil.nvim'+```++</details>++<details>+ <summary>dein</summary>++```vim+call dein#add('stevearc/oil.nvim')+```++</details>++<details>+ <summary>Pathogen</summary>++```sh+git clone --depth=1 https://github.com/stevearc/oil.nvim.git ~/.vim/bundle/+```++</details>++<details>+ <summary>Neovim native package</summary>++```sh+git clone --depth=1 https://github.com/stevearc/oil.nvim.git \+ "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/oil/start/oil.nvim+```++</details>++## Quick start++Add the following to your init.lua++```lua+require("oil").setup()+```++Then open a directory with `nvim .`. Use `<CR>` to open a file/directory, and `-` to go up a directory. Otherwise, just treat it like a normal buffer and make changes as you like. Remember to `:w` when you're done to actually perform the actions.++If you want to mimic the `vim-vinegar` method of navigating to the parent directory of a file, add this keymap:++```lua+vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })+```++You can open a directory with `:edit <path>` or `:Oil <path>`. To open oil in a floating window, do `:Oil --float <path>`.++## Options++```lua+require("oil").setup({+ -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)+ -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories.+ default_file_explorer = true,+ -- Id is automatically added at the beginning, and name at the end+ -- See :help oil-columns+ columns = {+ "icon",+ -- "permissions",+ -- "size",+ -- "mtime",+ },+ -- Buffer-local options to use for oil buffers+ buf_options = {+ buflisted = false,+ bufhidden = "hide",+ },+ -- Window-local options to use for oil buffers+ win_options = {+ wrap = false,+ signcolumn = "no",+ cursorcolumn = false,+ foldcolumn = "0",+ spell = false,+ list = false,+ conceallevel = 3,+ concealcursor = "nvic",+ },+ -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)+ delete_to_trash = false,+ -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)+ skip_confirm_for_simple_edits = false,+ -- Selecting a new/moved/renamed file or directory will prompt you to save changes first+ -- (:help prompt_save_on_select_new_entry)+ prompt_save_on_select_new_entry = true,+ -- Oil will automatically delete hidden buffers after this delay+ -- You can set the delay to false to disable cleanup entirely+ -- Note that the cleanup process only starts when none of the oil buffers are currently displayed+ cleanup_delay_ms = 2000,+ lsp_file_methods = {+ -- Enable or disable LSP file operations+ enabled = true,+ -- Time to wait for LSP file operations to complete before skipping+ timeout_ms = 1000,+ -- Set to true to autosave buffers that are updated with LSP willRenameFiles+ -- Set to "unmodified" to only save unmodified buffers+ autosave_changes = false,+ },+ -- Constrain the cursor to the editable parts of the oil buffer+ -- Set to `false` to disable, or "name" to keep it on the file names+ constrain_cursor = "editable",+ -- Set to true to watch the filesystem for changes and reload oil+ watch_for_changes = false,+ -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap+ -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })+ -- Additionally, if it is a string that matches "actions.<name>",+ -- it will use the mapping at require("oil.actions").<name>+ -- Set to `false` to remove a keymap+ -- See :help oil-actions for a list of all available actions+ keymaps = {+ ["g?"] = { "actions.show_help", mode = "n" },+ ["<CR>"] = "actions.select",+ ["<C-s>"] = { "actions.select", opts = { vertical = true } },+ ["<C-h>"] = { "actions.select", opts = { horizontal = true } },+ ["<C-t>"] = { "actions.select", opts = { tab = true } },+ ["<C-p>"] = "actions.preview",+ ["<C-c>"] = { "actions.close", mode = "n" },+ ["<C-l>"] = "actions.refresh",+ ["-"] = { "actions.parent", mode = "n" },+ ["_"] = { "actions.open_cwd", mode = "n" },+ ["`"] = { "actions.cd", mode = "n" },+ ["g~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },+ ["gs"] = { "actions.change_sort", mode = "n" },+ ["gx"] = "actions.open_external",+ ["g."] = { "actions.toggle_hidden", mode = "n" },+ ["g\\"] = { "actions.toggle_trash", mode = "n" },+ },+ -- Set to false to disable all of the above keymaps+ use_default_keymaps = true,+ view_options = {+ -- Show files and directories that start with "."+ show_hidden = false,+ -- This function defines what is considered a "hidden" file+ is_hidden_file = function(name, bufnr)+ local m = name:match("^%.")+ return m ~= nil+ end,+ -- This function defines what will never be shown, even when `show_hidden` is set+ is_always_hidden = function(name, bufnr)+ return false+ end,+ -- Sort file names with numbers in a more intuitive order for humans.+ -- Can be "fast", true, or false. "fast" will turn it off for large directories.+ natural_order = "fast",+ -- Sort file and directory names case insensitive+ case_insensitive = false,+ sort = {+ -- sort order can be "asc" or "desc"+ -- see :help oil-columns to see which columns are sortable+ { "type", "asc" },+ { "name", "asc" },+ },+ -- Customize the highlight group for the file name+ highlight_filename = function(entry, is_hidden, is_link_target, is_link_orphan)+ return nil+ end,+ },+ -- Extra arguments to pass to SCP when moving/copying files over SSH+ extra_scp_args = {},+ -- Extra arguments to pass to aws s3 when creating/deleting/moving/copying files using aws s3+ extra_s3_args = {},+ -- EXPERIMENTAL support for performing file operations with git+ git = {+ -- Return true to automatically git add/mv/rm files+ add = function(path)+ return false+ end,+ mv = function(src_path, dest_path)+ return false+ end,+ rm = function(path)+ return false+ end,+ },+ -- Configuration for the floating window in oil.open_float+ float = {+ -- Padding around the floating window+ padding = 2,+ -- max_width and max_height can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)+ max_width = 0,+ max_height = 0,+ border = nil,+ win_options = {+ winblend = 0,+ },+ -- optionally override the oil buffers window title with custom function: fun(winid: integer): string+ get_win_title = nil,+ -- preview_split: Split direction: "auto", "left", "right", "above", "below".+ preview_split = "auto",+ -- This is the config that will be passed to nvim_open_win.+ -- Change values here to customize the layout+ override = function(conf)+ return conf+ end,+ },+ -- Configuration for the file preview window+ preview_win = {+ -- Whether the preview window is automatically updated when the cursor is moved+ update_on_cursor_moved = true,+ -- How to open the preview window "load"|"scratch"|"fast_scratch"+ preview_method = "fast_scratch",+ -- A function that returns true to disable preview on a file e.g. to avoid lag+ disable_preview = function(filename)+ return false+ end,+ -- Window-local options to use for preview window buffers+ win_options = {},+ },+ -- Configuration for the floating action confirmation window+ confirmation = {+ -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)+ -- min_width and max_width can be a single value or a list of mixed integer/float types.+ -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"+ max_width = 0.9,+ -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"+ min_width = { 40, 0.4 },+ -- optionally define an integer/float for the exact width of the preview window+ width = nil,+ -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)+ -- min_height and max_height can be a single value or a list of mixed integer/float types.+ -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"+ max_height = 0.9,+ -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"+ min_height = { 5, 0.1 },+ -- optionally define an integer/float for the exact height of the preview window+ height = nil,+ border = nil,+ win_options = {+ winblend = 0,+ },+ },+ -- Configuration for the floating progress window+ progress = {+ max_width = 0.9,+ min_width = { 40, 0.4 },+ width = nil,+ max_height = { 10, 0.9 },+ min_height = { 5, 0.1 },+ height = nil,+ border = nil,+ minimized_border = "none",+ win_options = {+ winblend = 0,+ },+ },+ -- Configuration for the floating SSH window+ ssh = {+ border = nil,+ },+ -- Configuration for the floating keymaps help window+ keymaps_help = {+ border = nil,+ },+})+```++## Adapters++Oil does all of its filesystem interaction through an _adapter_ abstraction. In practice, this means that oil can be used to view and modify files in more places than just the local filesystem, so long as the destination has an adapter implementation.++Note that file operations work _across adapters_. This means that you can use oil to copy files to/from a remote server using the ssh adapter just as easily as you can copy files from one directory to another on your local machine.++### SSH++This adapter allows you to browse files over ssh, much like netrw. To use it, simply open a buffer using the following name template:++```+nvim oil-ssh://[username@]hostname[:port]/[path]+```++This may look familiar. In fact, this is the same url format that netrw uses.++Note that at the moment the ssh adapter does not support Windows machines, and it requires the server to have a `/bin/sh` binary as well as standard unix commands (`ls`, `rm`, `mv`, `mkdir`, `chmod`, `cp`, `touch`, `ln`, `echo`).++### S3++This adapter allows you to browse files stored in aws s3. To use it, make sure `aws` is setup correctly and then simply open a buffer using the following name template:++```+nvim oil-s3://[bucket]/[path]+```++Note that older versions of Neovim don't support numbers in the url, so for Neovim 0.11 and older the url starts with `oil-sss`.++## Recipes++- [Toggle file detail view](doc/recipes.md#toggle-file-detail-view)+- [Show CWD in the winbar](doc/recipes.md#show-cwd-in-the-winbar)+- [Hide gitignored files and show git tracked hidden files](doc/recipes.md#hide-gitignored-files-and-show-git-tracked-hidden-files)++## Third-party extensions++These are plugins maintained by other authors that extend the functionality of oil.nvim.++- [oil-git-status.nvim](https://github.com/refractalize/oil-git-status.nvim) - Shows git status of files in statuscolumn+- [oil-git.nvim](https://github.com/benomahony/oil-git.nvim) - Shows git status of files with colour and symbols+- [oil-lsp-diagnostics.nvim](https://github.com/JezerM/oil-lsp-diagnostics.nvim) - Shows LSP diagnostics indicator as virtual text++## API++<!-- API -->++- [get_entry_on_line(bufnr, lnum)](doc/api.md#get_entry_on_linebufnr-lnum)+- [get_cursor_entry()](doc/api.md#get_cursor_entry)+- [discard_all_changes()](doc/api.md#discard_all_changes)+- [set_columns(cols)](doc/api.md#set_columnscols)+- [set_sort(sort)](doc/api.md#set_sortsort)+- [set_is_hidden_file(is_hidden_file)](doc/api.md#set_is_hidden_fileis_hidden_file)+- [toggle_hidden()](doc/api.md#toggle_hidden)+- [get_current_dir(bufnr)](doc/api.md#get_current_dirbufnr)+- [open_float(dir, opts, cb)](doc/api.md#open_floatdir-opts-cb)+- [toggle_float(dir, opts, cb)](doc/api.md#toggle_floatdir-opts-cb)+- [open(dir, opts, cb)](doc/api.md#opendir-opts-cb)+- [close(opts)](doc/api.md#closeopts)+- [open_preview(opts, callback)](doc/api.md#open_previewopts-callback)+- [select(opts, callback)](doc/api.md#selectopts-callback)+- [save(opts, cb)](doc/api.md#saveopts-cb)+- [setup(opts)](doc/api.md#setupopts)++<!-- /API -->++## FAQ++**Q: Why "oil"**?++**A:** From the [vim-vinegar](https://github.com/tpope/vim-vinegar) README, a quote by Drew Neil:++> Split windows and the project drawer go together like oil and vinegar++Vinegar was taken. Let's be oil.+Plus, I think it's pretty slick ;)++**Q: Why would I want to use oil vs any other plugin?**++**A:**++- You like to use a netrw-like view to browse directories (as opposed to a file tree)+- AND you want to be able to edit your filesystem like a buffer+- AND you want to perform cross-directory actions. AFAIK there is no other plugin that does this. (update: [mini.files](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-files.md) also offers this functionality)++If you don't need those features specifically, check out the alternatives listed below++**Q: Why write another plugin yourself instead of adding functionality to one that already exists**?++**A:** Because I am a _maniac control freak_.++**Q: Can oil display files as a tree view**?++**A:** No. A tree view would require a completely different methodology, necessitating a complete rewrite. I don't use tree views, so I will leave this as a plugin for someone else to write.++**Q: What are some alternatives?**++**A:**++- [mini.files](https://github.com/nvim-mini/mini.nvim/blob/main/readmes/mini-files.md): A newer plugin that also supports cross-directory filesystem-as-buffer edits. It utilizes a unique column view.+- [vim-vinegar](https://github.com/tpope/vim-vinegar): The granddaddy. This made me fall in love with single-directory file browsing. I stopped using it when I encountered netrw bugs and performance issues.+- [defx.nvim](https://github.com/Shougo/defx.nvim): What I switched to after vim-vinegar. Much more flexible and performant, but requires python and the API is a little hard to work with.+- [dirbuf.nvim](https://github.com/elihunter173/dirbuf.nvim): The first plugin I encountered that let you edit the filesystem like a buffer. Never used it because it [can't do cross-directory edits](https://github.com/elihunter173/dirbuf.nvim/issues/7).+- [lir.nvim](https://github.com/tamago324/lir.nvim): What I used prior to writing this plugin. Similar to vim-vinegar, but with better Neovim integration (floating windows, lua API).+- [vim-dirvish](https://github.com/justinmk/vim-dirvish): Never personally used, but well-established, stable, simple directory browser.+- [vidir](https://github.com/trapd00r/vidir): Never personally used, but might be the first plugin to come up with the idea of editing a directory like a buffer.++There's also file trees like [neo-tree](https://github.com/nvim-neo-tree/neo-tree.nvim) and [nvim-tree](https://github.com/nvim-tree/nvim-tree.lua), but they're really a different category entirely.nvim/pack/plugins/opt/oil.nvim/doc/api.md view file
@@ -0,0 +1,205 @@+# API++<!-- TOC -->++- [get_entry_on_line(bufnr, lnum)](#get_entry_on_linebufnr-lnum)+- [get_cursor_entry()](#get_cursor_entry)+- [discard_all_changes()](#discard_all_changes)+- [set_columns(cols)](#set_columnscols)+- [set_sort(sort)](#set_sortsort)+- [set_is_hidden_file(is_hidden_file)](#set_is_hidden_fileis_hidden_file)+- [toggle_hidden()](#toggle_hidden)+- [get_current_dir(bufnr)](#get_current_dirbufnr)+- [open_float(dir, opts, cb)](#open_floatdir-opts-cb)+- [toggle_float(dir, opts, cb)](#toggle_floatdir-opts-cb)+- [open(dir, opts, cb)](#opendir-opts-cb)+- [close(opts)](#closeopts)+- [open_preview(opts, callback)](#open_previewopts-callback)+- [select(opts, callback)](#selectopts-callback)+- [save(opts, cb)](#saveopts-cb)+- [setup(opts)](#setupopts)++<!-- /TOC -->++<!-- API -->++## get_entry_on_line(bufnr, lnum)++`get_entry_on_line(bufnr, lnum): nil|oil.Entry` \+Get the entry on a specific line (1-indexed)++| Param | Type | Desc |+| ----- | --------- | ---- |+| bufnr | `integer` | |+| lnum | `integer` | |++## get_cursor_entry()++`get_cursor_entry(): nil|oil.Entry` \+Get the entry currently under the cursor+++## discard_all_changes()++`discard_all_changes()` \+Discard all changes made to oil buffers+++## set_columns(cols)++`set_columns(cols)` \+Change the display columns for oil++| Param | Type | Desc |+| ----- | ------------------ | ---- |+| cols | `oil.ColumnSpec[]` | |++## set_sort(sort)++`set_sort(sort)` \+Change the sort order for oil++| Param | Type | Desc |+| ----- | ---------------- | ------------------------------------------------------------------------------------- |+| sort | `oil.SortSpec[]` | List of columns plus direction. See :help oil-columns to see which ones are sortable. |++**Examples:**+```lua+require("oil").set_sort({ { "type", "asc" }, { "size", "desc" } })+```++## set_is_hidden_file(is_hidden_file)++`set_is_hidden_file(is_hidden_file)` \+Change how oil determines if the file is hidden++| Param | Type | Desc |+| -------------- | ------------------------------------------------ | -------------------------------------------- |+| is_hidden_file | `fun(filename: string, bufnr: integer): boolean` | Return true if the file/dir should be hidden |++## toggle_hidden()++`toggle_hidden()` \+Toggle hidden files and directories+++## get_current_dir(bufnr)++`get_current_dir(bufnr): nil|string` \+Get the current directory++| Param | Type | Desc |+| ----- | -------------- | ---- |+| bufnr | `nil\|integer` | |++## open_float(dir, opts, cb)++`open_float(dir, opts, cb)` \+Open oil browser in a floating window+nvim/pack/plugins/opt/oil.nvim/doc/oil.txt view file
@@ -0,0 +1,778 @@+*oil.txt*+*Oil* *oil* *oil.nvim*+--------------------------------------------------------------------------------+CONTENTS *oil-contents*++ 1. Config |oil-config|+ 2. Options |oil-options|+ 3. Api |oil-api|+ 4. Columns |oil-columns|+ 5. Actions |oil-actions|+ 6. Highlights |oil-highlights|+ 7. Trash |oil-trash|++--------------------------------------------------------------------------------+CONFIG *oil-config*++>lua+ require("oil").setup({+ -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)+ -- Set to false if you want some other plugin (e.g. netrw) to open when you edit directories.+ default_file_explorer = true,+ -- Id is automatically added at the beginning, and name at the end+ -- See :help oil-columns+ columns = {+ "icon",+ -- "permissions",+ -- "size",+ -- "mtime",+ },+ -- Buffer-local options to use for oil buffers+ buf_options = {+ buflisted = false,+ bufhidden = "hide",+ },+ -- Window-local options to use for oil buffers+ win_options = {+ wrap = false,+ signcolumn = "no",+ cursorcolumn = false,+ foldcolumn = "0",+ spell = false,+ list = false,+ conceallevel = 3,+ concealcursor = "nvic",+ },+ -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)+ delete_to_trash = false,+ -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)+ skip_confirm_for_simple_edits = false,+ -- Selecting a new/moved/renamed file or directory will prompt you to save changes first+ -- (:help prompt_save_on_select_new_entry)+ prompt_save_on_select_new_entry = true,+ -- Oil will automatically delete hidden buffers after this delay+ -- You can set the delay to false to disable cleanup entirely+ -- Note that the cleanup process only starts when none of the oil buffers are currently displayed+ cleanup_delay_ms = 2000,+ lsp_file_methods = {+ -- Enable or disable LSP file operations+ enabled = true,+ -- Time to wait for LSP file operations to complete before skipping+ timeout_ms = 1000,+ -- Set to true to autosave buffers that are updated with LSP willRenameFiles+ -- Set to "unmodified" to only save unmodified buffers+ autosave_changes = false,+ },+ -- Constrain the cursor to the editable parts of the oil buffer+ -- Set to `false` to disable, or "name" to keep it on the file names+ constrain_cursor = "editable",+ -- Set to true to watch the filesystem for changes and reload oil+ watch_for_changes = false,+ -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap+ -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" })+ -- Additionally, if it is a string that matches "actions.<name>",+ -- it will use the mapping at require("oil.actions").<name>+ -- Set to `false` to remove a keymap+ -- See :help oil-actions for a list of all available actions+ keymaps = {+ ["g?"] = { "actions.show_help", mode = "n" },+ ["<CR>"] = "actions.select",+ ["<C-s>"] = { "actions.select", opts = { vertical = true } },+ ["<C-h>"] = { "actions.select", opts = { horizontal = true } },+ ["<C-t>"] = { "actions.select", opts = { tab = true } },+ ["<C-p>"] = "actions.preview",+ ["<C-c>"] = { "actions.close", mode = "n" },+ ["<C-l>"] = "actions.refresh",+ ["-"] = { "actions.parent", mode = "n" },+ ["_"] = { "actions.open_cwd", mode = "n" },+ ["`"] = { "actions.cd", mode = "n" },+ ["g~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },+ ["gs"] = { "actions.change_sort", mode = "n" },+ ["gx"] = "actions.open_external",+ ["g."] = { "actions.toggle_hidden", mode = "n" },+ ["g\\"] = { "actions.toggle_trash", mode = "n" },+ },+ -- Set to false to disable all of the above keymaps+ use_default_keymaps = true,+ view_options = {+ -- Show files and directories that start with "."+ show_hidden = false,nvim/pack/plugins/opt/oil.nvim/doc/recipes.md view file
@@ -0,0 +1,127 @@+# Recipes++Have a cool recipe to share? Open a pull request and add it to this doc!++<!-- TOC -->nvim/pack/plugins/opt/oil.nvim/lua/oil/actions.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/files.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/files/permissions.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/s3.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/s3/s3fs.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/ssh.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/ssh/connection.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/ssh/sshfs.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/test.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/trash.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/trash/freedesktop.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/trash/mac.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/trash/windows.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/trash/windows/powershell-connection.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/adapters/trash/windows/powershell-trash.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/cache.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/clipboard.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/columns.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/config.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/constants.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/fs.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/git.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/init.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/keymap_util.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/layout.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/loading.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/log.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/lsp/helpers.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/lsp/workspace.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/mutator/confirmation.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/mutator/init.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/mutator/parser.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/mutator/progress.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/mutator/trie.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/pathutil.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/ringbuf.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/shell.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/util.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/oil/view.lua view file
nvim/pack/plugins/opt/oil.nvim/lua/resession/extensions/oil.lua view file
nvim/pack/plugins/opt/oil.nvim/perf/bootstrap.lua view file
nvim/pack/plugins/opt/oil.nvim/run_tests.sh view file
nvim/pack/plugins/opt/oil.nvim/scripts/generate.py view file
nvim/pack/plugins/opt/oil.nvim/scripts/main.py view file
nvim/pack/plugins/opt/oil.nvim/scripts/requirements.txt view file
nvim/pack/plugins/opt/oil.nvim/syntax/oil.vim view file
nvim/pack/plugins/opt/oil.nvim/syntax/oil_preview.vim view file
nvim/pack/plugins/opt/oil.nvim/tests/altbuf_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/files_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/manual_progress.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/minimal_init.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/move_rename_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/mutator_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/parser_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/path_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/preview_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/regression_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/select_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/test_util.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/tmpdir.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/trash_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/url_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/util_spec.lua view file
nvim/pack/plugins/opt/oil.nvim/tests/win_options_spec.lua view file