diff --git a/config/ideavim/.ideavimrc b/config/ideavim/.ideavimrc new file mode 100644 index 0000000..0b3cca1 --- /dev/null +++ b/config/ideavim/.ideavimrc @@ -0,0 +1,17 @@ +let mapleader = " " + +" plugins +Plug 'preservim/nerdtree' +Plug 'tpope/vim-surround' +Plug 'toppe/vim-commentary' + +" key mappings +nmap gi (GotoImplementation) +nmap gr (FindUsages) +nmap ca (GotoAction) +nmap (SearchEverywhere) +nmap rn (RenameElement) +nmap [b (PreviousTab) +nmap ]b (NextTab) + +nmap :NERDTreeToggle \ No newline at end of file diff --git a/config/latexmk/.latexmkrc b/config/latexmk/.latexmkrc index 472b9cd..8d4ab11 100644 --- a/config/latexmk/.latexmkrc +++ b/config/latexmk/.latexmkrc @@ -1,9 +1,13 @@ #!/usr/bin/perl # commands for latex,bibtex,dvipdf. %S : source file, %B : base name, %D : pdf file, %O : option -$latex = 'uplatex %O -interaction=nonstopmode -synctex=1 -kanji=utf8 %S'; +$latex = 'uplatex %O -shell-escape -interaction=nonstopmode -synctex=1 -kanji=utf8 %S'; $bibtex = 'upbibtex %O %B -kanji=utf8'; $dvipdf = 'dvipdfmx %O -o %D %S'; +# スタイルファイルは sty/ に置く +ensure_path('TEXINPUTS', 'sty/'); +ensure_path('BSTINPUTS', 'sty/'); + # method to make pdf - 0:not making, 1:pdflatex, 2:ps2pdf, 3:dvipdf $pdf_mode = 3; diff --git a/config/nvim/lua/base.lua b/config/nvim/lua/base.lua index e0fbb16..e401f41 100644 --- a/config/nvim/lua/base.lua +++ b/config/nvim/lua/base.lua @@ -9,6 +9,7 @@ vim.o.shiftwidth = 4 -- インデントの見た目の空白数をスペース4 vim.o.expandtab = true -- を押したときにタブ文字ではなく半角スペースを挿入 vim.o.autoindent = true -- 改行したときにインデントを継承 vim.o.smartindent = true -- '{'で終わる行で改行すると勝手にインデント +vim.o.clipboard = "unnamedplus" -- クリップボード同期を有効化 vim.o.termguicolors = true -- GUIカラーを有効化 vim.o.background = "dark" -- 背景を明るく diff --git a/config/nvim/lua/lazy-setup.lua b/config/nvim/lua/lazy-setup.lua index 7c83c5f..80145b5 100644 --- a/config/nvim/lua/lazy-setup.lua +++ b/config/nvim/lua/lazy-setup.lua @@ -76,7 +76,10 @@ require("lazy").setup({ "hrsh7th/cmp-calc", -- luaのneovim APIを補完 - "folke/neodev.nvim", + { + "folke/lazydev.nvim", + ft = "lua", + }, -- ポータブルLSPインストーラ { @@ -86,7 +89,7 @@ require("lazy").setup({ end, }, - -- Masonとlsp-configの橋渡し + -- Masonとlspconfigの橋渡し { "williamboman/mason-lspconfig.nvim", config = function() @@ -103,24 +106,6 @@ require("lazy").setup({ end, }, - -- 疑似LSP - -- deprecatedとなったため削除 - { - "nvimtools/none-ls.nvim", - config = function() - require("plugin-config/none-ls") - end, - }, - - -- LSPの起動状況を表示 - -- 現在開発者によってリライトされているため,破壊的変更を防ぐためにlegacyタグを指定 - -- { - -- "j-hui/fidget.nvim", - -- config = function() - -- require("fidget").setup() - -- end, - -- }, - -- LSPのUIを提供 { "folke/trouble.nvim", @@ -238,7 +223,10 @@ require("lazy").setup({ end, }, - -- ファンシーなUI + -- ファンシーな選択・入力UI + "stevearc/dressing.nvim", + + -- ファンシーな通知UI { "folke/noice.nvim", event = "VeryLazy", @@ -300,6 +288,9 @@ require("lazy").setup({ }, }, + -- コメント整形 + "godlygeek/tabular", + -- -------------------------------------------------------------- -- ファイル操作系 -- -------------------------------------------------------------- @@ -466,13 +457,26 @@ require("lazy").setup({ }, -- Markdown - { - "MeanderingProgrammer/markdown.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - config = function() - require("render-markdown").setup({}) - end, - }, + -- { + -- "MeanderingProgrammer/markdown.nvim", + -- dependencies = { "nvim-treesitter/nvim-treesitter" }, + -- config = function() + -- require("render-markdown").setup({}) + -- end, + -- }, + + -- PlantUML + -- { + -- "https://gitlab.com/itaranto/plantuml.nvim", + -- version = "*", + -- config = function() + -- require("plantuml").setup({ + -- renderer = { + -- type = "image", + -- }, + -- }) + -- end, + -- }, -- { -- "nvim-java/nvim-java", @@ -541,4 +545,9 @@ require("lazy").setup({ require("startup").setup() end, }, + { + "m4xshen/hardtime.nvim", + dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" }, + opts = {}, + }, }) diff --git a/config/nvim/lua/plugin-config/auto-dark-mode.lua b/config/nvim/lua/plugin-config/auto-dark-mode.lua index 73c80de..a5b4b06 100644 --- a/config/nvim/lua/plugin-config/auto-dark-mode.lua +++ b/config/nvim/lua/plugin-config/auto-dark-mode.lua @@ -1,7 +1,7 @@ require("auto-dark-mode").setup({ update_interval = 1000, set_dark_mode = function() - vim.api.nvim_set_option("background", "light") + vim.api.nvim_set_option("background", "dark") vim.cmd("colorscheme catppuccin") end, set_light_mode = function() diff --git a/config/nvim/lua/plugin-config/catppuccin.lua b/config/nvim/lua/plugin-config/catppuccin.lua index 321b8f0..a051f32 100644 --- a/config/nvim/lua/plugin-config/catppuccin.lua +++ b/config/nvim/lua/plugin-config/catppuccin.lua @@ -1,10 +1,13 @@ require("catppuccin").setup({ integrations = { + flash = true, aerial = true, diffview = true, dropbar = { enabled = true, }, noice = true, - } + notify = true, + }, + transparent_background = true, }) diff --git a/config/nvim/lua/plugin-config/conform.lua b/config/nvim/lua/plugin-config/conform.lua index 19bdd9a..f152dc6 100644 --- a/config/nvim/lua/plugin-config/conform.lua +++ b/config/nvim/lua/plugin-config/conform.lua @@ -1,19 +1,17 @@ require("conform").setup({ formatters_by_ft = { 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" } }, - typescript = { "rustywind", { "prettierd", "prettier" } }, - typescriptreact = { "rustywind", { "prettierd", "prettier" } }, + java = { "google-java-format" }, + javascript = { "biome", "prettierd", "prettier", stop_after_first = true }, + javascriptreact = { "biome", "prettierd", "prettier", stop_after_first = true }, + typescript = { "biome", "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "biome", "prettierd", "prettier", stop_after_first = true }, sh = { "shfmt" }, bash = { "shfmt" }, }, format_on_save = { - -- timeout_ms = 500, + timeout_ms = 500, lsp_fallback = true, }, }) diff --git a/config/nvim/lua/plugin-config/lspconfig.lua b/config/nvim/lua/plugin-config/lspconfig.lua index 77f9d41..ef83730 100644 --- a/config/nvim/lua/plugin-config/lspconfig.lua +++ b/config/nvim/lua/plugin-config/lspconfig.lua @@ -99,5 +99,8 @@ vim.api.nvim_create_autocmd("LspAttach", { -- vim.keymap.set('n', 'f', function() -- vim.lsp.buf.format { async = true } -- end, opts) + + -- inlay hintsを有効化 + vim.lsp.inlay_hint.enable(true) end, }) diff --git a/config/nvim/lua/plugin-config/none-ls.lua b/config/nvim/lua/plugin-config/none-ls.lua index 2e02238..38d1e5d 100644 --- a/config/nvim/lua/plugin-config/none-ls.lua +++ b/config/nvim/lua/plugin-config/none-ls.lua @@ -1,20 +1,10 @@ local null_ls = require("null-ls") null_ls.setup({ - sources = { - null_ls.builtins.diagnostics.textlint.with({ - extra_filetypes = { "tex", "plaintex" }, - args = { - "--config", - "$XDG_CONFIG_HOME/textlint/.textlintrc.json", - "--rules-base-directory", - "$NVM_BIN/../lib/node_modules", - "-f", - "json", - "--stdin", - "--stdin-filename", - "$FILENAME", - }, - }), - }, + -- debug = true, + -- sources = { + -- null_ls.builtins.diagnostics.textlint.with({ + -- extra_filetypes = { "tex", "plaintex" }, + -- }), + -- }, }) diff --git a/config/nvim/lua/plugin-config/nvim-cmp.lua b/config/nvim/lua/plugin-config/nvim-cmp.lua index af9878a..8ed41d8 100644 --- a/config/nvim/lua/plugin-config/nvim-cmp.lua +++ b/config/nvim/lua/plugin-config/nvim-cmp.lua @@ -1,45 +1,48 @@ local cmp = require("cmp") cmp.setup({ - window = { - completion = cmp.config.window.bordered(), - documentation = cmp.config.window.bordered(), - }, - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - sources = { - { name = "nvim_lsp" }, - { name = "nvim_lsp_signature_help" }, - { name = "nvim_lsp_document_symbol" }, - { name = "buffer" }, - { name = "path" }, - { name = "nvim_lua" }, - { name = "luasnip" }, - { name = "calc" }, - }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm { select = true }, - }), - formatting = { - format = require("lspkind").cmp_format({ - mode = "symbol", - maxwidth = 50, - ellipsis_char = "...", - }) - }, - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' } - }, { - { name = 'cmdline' } - }) - }) + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + sources = { + { name = "nvim_lsp" }, -- LSP + { name = "nvim_lsp_signature_help" }, -- 関数のパラメータ + { name = "nvim_lsp_document_symbol" }, -- LSPのdocumentSymbol + { name = "buffer" }, -- バッファ内の単語 + { name = "path" }, -- ファイルパス + { name = "nvim_lua" }, -- NeovimのLua API + { name = "lazydev" }, + { name = "luasnip" }, -- スニペット + { name = "calc" }, -- 計算結果 + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(), + [""] = cmp.mapping.select_next_item(), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = false }), + }), + formatting = { + expandable_indicator = true, + fields = { "abbr", "kind", "menu" }, + format = require("lspkind").cmp_format({ + mode = "symbol_text", + maxwidth = 50, + ellipsis_char = "...", + }), + }, + cmp.setup.cmdline(":", { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + }), }) diff --git a/config/sketchybar/items/media.sh b/config/sketchybar/items/media.sh index 537e922..61f38ec 100755 --- a/config/sketchybar/items/media.sh +++ b/config/sketchybar/items/media.sh @@ -3,7 +3,7 @@ sketchybar --add item media e \ --set media label.color=$ACCENT_COLOR \ label.max_chars=20 \ - icon.padding_left=0 \ + icon.padding_left=20 \ scroll_texts=on \ icon=􀑪 \ icon.color=$ACCENT_COLOR \ diff --git a/config/sketchybar/plugins/icon_map_fn.sh b/config/sketchybar/plugins/icon_map_fn.sh index 6926b01..58d2eb9 100755 --- a/config/sketchybar/plugins/icon_map_fn.sh +++ b/config/sketchybar/plugins/icon_map_fn.sh @@ -249,7 +249,7 @@ function __icon_map() { "Logseq") icon_result=":logseq:" ;; - "Canary Mail" | "HEY" | "Mail" | "Mailspring" | "MailMate" | "邮件") + "Canary Mail" | "HEY" | "Mail" | "Mailspring" | "MailMate" | "邮件" | "メール") icon_result=":mail:" ;; "MAMP" | "MAMP PRO") @@ -303,7 +303,7 @@ function __icon_map() { "Mullvad Browser") icon_result=":mullvad_browser:" ;; - "Music" | "音乐" | "Musique") + "Music" | "音乐" | "Musique" | "ミュージック") icon_result=":music:" ;; "Neovide" | "neovide") diff --git a/config/skhd/skhdrc b/config/skhd/skhdrc index 6d87481..fb0a8e5 100644 --- a/config/skhd/skhdrc +++ b/config/skhd/skhdrc @@ -1,45 +1,49 @@ # focus window -alt - x : yabai -m window --focus recent alt - h : yabai -m window --focus west alt - j : yabai -m window --focus south alt - k : yabai -m window --focus north alt - l : yabai -m window --focus east -alt - n : ~/.scripts/yabai_next_window.sh -alt - p : ~/.scripts/yabai_prev_window.sh # swap window -shift + alt - x : yabai -m window --swap recent shift + alt - h : yabai -m window --swap west shift + alt - j : yabai -m window --swap south shift + alt - k : yabai -m window --swap north shift + alt - l : yabai -m window --swap east -# move window -shift + cmd - h : yabai -m window --warp west -shift + cmd - j : yabai -m window --warp south -shift + cmd - k : yabai -m window --warp north -shift + cmd - l : yabai -m window --warp east +# defines a new mode 'resize' with an on_enter command, that captures keypresses +:: resize @ : yabai -m config active_window_opacity 1; yabai -m config normal_window_opacity 0.9; -# move window -shift + ctrl - a : yabai -m window --move rel:-20:0 -shift + ctrl - s : yabai -m window --move rel:0:20 -shift + ctrl - w : yabai -m window --move rel:0:-20 -shift + ctrl - d : yabai -m window --move rel:20:0 +# from 'default' mode, activate mode 'resize' +# (this is the key combination you want to use to enter resize mode) +alt - r ; resize + +# from 'resize' mode, activate mode 'default' +# (this is the keypress required to leave resize mode) +resize < escape ; default + +# equalize windows +# resize < ctrl - 0 : yabai -m space --balance # increase window size -shift + alt - a : yabai -m window --resize left:-20:0 -shift + alt - s : yabai -m window --resize bottom:0:20 -shift + alt - w : yabai -m window --resize top:0:-20 -shift + alt - d : yabai -m window --resize right:20:0 +resize < h : yabai -m window --resize left:-25:0 +resize < j : yabai -m window --resize bottom:0:25 +resize < k : yabai -m window --resize top:0:-25 +resize < l : yabai -m window --resize right:25:0 # decrease window size -shift + cmd - a : yabai -m window --resize left:20:0 -shift + cmd - s : yabai -m window --resize bottom:0:-20 -shift + cmd - w : yabai -m window --resize top:0:20 -shift + cmd - d : yabai -m window --resize right:-20:0 +resize < ctrl - h : yabai -m window --resize left:25:0 +resize < ctrl - j : yabai -m window --resize bottom:0:-25 +resize < ctrl - k : yabai -m window --resize top:0:25 +resize < ctrl - l : yabai -m window --resize right:-25:0 + +# move window +resize < cmd - left : yabai -m window --move rel:-25:0 +resize < cmd - down : yabai -m window -move rel:0:25 +resize < cmd - up : yabai -m window --move rel:0:-25 +resize < cmd - right : yabai -m window --move rel:25:0 # rotate tree -alt - r : yabai -m space --rotate 90 +# alt - r : yabai -m space --rotate 90 # mirror tree y-axis alt - y : yabai -m space --mirror y-axis @@ -111,4 +115,4 @@ ctrl + alt - 2 : yabai -m display --focus 2 ## WezTerm alt - return : open -a "WezTerm" ## Google Chrome -alt - b : open -a "Google Chrome" +alt - b : open -a "Arc" diff --git a/config/wezterm/wezterm.lua b/config/wezterm/wezterm.lua index 2ee29b5..6111fd7 100644 --- a/config/wezterm/wezterm.lua +++ b/config/wezterm/wezterm.lua @@ -54,6 +54,9 @@ config.window_padding = { bottom = 0, } +config.window_background_opacity = 0.85 +config.macos_window_background_blur = 20 + config.font_size = 12.0 -- : Leaderキー @@ -61,14 +64,22 @@ config.leader = { key = "s", mods = "CTRL", timeout_milliseconds = 2000 } local act = wezterm.action config.keys = { - { key = "h", mods = "LEADER", action = act.ActivatePaneDirection("Left") }, - { key = "j", mods = "LEADER", action = act.ActivatePaneDirection("Down") }, - { key = "k", mods = "LEADER", action = act.ActivatePaneDirection("Up") }, - { key = "l", mods = "LEADER", action = act.ActivatePaneDirection("Right") }, - { key = "v", mods = "LEADER", action = act.SplitVertical({ domain = "CurrentPaneDomain" }) }, - { key = "x", mods = "LEADER", action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }) }, + { key = "h", mods = "LEADER", action = act.ActivatePaneDirection("Left") }, + { key = "j", mods = "LEADER", action = act.ActivatePaneDirection("Down") }, + { key = "k", mods = "LEADER", action = act.ActivatePaneDirection("Up") }, + { key = "l", mods = "LEADER", action = act.ActivatePaneDirection("Right") }, + { + key = "v", + mods = "LEADER", + action = act.SplitVertical({ domain = "CurrentPaneDomain" }), + }, + { + key = "x", + mods = "LEADER", + action = act.SplitHorizontal({ domain = "CurrentPaneDomain" }), + }, -- : ランチャー表示 - { key = "l", mods = "CMD", action = act.ShowLauncher }, + { key = "l", mods = "CMD", action = act.ShowLauncher }, -- Windows / Linux環境では AltキーをSuperキーとして使う { key = "Alt", action = act.SendKey({ key = "Super" }) }, } diff --git a/config/yabai/yabairc b/config/yabai/yabairc index 144fd3f..a1fd101 100644 --- a/config/yabai/yabairc +++ b/config/yabai/yabairc @@ -5,7 +5,7 @@ yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa" sudo yabai --load-sa # global settings -yabai -m config mouse_follows_focus off +yabai -m config mouse_follows_focus on yabai -m config focus_follows_mouse on yabai -m config window_origin_display default yabai -m config window_placement second_child @@ -29,7 +29,7 @@ yabai -m config mouse_drop_action swap # general space settings yabai -m config layout bsp -yabai -m config top_padding 48 +yabai -m config top_padding 12 yabai -m config bottom_padding 12 yabai -m config left_padding 12 yabai -m config right_padding 12 diff --git a/install.sh b/install.sh index 8a80c09..42161d5 100755 --- a/install.sh +++ b/install.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/bash # dotfilesのレポジトリがあるパスを取得 export DOT_DIR="$(cd "$(dirname "$0")" && pwd)" diff --git a/scripts/link.sh b/scripts/link.sh index 22b5232..6debf45 100755 --- a/scripts/link.sh +++ b/scripts/link.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/bash source "$(dirname "$0")/common-var.sh" mkdir -p "$XDG_CONFIG_HOME" diff --git a/scripts/macos.sh b/scripts/macos.sh index e0431a5..a65c639 100755 --- a/scripts/macos.sh +++ b/scripts/macos.sh @@ -1,4 +1,4 @@ -#!/usr/bin/bash +#!/bin/bash source "$(dirname "$0")/common-var.sh" # Homebrewのインストール