Skip to content

Commit

Permalink
various
Browse files Browse the repository at this point in the history
  • Loading branch information
grtw2116 committed Sep 8, 2024
1 parent 5194ad4 commit a2caada
Show file tree
Hide file tree
Showing 18 changed files with 178 additions and 135 deletions.
17 changes: 17 additions & 0 deletions config/ideavim/.ideavimrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
let mapleader = " "

" plugins
Plug 'preservim/nerdtree'
Plug 'tpope/vim-surround'
Plug 'toppe/vim-commentary'

" key mappings
nmap gi <Action>(GotoImplementation)
nmap gr <Action>(FindUsages)
nmap <leader>ca <Action>(GotoAction)
nmap <C-p> <Action>(SearchEverywhere)
nmap <leader>rn <Action>(RenameElement)
nmap [b <Action>(PreviousTab)
nmap ]b <Action>(NextTab)

nmap <C-n> :NERDTreeToggle<CR>
6 changes: 5 additions & 1 deletion config/latexmk/.latexmkrc
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
1 change: 1 addition & 0 deletions config/nvim/lua/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vim.o.shiftwidth = 4 -- インデントの見た目の空白数をスペース4
vim.o.expandtab = true -- <Tab>を押したときにタブ文字ではなく半角スペースを挿入
vim.o.autoindent = true -- 改行したときにインデントを継承
vim.o.smartindent = true -- '{'で終わる行で改行すると勝手にインデント
vim.o.clipboard = "unnamedplus" -- クリップボード同期を有効化

vim.o.termguicolors = true -- GUIカラーを有効化
vim.o.background = "dark" -- 背景を明るく
65 changes: 37 additions & 28 deletions config/nvim/lua/lazy-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ require("lazy").setup({
"hrsh7th/cmp-calc",

-- luaのneovim APIを補完
"folke/neodev.nvim",
{
"folke/lazydev.nvim",
ft = "lua",
},

-- ポータブルLSPインストーラ
{
Expand All @@ -86,7 +89,7 @@ require("lazy").setup({
end,
},

-- Masonとlsp-configの橋渡し
-- Masonとlspconfigの橋渡し
{
"williamboman/mason-lspconfig.nvim",
config = function()
Expand All @@ -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",
Expand Down Expand Up @@ -238,7 +223,10 @@ require("lazy").setup({
end,
},

-- ファンシーなUI
-- ファンシーな選択・入力UI
"stevearc/dressing.nvim",

-- ファンシーな通知UI
{
"folke/noice.nvim",
event = "VeryLazy",
Expand Down Expand Up @@ -300,6 +288,9 @@ require("lazy").setup({
},
},

-- コメント整形
"godlygeek/tabular",

-- --------------------------------------------------------------
-- ファイル操作系
-- --------------------------------------------------------------
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -541,4 +545,9 @@ require("lazy").setup({
require("startup").setup()
end,
},
{
"m4xshen/hardtime.nvim",
dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim" },
opts = {},
},
})
2 changes: 1 addition & 1 deletion config/nvim/lua/plugin-config/auto-dark-mode.lua
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
5 changes: 4 additions & 1 deletion config/nvim/lua/plugin-config/catppuccin.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
require("catppuccin").setup({
integrations = {
flash = true,
aerial = true,
diffview = true,
dropbar = {
enabled = true,
},
noice = true,
}
notify = true,
},
transparent_background = true,
})
14 changes: 6 additions & 8 deletions config/nvim/lua/plugin-config/conform.lua
Original file line number Diff line number Diff line change
@@ -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,
},
})
3 changes: 3 additions & 0 deletions config/nvim/lua/plugin-config/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,8 @@ vim.api.nvim_create_autocmd("LspAttach", {
-- vim.keymap.set('n', '<leader>f', function()
-- vim.lsp.buf.format { async = true }
-- end, opts)

-- inlay hintsを有効化
vim.lsp.inlay_hint.enable(true)
end,
})
22 changes: 6 additions & 16 deletions config/nvim/lua/plugin-config/none-ls.lua
Original file line number Diff line number Diff line change
@@ -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" },
-- }),
-- },
})
85 changes: 44 additions & 41 deletions config/nvim/lua/plugin-config/nvim-cmp.lua
Original file line number Diff line number Diff line change
@@ -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({
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-l>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = 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({
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-l>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = 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" },
}),
}),
})
2 changes: 1 addition & 1 deletion config/sketchybar/items/media.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions config/sketchybar/plugins/icon_map_fn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -303,7 +303,7 @@ function __icon_map() {
"Mullvad Browser")
icon_result=":mullvad_browser:"
;;
"Music" | "音乐" | "Musique")
"Music" | "音乐" | "Musique" | "ミュージック")
icon_result=":music:"
;;
"Neovide" | "neovide")
Expand Down
Loading

0 comments on commit a2caada

Please sign in to comment.