Skip to content

Commit

Permalink
neovimの設定を更新
Browse files Browse the repository at this point in the history
  • Loading branch information
grtw2116 committed Apr 22, 2024
1 parent b1f6b92 commit cf6eded
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 37 deletions.
7 changes: 7 additions & 0 deletions config/nvim/ftplugin/java.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
local jdtls = require("jdtls")

-- LSPを起動
jdtls.start_or_attach({
cmd = { os.getenv("XDG_DATA_HOME") .. "/nvim/mason/bin/jdtls" },
root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]),
})
23 changes: 13 additions & 10 deletions config/nvim/lazy-lock.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"CopilotChat.nvim": { "branch": "canary", "commit": "fae15e1687e2436f308e1f795d03370a64432813" },
"LuaSnip": { "branch": "master", "commit": "8ae1dedd988eb56441b7858bd1e8554dfadaa46d" },
"aerial.nvim": { "branch": "master", "commit": "24ebacab5821107c50f628e8e7774f105c08fe9b" },
"CopilotChat.nvim": { "branch": "canary", "commit": "9898b4cd1b19c6ca639b77b34bb599a119356c1f" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"aerial.nvim": { "branch": "master", "commit": "399e276328be8242ccde01d90f6f6c619f7bb24f" },
"auto-dark-mode.nvim": { "branch": "master", "commit": "e328dc463d238cb7d690fb4daf068eba732a5a14" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"bufferline.nvim": { "branch": "main", "commit": "64e2c5def50dfd6b6f14d96a45fa3d815a4a1eef" },
Expand All @@ -16,37 +16,40 @@
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "9d5ba06d6ee7418c674f498634617416d15b6239" },
"conform.nvim": { "branch": "master", "commit": "820eec990d5f332d30cf939954c8672a43a0459e" },
"copilot.lua": { "branch": "master", "commit": "f7612f5af4a7d7615babf43ab1e67a2d790c13a6" },
"diffview.nvim": { "branch": "main", "commit": "3dc498c9777fe79156f3d32dddd483b8b3dbd95f" },
"fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" },
"flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" },
"fzf-lua": { "branch": "main", "commit": "97a88bb8b0785086d03e08a7f98f83998e0e1f8a" },
"gitsigns.nvim": { "branch": "main", "commit": "81369ed5405ec0c5d55a9608b495dbf827415116" },
"fzf-lua": { "branch": "main", "commit": "62cb8f37b3a017e6b2401726c96e02498f332b70" },
"gitsigns.nvim": { "branch": "main", "commit": "c02516144a4fbd777b6b060a068ab984ab5974d5" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"lazy.nvim": { "branch": "main", "commit": "31ddbea7c10b6920c9077b66c97951ca8682d5c8" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "44509689b9bf3984d729cc264aacb31cb7f41668" },
"mason.nvim": { "branch": "main", "commit": "751b1fcbf3d3b783fcf8d48865264a9bcd8f9b10" },
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
"neogit": { "branch": "master", "commit": "c0b1d4dfc8ba6371857868ca7c4d33954cf002fd" },
"neogit": { "branch": "master", "commit": "0cae7abc30cb91d661f28257c331fcb5b5198e31" },
"noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" },
"nui.nvim": { "branch": "main", "commit": "cbd2668414331c10039278f558630ed19b93e69b" },
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-dap": { "branch": "master", "commit": "405df1dcc2e395ab5173a9c3d00e03942c023074" },
"nvim-jdtls": { "branch": "master", "commit": "8eb5f0dbe6e126b392ddcaf45893358619893e45" },
"nvim-lspconfig": { "branch": "master", "commit": "9619e53d3f99f0ca4ea3b88f5d97fce703131820" },
"nvim-lspconfig": { "branch": "master", "commit": "9266dc26862d8f3556c2ca77602e811472b4c5b8" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" },
"nvim-scrollbar": { "branch": "main", "commit": "35f99d559041c7c0eff3a41f9093581ceea534e8" },
"nvim-toggleterm.lua": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
"nvim-tree.lua": { "branch": "master", "commit": "ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" },
"nvim-treesitter": { "branch": "master", "commit": "a2d6678bb21052013d0dd7cb35dffbac13846c98" },
"nvim-treesitter": { "branch": "master", "commit": "037c6af78fb50ec5ca9401c3fce437b95db8e09d" },
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-web-devicons": { "branch": "master", "commit": "e2e3475c7bffbafbda19df2be6ffd04f6d1a3e16" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "a6382f744f584bbf71d0a563af789af7190aabda" },
"nvim-web-devicons": { "branch": "master", "commit": "b3468391470034353f0e5110c70babb5c62967d3" },
"plenary.nvim": { "branch": "master", "commit": "8aad4396840be7fc42896e3011751b7609ca4119" },
"startup.nvim": { "branch": "master", "commit": "c6ba324f9eba0c23b675b53af431346aab893268" },
"telescope.nvim": { "branch": "master", "commit": "54930e1abfc94409e1bb9266e752ef8379008592" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"tokyonight.nvim": { "branch": "main", "commit": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5" },
Expand Down
32 changes: 25 additions & 7 deletions config/nvim/lua/lazy-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,16 @@ require("lazy").setup({
end,
},

-- --------------------------------------------------------------
-- 標準機能拡張系
-- --------------------------------------------------------------
-- ターミナル
{
"akinsho/nvim-toggleterm.lua",
version = "*",
config = true,
},

-- --------------------------------------------------------------
-- コーディング関連
-- --------------------------------------------------------------
Expand Down Expand Up @@ -416,13 +426,10 @@ require("lazy").setup({
},

-- Java
-- {
-- "mfussenegger/nvim-jdtls",
-- ft = "java",
-- config = function()
-- require("plugin-config/nvim-jdtls")
-- end,
-- },
{
"mfussenegger/nvim-jdtls",
ft = "java",
},

-- {
-- "nvim-java/nvim-java",
Expand Down Expand Up @@ -480,4 +487,15 @@ require("lazy").setup({
require("plugin-config/auto-dark-mode")
end,
},

{
"startup-nvim/startup.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"nvim-lua/plenary.nvim",
},
config = function()
require("startup").setup()
end,
},
})
2 changes: 2 additions & 0 deletions config/nvim/lua/plugin-config/aerial.lua
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
require("aerial").setup()

vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>", { silent = true })
1 change: 1 addition & 0 deletions config/nvim/lua/plugin-config/conform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require("conform").setup({
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "autopep8" },
google = { "google-java-format" },
-- Use a sub-list to run only the first available formatter
javascript = { "rustywind", { "prettierd", "prettier" } },
javascriptreact = { "rustywind", { "prettierd", "prettier" } },
Expand Down
11 changes: 8 additions & 3 deletions config/nvim/lua/plugin-config/copilot-chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ vim.keymap.set({ "n", "v" }, "<leader>cc", ":CopilotChatCommit<CR>", { noremap =
-- ステージ済みの差分を元にコミットメッセージを生成する
vim.keymap.set({ "n", "v" }, "<leader>cs", ":CopilotChatCommitStaged<CR>", { noremap = true, silent = true })

-- その場で質問する
vim.keymap.set({ "n", "v" }, "<leader>qc", function()
local input = vim.fn.input("Quick Chat: ")
if input ~= "" then
require("CopilotChat").ask("Quick Chat", { selection = require("CopilotChat.select").buffer })
end
end, { noremap = true, silent = true })

local select = require("CopilotChat.select")

require("CopilotChat").setup({
selection = function(source)
return select.visual(source) or select.line(source)
end,
prompts = {
Explain = {
prompt = "/COPILOT_EXPLAIN 上記のコードについて、テキストの段落としての説明を書いてください。",
Expand Down
2 changes: 1 addition & 1 deletion config/nvim/lua/plugin-config/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require("copilot").setup({
suggestion = {
auto_trigger = true,
keymap = {
open = "<leader>c",
accept = "<M-;>",
},
},
filetypes = {
Expand Down
4 changes: 0 additions & 4 deletions config/nvim/lua/plugin-config/nvim-jdtls.lua

This file was deleted.

21 changes: 10 additions & 11 deletions config/nvim/lua/plugin-config/telescope.lua
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
local builtin = require("telescope.builtin")
vim.keymap.set("n", "<C-p>", builtin.find_files, {}) -- <C-p>: ファイル名から検索
vim.keymap.set("n", "<C-g>", builtin.live_grep, {}) -- <C-g>: ファイル内の文字列から検索
vim.keymap.set("n", "<C-b>", builtin.buffers, {}) -- <C-b>: バッファを検索
vim.keymap.set("n", "<leader>fb", builtin.buffers, {}) -- <leader>fb: バッファを検索
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {}) -- <leader>fh: タグを検索
vim.keymap.set("n", "<C-p>", builtin.find_files, {}) -- <C-p>: ファイル名から検索
vim.keymap.set("n", "<C-g>", builtin.live_grep, {}) -- <C-g>: ファイル内の文字列から検索
vim.keymap.set("n", "<C-b>", builtin.buffers, {}) -- <C-b>: バッファを検索
vim.keymap.set("n", "<C-t>", builtin.git_branches, {}) -- <C-b>: バッファを検索

require("telescope").setup({
pickers = {
find_files = {
-- ファイル検索で隠れファイルを表示する
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
pickers = {
find_files = {
-- ファイル検索で隠れファイルを表示する
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
},
},
})
1 change: 0 additions & 1 deletion config/nvim/lua/util/lsp-servers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ lsp_servers.list = {
"rust_analyzer",
"lua_ls",
"bashls",
"jdtls",
"html",
"cssls",
"pyright",
Expand Down

0 comments on commit cf6eded

Please sign in to comment.