Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sfuruya0612 committed Oct 17, 2024
1 parent 839bb17 commit f2e71bd
Show file tree
Hide file tree
Showing 11 changed files with 154 additions and 149 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11.6"
python-version: "3.13.0"

- name: Install Ansible and ansible-lint
run: |
Expand Down
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[defaults]
interpreter_python=/opt/homebrew/bin/python3.11
interpreter_python=/opt/homebrew/bin/python3.13
1 change: 1 addition & 0 deletions roles/homebrew/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ homebrew_packages:
- knqyf263/trivy/trivy
- k6
- minikube
- mise
- neovim
- nmap
- node
Expand Down
2 changes: 1 addition & 1 deletion roles/shell/files/functions/fs.fish
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# fs (fzf + ssh)
# Interactively select a registered ssh host
function fs
set -l sshHost (grep -iE "^host" ~/.ssh/config | awk '{print $2}' | grep -v "#" | fzf)
set -l sshHost (grep -E "^Host" ~/.ssh/conf.d/* | awk '{print $2}' | grep -v "#" | grep -v '^[0-9]' | grep -v '^\*' | fzf)

if test -z "$sshHost"
echo "SSH host is not selected."
Expand Down
11 changes: 8 additions & 3 deletions roles/shell/templates/config.fish.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ set -g fish_pager_color_description $comment
set -x PATH $PATH /opt/homebrew/bin

# asdf path
source (brew --prefix asdf)/libexec/asdf.fish
set -x ASDF_DIR (brew --prefix asdf)/libexec
set -x PATH $PATH $HOME/.asdf/shims
# source (brew --prefix asdf)/libexec/asdf.fish
# set -x ASDF_DIR (brew --prefix asdf)/libexec
# set -x PATH $PATH $HOME/.asdf/shims

# mise activate
if type -q mise
$HOME/.local/bin/mise activate fish | source
end

# Go path
set -x GOPATH $HOME/go
Expand Down
24 changes: 12 additions & 12 deletions roles/vim/files/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,30 @@ local autocmd = vim.api.nvim_create_autocmd -- Create autocommand

-- Remove whitespace on save
autocmd("BufWritePre", {
pattern = "*",
command = ":%s/\\s\\+$//e",
pattern = "*",
command = ":%s/\\s\\+$//e",
})

-- Don't auto commenting new lines
autocmd("BufEnter", {
pattern = "*",
command = "set fo-=c fo-=r fo-=o",
pattern = "*",
command = "set fo-=c fo-=r fo-=o",
})

-- Restore cursor location when file is opened
autocmd({ "BufReadPost" }, {
pattern = { "*" },
callback = function()
vim.api.nvim_exec('silent! normal! g`"zv', false)
end,
pattern = { "*" },
callback = function()
vim.api.nvim_exec('silent! normal! g`"zv', false)
end,
})

autocmd({ "BufRead", "BufNewFile" }, {
pattern = { "*.yml", "*.yaml", "*.ts", "*.js", "*tsx" },
command = "setlocal tabstop=2 shiftwidth=2 softtabstop=2"
pattern = { "*.yml", "*.yaml", "*.ts", "*.js", "*tsx" },
command = "setlocal tabstop=2 shiftwidth=2 softtabstop=2"
})

autocmd({ "BufRead", "BufNewFile" }, {
pattern = { "*tsx" },
command = "let b:tsx_ext_found = 1"
pattern = { "*tsx" },
command = "let b:tsx_ext_found = 1"
})
12 changes: 6 additions & 6 deletions roles/vim/files/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ vim.wo.number = true

-- Setting providers
vim.g.loaded_python_provider = 0
vim.g.python3_host_prog = "/opt/homebrew/bin/python3.12"
vim.g.python3_host_prog = "/opt/homebrew/bin/python3.13"
vim.g.node_host_prog = "/opt/homebrew/bin/neovim-node-host"

function _G.show_documentation()
if vim.tbl_contains({ "vim", "help" }, vim.bo.filetype) then
vim.cmd("h " .. vim.fn.expand("<cword>"))
else
vim.fn["CocAction"]("doHover")
end
if vim.tbl_contains({ "vim", "help" }, vim.bo.filetype) then
vim.cmd("h " .. vim.fn.expand("<cword>"))
else
vim.fn["CocAction"]("doHover")
end
end
144 changes: 72 additions & 72 deletions roles/vim/files/copilot_chat_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,86 @@ local actions = require("CopilotChat.actions")


require("CopilotChat").setup {
debug = true, -- Enable debugging
debug = true, -- Enable debugging

model = 'gpt-4', -- GPT model to use, 'gpt-3.5-turbo' or 'gpt-4'
temperature = 0.1, -- GPT temperature
model = 'gpt-4', -- GPT model to use, 'gpt-3.5-turbo' or 'gpt-4'
temperature = 0.1, -- GPT temperature

prompts = {
Explain = {
prompt = '/COPILOT_EXPLAIN カーソル上のコードの説明を段落をつけて書いてください。',
},
Tests = {
prompt = '/COPILOT_TESTS カーソル上のコードの詳細な単体テスト関数を書いてください。',
},
Fix = {
prompt = '/COPILOT_FIX このコードには問題があります。バグを修正したコードに書き換えてください。',
},
Optimize = {
prompt = '/COPILOT_REFACTOR 選択したコードを最適化し、パフォーマンスと可読性を向上させてください。',
},
Docs = {
prompt = '/COPILOT_REFACTOR 選択したコードのドキュメントを書いてください。ドキュメントをコメントとして追加した元のコードを含むコードブロックで回答してください。使用するプログラミング言語に最も適したドキュメントスタイルを使用してください(例:JavaScriptのJSDoc、Pythonのdocstringsなど)',
},
FixDiagnostic = {
prompt = 'ファイル内の次のような診断上の問題を解決してください:',
selection = select.diagnostics,
}
prompts = {
Explain = {
prompt = '/COPILOT_EXPLAIN カーソル上のコードの説明を段落をつけて書いてください。',
},

-- default window options
window = {
layout = 'vertical', -- 'vertical', 'horizontal', 'float', 'replace'
width = 0.3, -- fractional width of parent, or absolute width in columns when > 1
height = 0.3, -- fractional height of parent, or absolute height in rows when > 1
-- Options below only apply to floating windows
relative = 'editor', -- 'editor', 'win', 'cursor', 'mouse'
border = 'single', -- 'none', single', 'double', 'rounded', 'solid', 'shadow'
row = nil, -- row position of the window, default is centered
col = nil, -- column position of the window, default is centered
title = 'Copilot Chat', -- title of chat window
footer = nil, -- footer of chat window
zindex = 1, -- determines if window is on top or below other floating windows
Tests = {
prompt = '/COPILOT_TESTS カーソル上のコードの詳細な単体テスト関数を書いてください。',
},
Fix = {
prompt = '/COPILOT_FIX このコードには問題があります。バグを修正したコードに書き換えてください。',
},
Optimize = {
prompt = '/COPILOT_REFACTOR 選択したコードを最適化し、パフォーマンスと可読性を向上させてください。',
},
Docs = {
prompt = '/COPILOT_REFACTOR 選択したコードのドキュメントを書いてください。ドキュメントをコメントとして追加した元のコードを含むコードブロックで回答してください。使用するプログラミング言語に最も適したドキュメントスタイルを使用してください(例:JavaScriptのJSDoc、Pythonのdocstringsなど)',
},
FixDiagnostic = {
prompt = 'ファイル内の次のような診断上の問題を解決してください:',
selection = select.diagnostics,
}
},

-- default mappings
mappings = {
complete = {
detail = 'Use @<Tab> or /<Tab> for options.',
insert = '<Tab>',
},
close = {
normal = 'q',
insert = '<C-c>'
},
reset = {
normal = '<C-l>',
insert = '<C-l>'
},
submit_prompt = {
normal = '<CR>',
insert = '<C-m>'
},
accept_diff = {
normal = '<C-y>',
insert = '<C-y>'
},
yank_diff = {
normal = 'gy',
},
show_diff = {
normal = 'gd'
},
show_system_prompt = {
normal = 'gp'
},
show_user_selection = {
normal = 'gs'
},
-- default window options
window = {
layout = 'vertical', -- 'vertical', 'horizontal', 'float', 'replace'
width = 0.3, -- fractional width of parent, or absolute width in columns when > 1
height = 0.3, -- fractional height of parent, or absolute height in rows when > 1
-- Options below only apply to floating windows
relative = 'editor', -- 'editor', 'win', 'cursor', 'mouse'
border = 'single', -- 'none', single', 'double', 'rounded', 'solid', 'shadow'
row = nil, -- row position of the window, default is centered
col = nil, -- column position of the window, default is centered
title = 'Copilot Chat', -- title of chat window
footer = nil, -- footer of chat window
zindex = 1, -- determines if window is on top or below other floating windows
},

-- default mappings
mappings = {
complete = {
detail = 'Use @<Tab> or /<Tab> for options.',
insert = '<Tab>',
},
close = {
normal = 'q',
insert = '<C-c>'
},
reset = {
normal = '<C-l>',
insert = '<C-l>'
},
submit_prompt = {
normal = '<CR>',
insert = '<C-m>'
},
accept_diff = {
normal = '<C-y>',
insert = '<C-y>'
},
yank_diff = {
normal = 'gy',
},
show_diff = {
normal = 'gd'
},
show_system_prompt = {
normal = 'gp'
},
show_user_selection = {
normal = 'gs'
},
},

}

function ShowCopilotChatActionPrompt()
require("CopilotChat.integrations.telescope").pick(actions.prompt_actions())
require("CopilotChat.integrations.telescope").pick(actions.prompt_actions())
end
1 change: 0 additions & 1 deletion roles/vim/files/dein.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ hook_source = '''
\ 'coc-markdownlint',
\ 'coc-prettier',
\ 'coc-tsserver',
\ 'coc-eslint',
\ 'coc-diagnostic',
\ 'coc-vimlsp',
\ 'coc-lua',
Expand Down
86 changes: 43 additions & 43 deletions roles/vim/files/options.lua
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
local options = {
encoding = "utf-8",
fileencoding = "utf-8",
title = true,
backup = false,
clipboard = "unnamedplus",
cmdheight = 2,
completeopt = { "menuone", "noselect" },
conceallevel = 0,
hlsearch = true,
ignorecase = true,
mouse = "a",
pumheight = 10,
showmode = false,
showtabline = 2,
smartcase = true,
smartindent = true,
swapfile = false,
termguicolors = true,
timeoutlen = 300,
undofile = true,
updatetime = 100,
writebackup = false,
shell = "fish",
backupskip = { "/tmp/*", "/private/tmp/*" },
expandtab = true,
shiftwidth = 2,
tabstop = 2,
cursorline = true,
number = true,
relativenumber = false,
numberwidth = 4,
signcolumn = "yes",
wrap = false,
winblend = 0,
wildoptions = "pum",
pumblend = 5,
background = "dark",
scrolloff = 8,
sidescrolloff = 8,
guifont = "monospace:h17",
splitbelow = false, -- オンのとき、ウィンドウを横分割すると新しいウィンドウはカレントウィンドウの下に開かれる
splitright = false, -- オンのとき、ウィンドウを縦分割すると新しいウィンドウはカレントウィンドウの右に開かれる
encoding = "utf-8",
fileencoding = "utf-8",
title = true,
backup = false,
clipboard = "unnamedplus",
cmdheight = 2,
completeopt = { "menuone", "noselect" },
conceallevel = 0,
hlsearch = true,
ignorecase = true,
mouse = "a",
pumheight = 10,
showmode = false,
showtabline = 2,
smartcase = true,
smartindent = true,
swapfile = false,
termguicolors = true,
timeoutlen = 300,
undofile = true,
updatetime = 100,
writebackup = false,
shell = "fish",
backupskip = { "/tmp/*", "/private/tmp/*" },
expandtab = true,
shiftwidth = 2,
tabstop = 2,
cursorline = true,
number = true,
relativenumber = false,
numberwidth = 4,
signcolumn = "yes",
wrap = false,
winblend = 0,
wildoptions = "pum",
pumblend = 5,
background = "dark",
scrolloff = 8,
sidescrolloff = 8,
guifont = "monospace:h17",
splitbelow = false, -- オンのとき、ウィンドウを横分割すると新しいウィンドウはカレントウィンドウの下に開かれる
splitright = false, -- オンのとき、ウィンドウを縦分割すると新しいウィンドウはカレントウィンドウの右に開かれる
}

vim.opt.shortmess:append("c")

for k, v in pairs(options) do
vim.opt[k] = v
vim.opt[k] = v
end

vim.cmd("set whichwrap+=<,>,[,],h,l")
Expand Down
18 changes: 9 additions & 9 deletions roles/vim/files/telescope_config.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require('telescope').setup{
defaults = {
mappings = {
i = {
["<C-s>"] = require('telescope.actions').file_split,
["<C-v>"] = require('telescope.actions').file_vsplit
}
}
}
require('telescope').setup {
defaults = {
mappings = {
i = {
["<C-s>"] = require('telescope.actions').file_split,
["<C-v>"] = require('telescope.actions').file_vsplit
}
}
}
}

0 comments on commit f2e71bd

Please sign in to comment.