Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,13 @@ The current common Git baseline includes:
- global ignore via `~/.config/git/ignore`
- machine/user-local `~/.gitconfig.local`

The editor baseline is shared between Vim and Neovim:
The editor baseline is shared between Vim and Neovim. Each OS has only a thin
entry point; the configuration itself lives once under `home/vimfiles/`:

- `~/vimfiles/shared/base.vim` — the single source of truth for both editors (encoding, `~/.cache/vim` backup/swap/undo, display, folding, search, indent, statusline, `list`, window/tab/normal/insert/visual mappings, transparent background). Sourced by Vim's `_vimrc` and by Neovim's `init.lua`.
- `~/vimfiles/shared/base.vim` — the single source of truth for both editors (encoding, `~/.cache/vim` backup/swap/undo, display, folding, search, indent, statusline, `list`, window/tab/normal/insert/visual mappings, transparent background).
- `~/vimfiles/keymap/onishi.vim` — 大西配列 key placement; sourced last from `base.vim` so it overrides the defaults above.
- `%LOCALAPPDATA%\Programs\Vim\_vimrc` and `%LOCALAPPDATA%\nvim\` (Neovim config, lockfiles, `scripts/`, `snippets/`) mirror their real Windows locations under `home/AppData/Local/` so neither editor needs an environment variable to find its config.
- `~/vimfiles/nvim/init.lua` — the canonical Neovim config. `home/.config/nvim/init.lua` (POSIX) and `home/AppData/Local/nvim/init.lua` (Windows) are byte-identical thin loaders of that file.
- Entry points: `home/.vimrc` → `~/.vimrc` on macOS/WSL; `%LOCALAPPDATA%\Programs\Vim\_vimrc` and `%LOCALAPPDATA%\nvim\init.lua` at their real Windows locations via `home/AppData/Local/`. `script/link` skips `home/AppData/` on POSIX and `script/link.ps1` skips `home/.vimrc` / `home/.config/nvim/` on Windows; skipped sources are never deleted.

`set background=transparent` is rejected with E474 by both Vim and Neovim, so transparency is applied as `guibg=NONE` on `Normal` / `NormalNC` / `SignColumn` / `EndOfBuffer`, re-applied on `ColorScheme`.

Expand Down
11 changes: 11 additions & 0 deletions home/.config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- Thin Neovim entry point. Windows reads it from %LOCALAPPDATA%\nvim
-- (home/AppData/Local/nvim/init.lua), POSIX from ~/.config/nvim
-- (home/.config/nvim/init.lua); the two files are byte-identical on purpose
-- and source the one canonical config, home/vimfiles/nvim/init.lua, so the
-- configuration is never duplicated across operating systems.
local shared = vim.fn.expand("~/vimfiles/nvim/init.lua")
if vim.fn.filereadable(shared) == 1 then
vim.cmd.source(shared)
else
vim.notify("dotfiles: missing " .. shared .. " (run script/link)", vim.log.levels.WARN)
end
22 changes: 22 additions & 0 deletions home/.vimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
" POSIX entry point for Vim. Windows uses the install-dir entry at
" home/AppData/Local/Programs/Vim/_vimrc; both files only source shared
" configuration, nothing is configured here.
"
" vimrc_example.vim is the portable runtime template (its own header says
" "for Unix: ~/.vimrc") and it pulls in $VIMRUNTIME/defaults.vim. Sourcing it
" matters on Unix: with a user vimrc present Vim no longer auto-loads
" defaults.vim, so skipping the template would regress scrolloff/mouse/ttimeout
" that this machine has today. base.vim runs last and overrides every option it
" shares with the template, in the same order as the Windows entry.
if filereadable(expand('$VIMRUNTIME/vimrc_example.vim'))
source $VIMRUNTIME/vimrc_example.vim
endif

" The Windows-only `set diffexpr=MyDiff()` block is intentionally skipped:
" Vim 9 lists 'internal' in 'diffopt' on every platform (verified:
" diffopt=internal,filler,...), so MyDiff never runs on Windows either.

" 共通設定 (大西配列のキーマップ・背景透過を含む)
if filereadable(expand("~/vimfiles/shared/base.vim"))
source ~/vimfiles/shared/base.vim
endif
Loading
Loading