From 1fe43a2b869982f26707d9ae62c691d85fb52ef5 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 4 Aug 2020 11:49:42 +0800 Subject: [PATCH 1/5] [bugfix] powershell6 does not support Set-Prompt --- win/profile.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/win/profile.ps1 b/win/profile.ps1 index 9bf69cb..d8d3139 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -6,7 +6,10 @@ Set-PSReadLineOption -EditMode Emacs $Env:Path += ";$PSScriptRoot\bin" Set-Alias -Name k kubectl -Set-Prompt +$isPs7 = $host.Version.Major -ge 7 +if ( $isPs7 ) { + Set-Prompt +} function kcc { k config get-contexts $args } function kcu { k config use-context $args} @@ -70,4 +73,4 @@ function ssh-copy-id { ) Get-Content $IdentityFile | ssh $UserHost "umask 077; mkdir -p .ssh ; cat >> .ssh/authorized_keys" -} \ No newline at end of file +} From 0bbb2976aa01353b376be5cf7931dae8364ea204 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 4 Aug 2020 14:42:43 +0800 Subject: [PATCH 2/5] [feature] editor settings for Powershell --- config/nvim/ginit.vim | 2 ++ win/profile.ps1 | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 config/nvim/ginit.vim diff --git a/config/nvim/ginit.vim b/config/nvim/ginit.vim new file mode 100644 index 0000000..3ea44b4 --- /dev/null +++ b/config/nvim/ginit.vim @@ -0,0 +1,2 @@ +Guifont 等距更纱黑体 T SC:h12 +source $VIMRUNTIME/mswin.vim diff --git a/win/profile.ps1 b/win/profile.ps1 index d8d3139..2f3632a 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -5,6 +5,8 @@ Set-PSReadLineOption -EditMode Emacs $Env:Path += ";$PSScriptRoot\bin" +$Env:KUBE_EDITOR = 'nvim' +$Env:EDITOR = 'nvim' Set-Alias -Name k kubectl $isPs7 = $host.Version.Major -ge 7 if ( $isPs7 ) { From 412ca4bbec714c45c23956c72be8d44bc486cd88 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 4 Aug 2020 15:32:56 +0800 Subject: [PATCH 3/5] [feature] replace notepad with nvim-qt --- win/npd.vbs | 7 +++++++ win/setup.ps1 | 4 ++++ 2 files changed, 11 insertions(+) create mode 100644 win/npd.vbs diff --git a/win/npd.vbs b/win/npd.vbs new file mode 100644 index 0000000..90a4aaa --- /dev/null +++ b/win/npd.vbs @@ -0,0 +1,7 @@ +Set WshShell = WScript.CreateObject("WScript.Shell") +If wscript.arguments.count <2 then + WshShell.run "nvim-qt.exe" +Else + sCmd = "nvim-qt.exe " & """" & wscript.arguments(1) & """" + WshShell.run sCmd +End If diff --git a/win/setup.ps1 b/win/setup.ps1 index 410971a..8ae81c2 100644 --- a/win/setup.ps1 +++ b/win/setup.ps1 @@ -25,3 +25,7 @@ if (-not (Get-ScheduledTask -TaskName "Wubi No Shift")) { Install-Module posh-git Install-Module oh-my-posh + +# replace notepad with nvim-qt +reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "${dotfiles}\win\npd.vbs" /f + From dbb0487c735fccde0a238e7599b9d03bdd950363 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Tue, 4 Aug 2020 16:02:28 +0800 Subject: [PATCH 4/5] [feature] mouse support --- config/nvim/ginit.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/config/nvim/ginit.vim b/config/nvim/ginit.vim index 3ea44b4..b19319e 100644 --- a/config/nvim/ginit.vim +++ b/config/nvim/ginit.vim @@ -1,2 +1,3 @@ Guifont 等距更纱黑体 T SC:h12 source $VIMRUNTIME/mswin.vim +set mouse=a From 71d845ff3ad56bafeba115114a726fcd6f1585b6 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Wed, 5 Aug 2020 15:48:55 +0800 Subject: [PATCH 5/5] [misc] remove cr --- ubuntu/install-sources.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ubuntu/install-sources.sh b/ubuntu/install-sources.sh index b2175da..e26237f 100755 --- a/ubuntu/install-sources.sh +++ b/ubuntu/install-sources.sh @@ -23,9 +23,9 @@ trusted-host = pypi.doubanio.com EOF # docker accelerator -if [ -d /etc/docker ]; then$ - dj='{}'$ - [ -f /etc/docker/daemon.json ] && dj=$(cat /etc/docker/daemon.json)$ - echo $dj | jq '. + {"registry-mirrors": ["https://izuhlbap.mirror.aliyuncs.com"]}' > /etc/docker/daemon.json$ - systemctl restart docker$ -fi$ +if [ -d /etc/docker ]; then + dj='{}' + [ -f /etc/docker/daemon.json ] && dj=$(cat /etc/docker/daemon.json) + echo $dj | jq '. + {"registry-mirrors": ["https://izuhlbap.mirror.aliyuncs.com"]}' > /etc/docker/daemon.json + systemctl restart docker +fi