Merge branch 'main' into manjaro

This commit is contained in:
qwjyh 2022-10-17 19:15:47 +09:00
commit b7f0f5a7ea
17 changed files with 636 additions and 38 deletions

1
dotfiles/ahk/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.exe

View file

@ -0,0 +1,25 @@
; extra key remaps
; mainly for inputting special characters
; Play/Pause
;sc121::
; Send {Media_Play_Pause}
; return
;
; Henkan/Muhenkan + - -> en, em dash
vk1D & vkBD::
Send {U+2013} ; en dash
return
vk1C & vkBD::
Send {U+2014} ; em dash
return
; Henkan/Muhenkan + {Space} -> ZWSP, ZWJ
vk1D & Space::
Send {U+200B} ; ZWSP
return
vk1C & Space::
Send {U+200D} ; ZWJ
return

View file

@ -0,0 +1,67 @@
; basic key remapping for windows(JIS keyboard)
; using AutoHotKey
#SingleInstance, Force
SendMode Input
SetWorkingDir, %A_ScriptDir%1
; KeyHistory
#UseHook
; ==========================================
; 変換/無変換 + ASDF/HJKLのショートカット
vk1D::
Send, {vk1D}
Return
vk1C::
Send, {vk1C}
Return
; 十字キーの設定
; hjkl like vim
vk1D & h::
vk1C & h::
Send,{Blind}{Left}
return
vk1D & j::
vk1C & j::
Send,{Blind}{Down}
return
vk1D & k::
vk1C & k::
Send,{Blind}{Up}
return
vk1D & l::
vk1C & l::
Send,{Blind}{Right}
return
; Home,End,PgUp,PgDnの設定
; a s d f
; Home PgUp PgDn End
vk1D & a::
vk1C & a::
Send,{Blind}{Home}
return
vk1D & f::
vk1C & f::
Send,{Blind}{End}
return
vk1D & s::
vk1C & s::
Send,{Blind}{PgUp}
return
vk1D & d::
vk1C & d::
Send,{Blind}{PgDn}
return
; ==========================================
; include extra key remaps
#Include extra_remaps.ahk
; ==========================================
; HankakuZenkaku to esc
sc029::
Send, {Escape}

View file

@ -1,14 +1,39 @@
# load .bashrc
# bass source ~/.bashrc
if status is-interactive
# Commands to run in interactive sessions can go here
# starship
starship init fish | source
function set_win_title
echo -ne "\033]0; (basename "$PWD") \007"
end
set starship_precmd_uesr_func "set_win_title"
# keychain
set -x SHELL fish
keychain --eval --quiet -Q id_rsa, id_ed25519 | source
set -x SHELL bash
# opam
source ~/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
end
# opam configuration
source /home/qwjyh/.opam/opam-init/init.fish > /dev/null 2> /dev/null; or true
# key bindings
bind \b backward-kill-word
# save fish log to my custom file
set -gx my_fish_history "$HOME/my_fish_history.txt"
function save_myhistory --on-event fish_prompt -d "Save custom shell log to $my_fish_history"
set -l prev_status $status
echo "$(date '+%Y-%m-%d %H:%M:%S') $hostname:$fish_pid $PWD [$prev_status] $(history -1)" \
>> $my_fish_history
end
# julia
# to solve Graphic Card driver problem
export LD_PRELOAD=/usr/lib64/libstdc++.so.6

View file

@ -3,7 +3,8 @@
vim.o.number = true
vim.o.relativenumber = true
vim.cmd([[
highlight LineNr cterm=none ctermfg=256
highlight LineNr cterm=none ctermfg=243
highlight CursorLineNr cterm=none ctermfg=250
]])
vim.o.tabstop = 4
vim.o.shiftwidth = 4
@ -132,6 +133,10 @@ cmp.setup({
-- },
-- })
-- satysfi language server
require('lspconfig')['satysfi-ls'].setup{
autostart = true
}
-----------------------------------------------------------
-- Ctrl + P to invoke fzf file search
@ -141,7 +146,10 @@ vim.api.nvim_set_keymap('n', '<c-P>',
-----------------------------------------------------------
-- satysfi language server
require('lspconfig')['satysfi-ls'].setup{
autostart = true
}
-- lualine
require('lualine_setup')
lualine = require('lualine')
lualine.setup({
options = { theme = 'iceberg_dark' }
})
lualine.setup()

View file

@ -0,0 +1,40 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '|', right = '|'},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View file

@ -9,6 +9,12 @@ return require('packer').startup(function(use)
--requires = { 'kyazdan142/nvim-web/devicons' } -- not found
}
-- lualine(statusline)
use {
'nvim-lualine/lualine.nvim',
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
}
-- LSP
use 'neovim/nvim-lspconfig'
use "williamboman/mason.nvim"

35
dotfiles/pwsh/README.md Normal file
View file

@ -0,0 +1,35 @@
# PowerShell PROFILE description
some notable features
## Key-Bindings
- `F2` to toggle InlineView and ListView of predictions
- tab completion like fish
- `Ctrl + D` to exit
- `Ctrl + G` to Invoke-FzfTabCompletion
- `Ctrl + t` to select providers with fzf
- `Ctrl + r` to fzf history
## Aliases
- `~`, `..`
- `epl` = `explorer.exe .`
- `whereis` = `where.exe`
## Change Encodings Instantly
You can change PowerShell encodings instantly.
Especially useful for piping into linux commands like `less`
- `Set-UTF8`, `Set-UTF16LE`
- `Remove-EncodingSettings`
- `Reset-EncodingSettings`
## ssh-agent
- `Invoke-SshAdd`
## `$env:`
- `$env:LESS`
## Auto Completions
- scoop
- chezmoi
- git
- winget
- chocolatey

View file

@ -1,33 +1,55 @@
# auto completion
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
# ==============================================================
# PSReadLine Settings
# ==============================================================
Import-Module PSReadLine # >= 2.2.2
Import-Module CompletionPredictor
Set-PSReadLineOption -EditMode Windows
Set-PSReadLineOption -PredictionSource HistoryAndPlugin # require PowerShell ≧ 7.2 and PSReadLine ≧ 2.2.2
Set-PSReadlineOption -HistoryNoDuplicates
Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function ForwardWord # like fish
Set-PSReadLineOption -DingTone 880 # beep frequency
Set-PSReadLineKeyHandler -Chord "Ctrl+u" -Function BackwardKillInput # like emacs
Set-PSReadLineKeyHandler -Chord "Ctrl+p" -Function PreviousHistory # like emacs
Set-PSReadLineKeyHandler -Chord "Ctrl+n" -Function NextHistory # like emacs
Set-PSReadLineKeyHandler -Chord "Ctrl+f" -Function AcceptSuggestion # like fish
Set-PSReadLineKeyHandler -Chord "Tab" MenuComplete
Set-PSReadLineKeyHandler -Chord "Ctrl+d" DeleteCharOrExit
Set-PSReadLineKeyHandler -Chord "Ctrl+g" -ScriptBlock { Invoke-FzfTabCompletion } -BriefDescription "Fzf tab completion" -Description "Invoke fzf tab completion. Need some input first."
# PsFzf Options
# 'Ctrl+t' for provider path, 'Ctrl+r' for reverse history
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
# ==============================================================
# alias and functions
# ==============================================================
function ~ { cd ~ }
function .. { cd .. }
function epl {explorer.exe .}
Set-Alias touch New-Item
Set-Alias whereis where.exe
# starship
# change window name
# save my history
$My_Pwsh_History = "$HOME\my_pwsh_history.txt"
function Invoke-Starship-PreCommand {
# window title
$ParentFolder = Split-Path $PWD -Leaf
$host.ui.Write("`e]0; $ParentFolder `a")
# save log
Write-Output "$(Get-Date -UFormat '+%Y-%m-%d %H:%M:%S') $env:COMPUTERNAME`:$PID [$Global:LASTEXITCODE] $(Get-History -Count 1)"
| Out-File -FilePath $My_Pwsh_History -Append -Encoding utf8
}
Invoke-Expression (&starship init powershell)
$ENV:STARSHIP_CONFIG = "$HOME\.config\starship.toml"
# home_util shortcut
$home_util_path = "~\Documents\macro\ahk"
function home_util {
& (Join-Path -Path $home_util_path -ChildPath "home_util.exe")
}
# change encoding
# --------------------------------------------------------------
# change encoding
# --------------------------------------------------------------
# ref: https://qiita.com/e4rfx/items/3772ecb58b6918ed5348
# 文字エンコードをUTF8に設定する
function Set-UTF8 {
@ -111,14 +133,36 @@ function Enable-SshAgent {
#>
sudo Set-Service -Name ssh-agent -StartupType Manual && Start-Service ssh-agent
}
# auto start ssh-agent and do ssh-add
function Invoke-SshAdd {
<#
.SYNOPSIS
Starts ssh-agent and do ssh-add
.DESCRIPTION
Starts ssh-agent as admin and do ssh-add, to add sshkeys to ssh-agent.
#>
Enable-SshAgent
ssh-add
}
# execute "ssh-add" to add keys
# less options
$env:LESS = "-M -R -S -W -z-4 -x4"
$env:LESS = "-i -M -R -S -W -z-4 -x4"
# ==============================================================
# auto completions for modules
# ==============================================================
# scoop
# enable completion in current shell, use absolute path because PowerShell Core not respect $env:PSModulePath
Import-Module scoop-completion
#Import-Module "$($(Get-Item $(Get-Command scoop.ps1).Path).Directory.Parent.FullName)\modules\scoop-completion"
# chezmoi completion
$script = "$HOME\.config\powershell\chezmoi_completion.ps1"
if (Test-Path $script) {