woo, arch

This commit is contained in:
Kacper Donat 2018-07-31 19:53:06 +02:00
parent 10d542decc
commit ff71243908
5 changed files with 83 additions and 55 deletions

View File

@ -1,20 +1,23 @@
URxvt.perl-ext-common: selection-to-clipboard urxvt*font: xft:Fira Code Medium:size=8
urxvt*termName: xterm
urxvt*font: xft:Ubuntu Mono:pixelsize=13 urxvt*foreground: #d5d5d5
urxvt*termName: rxvt
urxvt*foreground: #cccccc
urxvt*scrollBar: false urxvt*scrollBar: false
urxvt*perl-lib: /usr/lib/urxvt/perl/ urxvt*perl-lib: /usr/lib/urxvt/perl/
urxvt*perl-ext-common: default,matcher urxvt*perl-ext-common: default,matcher
urxvt*urlLauncher: firefox urxvt*urlLauncher: firefox
urxvt*matcher.button: 1 urxvt*matcher.button: 1
urxvt*letterSpace: -1
urxvt*internalBorder: 6
urxvt*fading: 40
urxvt*fadeColor: [40]#000000
Xft*dpi: 96 Xft*dpi: 102
Xft*antialias: true Xft*antialias: true
Xft*hinting: full Xft.rgba: none
Xft*hinting: hintfull
urxvt*depth: 32 urxvt*depth: 32
urxvt*background: rgba:0000/0000/0200/c800 urxvt*background: [80]#000000
URxvt*color0: #222222 URxvt*color0: #222222
URxvt*color1: #9e1828 URxvt*color1: #9e1828

54
.vimrc
View File

@ -7,10 +7,6 @@ if has('win32') || has ('win64')
set directory=$TEMP// set directory=$TEMP//
else else
let $VIMHOME = $HOME."/.vim" let $VIMHOME = $HOME."/.vim"
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"
endif endif
call plug#begin($VIMHOME.'/plugged') call plug#begin($VIMHOME.'/plugged')
@ -33,40 +29,40 @@ call plug#begin($VIMHOME.'/plugged')
call plug#end() call plug#end()
set colorcolumn=80,120 set colorcolumn=80,120
set t_Co=256
" "
" My own config " My own config
" "
" one time settings " one time settings
if !exists("g:running") " if !exists("g:running")
" Conemu specific settings " " Conemu specific settings
if !has('gui_running') && !has('nvim') " if !has('gui_running') && !has('nvim')
set term=xterm " set term=xterm
set t_Co=256
inoremap <Char-0x07F> <BS> " inoremap <Char-0x07F> <BS>
nnoremap <Char-0x07F> <BS> " nnoremap <Char-0x07F> <BS>
let &t_AB="\e[48;5;%dm" " let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm" " let &t_AF="\e[38;5;%dm"
inoremap <Esc>[62~ <C-X><C-E> " inoremap <Esc>[62~ <C-X><C-E>
inoremap <Esc>[63~ <C-X><C-Y> " inoremap <Esc>[63~ <C-X><C-Y>
nnoremap <Esc>[62~ <C-E> " nnoremap <Esc>[62~ <C-E>
nnoremap <Esc>[63~ <C-Y> " nnoremap <Esc>[63~ <C-Y>
endif " endif
if has('gui_running') " if has('gui_running')
set guifont=Fira_Code_Medium:h9:cANSI:qDRAFT " set guifont=Fira_Code_Medium:h9:cANSI:qDRAFT
set guioptions= " set guioptions=
set columns=200 " set columns=200
set lines=58 " set lines=58
colorscheme tender " colorscheme tender
endif " endif
endif " endif
let g:running = 1 let g:running = 1
@ -90,7 +86,7 @@ set hidden
set splitbelow set splitbelow
set shellslash set shellslash
set backspace=2 " set backspace=2
set autoindent set autoindent
" tabs " tabs
@ -104,6 +100,10 @@ set number
" disable bells " disable bells
set noeb vb t_vb= set noeb vb t_vb=
let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[6 q"
let &t_EI = "\<Esc>[2 q"
" filetypes " filetypes
" autocmd FileType c,cpp :compiler cl " autocmd FileType c,cpp :compiler cl

View File

@ -2,8 +2,8 @@
[Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding [Console]::OutputEncoding = New-Object -typename System.Text.UTF8Encoding
[Console]::InputEncoding = New-Object -typename System.Text.UTF8Encoding [Console]::InputEncoding = New-Object -typename System.Text.UTF8Encoding
Import-Module posh-git # Import-Module posh-git
Import-Module php # Import-Module php
$__dir__ = $(Get-Item $profile).Directory; $__dir__ = $(Get-Item $profile).Directory;

View File

@ -1,12 +1,17 @@
function Test-IsAdmin { function Test-IsAdmin {
try { if ($IsWindows) {
$identity = [Security.Principal.WindowsIdentity]::GetCurrent() try {
$principal = New-Object Security.Principal.WindowsPrincipal -ArgumentList $identity $identity = [Security.Principal.WindowsIdentity]::GetCurrent()
return $principal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator ) $principal = New-Object Security.Principal.WindowsPrincipal -ArgumentList $identity
} catch { return $principal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator )
throw "Failed to determine if the current user has elevated privileges. The error was: '{0}'." -f $_ } catch {
throw "Failed to determine if the current user has elevated privileges. The error was: '{0}'." -f $_
}
} else {
$(whoami) -eq "root"
} }
<# <#
.SYNOPSIS .SYNOPSIS
Checks if the current Powershell instance is running with elevated privileges or not. Checks if the current Powershell instance is running with elevated privileges or not.

View File

@ -1,12 +1,24 @@
$script:bg = [Console]::BackgroundColor; $script:bg = [System.ConsoleColor]::Black;
$script:fg = [System.ConsoleColor]::White; $script:fg = [System.ConsoleColor]::White;
$script:first = $true; $script:first = $true;
$script:last = 0; $script:last = 0;
$global:PromptReplacementDirs = @{ function Get-If {
$env:USERPROFILE = '~'; [CmdletBinding()]param(
$Condition,
$IfTrue,
$IfFalse
)
if ($Condition) {
$IfTrue
} else {
$IfFalse
}
} }
New-Alias ?: Get-If
function Write-PromptFancyEnd { function Write-PromptFancyEnd {
Write-Host -NoNewline -ForegroundColor $script:fg Write-Host -NoNewline -ForegroundColor $script:fg
@ -14,6 +26,16 @@ function Write-PromptFancyEnd {
$script:fg = [System.ConsoleColor]::White $script:fg = [System.ConsoleColor]::White
} }
if ($IsWindows) {
$script:separator = '\';
} else {
$script:separator = '/';
}
$global:PromptReplacementDirs = @{
$(?: $IsWindows $env:USERPROFILE $env:HOME) = '~'
}
function Write-PromptSegment { function Write-PromptSegment {
param( param(
[Parameter( [Parameter(
@ -24,17 +46,15 @@ function Write-PromptSegment {
)][string]$Text, )][string]$Text,
[Parameter(Position=1)][System.ConsoleColor] $Foreground = [System.ConsoleColor]::White, [Parameter(Position=1)][System.ConsoleColor] $Foreground = [System.ConsoleColor]::White,
[Parameter(Position=2)][System.ConsoleColor] $Background = [Console]::BackgroundColor,
[switch] $NoSegment [switch] $NoSegment
) )
Write-Host $text -NoNewline -BackgroundColor $Background -ForegroundColor $Foreground Write-Host $text -NoNewline -ForegroundColor $Foreground
if (-not $NoSegment) { if (-not $NoSegment) {
Write-Host -NoNewline -BackgroundColor $Background -ForegroundColor $Foreground Write-Host -NoNewline -ForegroundColor $Foreground
} }
$script:bg = $Background;
$script:fg = $Foreground; $script:fg = $Foreground;
} }
@ -44,7 +64,7 @@ function Get-FancyDir {
$location = $location.Replace($replacement.Name, $replacement.Value); $location = $location.Replace($replacement.Name, $replacement.Value);
} }
return $location.Replace('\', '  '); return $location.Replace($script:separator, '  ');
} }
function Get-GitBranch { function Get-GitBranch {
@ -77,14 +97,14 @@ function Write-PromptVirtualEnv {
} }
function Write-PromptDir { function Write-PromptDir {
Write-PromptSegment " $(Get-FancyDir) " DarkGray -NoSegment Write-PromptSegment " $(Get-FancyDir) " Gray -NoSegment
} }
# Depends on posh-git # Depends on posh-git
function Write-PromptGit { function Write-PromptGit {
if(Get-GitDirectory) { # if(Get-GitDirectory) {
Write-PromptSegment "$(Get-GitBranch) " Blue # Write-PromptSegment "  $(Get-GitBranch) " Blue
} # }
} }
function prompt { function prompt {