Instantly share code, notes, and snippets.

Embed
What would you like to do?
My Windows Settings
# keyhac config file
import sys
import os
import datetime
import pyauto
from keyhac import *
def configure(keymap):
keymap.editor = "Atom.exe"
keymap.setFont("MS Gothic", 12)
keymap.setTheme("black")
keymap_global = keymap.defineWindowKeymap()
# Cursor
keymap_global[ "C-P" ] = "Up"
keymap_global[ "C-N" ] = "Down"
keymap_global[ "C-F" ] = "Right"
keymap_global[ "C-B" ] = "Left"
keymap_global[ "C-A" ] = "Home"
keymap_global[ "C-E" ] = "End"
keymap_global[ "C-V" ] = "PageDown"
keymap_global[ "A-V" ] = "PageUp"
keymap_global[ "A-Comma" ] = "C-Home"
keymap_global[ "A-Period" ] = "C-End"
keymap_global[ "S-C-P" ] = "S-Up"
keymap_global[ "S-C-N" ] = "S-Down"
keymap_global[ "S-C-F" ] = "S-Right"
keymap_global[ "S-C-B" ] = "S-Left"
keymap_global[ "S-C-A" ] = "S-Home"
keymap_global[ "S-C-E" ] = "S-End"
keymap_global[ "S-C-V" ] = "S-PageDown"
keymap_global[ "S-A-V" ] = "S-PageUp"
keymap_global[ "S-A-Comma" ] = "S-C-Home"
keymap_global[ "S-A-Period" ] = "S-C-End"
# Ctrl bindings
keymap_global[ "C-D" ] = "Delete" # Delete
keymap_global[ "C-H" ] = "Back" # Backspace
keymap_global[ "C-W" ] = "C-X" # Cut
keymap_global[ "C-Y" ] = "C-V" # Paste
keymap_global[ "C-(191)" ] = "C-Z" # Undo
keymap_global[ "C-K" ] = "S-End","C-X" # Removing following text
keymap_global[ "C-J" ] = "Enter"
# Ctrl押しっぱなしになってしまうので、Ctrlをもう一度押して解除する関数
withC = lambda x: (x, "D-Ctrl", "U-Ctrl")
# Alt as Command
keymap_global[ "A-C" ] = withC("C-C") # Copy
keymap_global[ "A-V" ] = withC("C-V") # Paste
keymap_global[ "A-F" ] = withC("C-F") # Find
keymap_global[ "A-T" ] = withC("C-T") # New Tab
keymap_global[ "A-W" ] = withC("C-W") # Close Tab
keymap_global[ "A-L" ] = withC("C-L") # Focus URL bar
keymap_global[ "A-A" ] = withC("C-A") # Select All
keymap_global[ "A-S" ] = withC("C-S") # Save
keymap_global[ "A-K" ] = withC("C-K") # Channels
# Tabs
keymap_global[ "A-1" ] = withC("C-1")
keymap_global[ "A-2" ] = withC("C-2")
keymap_global[ "A-3" ] = withC("C-3")
keymap_global[ "A-4" ] = withC("C-4")
keymap_global[ "A-5" ] = withC("C-5")
keymap_global[ "A-6" ] = withC("C-6")
keymap_global[ "A-7" ] = withC("C-7")
keymap_global[ "A-8" ] = withC("C-8")
keymap_global[ "A-9" ] = withC("C-9")
keymap_global[ "A-0" ] = withC("C-0")
Import-Module 'posh-git'
Import-Module 'oh-my-posh'
Set-Theme agnoster
# Set l and ls alias to use the new Get-ChildItemColor cmdlets
Set-Alias l Get-ChildItemColor -Option AllScope
Set-Alias ls Get-ChildItemColorFormatWide -Option AllScope
# Helper function to change directory to my development workspace
# Change c:\ws to your usual workspace and everytime you type
# in cws from PowerShell it will take you directly there.
function cws { Set-Location c:\ws }
# Helper function to set location to the User Profile directory
function cuserprofile { Set-Location ~ }
Set-Alias ~ cuserprofile -Option AllScope
Set-PSReadlineOption -EditMode Emacs
Set-PSReadlineKeyHandler -Key 'Ctrl+p' -Function HistorySearchBackward
Set-PSReadlineKeyHandler -Key 'Ctrl+n' -Function HistorySearchForward
Set-Alias -name g -value git
function gh () {
cd $(ghq list --full-path | peco)
}
Set-Alias -name open -value Invoke-Item
function U {
param
(
[int] $Code
)
if ((0 -le $Code) -and ($Code -le 0xFFFF))
{
return [char] $Code
}
if ((0x10000 -le $Code) -and ($Code -le 0x10FFFF))
{
return [char]::ConvertFromUtf32($Code)
}
throw "Invalid character code $Code"
}
$Env:Path += ";C:\Program Files (x86)\Yarn\bin"
$Env:Path += ";C:\Program Files\dotnet"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment