Remove moonfly colorscheme and refine mini.files keymaps
- Delete colors/moonfly.vim (unused theme) - Remove <leader>- binding for mini.files - Add _ binding to open mini.files at project root (git root) - Update starter page keymaps accordingly Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
9c8deeafc8
commit
a48d83cc2f
@ -1,35 +0,0 @@
|
||||
" Dark Vim/Neovim colorscheme.
|
||||
"
|
||||
" URL: github.com/bluz71/vim-moonfly-colors
|
||||
" License: MIT (https://opensource.org/licenses/MIT)
|
||||
|
||||
" Clear highlights and reset syntax.
|
||||
highlight clear
|
||||
if exists('syntax_on')
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
" Set colorscheme name.
|
||||
let g:colors_name = 'moonfly'
|
||||
|
||||
" Define theme options.
|
||||
let g:moonflyCursorColor = get(g:, 'moonflyCursorColor', v:false)
|
||||
let g:moonflyItalics = get(g:, 'moonflyItalics', v:true)
|
||||
let g:moonflyNormalPmenu = get(g:, 'moonflyNormalPmenu', v:false)
|
||||
let g:moonflyNormalFloat = get(g:, 'moonflyNormalFloat', v:false)
|
||||
let g:moonflyTerminalColors = get(g:, 'moonflyTerminalColors', v:true)
|
||||
let g:moonflyTransparent = get(g:, 'moonflyTransparent', v:false)
|
||||
let g:moonflyUndercurls = get(g:, 'moonflyUndercurls', v:true)
|
||||
let g:moonflyUnderlineMatchParen = get(g:, 'moonflyUnderlineMatchParen', v:false)
|
||||
let g:moonflyVirtualTextColor = get(g:, 'moonflyVirtualTextColor', v:false)
|
||||
let g:moonflyWinSeparator = get(g:, 'moonflyWinSeparator', 1)
|
||||
|
||||
" Load theme style independently for Neovim and Vim.
|
||||
if has('nvim')
|
||||
lua pcall(function() require("moonfly").style() end)
|
||||
else
|
||||
call moonfly#Style()
|
||||
end
|
||||
|
||||
set background=dark " moonfly is a dark theme
|
||||
set termguicolors " moonfly is a true-color theme
|
||||
25
lua/pack.lua
25
lua/pack.lua
@ -238,11 +238,6 @@ local function setup_mini_files()
|
||||
})
|
||||
end
|
||||
|
||||
-- <leader>- :在当前工作目录打开文件浏览器
|
||||
lazy.on_keys("files", "<leader>-", "n", setup_mini_files, function()
|
||||
require("mini.files").open()
|
||||
end, { desc = "打开文件浏览器(工作目录)" })
|
||||
|
||||
-- - :在当前文件所在目录打开文件浏览器
|
||||
lazy.on_keys("files", "-", "n", setup_mini_files, function()
|
||||
local MiniFiles = require("mini.files")
|
||||
@ -251,22 +246,30 @@ lazy.on_keys("files", "-", "n", setup_mini_files, function()
|
||||
MiniFiles.reveal_cwd()
|
||||
end, { desc = "打开文件浏览器(当前文件目录)" })
|
||||
|
||||
-- 在启动页(mini.starter)中也绑定 - / <leader>-,
|
||||
-- _ :在项目根目录(git root)打开文件浏览器
|
||||
lazy.on_keys("files", "_", "n", setup_mini_files, function()
|
||||
local git_root = vim.fs.root(0, ".git")
|
||||
-- use_latest = false 避免恢复上次浏览深度,确保只展开根目录一层
|
||||
require("mini.files").open(git_root or vim.fn.getcwd(), false)
|
||||
end, { desc = "打开文件浏览器(项目根目录)" })
|
||||
|
||||
-- 在启动页(mini.starter)中也绑定 - / _,
|
||||
-- 因为 starter buffer 可能拦截全局映射
|
||||
vim.api.nvim_create_autocmd("User", {
|
||||
pattern = "MiniStarterOpened",
|
||||
callback = function(args)
|
||||
vim.keymap.set("n", "<leader>-", function()
|
||||
require("lazy").load("files", setup_mini_files)
|
||||
require("mini.files").open()
|
||||
end, { buffer = args.buf, desc = "打开文件浏览器(工作目录)" })
|
||||
|
||||
vim.keymap.set("n", "-", function()
|
||||
require("lazy").load("files", setup_mini_files)
|
||||
local MiniFiles = require("mini.files")
|
||||
-- starter 无当前文件,打开工作目录
|
||||
MiniFiles.open(vim.fn.getcwd())
|
||||
end, { buffer = args.buf, desc = "打开文件浏览器(工作目录)" })
|
||||
|
||||
vim.keymap.set("n", "_", function()
|
||||
require("lazy").load("files", setup_mini_files)
|
||||
local git_root = vim.fs.root(0, ".git")
|
||||
require("mini.files").open(git_root or vim.fn.getcwd(), false)
|
||||
end, { buffer = args.buf, desc = "打开文件浏览器(项目根目录)" })
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user