From 7456dd4614a490e93f3c367efe81a9f3af6bb82c Mon Sep 17 00:00:00 2001 From: oyoshot <105966658+oyoshot@users.noreply.github.com> Date: Tue, 16 Apr 2024 09:12:59 +0900 Subject: [PATCH 1/2] Device/mac (#38) * Update --- dot_config/zsh/defer.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dot_config/zsh/defer.zsh b/dot_config/zsh/defer.zsh index 82b60b8..7469002 100644 --- a/dot_config/zsh/defer.zsh +++ b/dot_config/zsh/defer.zsh @@ -7,6 +7,9 @@ # Mise (( ${+commands[mise]} )) && eval "$(mise activate zsh)" +# fzf +(( ${+commands[fzf]} )) && eval "$(fzf --zsh)" + if (( ${+commands[brew]} )); then FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" # rip From ddedd434fb4ccc0c65de196d35c5e1b847ee6c4d Mon Sep 17 00:00:00 2001 From: oyoshot <105966658+oyoshot@users.noreply.github.com> Date: Sun, 21 Apr 2024 20:05:51 +0900 Subject: [PATCH 2/2] Device/mac (#39) * Add .config/keras/keras.json Update .config/zsh/.zshenv * Add .config/zsh/defer.zsh Add command * Update * Remove kitty * Update .config/git/conf.d/core.conf Add .config/git/ignore * Update * Update .config/mise/config.toml * Update .config/nvim/lua/plugins/lsp-zero.lua --- dot_config/mise/config.toml | 4 +- .../nvim/lua/plugins/executable_lsp-zero.lua | 632 +++++++++--------- 2 files changed, 318 insertions(+), 318 deletions(-) diff --git a/dot_config/mise/config.toml b/dot_config/mise/config.toml index 06c6241..0ad03fb 100644 --- a/dot_config/mise/config.toml +++ b/dot_config/mise/config.toml @@ -12,7 +12,7 @@ scala = "latest" elixir = "latest" erlang = "latest" bun = "latest" -#rye = "latest" +rye = "latest" helm = "latest" opentofu = "latest" -#uv = "latest" +uv = "latest" diff --git a/dot_config/nvim/lua/plugins/executable_lsp-zero.lua b/dot_config/nvim/lua/plugins/executable_lsp-zero.lua index d43bd1b..df35502 100644 --- a/dot_config/nvim/lua/plugins/executable_lsp-zero.lua +++ b/dot_config/nvim/lua/plugins/executable_lsp-zero.lua @@ -1,335 +1,335 @@ return { - -- Autocompletion - { - "hrsh7th/nvim-cmp", - lazy = true, - event = "InsertEnter", - dependencies = { - { "L3MON4D3/LuaSnip" }, - { "hrsh7th/cmp-path" }, - }, - config = function() - -- Here is where you configure the autocompletion settings. - -- The arguments for .extend() have the same shape as `manage_nvim_cmp`: - -- https://github.com/VonHeikemen/lsp-zero.nvim/blob/v2.x/doc/md/api-reference.md#manage_nvim_cmp + -- Autocompletion + { + "hrsh7th/nvim-cmp", + lazy = true, + event = "InsertEnter", + dependencies = { + { "L3MON4D3/LuaSnip" }, + { "hrsh7th/cmp-path" }, + }, + config = function() + -- Here is where you configure the autocompletion settings. + -- The arguments for .extend() have the same shape as `manage_nvim_cmp`: + -- https://github.com/VonHeikemen/lsp-zero.nvim/blob/v2.x/doc/md/api-reference.md#manage_nvim_cmp - require("lsp-zero.cmp").extend() + require("lsp-zero.cmp").extend() - -- And you can configure cmp even more, if you want to. - local cmp = require("cmp") - local cmp_action = require("lsp-zero.cmp").action() + -- And you can configure cmp even more, if you want to. + local cmp = require("cmp") + local cmp_action = require("lsp-zero.cmp").action() - cmp.setup({ - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - mapping = { - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.complete(), - [""] = cmp_action.luasnip_jump_forward(), - [""] = cmp_action.luasnip_jump_backward(), - }, - completion = { - completeopt = "menu,menuone,preview,noselect", - }, - formatting = { - fields = { "abbr", "kind", "menu" }, - }, - }) + cmp.setup({ + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = { + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), + [""] = cmp_action.luasnip_jump_forward(), + [""] = cmp_action.luasnip_jump_backward(), + }, + completion = { + completeopt = "menu,menuone,preview,noselect", + }, + formatting = { + fields = { "abbr", "kind", "menu" }, + }, + }) - -- If you want insert `(` after select function or method item - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, - }, + -- If you want insert `(` after select function or method item + local cmp_autopairs = require("nvim-autopairs.completion.cmp") + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + end, + }, - -- LSP - { - "VonHeikemen/lsp-zero.nvim", - branch = "v2.x", - lazy = true, - opts = { - { - float_border = "rounded", - call_servers = "local", - configure_diagnostics = true, - setup_servers_on_start = true, - set_lsp_keymaps = { - preserve_mappings = false, - omit = {}, - }, - manage_nvim_cmp = { - set_sources = "recommended", - set_basic_mappings = true, - set_extra_mappings = false, - use_luasnip = true, - set_format = true, - documentation_window = true, - }, - }, - }, - config = function(_, opts) - -- This is where you modify the settings for lsp-zero - -- Note: autocompletion settings will not take effect - require("lsp-zero.settings").preset(opts) - end, - }, + -- LSP + { + "VonHeikemen/lsp-zero.nvim", + branch = "v2.x", + lazy = true, + opts = { + { + float_border = "rounded", + call_servers = "local", + configure_diagnostics = true, + setup_servers_on_start = true, + set_lsp_keymaps = { + preserve_mappings = false, + omit = {}, + }, + manage_nvim_cmp = { + set_sources = "recommended", + set_basic_mappings = true, + set_extra_mappings = false, + use_luasnip = true, + set_format = true, + documentation_window = true, + }, + }, + }, + config = function(_, opts) + -- This is where you modify the settings for lsp-zero + -- Note: autocompletion settings will not take effect + require("lsp-zero.settings").preset(opts) + end, + }, - { - "neovim/nvim-lspconfig", - cmd = "LspInfo", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - { "hrsh7th/cmp-nvim-lsp" }, - }, - config = function() - -- This is where all the LSP shenanigans will live + { + "neovim/nvim-lspconfig", + cmd = "LspInfo", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + { "hrsh7th/cmp-nvim-lsp" }, + }, + config = function() + -- This is where all the LSP shenanigans will live - local lsp_zero = require("lsp-zero") - lsp_zero.set_sign_icons({ - error = "✘", - warn = "▲", - hint = "⚑", - info = "»", - }) + local lsp_zero = require("lsp-zero") + lsp_zero.set_sign_icons({ + error = "✘", + warn = "▲", + hint = "⚑", + info = "»", + }) - local lsp_format_on_save = function(bufnr) - local augroup = vim.api.nvim_create_augroup("LspFormatting", { clear = true }) - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - callback = function() - vim.lsp.buf.format({ - async = true, - timeout_ms = 10000, - }) - end, - }) - end + local lsp_format_on_save = function(bufnr) + local augroup = vim.api.nvim_create_augroup("LspFormatting", { clear = true }) + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + callback = function() + vim.lsp.buf.format({ + async = true, + timeout_ms = 10000, + }) + end, + }) + end - lsp_zero.preset("recommended") + lsp_zero.preset("recommended") - lsp_zero.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp_zero.default_keymaps({ buffer = bufnr }) - vim.keymap.set("n", "r", "lua vim.lsp.buf.rename()") - vim.keymap.set("n", "ga", "lua vim.lsp.buf.code_action()") - lsp_format_on_save(bufnr) - end) + lsp_zero.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({ buffer = bufnr }) + vim.keymap.set("n", "r", "lua vim.lsp.buf.rename()") + vim.keymap.set("n", "ga", "lua vim.lsp.buf.code_action()") + lsp_format_on_save(bufnr) + end) - lsp_zero.setup() - end, - }, + lsp_zero.setup() + end, + }, - -- Mason - { - "williamboman/mason.nvim", - event = "VeryLazy", - config = function() - require("mason").setup({}) - end, - }, - { - "williamboman/mason-lspconfig.nvim", - dependencies = "williamboman/mason.nvim", - event = "VeryLazy", - config = function() - local lsp_zero = require("lsp-zero") - require("mason-lspconfig").setup({ - ensure_installed = { - "gopls", - "marksman", - "lua_ls", - "terraformls", - "tflint", - "tsserver", - "yamlls", - "dagger", - -- "rust_analyzer", - "jdtls", - "clangd", - "solargraph", - "bashls", - "ruff_lsp", - "pyright", - "typos_lsp", - }, - handlers = { - lsp_zero.default_setup, - }, - }) + -- Mason + { + "williamboman/mason.nvim", + event = "VeryLazy", + config = function() + require("mason").setup({}) + end, + }, + { + "williamboman/mason-lspconfig.nvim", + dependencies = "williamboman/mason.nvim", + event = "VeryLazy", + config = function() + local lsp_zero = require("lsp-zero") + require("mason-lspconfig").setup({ + ensure_installed = { + "gopls", + "marksman", + "lua_ls", + "terraformls", + "tflint", + "tsserver", + "yamlls", + "dagger", + -- "rust_analyzer", + "jdtls", + "clangd", + "solargraph", + "bashls", + "ruff_lsp", + "pyright", + "typos_lsp", + }, + handlers = { + lsp_zero.default_setup, + }, + }) - -- (Optional) Configure lua language server for neovim - require("lspconfig").gopls.setup({ - on_attach = function(client, bufnr) - print("hello gopls") - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*.go", - callback = function() - vim.lsp.buf.code_action({ context = { only = { "source.organizeImports" } }, apply = true }) - end, - }) - end, - }) + -- (Optional) Configure lua language server for neovim + require("lspconfig").gopls.setup({ + on_attach = function(client, bufnr) + print("hello gopls") + vim.api.nvim_create_autocmd("BufWritePre", { + pattern = "*.go", + callback = function() + vim.lsp.buf.code_action({ context = { only = { "source.organizeImports" } }, apply = true }) + end, + }) + end, + }) - require("lspconfig").pyright.setup({ - settings = { - pyright = { - -- Using Ruff's import organizer - disableOrganizeImports = true, - }, - }, - }) + require("lspconfig").pyright.setup({ + settings = { + pyright = { + -- Using Ruff's import organizer + disableOrganizeImports = true, + }, + }, + }) - require("lspconfig").ruff_lsp.setup({ - init_options = { - settings = { - format = { - args = {}, - }, - lint = { - args = {}, - }, - }, - }, - }) + require("lspconfig").ruff_lsp.setup({ + init_options = { + settings = { + format = { + args = {}, + }, + lint = { + args = {}, + }, + }, + }, + }) - require("lspconfig").typos_lsp.setup({ - init_options = { - config = vim.fn.expand("~/.config/typos/typos.toml"), - }, - }) - vim.api.nvim_create_autocmd("FileType", { - pattern = { "sh", "zsh", "template" }, - callback = function() - vim.lsp.start({ - name = "bash-language-server", - cmd = { "bash-language-server", "start" }, - }) - -- 頑張って shfmt するかもしれない - end, - }) - end, - }, - { - "jay-babu/mason-null-ls.nvim", - event = "VeryLazy", - dependencies = { "williamboman/mason.nvim", "nvimtools/none-ls.nvim" }, - config = function() - -- See mason-null-ls.nvim's documentation for more details: - -- https://github.com/jay-babu/mason-null-ls.nvim#setup - require("mason-null-ls").setup({ - ensure_installed = { - "hadolint", - "terraform_fmt", - "terraform_validate", - "stylua", - "gofumpt", - "golangci_lint", - "prettierd", - }, - automatic_installation = true, - handlers = {}, - }) - end, - }, - { - "nvimtools/none-ls.nvim", - event = "VeryLazy", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.diagnostics.fish, - null_ls.builtins.formatting.fish_indent, - -- null_ls.builtins.formatting.shfmt.with({ - -- filetypes = { "sh", "zsh" }, - -- }), - }, - }) - end, - }, + require("lspconfig").typos_lsp.setup({ + init_options = { + config = vim.fn.expand("~/.config/typos/typos.toml"), + }, + }) + vim.api.nvim_create_autocmd("FileType", { + pattern = { "sh", "zsh" }, + callback = function() + vim.lsp.start({ + name = "bash-language-server", + cmd = { "bash-language-server", "start" }, + }) + -- 頑張って shfmt するかもしれない + end, + }) + end, + }, + { + "jay-babu/mason-null-ls.nvim", + event = "VeryLazy", + dependencies = { "williamboman/mason.nvim", "nvimtools/none-ls.nvim" }, + config = function() + -- See mason-null-ls.nvim's documentation for more details: + -- https://github.com/jay-babu/mason-null-ls.nvim#setup + require("mason-null-ls").setup({ + ensure_installed = { + "hadolint", + "terraform_fmt", + "terraform_validate", + "stylua", + "gofumpt", + "golangci_lint", + "prettierd", + }, + automatic_installation = true, + handlers = {}, + }) + end, + }, + { + "nvimtools/none-ls.nvim", + event = "VeryLazy", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.diagnostics.fish, + null_ls.builtins.formatting.fish_indent, + -- null_ls.builtins.formatting.shfmt.with({ + -- filetypes = { "sh", "zsh" }, + -- }), + }, + }) + end, + }, - -- Rust - { - { "simrat39/rust-tools.nvim", enable = false }, - { - "mrcjkb/rustaceanvim", - version = "^3", -- Recommended - dependencies = { - "nvim-lua/plenary.nvim", - "mfussenegger/nvim-dap", - { - "lvimuser/lsp-inlayhints.nvim", - opts = {}, - }, - }, - ft = { "rust" }, - opts = { - server = { - on_attach = function(client, bufnr) - -- register which-key mappings - local wk = require("which-key") - wk.register({ - ["cR"] = { - function() - vim.cmd.RustLsp("codeAction") - end, - "Code Action", - }, - ["dr"] = { - function() - vim.cmd.RustLsp("debuggables") - end, - "Rust debuggables", - }, - }, { mode = "n", buffer = bufnr }) - end, - settings = { - -- rust-analyzer language server configuration - ["rust-analyzer"] = { - cargo = { - allFeatures = true, - loadOutDirsFromCheck = true, - runBuildScripts = true, - }, - -- Add clippy lints for Rust. - checkOnSave = { - allFeatures = true, - command = "clippy", - extraArgs = { "--no-deps" }, - }, - procMacro = { - enable = true, - ignored = { - ["async-trait"] = { "async_trait" }, - ["napi-derive"] = { "napi" }, - ["async-recursion"] = { "async_recursion" }, - }, - }, - }, - }, - }, - }, - config = function(_, opts) - vim.g.rustaceanvim = vim.tbl_deep_extend("force", {}, { - inlay_hints = { - highlight = "NonText", - }, - tools = { - hover_actions = { - auto_focus = true, - }, - }, - server = { - on_attach = function(client, bufnr) - require("lsp-inlayhints").on_attach(client, bufnr) - end, - }, - }) - end, - }, - }, + -- Rust + { + { "simrat39/rust-tools.nvim", enable = false }, + { + "mrcjkb/rustaceanvim", + version = "^3", -- Recommended + dependencies = { + "nvim-lua/plenary.nvim", + "mfussenegger/nvim-dap", + { + "lvimuser/lsp-inlayhints.nvim", + opts = {}, + }, + }, + ft = { "rust" }, + opts = { + server = { + on_attach = function(client, bufnr) + -- register which-key mappings + local wk = require("which-key") + wk.register({ + ["cR"] = { + function() + vim.cmd.RustLsp("codeAction") + end, + "Code Action", + }, + ["dr"] = { + function() + vim.cmd.RustLsp("debuggables") + end, + "Rust debuggables", + }, + }, { mode = "n", buffer = bufnr }) + end, + settings = { + -- rust-analyzer language server configuration + ["rust-analyzer"] = { + cargo = { + allFeatures = true, + loadOutDirsFromCheck = true, + runBuildScripts = true, + }, + -- Add clippy lints for Rust. + checkOnSave = { + allFeatures = true, + command = "clippy", + extraArgs = { "--no-deps" }, + }, + procMacro = { + enable = true, + ignored = { + ["async-trait"] = { "async_trait" }, + ["napi-derive"] = { "napi" }, + ["async-recursion"] = { "async_recursion" }, + }, + }, + }, + }, + }, + }, + config = function(_, opts) + vim.g.rustaceanvim = vim.tbl_deep_extend("force", {}, { + inlay_hints = { + highlight = "NonText", + }, + tools = { + hover_actions = { + auto_focus = true, + }, + }, + server = { + on_attach = function(client, bufnr) + require("lsp-inlayhints").on_attach(client, bufnr) + end, + }, + }) + end, + }, + }, }