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
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: CI
on:
pull_request:
branches: [for-business]
paths:
- "**/*.nix"
- "flake.lock"
- ".github/workflows/ci.yml"

concurrency:
group: ci-${{ github.ref }}
Expand Down
5 changes: 5 additions & 0 deletions home/claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
],
"defaultMode": "plan"
},
"model": "claude-opus-4-7[1m]",
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.js"
Expand Down Expand Up @@ -184,7 +185,11 @@
"effortLevel": "xhigh",
"showClearContextOnPlanAccept": true,
"autoUpdatesChannel": "latest",
"tui": "fullscreen",
"skipDangerousModePermissionPrompt": true,
"skipWorkflowUsageWarning": true,
"inputNeededNotifEnabled": false,
"agentPushNotifEnabled": true,
"skipAutoPermissionPrompt": true,
"voiceEnabled": false
}
1 change: 0 additions & 1 deletion home/nvim/.luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"runtime.version": "LuaJIT",
"diagnostics.globals": [
"vim",
"MiniDeps",
"MiniIcons",
"MiniTrailspace",
"MiniGit",
Expand Down
22 changes: 7 additions & 15 deletions home/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
vim.loader.enable()

-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps'
local path_package = vim.fn.stdpath('data') .. '/site/'
local mini_path = path_package .. 'pack/deps/start/mini.nvim'
if vim.uv.fs_stat(mini_path) == nil then
vim.cmd('echo "Installing `mini.nvim`" | redraw')
local clone_cmd = {
'git', 'clone', '--filter=blob:none',
'https://github.com/echasnovski/mini.nvim', mini_path
}
vim.fn.system(clone_cmd)
vim.cmd('packadd mini.nvim | helptags ALL')
vim.cmd('echo "Installed `mini.nvim`" | redraw')
end
-- mini.deps は最新の mini.nvim で開発が凍結されたため、プラグイン管理は
-- Neovim 組み込みの vim.pack に移行。mini.nvim 本体も vim.pack で入れる。
vim.pack.add({ 'https://github.com/echasnovski/mini.nvim' })

-- Set up 'mini.deps' (customize to your liking)
require('mini.deps').setup({ path = { package = path_package } })
-- 各モジュールは MiniDeps.now/later の代わりに MiniMisc.safely を使う。
-- MiniMisc グローバルは require('mini.misc').setup() で生成されるため、
-- 他モジュールを読み込む前にここでセットアップしておく。
require('mini.misc').setup()

-- keymaps
-- jkで抜ける系
Expand Down
20 changes: 10 additions & 10 deletions home/nvim/lua/appearance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

vim.o.winbar = " %m %f "

local now, later = MiniDeps.now, MiniDeps.later
local safely = MiniMisc.safely

-- colorscheme
now(function()
safely('now', function()
vim.pack.add({ 'https://github.com/folke/tokyonight.nvim' })
require("tokyonight").setup({
style = "storm",
Expand All @@ -25,33 +25,33 @@ now(function()
vim.cmd.colorscheme('tokyonight')
end)

later(function()
safely('later', function()
vim.pack.add({ 'https://github.com/vim-jp/vimdoc-ja' })
vim.opt.helplang:prepend('ja')
end)

-- Simple plugins
now(function()
safely('now', function()
require('mini.icons').setup()
MiniIcons.mock_nvim_web_devicons()
end)
later(require('mini.indentscope').setup)
safely('later', require('mini.indentscope').setup)

-- statusline
now(function()
safely('now', function()
require('mini.statusline').setup()
vim.opt.laststatus = 3
vim.opt.cmdheight = 0
end)

-- notify
now(function()
safely('now', function()
require('mini.notify').setup()
vim.notify = require('mini.notify').make_notify({})
end)

-- hipatterns
later(function()
safely('later', function()
local hipatterns = require('mini.hipatterns')
local hi_words = require('mini.extra').gen_highlighter.words
hipatterns.setup({
Expand All @@ -65,7 +65,7 @@ later(function()
end)

-- trailspace
later(function()
safely('later', function()
require('mini.trailspace').setup()
vim.api.nvim_create_user_command(
'Trim',
Expand All @@ -78,7 +78,7 @@ later(function()
end)

-- clue (全体のキーバインドヒント)
later(function()
safely('later', function()
local function mode_nx(keys)
return { mode = 'n', keys = keys }, { mode = 'x', keys = keys }
end
Expand Down
28 changes: 14 additions & 14 deletions home/nvim/lua/edit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,20 @@ vim.api.nvim_create_user_command('CopyPath', function()
print("Copied: " .. path)
end, {})

local add, now, later = MiniDeps.add, MiniDeps.now, MiniDeps.later
local safely = MiniMisc.safely

-- treesitter
now(function()
add({
source = 'https://github.com/nvim-treesitter/nvim-treesitter',
hooks = {
post_checkout = function()
safely('now', function()
-- mini.deps の hooks.post_checkout 相当: install/update 時に parser を更新
vim.api.nvim_create_autocmd('PackChanged', {
callback = function(ev)
if ev.data.spec.name == 'nvim-treesitter'
and (ev.data.kind == 'install' or ev.data.kind == 'update') then
vim.cmd.TSUpdate()
end
},
end,
})
vim.pack.add({ 'https://github.com/nvim-treesitter/nvim-treesitter' })
require('nvim-treesitter').install({
'lua', 'vim', 'markdown', 'markdown_inline', 'bash', 'yaml', 'zsh',
'tsx', 'typescript', 'html',
Expand Down Expand Up @@ -112,11 +114,9 @@ now(function()
})
end)

later(function()
add({
source = 'https://github.com/folke/ts-comments.nvim',
depends = { 'nvim-treesitter/nvim-treesitter' },
})
safely('later', function()
-- nvim-treesitter は treesitter ブロックで既に追加済み (depends 相当)
vim.pack.add({ 'https://github.com/folke/ts-comments.nvim' })
require('ts-comments').setup()
end)

Expand All @@ -126,8 +126,8 @@ vim.opt.foldlevel = 99

-- Simple plugins
for _, name in ipairs({ 'pairs', 'surround', 'move', 'bracketed', 'jump2d' }) do
later(require('mini.' .. name).setup)
safely('later', require('mini.' .. name).setup)
end

-- basics
now(require('mini.basics').setup)
safely('now', require('mini.basics').setup)
6 changes: 3 additions & 3 deletions home/nvim/lua/git.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
-- Git系

local later = MiniDeps.later
local safely = MiniMisc.safely

later(require('mini.diff').setup)
safely('later', require('mini.diff').setup)

later(function()
safely('later', function()
require('mini.git').setup()

vim.keymap.set({ 'n', 'x' }, '<space>gs', MiniGit.show_at_cursor, { desc = 'Show at cursor' })
Expand Down
36 changes: 35 additions & 1 deletion home/nvim/lua/lsp/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,40 @@
-- config of lsp

local add, now, later = MiniDeps.add, MiniDeps.now, MiniDeps.later
local safely = MiniMisc.safely

safely('now', function()
vim.pack.add({ 'https://github.com/pcolladosoto/tinygo.nvim' })
local tinygo = require("tinygo")
tinygo.setup({})

-- tinygo.nvim の applyConfigFile は .tinygo.json を相対パスで開くため、
-- nvim の cwd がプロジェクト外だと検出漏れする。バッファから上向き探索し
-- 絶対パスで読み取って TinyGoSetTarget を直接呼ぶ。
tinygo.applyConfigFile = function()
local bufname = vim.api.nvim_buf_get_name(0)
local search_path = nil
if bufname ~= "" then
search_path = vim.fs.dirname(bufname)
end
local found = vim.fs.find(tinygo.config_file, {
upward = true,
path = search_path,
})
if vim.tbl_isempty(found) then return end
local f = io.open(found[1], "r")
if f == nil then return end
local raw = f:read("a")
f:close()
local ok, cfg = pcall(vim.json.decode, raw)
if not ok or type(cfg) ~= "table" or cfg.target == nil then return end
vim.cmd.TinyGoSetTarget(cfg.target)
end

-- applyConfigFile は vim.lsp.enable(lsp_names) より後に走らせる必要がある。
-- tinygo.setup() で登録される LspAttach autocmd が gopls attach 時に拾って
-- くれるが、取りこぼし保険として main 完了後にも明示実行する。
vim.schedule(function() pcall(tinygo.applyConfigFile) end)
end)

vim.diagnostic.config({
virtual_text = true,
Expand Down
14 changes: 6 additions & 8 deletions home/nvim/lua/nav.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
-- 探索系

local now, later = MiniDeps.now, MiniDeps.later
local safely = MiniMisc.safely

-- starter
now(require('mini.starter').setup)

-- misc
now(function()
require('mini.misc').setup()
safely('now', require('mini.starter').setup)

-- misc (mini.misc.setup() は init.lua で実行済み)
safely('now', function()
MiniMisc.setup_restore_cursor()
vim.api.nvim_create_user_command('Zoom', function()
MiniMisc.zoom(0, {})
Expand All @@ -17,7 +15,7 @@ now(function()
end)

-- files
now(function()
safely('now', function()
require('mini.files').setup()

-- mini.files.setup() がハイライトを上書きするため、setup() 後に再設定
Expand All @@ -43,7 +41,7 @@ now(function()
end)

-- pick
later(function()
safely('later', function()
local prev_paste = vim.paste
require('mini.pick').setup()

Expand Down
4 changes: 2 additions & 2 deletions home/nvim/lua/terminal.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
-- Terminal系

local later = MiniDeps.later
local safely = MiniMisc.safely

vim.pack.add({ 'https://github.com/akinsho/toggleterm.nvim' })

later(function()
safely('later', function()
require('toggleterm').setup({
-- `open_mapping` を <C-\> に設定すると ciw など operator-pending の
-- キーシーケンスに割り込むため未設定。<leader>th/tv/tf や <leader>1..5 を使う。
Expand Down