Added work to some shortcuts in ranger, vim for C# and soem colorchanges

clean_emacs
Tuan-Dat Tran 2018-08-29 21:22:24 +02:00
parent 3ea585c26a
commit c6f99af469
No known key found for this signature in database
GPG Key ID: 0DA1B0B23302CA72
9 changed files with 149 additions and 114 deletions

View File

@ -1,36 +1,37 @@
! special ! special
*.foreground: #f1ebeb *.foreground: #f8f8f2
*.background: #272822 *.background: #272822
*.cursorColor: #f1ebeb *.cursorColor: #f8f8f2
! black ! black
*.color0: #48483e *.color0: #272822
*.color8: #76715e *.color8: #75715e
! red ! red
*.color1: #dc2566 *.color1: #f92672
*.color9: #fa2772 *.color9: #f92672
! green ! green
*.color2: #8fc029 *.color2: #a6e22e
*.color10: #a7e22e *.color10: #a6e22e
! yellow ! yellow
*.color3: #d4c96e *.color3: #f4bf75
*.color11: #e7db75 *.color11: #f4bf75
! blue ! blue
*.color4: #55bcce *.color4: #66d9ef
*.color12: #66d9ee *.color12: #66d9ef
! magenta ! magenta
*.color5: #9358fe *.color5: #ae81ff
*.color13: #ae82ff *.color13: #ae81ff
! cyan ! cyan
*.color6: #56b7a5 *.color6: #a1efe4
*.color14: #66efd5 *.color14: #a1efe4
! white ! white
*.color7: #acada1 *.color7: #f8f8f2
*.color15: #cfd0c2 *.color15: #f9f8f5

View File

@ -121,13 +121,13 @@ for_window [instance="^sun-awt-X11-XDialogPeer$" title="^Complete Installation$"
############################################################################### ###############################################################################
exec --no-startup-id setxkbmap us,de exec --no-startup-id setxkbmap us,de
exec --no-startup-id setxkbmap -option ctrl:swapcaps
exec --no-startup-id nitrogen --restore; compton -b exec --no-startup-id nitrogen --restore; compton -b
exec --no-startup-id nextcloud exec --no-startup-id nextcloud
exec --no-startup-id emacs --daemon exec --no-startup-id emacs --daemon
exec --no-startup-id udiskie exec --no-startup-id udiskie
exec --no-startup-id polybar beep -r exec --no-startup-id polybar beep -r
exec --no-startup-id polybar boop -r exec --no-startup-id polybar boop -r
exec --no-startup-id setxkbmap -option "ctrl:swapcaps"
exec --no-startup-id nm-applet exec --no-startup-id nm-applet
exec --no-startup-id xss-lock -- python ~/.scripts/i3lock.py exec --no-startup-id xss-lock -- python ~/.scripts/i3lock.py
@ -154,11 +154,15 @@ bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5%
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5%
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle
bindsym XF86AudioPlay exec "if [ `cat /home/$USER/.scripts/playstate` = 0 ]; then echo '1'>/home/$USER/.scripts/playstate;else echo '0'>/home/$USER/.scripts/playstate;fi" # bindsym XF86AudioPlay exec "if [ `cat /home/$USER/.scripts/playstate` = 0 ]; then echo '1'>/home/$USER/.scripts/playstate;else echo '0'>/home/$USER/.scripts/playstate;fi"
bindsym XF86AudioStop exec "playerctl stop && echo '0'>/home/$USER/.scripts/playstate" # bindsym XF86AudioStop exec "playerctl stop && echo '0'>/home/$USER/.scripts/playstate"
bindsym XF86AudioPlay exec "playerctl play-pause; cmus-remote -u"
bindsym XF86AudioStop exec "playerctl stop; cmus-remote -s"
bindsym XF86AudioNext exec "playerctl next; cmus-remote -n"
bindsym XF86AudioPrevious exec "playerctl previous; cmus-remote -r"
# Application Shortcuts # Application Shortcuts
bindsym $mod+b exec firefox bindsym $mod+b exec env GTK_THEME=Materia:dark firefox
bindsym $mod+e exec source ~/.zshrc && termite -e 'ranger' bindsym $mod+e exec source ~/.zshrc && termite -e 'ranger'
bindsym $mod+m exec thunderbird bindsym $mod+m exec thunderbird

View File

@ -35,9 +35,9 @@ font-1 = unifont:fontformat=truetype:size=8:antialias=false;0
font-2 = siji:pixelsize=10;1 font-2 = siji:pixelsize=10;1
font-3 = FontAwesome:style=Regular:pixelsize=10 font-3 = FontAwesome:style=Regular:pixelsize=10
modules-left = spotify modules-left = volume xkeyboard
modules-center = spotify-prev spotify-play spotify-stop spotify-next modules-center = date
modules-right = xkeyboard volume xbacklight wlan eth battery1 date modules-right =
cursor-click = pointer cursor-click = pointer
cursor-scroll = ns-resize cursor-scroll = ns-resize
@ -72,7 +72,7 @@ font-3 = FontAwesome:style=Regular:pixelsize=10
modules-left = airvpn modules-left = airvpn
modules-center = i3 modules-center = i3
modules-right = powermenu modules-right = xbacklight wlan eth battery1 powermenu
cursor-click = pointer cursor-click = pointer
cursor-scroll = ns-resize cursor-scroll = ns-resize

View File

@ -4,3 +4,6 @@ set vcs_aware true
map f console scout -ftsea%space map f console scout -ftsea%space
map gg console mkdir%space map gg console mkdir%space
map np shell cp -r ~/Templates/LaTeX/Protokoll $(date +%g.%m.%%d) map np shell cp -r ~/Templates/LaTeX/Protokoll $(date +%g.%m.%%d)
map ny shell cp %f ../Protokoll_$(echo $(basename $(pwd)) | awk '{gsub("\\.","-");print}' $2).pdf
map nr shell cp ~/Templates/LaTeX/Invoice/invoice.tex Gefeba_Engineering_-_Rechnung_$(date +%g.%m)_-Elektro-1.tex

View File

@ -22,9 +22,8 @@ hyperlinks = true
# "system", "on" or "off" # "system", "on" or "off"
cursor_blink = system cursor_blink = system
# "block", "underline" or "ibeam" # "block", "underline" or "ibeam"
cursor_shape = ibeam cursor_shape = block
# Hide links that are no longer valid in url select overlay mode # Hide links that are no longer valid in url select overlay mode
#filter_unmatched_urls = true #filter_unmatched_urls = true
@ -42,39 +41,40 @@ scrollbar = off
[colors] [colors]
# special # special
foreground = #f1ebeb foreground = #f8f8f2
foreground_bold = #f1ebeb foreground_bold = #f8f8f2
cursor = #f1ebeb cursor = #f8f8f2
background = #272822 background = #272822
# black # black
color0 = #48483e color0 = #272822
color8 = #76715e color8 = #75715e
# red # red
color1 = #dc2566 color1 = #f92672
color9 = #fa2772 color9 = #f92672
# green # green
color2 = #8fc029 color2 = #a6e22e
color10 = #a7e22e color10 = #a6e22e
# yellow # yellow
color3 = #d4c96e color3 = #f4bf75
color11 = #e7db75 color11 = #f4bf75
# blue # blue
color4 = #55bcce color4 = #66d9ef
color12 = #66d9ee color12 = #66d9ef
# magenta # magenta
color5 = #9358fe color5 = #ae81ff
color13 = #ae82ff color13 = #ae81ff
# cyan # cyan
color6 = #56b7a5 color6 = #a1efe4
color14 = #66efd5 color14 = #a1efe4
# white # white
color7 = #acada1 color7 = #f8f8f2
color15 = #cfd0c2 color15 = #f9f8f5

View File

@ -66,8 +66,12 @@ def lock_config():
lock_date_pos = '--datepos="{}:{}"'.format(date_x, date_y) lock_date_pos = '--datepos="{}:{}"'.format(date_x, date_y)
lock_date_size = '--datesize={}'.format(default_fontsize) lock_date_size = '--datesize={}'.format(default_fontsize)
date = "{} {}".format(lock_date_pos, lock_date_size) date = "{} {}".format(lock_date_pos, lock_date_size)
# date color
datecolor = '--datecolor=777777ff'
timecolor = '--timecolor=777777ff'
color = '{} {}'.format(datecolor, timecolor)
# done # done
datetime = "{} {}".format(l_time, date) datetime = "{} {} {}".format(l_time, date, color)
# Indicator config # Indicator config
# Indicator inner # Indicator inner

View File

@ -1,2 +1,3 @@
(package-initialize) (package-initialize)
(org-babel-load-file "~/.emacs.d/config.org") (org-babel-load-file "~/.emacs.d/config.org")
(put 'upcase-region 'disabled nil)

View File

@ -4,35 +4,31 @@ filetype off
set rtp+=~/.vim/bundle/Vundle.vim set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin() call vundle#begin()
Plugin 'VundleVim/Vundle.vim' Plugin 'VundleVim/Vundle.vim'
Plugin 'vim-pandoc/vim-pandoc' Plugin 'vim-pandoc/vim-pandoc'
Plugin 'vim-pandoc/vim-pandoc-syntax' Plugin 'vim-pandoc/vim-pandoc-syntax'
Plugin 'ledger/vim-ledger' Plugin 'terryma/vim-multiple-cursors'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'haya14busa/incsearch.vim'
Plugin 'esalter-va/vim-checklist'
call vundle#end() call vundle#end()
" Filetypes
au BufNewFile,BufRead *.md set filetype=md
au BufNewFile,BufRead *.tex set filetype=tex
au BufNewFile,BufRead config set filetype=config
" Functions " Functions
command! -complete=shellcmd -nargs=+ Shell call s:RunShellCommand(<q-args>)
function! s:RunShellCommand(cmdline) " Arch defaults
echo a:cmdline
let expanded_cmdline = a:cmdline "" Move the swap file location to protect against CVE-2017-1000382
for part in split(a:cmdline, ' ') if exists('$XDG_CACHE_HOME')
if part[0] =~ '\v[%#<]' let &g:directory=$XDG_CACHE_HOME
let expanded_part = fnameescape(expand(part)) else
let expanded_cmdline = substitute(expanded_cmdline, part, expanded_part, '') let &g:directory=$HOME . '/.cache'
endif endif
endfor let &g:directory.='/vim/swap//'
botright new "" Create swap directory if it doesn't exist
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap if ! isdirectory(expand(&g:directory))
call setline(1, 'You entered: ' . a:cmdline) silent! call mkdir(expand(&g:directory), 'p', 0700)
call setline(2, 'Expanded Form: ' .expanded_cmdline) endif
call setline(3,substitute(getline(2),'.','=','g'))
execute '$read !'. expanded_cmdline
setlocal nomodifiable
1
endfunction
" Basics " Basics
syntax on syntax on
@ -41,11 +37,12 @@ set encoding=utf-8
colorscheme monokai colorscheme monokai
set autowrite set autowrite
set smartcase set smartcase
set spelllang=en_gb,de_de set incsearch
set hlsearch
set nofoldenable
" Line Numbers " Line Numbers
set number "set number
set relativenumber "set relativenumber
" Tab behavior " Tab behavior
set expandtab set expandtab
@ -57,38 +54,57 @@ set softtabstop=4
set splitbelow set splitbelow
set splitright set splitright
" Remaps " Remaps
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
nnoremap <C-J> <C-W><C-J> nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K> nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L> nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H> nnoremap <C-H> <C-W><C-H>
nmap 0 ^
" Latex
let g:tex_nospell=1
" Shortcuts " Shortcuts
inoremap <Tab><Tab> <Esc>/<x_x><Enter>c5l map <Space><Tab> <Esc>/<x_x><Enter>c5l
vnoremap <Tab><Tab> <Esc>/<x_x><Enter>c5l inoremap <Space><Tab> <Esc>/<x_x><Enter>c5l
map <Tab><Tab> <Esc>/<x_x><Enter>c5l vnoremap <Space><Tab> <Esc>/<x_x><Enter>c5l
inoremap ;; <x_x> inoremap ;; <x_x>
imap jj <Esc>
inoremap ;date <C-R>=strftime("%Y/%m/%d")<Enter>
inoremap ;time <C-R>=strftime("%H:%M:%S")<Enter>
" Diaeresis for e.g. german
inoremap "a ä
inoremap "o ö
inoremap "u ü
inoremap "A Ä
inoremap "U Ü
inoremap "O Ö
inoremap ;ss ß
inoremap ;euro
"" Latex " This callback will be executed when the entire command is completed
autocmd FileType tex inoremap ;l \item function! BackgroundCommandClose(channel)
autocmd FileType tex inoremap ;beg \begin{<o_o>}<Enter><x_x><Enter>\end{<o_o>}<Enter><Enter><x_x><Esc>4k0:MultipleCursorsFind<Space><o_o><Enter>c " Read the output from the command into the quickfix window
autocmd FileType tex inoremap ;sec \section{<x_x>}<Enter><Enter><x_x><Esc>2k<Tab><Tab> unlet g:backgroundCommandOutput
autocmd FileType tex inoremap ;ssec \subsection{<x_x>}<Enter><Enter><x_x><Esc>2k<Tab><Tab> endfunction
autocmd FileType tex inoremap ;sssec \subsubsection{<x_x>}<Enter><Enter><x_x><Esc>2k<Tab><Tab>
""" Compile to pdf and open it in evince
autocmd FileType tex map <C-c><C-c> mx:silent !pdflatex % && evince %<.pdf &<Enter>ggGG`x
"" Ledger function! RunBackgroundCommand(command)
autocmd FileType ledger inoremap ;a <C-R>=strftime("%Y/%m/%d")<Enter> * <x_x><Enter><Space><Space><Space><Space><x_x><Space><Space><Space><Space><x_x><Enter><Enter><x_x><Esc>3k0 " Make sure we're running VIM version 8 or higher.
autocmd FileType ledger map <C-R>b :! ledger -f % reg Brieftasche$<Enter> if v:version < 800
autocmd FileType ledger map <C-R>g :! ledger -f % reg Girokonto$<Enter> echoerr 'RunBackgroundCommand requires VIM version 8 or higher'
autocmd FileType ledger map <C-R>p :! ledger -f % reg PayPal$<Enter> return
endif
if exists('g:backgroundCommandOutput')
echo 'Already running task in background'
else
echo 'Running task in background'
" Launch the job.
" Notice that we're only capturing out, and not err here. This is because, for some reason, the callback
" will not actually get hit if we write err out to the same file. Not sure if I'm doing this wrong or?
let g:backgroundCommandOutput = tempname()
call job_start(a:command, {'close_cb': 'BackgroundCommandClose', 'out_io': 'file', 'out_name': g:backgroundCommandOutput})
endif
endfunction
" So we can use :BackgroundCommand to call our function.
command! -nargs=+ -complete=shellcmd RunBackgroundCommand call RunBackgroundCommand(<q-args>)
"" Markdown
autocmd FileType markdown,rmd map <C-c><C-c> mx:silent !pandoc % --pdf-engine=xelatex -o %<.pdf && evince %<.pdf &<Enter>ggGG`x
autocmd FileType markdown,rmd map <C-c>t :ChecklistToggleCheckbox<Enter>
autocmd FileType markdown,rmd inoremap ;h ---<Enter><Tab>title: <x_x><Enter>author: Tuan-Dat Tran<Enter><Esc>0i---<Enter><x_x><Esc>4k0

View File

@ -4,12 +4,9 @@ plugins=(
git git
history history
sudo sudo
wd
web-search
) )
ZSH_THEME="powerlevel9k/powerlevel9k" ZSH_THEME="powerlevel9k/powerlevel9k"
HIST_STAMPS="yyyy.mm.dd"
#POWERLEVEL #POWERLEVEL
POWERLEVEL9K_MODE='awesome-fontconfig' POWERLEVEL9K_MODE='awesome-fontconfig'
@ -28,26 +25,32 @@ POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S}"
POWERLEVEL9k_SHORTEN_STRATEGY="trunctuate_middle" POWERLEVEL9k_SHORTEN_STRATEGY="trunctuate_middle"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# Alias # Alias
alias matrix="cmatrix"
alias df="df -h" alias df="df -h"
alias mkvirtenv="python -m virtualenv --system-site-packages" alias mkvirtenv="python -m virtualenv --system-site-packages"
alias e="emacsclient -t" alias e="emacsclient -t"
alias ek="pkill emacs" alias ek="pkill emacs"
alias ej="emacs --daemon" alias ej="emacs --daemon"
alias nyan="nyancat" alias nyan="nyancat"
alias rm="rm -i" alias rm="rm -I"
alias -s tex=e alias -s tex=vim
alias -s cpp=e alias -s cpp=vim
alias -s org=e alias -s org=vim
alias diff="diff -s" alias diff="diff -s"
alias stunden="e $HOME/Nextcloud/Arbeit/Stundenzettel.org" alias stunden="et $HOME/Nextcloud/Arbeit/Stunden/Stundenzettel.xlsx &; disown %1;"
alias budget="e $HOME/Nextcloud/orgs/Budget/MyBudget.ledger" alias budget="emacs -nw $HOME/Nextcloud/orgs/Budget/MyBudget.ledger"
alias vudget="vim $HOME/Nextcloud/orgs/Budget/MyBudget.ledger" alias vudget="vim $HOME/Nextcloud/orgs/Budget/MyBudget.ledger"
alias q="exit" alias q="exit"
alias ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"' alias ranger='ranger --choosedir=$HOME/.rangerdir; LASTDIR=`cat $HOME/.rangerdir`; cd "$LASTDIR"'
alias steam='steam -silent %U' alias steam='steam'
alias vrc='vim ~/.vimrc' alias vrc='vim ~/.vimrc'
alias erc='e ~/.emacs.d/config.org' alias erc='emacs -nw ~/.emacs.d/config.org'
alias mp3='youtube-dl -x --audio-format mp3 -o "./%(title)s.%(ext)s"'
alias zrc='vim ~/.zshrc'
alias vpn_eu='sudo openvpn --config Downloads/AirVPN_Europe_UDP-443.ovpn'
alias vpn_us='sudo openvpn --config Downloads/AirVPN_America_UDP-443.ovpn'
source $ZSH/oh-my-zsh.sh source $ZSH/oh-my-zsh.sh
# Variables # Variables
@ -61,3 +64,6 @@ export VISUAL=$EDITOR
export VISUAL_EDITOR=$EDITOR export VISUAL_EDITOR=$EDITOR
export STEAM_FRAME_FORCE_CLOSE=1 export STEAM_FRAME_FORCE_CLOSE=1
export HIGHLIGHT_DATADIR="~/.config/highlight/" export HIGHLIGHT_DATADIR="~/.config/highlight/"
export GOPATH="$HOME/workspace/go/"
# Functions