Skip to content

Commit 889a32c

Browse files
committed
update nvim config
1 parent eae1409 commit 889a32c

11 files changed

Lines changed: 132 additions & 23 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Sync Neovim config to Google Drive
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "config/nvim/**"
8+
workflow_dispatch:
9+
10+
jobs:
11+
sync:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Install rclone
17+
run: curl -fsSL https://rclone.org/install.sh | sudo bash
18+
19+
- name: Configure rclone
20+
env:
21+
RCLONE_TOKEN: ${{ secrets.RCLONE_DRIVE_TOKEN }}
22+
run: |
23+
mkdir -p ~/.config/rclone
24+
cat > ~/.config/rclone/rclone.conf <<EOF
25+
[gdrive]
26+
type = drive
27+
scope = drive
28+
token = ${RCLONE_TOKEN}
29+
root_folder_id = ${{ secrets.DRIVE_FOLDER_ID }}
30+
EOF
31+
32+
- name: Sync nvim config
33+
run: rclone sync config/nvim gdrive:/ --verbose

config/nvim/init.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ vim.opt.shellxquote = ""
66
vim.opt.shellpipe = "| Out-File -Encoding UTF8 %s"
77
vim.opt.shellredir = "| Out-File -Encoding UTF8 %s"
88

9+
-- 不要なビルトインプラグインを無効化
10+
vim.g.loaded_netrw = 1
11+
vim.g.loaded_netrwPlugin = 1
12+
vim.g.loaded_matchit = 1 -- vim-matchup で代替
13+
vim.g.loaded_zipPlugin = 1
14+
vim.g.loaded_zip = 1
15+
vim.g.loaded_gzip = 1
16+
vim.g.loaded_tarPlugin = 1
17+
vim.g.loaded_tar = 1
18+
vim.g.loaded_tutor_mode_plugin = 1
19+
920
-- leaderキー
1021
vim.g.mapleader = " "
1122

config/nvim/lazy-lock.json

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
{
22
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
3-
"catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" },
3+
"catppuccin": { "branch": "main", "commit": "0a5de4da015a175f416d6ef1eda84661623e0500" },
44
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
55
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
66
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
77
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
8-
"gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" },
8+
"gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" },
9+
"hydra.nvim": { "branch": "main", "commit": "8c4a9f621ec7cdc30411a1f3b6d5eebb12b469dc" },
910
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
10-
"mini.trailspace": { "branch": "main", "commit": "f8083ca969e1b2098480c10f3c3c4d2ce3586680" },
11-
"neo-tree.nvim": { "branch": "v3.x", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" },
11+
"mini.trailspace": { "branch": "main", "commit": "27acb69562a4742256ab3e4b0127391fcb49dbb3" },
12+
"multicursors.nvim": { "branch": "main", "commit": "72225ea9e4443c3f4b9df91d0193e07c4ee8d382" },
1213
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
1314
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
1415
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
15-
"nvim-lspconfig": { "branch": "master", "commit": "3f58aeca0c6ece8a9fb8782ea3fcb6024f285be3" },
16+
"nvim-lspconfig": { "branch": "master", "commit": "ab5139c99df944479e5a26495a37840fcbb1d512" },
1617
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
17-
"nvim-treesitter": { "branch": "main", "commit": "4967fa48b0fe7a7f92cee546c76bb4bb61bb14d5" },
18-
"nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" },
18+
"nvim-treesitter": { "branch": "main", "commit": "c6d295e96698b14c344a62a3abcf64139268c56b" },
19+
"nvim-web-devicons": { "branch": "master", "commit": "16d919d768b5bc2921bd7d5a4ee76f158f7ea1c0" },
1920
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
20-
"render-markdown.nvim": { "branch": "main", "commit": "48934b49a2363b49ae1d698ed4cb30fb79d7efe8" },
21-
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
21+
"render-markdown.nvim": { "branch": "main", "commit": "1c958131c083c8557ea499fdb08c88b8afb05c4e" },
22+
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
23+
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
24+
"vim-asterisk": { "branch": "master", "commit": "77e97061d6691637a034258cc415d98670698459" },
25+
"vim-matchup": { "branch": "master", "commit": "0fb1e6b7cea34e931a2af50b8ad565c5c4fd8f4d" },
26+
"yazi.nvim": { "branch": "main", "commit": "1317633540114eeed5dd060d23590d448b7fe16e" }
2227
}

config/nvim/lua/plugins/ime.lua

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
local ENGLISH = "1033"
2+
local JAPANESE = "1041"
3+
local CMD = "im-select.exe"
4+
5+
local ime_off = CMD .. " " .. ENGLISH
6+
local ime_on = CMD .. " " .. JAPANESE
7+
8+
local group = vim.api.nvim_create_augroup("ime-control", { clear = true })
9+
10+
-- InsertLeave / CmdlineLeave: IME → English
11+
vim.api.nvim_create_autocmd({ "InsertLeave", "CmdlineLeave" }, {
12+
group = group,
13+
callback = function()
14+
vim.fn.system(ime_off)
15+
end,
16+
})
17+
18+
-- VimLeave / FocusLost: IME → Japanese(nvim外で困らないように)
19+
vim.api.nvim_create_autocmd({ "VimLeave", "FocusLost" }, {
20+
group = group,
21+
callback = function()
22+
vim.fn.system(ime_on)
23+
end,
24+
})
25+
26+
-- ESC ESC: IME → English + clear search highlights
27+
-- 単体ESCはフローティングウィンドウ等のネイティブ動作を維持
28+
vim.keymap.set("n", "<Esc><Esc>", function()
29+
vim.fn.system(ime_off)
30+
vim.cmd.nohlsearch()
31+
end, { desc = "IME → English / Clear highlights" })
32+
33+
return {}

config/nvim/lua/plugins/lsp.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
return {
22
{
33
"neovim/nvim-lspconfig",
4+
event = { "BufReadPre", "BufNewFile" },
45
dependencies = {
56
"hrsh7th/nvim-cmp",
67
"hrsh7th/cmp-nvim-lsp",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
return {
2+
"andymass/vim-matchup",
3+
event = { "BufReadPre", "BufNewFile" },
4+
config = function()
5+
vim.g.matchup_matchparen_offscreen = { method = "popup" }
6+
end,
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
return {
2+
"smoka7/multicursors.nvim",
3+
dependencies = { "nvimtools/hydra.nvim" },
4+
opts = {},
5+
cmd = { "MCstart", "MCvisual", "MCclear", "MCpattern", "MCvisualPattern", "MCunderCursor" },
6+
keys = {
7+
{ "<Leader>m", "<cmd>MCstart<cr>", mode = { "n", "v" }, desc = "Multicursors" },
8+
},
9+
}

config/nvim/lua/plugins/neo-tree.lua

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
return {
22
"nvim-telescope/telescope.nvim",
3-
branch = "0.1.x",
4-
dependencies = { "nvim-lua/plenary.nvim" },
3+
branch = "master",
4+
dependencies = {
5+
"nvim-lua/plenary.nvim",
6+
{ "nvim-telescope/telescope-fzf-native.nvim", build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && copy build\\Release\\libfzf.dll build\\libfzf.dll" },
7+
},
58
keys = {
69
{ "<leader>ff", "<cmd>Telescope find_files<cr>" },
710
{ "<leader>fg", "<cmd>Telescope live_grep<cr>" },
811
{ "<leader>fb", "<cmd>Telescope buffers<cr>" },
912
{ "<leader>fh", "<cmd>Telescope help_tags<cr>" },
1013
},
14+
config = function()
15+
require("telescope").setup({
16+
defaults = {
17+
sorting_strategy = "ascending",
18+
layout_config = { prompt_position = "top" },
19+
},
20+
})
21+
require("telescope").load_extension("fzf")
22+
end,
1123
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
return {
22
"nvim-treesitter/nvim-treesitter",
3+
event = { "BufReadPre", "BufNewFile" },
34
build = ":TSUpdate",
45
config = function()
56
require("nvim-treesitter").setup({
67
ensure_installed = { "lua", "javascript", "typescript", "python", "json", "yaml", "html", "css" },
78
highlight = { enable = true },
89
indent = { enable = true },
10+
matchup = { enable = true },
911
})
1012
end,
1113
}

0 commit comments

Comments
 (0)