Skip to content

Commit ace587a

Browse files
committed
start to store nvim config data
1 parent 07fbce9 commit ace587a

File tree

11 files changed

+167
-0
lines changed

11 files changed

+167
-0
lines changed

.config/nvim/README

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Folder structure
2+
3+
e.g.
4+
~/.config/nvim/
5+
├── init.lua # メインの設定ファイル
6+
├── lua/ # Luaスクリプトを格納するディレクトリ
7+
│ ├── plugins/ # プラグイン設定を格納
8+
│ │ ├── init.lua # プラグインマネージャの設定 (Lazy.nvim)
9+
│ │ ├── telescope.lua # Telescopeプラグインの設定
10+
│ │ ├── lualine.lua # Lualineプラグインの設定
11+
│ │ └── treesitter.lua # Treesitterプラグインの設定
12+
│ ├── settings.lua # 基本設定(例: 行番号、インデント)
13+
│ ├── keymaps.lua # キーマッピング設定
14+
│ └── lsp/ # LSP関連の設定を格納
15+
│ ├── init.lua # LSP全体の初期設定
16+
│ ├── servers.lua # 各LSPサーバーの設定 (例: pyright, tsserver)
17+
│ └── format.lua # フォーマット設定
18+
└── after/ # 特定の条件で適用される設定
19+
├── ftplugin/ # ファイルタイプごとの設定 (例: PythonやMarkdown用)
20+
└── plugin/ # プラグインの読み込み後に適用する設定

.config/nvim/init.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- basic settings
2+
require("settings")
3+
4+
-- keymaps
5+
require("keymaps")
6+
7+
-- plugins
8+
require("plugins.init")
9+
10+
-- LSP
11+
require("lsp.init")
12+

.config/nvim/lazy-lock.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
3+
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
4+
"nvim-lspconfig": { "branch": "master", "commit": "88157521e890fe7fdf18bee22438875edd6300a6" },
5+
"nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" },
6+
"nvim-treesitter": { "branch": "master", "commit": "306dd6e9dc806db1d79568d26e1c9b6c98b95fbc" },
7+
"nvim-web-devicons": { "branch": "master", "commit": "aafa5c187a15701a7299a392b907ec15d9a7075f" },
8+
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
9+
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }
10+
}

.config/nvim/lua/keymaps.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- リーダーキー設定
2+
vim.g.mapleader = " "
3+
4+
-- キーマッピング
5+
vim.keymap.set("n", "<leader>w", ":w<CR>", { noremap = true, silent = true }) -- 保存
6+
vim.keymap.set("n", "<leader>q", ":q<CR>", { noremap = true, silent = true }) -- 終了
7+
8+
-- NvimTreeトグル
9+
vim.keymap.set("n", "<C-n>", ":NvimTreeToggle<CR>", { noremap = true, silent = true })
10+
11+
-- Telescope検索
12+
vim.keymap.set("n", "<C-p>", ":Telescope find_files<CR>", { noremap = true, silent = true })
13+
vim.keymap.set("n", "<C-f>", ":Telescope live_grep<CR>", { noremap = true, silent = true })
14+

.config/nvim/lua/lsp/init.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
local lspconfig = require("lspconfig")
2+
3+
-- 各サーバーの設定を読み込む
4+
require("lsp.servers")
5+
6+
-- 共通設定
7+
vim.diagnostic.config({
8+
virtual_text = true,
9+
signs = true,
10+
update_in_insert = false,
11+
})
12+

.config/nvim/lua/lsp/servers.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
local lspconfig = require("lspconfig")
2+
3+
-- Python: pyright
4+
lspconfig.pyright.setup({})
5+
6+
-- TypeScript: ts_ls
7+
lspconfig.ts_ls.setup({})
8+
9+
-- Go: gopls
10+
lspconfig.gopls.setup({})
11+

.config/nvim/lua/plugins/init.lua

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-- Lazy.nvimのインストールパスを設定
2+
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
3+
if not vim.loop.fs_stat(lazypath) then
4+
vim.fn.system({
5+
"git",
6+
"clone",
7+
"--filter=blob:none",
8+
"https://github.com/folke/lazy.nvim.git",
9+
lazypath,
10+
})
11+
end
12+
vim.opt.rtp:prepend(lazypath)
13+
14+
-- プラグインセットアップ
15+
require("lazy").setup({
16+
-- ファイラー: NvimTree
17+
{
18+
"nvim-tree/nvim-tree.lua",
19+
dependencies = { "nvim-tree/nvim-web-devicons" },
20+
config = function()
21+
require("nvim-tree").setup()
22+
end,
23+
},
24+
-- 検索: Telescope
25+
{
26+
"nvim-telescope/telescope.nvim",
27+
dependencies = { "nvim-lua/plenary.nvim" },
28+
config = function()
29+
require("plugins.telescope")
30+
end,
31+
},
32+
-- ステータスライン: Lualine
33+
{
34+
"nvim-lualine/lualine.nvim",
35+
dependencies = { "nvim-tree/nvim-web-devicons" },
36+
config = function()
37+
require("plugins.lualine")
38+
end,
39+
},
40+
-- 構文解析: Treesitter
41+
{
42+
"nvim-treesitter/nvim-treesitter",
43+
build = ":TSUpdate",
44+
config = function()
45+
require("plugins.treesitter")
46+
end,
47+
},
48+
-- LSPサポート
49+
{
50+
"neovim/nvim-lspconfig",
51+
},
52+
})
53+

.config/nvim/lua/plugins/lualine.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require("lualine").setup({
2+
options = {
3+
theme = "gruvbox",
4+
},
5+
})
6+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
require("telescope").setup({
2+
defaults = {
3+
mappings = {
4+
i = {
5+
["<C-u>"] = false, -- Ctrl+uを無効化
6+
["<C-d>"] = false, -- Ctrl+dを無効化
7+
},
8+
},
9+
},
10+
})
11+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require("nvim-treesitter.configs").setup({
2+
ensure_installed = "all",
3+
highlight = {
4+
enable = true,
5+
},
6+
})
7+

0 commit comments

Comments
 (0)