urxvt clipboard/vselect/xdg-open, rewrite color red in terminal, added dunst, added ranger config
parent
352b894ce2
commit
92001234c6
|
@ -1,12 +1,12 @@
|
||||||
! urxvt
|
! urxvt
|
||||||
! Fonts
|
! Fonts
|
||||||
urxvt*font: xft:Hack Nerd Font Mono:style=Regular:size=11:hinting=full, xft:DejaVu Sans Mono for Powerline:size=11
|
urxvt*font: xft:Hack Nerd Font Mono:style=Regular:size=11:hinting=full, xft:DejaVu Sans Mono for Powerline:size=11, xtf:Noto Color Emoji:style=Regular:size=11
|
||||||
|
|
||||||
! Behavior
|
! Behavior
|
||||||
urxvt*scrollBar: false
|
urxvt*scrollBar: false
|
||||||
|
|
||||||
! Plugins
|
! Plugins
|
||||||
URxvt.perl-ext: default,matcher,resize-font,tabbed
|
URxvt.perl-ext: default,matcher,resize-font,tabbed,keyboard-select
|
||||||
|
|
||||||
! Matcher
|
! Matcher
|
||||||
URxvt.url-launcher: /usr/bin/xdg-open
|
URxvt.url-launcher: /usr/bin/xdg-open
|
||||||
|
@ -14,3 +14,7 @@ URxvt.matcher.button: 1
|
||||||
|
|
||||||
! Tabs
|
! Tabs
|
||||||
URxvt.tabbed.new-button: false
|
URxvt.tabbed.new-button: false
|
||||||
|
|
||||||
|
! Keyboard-select
|
||||||
|
URxvt.keysym.M-Escape: perl:keyboard-select:activate
|
||||||
|
URxvt.keyboard-select.clipboard: true
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
! red
|
! red
|
||||||
*.color1: #8b8b8b
|
*.color1: #8b8b8b
|
||||||
*.color9: #8b8b8b
|
*.color9: #e91e63
|
||||||
|
|
||||||
! green
|
! green
|
||||||
*.color2: #237885
|
*.color2: #237885
|
||||||
|
@ -34,3 +34,4 @@
|
||||||
! white
|
! white
|
||||||
*.color7: #98abb2
|
*.color7: #98abb2
|
||||||
*.color15: #c0bfbc
|
*.color15: #c0bfbc
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ exec --no-startup-id conky -c ~/.conky/syclo-crimson-bottomleft.conkyrc
|
||||||
exec --no-startup-id urxvtd
|
exec --no-startup-id urxvtd
|
||||||
exec --no-startup-id synergyc -f --no-tray --debug INFO --name genesis --enable-crypto 192.168.178.38:24800
|
exec --no-startup-id synergyc -f --no-tray --debug INFO --name genesis --enable-crypto 192.168.178.38:24800
|
||||||
exec --no-startup-id dunst
|
exec --no-startup-id dunst
|
||||||
exec --no-startup-id ~/.scripts/language_switch.sh
|
exec --no-startup-id ~/.scripts/startup.sh
|
||||||
exec --no-startup-id /home/tuan/workspace/go/monthlyLedger/main /home/tuan/Templates/ledger/*
|
exec --no-startup-id /home/tuan/workspace/go/monthlyLedger/main /home/tuan/Templates/ledger/*
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -133,9 +133,9 @@ bindsym XF86MonBrightnessUp exec "xbacklight -inc 10; notify-send 'brightness up
|
||||||
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness down'"
|
bindsym XF86MonBrightnessDown exec "xbacklight -dec 10; notify-send 'brightness down'"
|
||||||
|
|
||||||
# Pulse Audio controls
|
# Pulse Audio controls
|
||||||
bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume 0 +5%; notify-send 'sound up'"
|
bindsym XF86AudioRaiseVolume exec --no-startup-id "pactl set-sink-volume $(pactl info | grep 'Default Sink' | cut -d' ' -f3) +5%; notify-send 'sound up'"
|
||||||
bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume 0 -5%; notify-send 'sound down'"
|
bindsym XF86AudioLowerVolume exec --no-startup-id "pactl set-sink-volume $(pactl info | grep 'Default Sink' | cut -d' ' -f3) -5%; notify-send 'sound down'"
|
||||||
bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute 0 toggle; notify-end 'sound muted'"
|
bindsym XF86AudioMute exec --no-startup-id "pactl set-sink-mute $(pactl info | grep 'Default Sink' | cut -d' ' -f3) toggle; notify-end 'sound muted'"
|
||||||
bindsym XF86AudioPlay exec "playerctl play-pause; cmus-remote -u"
|
bindsym XF86AudioPlay exec "playerctl play-pause; cmus-remote -u"
|
||||||
bindsym XF86AudioStop exec "playerctl stop; cmus-remote -s"
|
bindsym XF86AudioStop exec "playerctl stop; cmus-remote -s"
|
||||||
bindsym XF86AudioNext exec "playerctl next; cmus-remote -n"
|
bindsym XF86AudioNext exec "playerctl next; cmus-remote -n"
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
from __future__ import (absolute_import, division, print_function)
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
from ranger.api.commands import Command
|
||||||
|
|
||||||
|
class my_edit(Command):
|
||||||
|
# The so-called doc-string of the class will be visible in the built-in
|
||||||
|
# help that is accessible by typing "?c" inside ranger.
|
||||||
|
""":my_edit <filename>
|
||||||
|
|
||||||
|
A sample command for demonstration purposes that opens a file in an editor.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# The execute method is called when you run this command in ranger.
|
||||||
|
def execute(self):
|
||||||
|
# self.arg(1) is the first (space-separated) argument to the function.
|
||||||
|
# This way you can write ":my_edit somefilename<ENTER>".
|
||||||
|
if self.arg(1):
|
||||||
|
# self.rest(1) contains self.arg(1) and everything that follows
|
||||||
|
target_filename = self.rest(1)
|
||||||
|
else:
|
||||||
|
# self.fm is a ranger.core.filemanager.FileManager object and gives
|
||||||
|
# you access to internals of ranger.
|
||||||
|
# self.fm.thisfile is a ranger.container.file.File object and is a
|
||||||
|
# reference to the currently selected file.
|
||||||
|
target_filename = self.fm.thisfile.path
|
||||||
|
|
||||||
|
# This is a generic function to print text in ranger.
|
||||||
|
self.fm.notify("Let's edit the file " + target_filename + "!")
|
||||||
|
|
||||||
|
# Using bad=True in fm.notify allows you to print error messages:
|
||||||
|
if not os.path.exists(target_filename):
|
||||||
|
self.fm.notify("The given file does not exist!", bad=True)
|
||||||
|
return
|
||||||
|
|
||||||
|
# This executes a function from ranger.core.acitons, a module with a
|
||||||
|
# variety of subroutines that can help you construct commands.
|
||||||
|
# Check out the source, or run "pydoc ranger.core.actions" for a list.
|
||||||
|
self.fm.edit_file(target_filename)
|
||||||
|
|
||||||
|
# The tab method is called when you press tab, and should return a list of
|
||||||
|
# suggestions that the user will tab through.
|
||||||
|
# tabnum is 1 for <TAB> and -1 for <S-TAB> by default
|
||||||
|
def tab(self, tabnum):
|
||||||
|
# This is a generic tab-completion function that iterates through the
|
||||||
|
# content of the current directory.
|
||||||
|
return self._tab_directory_content()
|
File diff suppressed because it is too large
Load Diff
|
@ -9,3 +9,4 @@ map nrg shell cp ~/Templates/LaTeX/Invoice/elektro_invoice.tex Gefeba_Elektr
|
||||||
map nrb shell cp ~/Templates/LaTeX/Invoice/engineering_invoice.tex Gefeba_Engineering_-_Rechnung_$(date +%g-%m)_-Engineering.tex; ~/Templates/LaTeX/Invoice/InvNum.sh
|
map nrb shell cp ~/Templates/LaTeX/Invoice/engineering_invoice.tex Gefeba_Engineering_-_Rechnung_$(date +%g-%m)_-Engineering.tex; ~/Templates/LaTeX/Invoice/InvNum.sh
|
||||||
map nu shell touch L_$(basename %f .pdf)\.md
|
map nu shell touch L_$(basename %f .pdf)\.md
|
||||||
map ntu shell cp ~/Templates/LaTeX/UniversityAssignmets/assignment.tex .
|
map ntu shell cp ~/Templates/LaTeX/UniversityAssignmets/assignment.tex .
|
||||||
|
map nw shell sed "s/# $/# $(pwd | rev | cut -d/ -f1 | rev)/" ~/Templates/writeup.md > ./writeup.md
|
||||||
|
|
|
@ -0,0 +1,207 @@
|
||||||
|
#-------------------------------------------
|
||||||
|
# Websites
|
||||||
|
#-------------------------------------------
|
||||||
|
# Rarely installed browsers get higher priority; It is assumed that if you
|
||||||
|
# install a rare browser, you probably use it. Firefox/konqueror/w3m on the
|
||||||
|
# other hand are often only installed as fallback browsers.
|
||||||
|
ext x?html?, has surf, X, flag f = surf -- file://"$1"
|
||||||
|
ext x?html?, has vimprobable, X, flag f = vimprobable -- "$@"
|
||||||
|
ext x?html?, has vimprobable2, X, flag f = vimprobable2 -- "$@"
|
||||||
|
ext x?html?, has qutebrowser, X, flag f = qutebrowser -- "$@"
|
||||||
|
ext x?html?, has dwb, X, flag f = dwb -- "$@"
|
||||||
|
ext x?html?, has jumanji, X, flag f = jumanji -- "$@"
|
||||||
|
ext x?html?, has luakit, X, flag f = luakit -- "$@"
|
||||||
|
ext x?html?, has uzbl, X, flag f = uzbl -- "$@"
|
||||||
|
ext x?html?, has uzbl-tabbed, X, flag f = uzbl-tabbed -- "$@"
|
||||||
|
ext x?html?, has uzbl-browser, X, flag f = uzbl-browser -- "$@"
|
||||||
|
ext x?html?, has uzbl-core, X, flag f = uzbl-core -- "$@"
|
||||||
|
ext x?html?, has midori, X, flag f = midori -- "$@"
|
||||||
|
ext x?html?, has chromium-browser, X, flag f = chromium-browser -- "$@"
|
||||||
|
ext x?html?, has chromium, X, flag f = chromium -- "$@"
|
||||||
|
ext x?html?, has google-chrome, X, flag f = google-chrome -- "$@"
|
||||||
|
ext x?html?, has opera, X, flag f = opera -- "$@"
|
||||||
|
ext x?html?, has firefox, X, flag f = firefox -- "$@"
|
||||||
|
ext x?html?, has seamonkey, X, flag f = seamonkey -- "$@"
|
||||||
|
ext x?html?, has iceweasel, X, flag f = iceweasel -- "$@"
|
||||||
|
ext x?html?, has epiphany, X, flag f = epiphany -- "$@"
|
||||||
|
ext x?html?, has konqueror, X, flag f = konqueror -- "$@"
|
||||||
|
ext x?html?, has elinks, terminal = elinks "$@"
|
||||||
|
ext x?html?, has links2, terminal = links2 "$@"
|
||||||
|
ext x?html?, has links, terminal = links "$@"
|
||||||
|
ext x?html?, has lynx, terminal = lynx -- "$@"
|
||||||
|
ext x?html?, has w3m, terminal = w3m "$@"
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# Misc
|
||||||
|
#-------------------------------------------
|
||||||
|
# Define the "editor" for text files as first action
|
||||||
|
mime ^text, label editor = ${VISUAL:-$EDITOR} -- "$@"
|
||||||
|
mime ^text, label pager = "$PAGER" -- "$@"
|
||||||
|
!mime ^text, label editor, ext xml|json|csv|tex|py|pl|rb|js|sh|php|rs = ${VISUAL:-$EDITOR} -- "$@"
|
||||||
|
!mime ^text, label pager, ext xml|json|csv|tex|py|pl|rb|js|sh|php|rs = "$PAGER" -- "$@"
|
||||||
|
|
||||||
|
ext 1 = man "$1"
|
||||||
|
ext s[wmf]c, has zsnes, X = zsnes "$1"
|
||||||
|
ext s[wmf]c, has snes9x-gtk,X = snes9x-gtk "$1"
|
||||||
|
ext nes, has fceux, X = fceux "$1"
|
||||||
|
ext exe = wine "$1"
|
||||||
|
name ^[mM]akefile$ = make
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
# Code
|
||||||
|
#-------------------------------------------
|
||||||
|
ext py = python -- "$1"
|
||||||
|
ext pl = perl -- "$1"
|
||||||
|
ext rb = ruby -- "$1"
|
||||||
|
ext js = node -- "$1"
|
||||||
|
ext sh = sh -- "$1"
|
||||||
|
ext php = php -- "$1"
|
||||||
|
ext rs = rs -- "$1"
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
# Audio without X
|
||||||
|
#-------------------------------------------
|
||||||
|
mime ^audio|ogg$, terminal, has mpv = mpv -- "$@"
|
||||||
|
mime ^audio|ogg$, terminal, has mplayer2 = mplayer2 -- "$@"
|
||||||
|
mime ^audio|ogg$, terminal, has mplayer = mplayer -- "$@"
|
||||||
|
ext midi?, terminal, has wildmidi = wildmidi -- "$@"
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
# Video/Audio with a GUI
|
||||||
|
#-------------------------------------------
|
||||||
|
mime ^video|audio, has gmplayer, X, flag f = gmplayer -- "$@"
|
||||||
|
mime ^video|audio, has smplayer, X, flag f = smplayer "$@"
|
||||||
|
mime ^video, has mpv, X, flag f = mpv -- "$@"
|
||||||
|
mime ^video, has mpv, X, flag f = mpv --fs -- "$@"
|
||||||
|
mime ^video, has mplayer2, X, flag f = mplayer2 -- "$@"
|
||||||
|
mime ^video, has mplayer2, X, flag f = mplayer2 -fs -- "$@"
|
||||||
|
mime ^video, has mplayer, X, flag f = mplayer -- "$@"
|
||||||
|
mime ^video, has mplayer, X, flag f = mplayer -fs -- "$@"
|
||||||
|
mime ^video|audio, has vlc, X, flag f = vlc -- "$@"
|
||||||
|
mime ^video|audio, has totem, X, flag f = totem -- "$@"
|
||||||
|
mime ^video|audio, has totem, X, flag f = totem --fullscreen -- "$@"
|
||||||
|
|
||||||
|
#--------------------------------------------
|
||||||
|
# Video without X:
|
||||||
|
#-------------------------------------------
|
||||||
|
mime ^video, terminal, !X, has mpv = mpv -- "$@"
|
||||||
|
mime ^video, terminal, !X, has mplayer2 = mplayer2 -- "$@"
|
||||||
|
mime ^video, terminal, !X, has mplayer = mplayer -- "$@"
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# Documents
|
||||||
|
#-------------------------------------------
|
||||||
|
ext pdf, has llpp, X, flag f = llpp "$@"
|
||||||
|
ext pdf, has zathura, X, flag f = zathura -- "$@"
|
||||||
|
ext pdf, has mupdf, X, flag f = mupdf "$@"
|
||||||
|
ext pdf, has mupdf-x11,X, flag f = mupdf-x11 "$@"
|
||||||
|
ext pdf, has apvlv, X, flag f = apvlv -- "$@"
|
||||||
|
ext pdf, has xpdf, X, flag f = xpdf -- "$@"
|
||||||
|
ext pdf, has evince, X, flag f = evince -- "$@"
|
||||||
|
ext pdf, has atril, X, flag f = atril -- "$@"
|
||||||
|
ext pdf, has okular, X, flag f = okular -- "$@"
|
||||||
|
ext pdf, has epdfview, X, flag f = epdfview -- "$@"
|
||||||
|
ext pdf, has qpdfview, X, flag f = qpdfview "$@"
|
||||||
|
ext pdf, has open, X, flag f = open "$@"
|
||||||
|
|
||||||
|
ext docx?, has catdoc, terminal = catdoc -- "$@" | "$PAGER"
|
||||||
|
|
||||||
|
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has gnumeric, X, flag f = gnumeric -- "$@"
|
||||||
|
ext sxc|xlsx?|xlt|xlw|gnm|gnumeric, has kspread, X, flag f = kspread -- "$@"
|
||||||
|
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has libreoffice, X, flag f = libreoffice "$@"
|
||||||
|
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has soffice, X, flag f = soffice "$@"
|
||||||
|
ext pptx?|od[dfgpst]|docx?|sxc|xlsx?|xlt|xlw|gnm|gnumeric, has ooffice, X, flag f = ooffice "$@"
|
||||||
|
|
||||||
|
ext djvu, has zathura,X, flag f = zathura -- "$@"
|
||||||
|
ext djvu, has evince, X, flag f = evince -- "$@"
|
||||||
|
ext djvu, has atril, X, flag f = atril -- "$@"
|
||||||
|
ext djvu, has djview, X, flag f = djview -- "$@"
|
||||||
|
|
||||||
|
ext epub, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||||
|
ext mobi, has ebook-viewer, X, flag f = ebook-viewer -- "$@"
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# Image Viewing:
|
||||||
|
#-------------------------------------------
|
||||||
|
mime ^image/svg, has inkscape, X, flag f = inkscape -- "$@"
|
||||||
|
mime ^image/svg, has display, X, flag f = display -- "$@"
|
||||||
|
|
||||||
|
mime ^image, has pqiv, X, flag f = pqiv -- "$@"
|
||||||
|
mime ^image, has sxiv, X, flag f = sxiv -- "$@"
|
||||||
|
mime ^image, has feh, X, flag f = feh -- "$@"
|
||||||
|
mime ^image, has mirage, X, flag f = mirage -- "$@"
|
||||||
|
mime ^image, has ristretto, X, flag f = ristretto "$@"
|
||||||
|
mime ^image, has eog, X, flag f = eog -- "$@"
|
||||||
|
mime ^image, has eom, X, flag f = eom -- "$@"
|
||||||
|
mime ^image, has nomacs, X, flag f = nomacs -- "$@"
|
||||||
|
mime ^image, has geeqie, X, flag f = geeqie -- "$@"
|
||||||
|
mime ^image, has gwenview, X, flag f = gwenview -- "$@"
|
||||||
|
mime ^image, has gimp, X, flag f = gimp -- "$@"
|
||||||
|
ext xcf, X, flag f = gimp -- "$@"
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# Archives
|
||||||
|
#-------------------------------------------
|
||||||
|
|
||||||
|
# avoid password prompt by providing empty password
|
||||||
|
ext 7z, has 7z = 7z -p l "$@" | "$PAGER"
|
||||||
|
# This requires atool
|
||||||
|
ext ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||||
|
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --list --each -- "$@" | "$PAGER"
|
||||||
|
ext 7z|ace|ar|arc|bz2?|cab|cpio|cpt|deb|dgc|dmg|gz, has atool = atool --extract --each -- "$@"
|
||||||
|
ext iso|jar|msi|pkg|rar|shar|tar|tgz|xar|xpi|xz|zip, has atool = atool --extract --each -- "$@"
|
||||||
|
|
||||||
|
# Listing and extracting archives without atool:
|
||||||
|
ext tar|gz|bz2|xz, has tar = tar vvtf "$1" | "$PAGER"
|
||||||
|
ext tar|gz|bz2|xz, has tar = for file in "$@"; do tar vvxf "$file"; done
|
||||||
|
ext bz2, has bzip2 = for file in "$@"; do bzip2 -dk "$file"; done
|
||||||
|
ext zip, has unzip = unzip -l "$1" | less
|
||||||
|
ext zip, has unzip = for file in "$@"; do unzip -d "${file%.*}" "$file"; done
|
||||||
|
ext ace, has unace = unace l "$1" | less
|
||||||
|
ext ace, has unace = for file in "$@"; do unace e "$file"; done
|
||||||
|
ext rar, has unrar = unrar l "$1" | less
|
||||||
|
ext rar, has unrar = for file in "$@"; do unrar x "$file"; done
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# Flag t fallback terminals
|
||||||
|
#-------------------------------------------
|
||||||
|
# Rarely installed terminal emulators get higher priority; It is assumed that
|
||||||
|
# if you install a rare terminal emulator, you probably use it.
|
||||||
|
# gnome-terminal/konsole/xterm on the other hand are often installed as part of
|
||||||
|
# a desktop environment or as fallback terminal emulators.
|
||||||
|
mime ^ranger/x-terminal-emulator, has terminology = terminology -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has kitty = kitty -- "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has alacritty = alacritty -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has sakura = sakura -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has lilyterm = lilyterm -e "$@"
|
||||||
|
#mime ^ranger/x-terminal-emulator, has cool-retro-term = cool-retro-term -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has termite = termite -x '"$@"'
|
||||||
|
#mime ^ranger/x-terminal-emulator, has yakuake = yakuake -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has guake = guake -ne "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has tilda = tilda -c "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has st = st -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has terminator = terminator -x "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has urxvt = urxvt -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has pantheon-terminal = pantheon-terminal -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has lxterminal = lxterminal -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has mate-terminal = mate-terminal -x "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has xfce4-terminal = xfce4-terminal -x "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has konsole = konsole -e "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has gnome-terminal = gnome-terminal -- "$@"
|
||||||
|
mime ^ranger/x-terminal-emulator, has xterm = xterm -e "$@"
|
||||||
|
|
||||||
|
#-------------------------------------------
|
||||||
|
# Misc
|
||||||
|
#-------------------------------------------
|
||||||
|
label wallpaper, number 11, mime ^image, has feh, X = feh --bg-scale "$1"
|
||||||
|
label wallpaper, number 12, mime ^image, has feh, X = feh --bg-tile "$1"
|
||||||
|
label wallpaper, number 13, mime ^image, has feh, X = feh --bg-center "$1"
|
||||||
|
label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
|
||||||
|
|
||||||
|
# Define the editor for non-text files + pager as last action
|
||||||
|
!mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|rs = ask
|
||||||
|
label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|rs = ${VISUAL:-$EDITOR} -- "$@"
|
||||||
|
label pager, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php|rs = "$PAGER" -- "$@"
|
||||||
|
|
||||||
|
# The very last action, so that it's never triggered accidentally, is to execute a program:
|
||||||
|
mime application/x-executable = "$1"
|
|
@ -0,0 +1,216 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -o noclobber -o noglob -o nounset -o pipefail
|
||||||
|
IFS=$'\n'
|
||||||
|
|
||||||
|
# If the option `use_preview_script` is set to `true`,
|
||||||
|
# then this script will be called and its output will be displayed in ranger.
|
||||||
|
# ANSI color codes are supported.
|
||||||
|
# STDIN is disabled, so interactive scripts won't work properly
|
||||||
|
|
||||||
|
# This script is considered a configuration file and must be updated manually.
|
||||||
|
# It will be left untouched if you upgrade ranger.
|
||||||
|
|
||||||
|
# Meanings of exit codes:
|
||||||
|
# code | meaning | action of ranger
|
||||||
|
# -----+------------+-------------------------------------------
|
||||||
|
# 0 | success | Display stdout as preview
|
||||||
|
# 1 | no preview | Display no preview at all
|
||||||
|
# 2 | plain text | Display the plain content of the file
|
||||||
|
# 3 | fix width | Don't reload when width changes
|
||||||
|
# 4 | fix height | Don't reload when height changes
|
||||||
|
# 5 | fix both | Don't ever reload
|
||||||
|
# 6 | image | Display the image `$IMAGE_CACHE_PATH` points to as an image preview
|
||||||
|
# 7 | image | Display the file directly as an image
|
||||||
|
|
||||||
|
# Script arguments
|
||||||
|
FILE_PATH="${1}" # Full path of the highlighted file
|
||||||
|
PV_WIDTH="${2}" # Width of the preview pane (number of fitting characters)
|
||||||
|
PV_HEIGHT="${3}" # Height of the preview pane (number of fitting characters)
|
||||||
|
IMAGE_CACHE_PATH="${4}" # Full path that should be used to cache image preview
|
||||||
|
PV_IMAGE_ENABLED="${5}" # 'True' if image previews are enabled, 'False' otherwise.
|
||||||
|
|
||||||
|
FILE_EXTENSION="${FILE_PATH##*.}"
|
||||||
|
FILE_EXTENSION_LOWER=$(echo ${FILE_EXTENSION} | tr '[:upper:]' '[:lower:]')
|
||||||
|
|
||||||
|
# Settings
|
||||||
|
HIGHLIGHT_SIZE_MAX=262143 # 256KiB
|
||||||
|
HIGHLIGHT_TABWIDTH=8
|
||||||
|
HIGHLIGHT_STYLE='pablo'
|
||||||
|
PYGMENTIZE_STYLE='autumn'
|
||||||
|
|
||||||
|
|
||||||
|
handle_extension() {
|
||||||
|
case "${FILE_EXTENSION_LOWER}" in
|
||||||
|
# Archive
|
||||||
|
a|ace|alz|arc|arj|bz|bz2|cab|cpio|deb|gz|jar|lha|lz|lzh|lzma|lzo|\
|
||||||
|
rpm|rz|t7z|tar|tbz|tbz2|tgz|tlz|txz|tZ|tzo|war|xpi|xz|Z|zip)
|
||||||
|
atool --list -- "${FILE_PATH}" && exit 5
|
||||||
|
bsdtar --list --file "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
rar)
|
||||||
|
# Avoid password prompt by providing empty password
|
||||||
|
unrar lt -p- -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
7z)
|
||||||
|
# Avoid password prompt by providing empty password
|
||||||
|
7z l -p -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# PDF
|
||||||
|
pdf)
|
||||||
|
# Preview as text conversion
|
||||||
|
pdftotext -l 10 -nopgbrk -q -- "${FILE_PATH}" - | fmt -w ${PV_WIDTH} && exit 5
|
||||||
|
mutool draw -F txt -i -- "${FILE_PATH}" 1-10 | fmt -w ${PV_WIDTH} && exit 5
|
||||||
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# BitTorrent
|
||||||
|
torrent)
|
||||||
|
transmission-show -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# OpenDocument
|
||||||
|
odt|ods|odp|sxw)
|
||||||
|
# Preview as text conversion
|
||||||
|
odt2txt "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# HTML
|
||||||
|
htm|html|xhtml)
|
||||||
|
# Preview as text conversion
|
||||||
|
w3m -dump "${FILE_PATH}" && exit 5
|
||||||
|
lynx -dump -- "${FILE_PATH}" && exit 5
|
||||||
|
elinks -dump "${FILE_PATH}" && exit 5
|
||||||
|
;; # Continue with next handler on failure
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_image() {
|
||||||
|
local mimetype="${1}"
|
||||||
|
case "${mimetype}" in
|
||||||
|
# SVG
|
||||||
|
# image/svg+xml)
|
||||||
|
# convert "${FILE_PATH}" "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
# exit 1;;
|
||||||
|
|
||||||
|
# Image
|
||||||
|
image/*)
|
||||||
|
local orientation
|
||||||
|
orientation="$( identify -format '%[EXIF:Orientation]\n' -- "${FILE_PATH}" )"
|
||||||
|
# If orientation data is present and the image actually
|
||||||
|
# needs rotating ("1" means no rotation)...
|
||||||
|
if [[ -n "$orientation" && "$orientation" != 1 ]]; then
|
||||||
|
# ...auto-rotate the image according to the EXIF data.
|
||||||
|
convert -- "${FILE_PATH}" -auto-orient "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
fi
|
||||||
|
|
||||||
|
# `w3mimgdisplay` will be called for all images (unless overriden as above),
|
||||||
|
# but might fail for unsupported types.
|
||||||
|
exit 7;;
|
||||||
|
|
||||||
|
# Video
|
||||||
|
# video/*)
|
||||||
|
# # Thumbnail
|
||||||
|
# ffmpegthumbnailer -i "${FILE_PATH}" -o "${IMAGE_CACHE_PATH}" -s 0 && exit 6
|
||||||
|
# exit 1;;
|
||||||
|
# PDF
|
||||||
|
# application/pdf)
|
||||||
|
# pdftoppm -f 1 -l 1 \
|
||||||
|
# -scale-to-x 1920 \
|
||||||
|
# -scale-to-y -1 \
|
||||||
|
# -singlefile \
|
||||||
|
# -jpeg -tiffcompression jpeg \
|
||||||
|
# -- "${FILE_PATH}" "${IMAGE_CACHE_PATH%.*}" \
|
||||||
|
# && exit 6 || exit 1;;
|
||||||
|
|
||||||
|
# Preview archives using the first image inside.
|
||||||
|
# (Very useful for comic book collections for example.)
|
||||||
|
# application/zip|application/x-rar|application/x-7z-compressed|\
|
||||||
|
# application/x-xz|application/x-bzip2|application/x-gzip|application/x-tar)
|
||||||
|
# local fn=""; local fe=""
|
||||||
|
# local zip=""; local rar=""; local tar=""; local bsd=""
|
||||||
|
# case "${mimetype}" in
|
||||||
|
# application/zip) zip=1 ;;
|
||||||
|
# application/x-rar) rar=1 ;;
|
||||||
|
# application/x-7z-compressed) ;;
|
||||||
|
# *) tar=1 ;;
|
||||||
|
# esac
|
||||||
|
# { [ "$tar" ] && fn=$(tar --list --file "${FILE_PATH}"); } || \
|
||||||
|
# { fn=$(bsdtar --list --file "${FILE_PATH}") && bsd=1 && tar=""; } || \
|
||||||
|
# { [ "$rar" ] && fn=$(unrar lb -p- -- "${FILE_PATH}"); } || \
|
||||||
|
# { [ "$zip" ] && fn=$(zipinfo -1 -- "${FILE_PATH}"); } || return
|
||||||
|
#
|
||||||
|
# fn=$(echo "$fn" | python -c "import sys; import mimetypes as m; \
|
||||||
|
# [ print(l, end='') for l in sys.stdin if \
|
||||||
|
# (m.guess_type(l[:-1])[0] or '').startswith('image/') ]" |\
|
||||||
|
# sort -V | head -n 1)
|
||||||
|
# [ "$fn" = "" ] && return
|
||||||
|
# [ "$bsd" ] && fn=$(printf '%b' "$fn")
|
||||||
|
#
|
||||||
|
# [ "$tar" ] && tar --extract --to-stdout \
|
||||||
|
# --file "${FILE_PATH}" -- "$fn" > "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
# fe=$(echo -n "$fn" | sed 's/[][*?\]/\\\0/g')
|
||||||
|
# [ "$bsd" ] && bsdtar --extract --to-stdout \
|
||||||
|
# --file "${FILE_PATH}" -- "$fe" > "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
# [ "$bsd" ] || [ "$tar" ] && rm -- "${IMAGE_CACHE_PATH}"
|
||||||
|
# [ "$rar" ] && unrar p -p- -inul -- "${FILE_PATH}" "$fn" > \
|
||||||
|
# "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
# [ "$zip" ] && unzip -pP "" -- "${FILE_PATH}" "$fe" > \
|
||||||
|
# "${IMAGE_CACHE_PATH}" && exit 6
|
||||||
|
# [ "$rar" ] || [ "$zip" ] && rm -- "${IMAGE_CACHE_PATH}"
|
||||||
|
# ;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_mime() {
|
||||||
|
local mimetype="${1}"
|
||||||
|
case "${mimetype}" in
|
||||||
|
# Text
|
||||||
|
text/* | */xml)
|
||||||
|
# Syntax highlight
|
||||||
|
if [[ "$( stat --printf='%s' -- "${FILE_PATH}" )" -gt "${HIGHLIGHT_SIZE_MAX}" ]]; then
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
if [[ "$( tput colors )" -ge 256 ]]; then
|
||||||
|
local pygmentize_format='terminal256'
|
||||||
|
local highlight_format='xterm256'
|
||||||
|
else
|
||||||
|
local pygmentize_format='terminal'
|
||||||
|
local highlight_format='ansi'
|
||||||
|
fi
|
||||||
|
highlight --replace-tabs="${HIGHLIGHT_TABWIDTH}" --out-format="${highlight_format}" \
|
||||||
|
--style="${HIGHLIGHT_STYLE}" --force -- "${FILE_PATH}" && exit 5
|
||||||
|
# pygmentize -f "${pygmentize_format}" -O "style=${PYGMENTIZE_STYLE}" -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 2;;
|
||||||
|
|
||||||
|
# Image
|
||||||
|
image/*)
|
||||||
|
# Preview as text conversion
|
||||||
|
# img2txt --gamma=0.6 --width="${PV_WIDTH}" -- "${FILE_PATH}" && exit 4
|
||||||
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
|
||||||
|
# Video and audio
|
||||||
|
video/* | audio/*)
|
||||||
|
mediainfo "${FILE_PATH}" && exit 5
|
||||||
|
exiftool "${FILE_PATH}" && exit 5
|
||||||
|
exit 1;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_fallback() {
|
||||||
|
echo '----- File Type Classification -----' && file --dereference --brief -- "${FILE_PATH}" && exit 5
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MIMETYPE="$( file --dereference --brief --mime-type -- "${FILE_PATH}" )"
|
||||||
|
if [[ "${PV_IMAGE_ENABLED}" == 'True' ]]; then
|
||||||
|
handle_image "${MIMETYPE}"
|
||||||
|
fi
|
||||||
|
handle_extension
|
||||||
|
handle_mime "${MIMETYPE}"
|
||||||
|
handle_fallback
|
||||||
|
|
||||||
|
exit 1
|
|
@ -4,7 +4,8 @@ o:/home/tuan/.dotfiles/config
|
||||||
m:/run/media/tuan
|
m:/run/media/tuan
|
||||||
a:/home/tuan/Documents/Arbeit
|
a:/home/tuan/Documents/Arbeit
|
||||||
l:/home/tuan/Local
|
l:/home/tuan/Local
|
||||||
c:/home/tuan/workspace_l/Projects/Angular/favorites
|
c:/home/tuan/Documents/CTF/picoCTF
|
||||||
':/run/media/tuan/UWU
|
':/home/tuan/.dotfiles/config
|
||||||
t:/home/tuan/Templates
|
t:/home/tuan/Templates
|
||||||
w:/home/tuan/workspace_l/Projects
|
w:/home/tuan/workspace_l/Projects
|
||||||
|
k:/home/tuan/Documents/Fachschaft/Berufungskomission
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
KBD="";
|
|
||||||
oldKBD="";
|
function kb_routine {
|
||||||
while :
|
|
||||||
do
|
|
||||||
oldKBD="$KBD";
|
oldKBD="$KBD";
|
||||||
case "$(xset -q | grep -A 0 'LED' | cut -c59-67)" in
|
case "$(xset -q | grep -A 0 'LED' | cut -c59-67)" in
|
||||||
"00000000")
|
"00000000")
|
||||||
|
@ -15,5 +13,22 @@ do
|
||||||
if [ "$KBD" != "$oldKBD" ]; then
|
if [ "$KBD" != "$oldKBD" ]; then
|
||||||
notify-send "$KBD";
|
notify-send "$KBD";
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function battery_routine {
|
||||||
|
capacity=$(< /sys/class/power_supply/BAT0/capacity)
|
||||||
|
if [[ $capacity -lt 5 ]]; then
|
||||||
|
echo $capacity
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
KBD="";
|
||||||
|
oldKBD="";
|
||||||
|
|
||||||
|
while :
|
||||||
|
do
|
||||||
|
kb_routine
|
||||||
|
battery_routine
|
||||||
sleep 1;
|
sleep 1;
|
||||||
done
|
done
|
|
@ -45,3 +45,9 @@ Host goldi
|
||||||
Port 22
|
Port 22
|
||||||
User goldi
|
User goldi
|
||||||
IdentityFile /mnt/veracrypt1/goldi
|
IdentityFile /mnt/veracrypt1/goldi
|
||||||
|
|
||||||
|
Host picoCTF
|
||||||
|
HostName 2018shell4.picoctf.com
|
||||||
|
Port 22
|
||||||
|
User mos4
|
||||||
|
IdentityFile "/home/tuan/Documents/CTF/picoCTF/2018/30 - ssh-keyz/picoCTF"
|
||||||
|
|
|
@ -0,0 +1,606 @@
|
||||||
|
#! perl -w
|
||||||
|
# Author: Bert Muennich
|
||||||
|
# Website: http://www.github.com/muennich/urxvt-perls
|
||||||
|
# License: GPLv2
|
||||||
|
|
||||||
|
# Use keyboard shortcuts to select and copy text.
|
||||||
|
|
||||||
|
# Usage: put the following lines in your .Xdefaults/.Xresources:
|
||||||
|
# URxvt.perl-ext-common: ...,keyboard-select
|
||||||
|
# URxvt.keysym.M-Escape: perl:keyboard-select:activate
|
||||||
|
# The following line overwrites the default Meta-s binding and allows to
|
||||||
|
# activate keyboard-select directly in backward search mode:
|
||||||
|
# URxvt.keysym.M-s: perl:keyboard-select:search
|
||||||
|
|
||||||
|
# Use Meta-Escape to activate selection mode, then use the following keys:
|
||||||
|
# h/j/k/l: Move cursor left/down/up/right (also with arrow keys)
|
||||||
|
# g/G/0/^/$/H/M/L/f/F/;/,/w/W/b/B/e/E: More vi-like cursor movement keys
|
||||||
|
# '/'/?: Start forward/backward search
|
||||||
|
# n/N: Repeat last search, N: in reverse direction
|
||||||
|
# Ctrl-f/b: Scroll down/up one screen
|
||||||
|
# Ctrl-d/u: Scroll down/up half a screen
|
||||||
|
# v/V/Ctrl-v: Toggle normal/linewise/blockwise selection
|
||||||
|
# y/Return: Copy selection to primary buffer, Return: quit afterwards
|
||||||
|
# Y: Copy selected lines to primary buffer or cursor line and quit
|
||||||
|
# q/Escape: Quit keyboard selection mode
|
||||||
|
|
||||||
|
# Options:
|
||||||
|
# URxvt.keyboard-select.clipboard: If true, copy to clipboard too
|
||||||
|
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
|
||||||
|
sub on_start{
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->{clipboard} = $self->x_resource_boolean('keyboard-select.clipboard');
|
||||||
|
|
||||||
|
$self->{patterns}{'w'} = qr/\w[^\w\s]|\W\w|\s\S/;
|
||||||
|
$self->{patterns}{'W'} = qr/\s\S/;
|
||||||
|
$self->{patterns}{'b'} = qr/.*(?:\w[^\w\s]|\W\w|\s\S)/;
|
||||||
|
$self->{patterns}{'B'} = qr/.*\s\S/;
|
||||||
|
$self->{patterns}{'e'} = qr/[^\w\s](?=\w)|\w(?=\W)|\S(?=\s|$)/;
|
||||||
|
$self->{patterns}{'E'} = qr/\S(?=\s|$)/;
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub on_action {
|
||||||
|
my ($self, $action) = @_;
|
||||||
|
|
||||||
|
on_user_command($self, "keyboard-select:" . $action);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub on_user_command {
|
||||||
|
my ($self, $cmd) = @_;
|
||||||
|
|
||||||
|
if (not $self->{active}) {
|
||||||
|
if ($cmd eq 'keyboard-select:activate') {
|
||||||
|
activate($self);
|
||||||
|
} elsif ($cmd eq 'keyboard-select:search') {
|
||||||
|
activate($self, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub key_press {
|
||||||
|
my ($self, $event, $keysym, $char) = @_;
|
||||||
|
my $key = chr($keysym);
|
||||||
|
|
||||||
|
if (lc($key) eq 'c' && $event->{state} & urxvt::ControlMask) {
|
||||||
|
deactivate($self);
|
||||||
|
} elsif ($self->{search}) {
|
||||||
|
if ($keysym == 0xff1b) {
|
||||||
|
if ($self->{search_mode}) {
|
||||||
|
deactivate($self);
|
||||||
|
} else {
|
||||||
|
$self->{search} = '';
|
||||||
|
status_area($self);
|
||||||
|
}
|
||||||
|
} elsif ($keysym == 0xff08) {
|
||||||
|
$self->{search} = substr($self->{search}, 0, -1);
|
||||||
|
if (not $self->{search} and $self->{search_mode}) {
|
||||||
|
deactivate($self);
|
||||||
|
} else {
|
||||||
|
status_area($self);
|
||||||
|
}
|
||||||
|
} elsif ($keysym == 0xff0d ||
|
||||||
|
(lc($key) eq 'm' && $event->{state} & urxvt::ControlMask)) {
|
||||||
|
my $txt = substr($self->{search}, 1);
|
||||||
|
if ($txt) {
|
||||||
|
$self->{pattern} = ($txt =~ m/[[:upper:]]/) ? qr/\Q$txt\E/ :
|
||||||
|
qr/\Q$txt\E/i;
|
||||||
|
} elsif ($self->{pattern}) {
|
||||||
|
delete $self->{pattern};
|
||||||
|
}
|
||||||
|
$self->{search} = '';
|
||||||
|
$self->screen_cur($self->{srhcr}, $self->{srhcc});
|
||||||
|
if (not find_next($self)) {
|
||||||
|
if ($self->{search_mode}) {
|
||||||
|
deactivate($self);
|
||||||
|
} else {
|
||||||
|
status_area($self);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elsif (length($char) > 0) {
|
||||||
|
$self->{search} .= $self->locale_decode($char);
|
||||||
|
my $txt = substr($self->{search}, 1);
|
||||||
|
if ($txt) {
|
||||||
|
$self->{pattern} = ($txt =~ m/[[:upper:]]/) ? qr/\Q$txt\E/ :
|
||||||
|
qr/\Q$txt\E/i;
|
||||||
|
} elsif ($self->{pattern}) {
|
||||||
|
delete $self->{pattern};
|
||||||
|
}
|
||||||
|
$self->screen_cur($self->{srhcr}, $self->{srhcc});
|
||||||
|
find_next($self);
|
||||||
|
status_area($self);
|
||||||
|
}
|
||||||
|
} elsif ($self->{move_to}) {
|
||||||
|
if ($keysym == 0xff1b) {
|
||||||
|
$self->{move_to} = 0;
|
||||||
|
status_area($self);
|
||||||
|
} elsif (length($char) > 0) {
|
||||||
|
$self->{move_to} = 0;
|
||||||
|
$self->{patterns}{'f-1'} = qr/^.*\Q$key\E/;
|
||||||
|
$self->{patterns}{'f+1'} = qr/^.+?\Q$key\E/;
|
||||||
|
move_to($self, ';');
|
||||||
|
status_area($self);
|
||||||
|
}
|
||||||
|
} elsif ($keysym == 0xff1b || lc($key) eq 'q') {
|
||||||
|
deactivate($self);
|
||||||
|
} elsif (lc($key) eq 'y' || $keysym == 0xff0d ||
|
||||||
|
(lc($key) eq 'm' && $event->{state} & urxvt::ControlMask)) {
|
||||||
|
my $quit = 0;
|
||||||
|
if ($key eq 'Y' && $self->{select} ne 'l') {
|
||||||
|
$quit = !$self->{select};
|
||||||
|
toggle_select($self, 'l');
|
||||||
|
}
|
||||||
|
if ($self->{select}) {
|
||||||
|
my ($br, $bc, $er, $ec) = calc_span($self);
|
||||||
|
$ec = $self->line($er)->l if $self->{select} eq 'l';
|
||||||
|
$self->selection_beg($br, $bc);
|
||||||
|
$self->selection_end($er, $ec);
|
||||||
|
$self->selection_make($event->{time}, $self->{select} eq 'b');
|
||||||
|
if ($self->{clipboard}) {
|
||||||
|
$self->selection($self->selection(), 1);
|
||||||
|
$self->selection_grab($event->{time}, 1);
|
||||||
|
}
|
||||||
|
if (lc($key) eq 'y') {
|
||||||
|
$self->selection_beg(1, 0);
|
||||||
|
$self->selection_end(1, 0);
|
||||||
|
$self->{select} = '';
|
||||||
|
status_area($self);
|
||||||
|
$self->want_refresh();
|
||||||
|
} else {
|
||||||
|
$quit = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($quit) {
|
||||||
|
deactivate($self);
|
||||||
|
}
|
||||||
|
} elsif ($key eq 'V') {
|
||||||
|
toggle_select($self, 'l');
|
||||||
|
} elsif ($key eq 'v') {
|
||||||
|
if ($event->{state} & urxvt::ControlMask) {
|
||||||
|
toggle_select($self, 'b');
|
||||||
|
} else {
|
||||||
|
toggle_select($self, 'n');
|
||||||
|
}
|
||||||
|
} elsif ($key eq 'k' || $keysym == 0xff52) {
|
||||||
|
move_cursor($self, 'k');
|
||||||
|
} elsif ($key eq 'j' || $keysym == 0xff54) {
|
||||||
|
move_cursor($self, 'j');
|
||||||
|
} elsif ($key eq 'h' || $keysym == 0xff51) {
|
||||||
|
move_cursor($self, 'h');
|
||||||
|
} elsif ($key eq 'l' || $keysym == 0xff53) {
|
||||||
|
move_cursor($self, 'l');
|
||||||
|
} elsif ($keysym == 0xff57) {
|
||||||
|
move_cursor($self, '$');
|
||||||
|
} elsif ($keysym == 0xff50) {
|
||||||
|
move_cursor($self, '^');
|
||||||
|
} elsif ('gG0^$HML' =~ m/\Q$key\E/ ||
|
||||||
|
('fbdu' =~ m/\Q$key\E/ && $event->{state} & urxvt::ControlMask)) {
|
||||||
|
move_cursor($self, $key);
|
||||||
|
} elsif (lc($key) eq 'f') {
|
||||||
|
$self->{move_to} = 1;
|
||||||
|
$self->{move_dir} = $key eq 'F' ? -1 : 1;
|
||||||
|
status_area($self, $key);
|
||||||
|
} elsif (';,wWbBeE' =~ m/\Q$key\E/) {
|
||||||
|
move_to($self, $key);
|
||||||
|
} elsif ($key eq '/' || $key eq '?') {
|
||||||
|
$self->{search} = $key;
|
||||||
|
$self->{search_dir} = $key eq '?' ? -1 : 1;
|
||||||
|
($self->{srhcr}, $self->{srhcc}) = $self->screen_cur();
|
||||||
|
status_area($self);
|
||||||
|
} elsif (lc($key) eq 'n') {
|
||||||
|
find_next($self, $self->{search_dir} * ($key eq 'N' ? -1 : 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub move_cursor {
|
||||||
|
my ($self, $key) = @_;
|
||||||
|
my ($cr, $cc) = $self->screen_cur();
|
||||||
|
my $line = $self->line($cr);
|
||||||
|
|
||||||
|
if ($key eq 'k' && $line->beg > $self->top_row) {
|
||||||
|
$cr = $line->beg - 1;
|
||||||
|
} elsif ($key eq 'j' && $line->end < $self->nrow - 1) {
|
||||||
|
$cr = $line->end + 1;
|
||||||
|
} elsif ($key eq 'h' && $self->{offset} > 0) {
|
||||||
|
$self->{offset} = $line->offset_of($cr, $cc) - 1;
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
} elsif ($key eq 'l' && $self->{offset} < $line->l - 1) {
|
||||||
|
++$self->{offset};
|
||||||
|
} elsif ($key eq 'f' || $key eq 'd') {
|
||||||
|
my $vs = $self->view_start() +
|
||||||
|
($key eq 'd' ? $self->nrow / 2 : $self->nrow - 1);
|
||||||
|
$vs = 0 if $vs > 0;
|
||||||
|
$cr += $vs - $self->view_start($vs);
|
||||||
|
} elsif ($key eq 'b' || $key eq 'u') {
|
||||||
|
my $vs = $self->view_start() -
|
||||||
|
($key eq 'u' ? $self->nrow / 2 : $self->nrow - 1);
|
||||||
|
$vs = $self->top_row if $vs < $self->top_row;
|
||||||
|
$cr += $vs - $self->view_start($vs);
|
||||||
|
} elsif ($key eq 'g') {
|
||||||
|
($cr, $self->{offset}) = ($self->top_row, 0);
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
} elsif ($key eq 'G') {
|
||||||
|
($cr, $self->{offset}) = ($self->nrow - 1, 0);
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
} elsif ($key eq '0') {
|
||||||
|
$self->{offset} = 0;
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
} elsif ($key eq '^') {
|
||||||
|
my $ltxt = $self->special_decode($line->t);
|
||||||
|
while ($ltxt =~ s/^( *)\t/$1 . " " x (8 - length($1) % 8)/e) {}
|
||||||
|
$self->{offset} = $ltxt =~ m/^ +/ ? $+[0] : 0;
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
} elsif ($key eq '$') {
|
||||||
|
my $co = $line->offset_of($cr, $cc);
|
||||||
|
$self->{dollar} = $co + 1;
|
||||||
|
$self->{offset} = $line->l - 1;
|
||||||
|
} elsif ($key eq 'H') {
|
||||||
|
$cr = $self->view_start();
|
||||||
|
} elsif ($key eq 'M') {
|
||||||
|
$cr = $self->view_start() + $self->nrow / 2;
|
||||||
|
} elsif ($key eq 'L') {
|
||||||
|
$cr = $self->view_start() + $self->nrow - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
$line = $self->line($cr);
|
||||||
|
$cc = $self->{dollar} || $self->{offset} >= $line->l ? $line->l - 1 :
|
||||||
|
$self->{offset};
|
||||||
|
$self->screen_cur($line->coord_of($cc));
|
||||||
|
|
||||||
|
status_area($self);
|
||||||
|
$self->want_refresh();
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub move_to {
|
||||||
|
my ($self, $key) = @_;
|
||||||
|
my ($cr, $cc) = $self->screen_cur();
|
||||||
|
my $line = $self->line($cr);
|
||||||
|
my $offset = $self->{offset};
|
||||||
|
my ($dir, $pattern);
|
||||||
|
my ($wrap, $found) = (0, 0);
|
||||||
|
|
||||||
|
if ($key eq ';' || $key eq ',') {
|
||||||
|
$dir = $self->{move_dir} * ($key eq ',' ? -1 : 1);
|
||||||
|
$pattern = $self->{patterns}{sprintf('f%+d', $dir)};
|
||||||
|
return if not $pattern;
|
||||||
|
} else {
|
||||||
|
if (lc($key) eq 'b') {
|
||||||
|
$dir = -1;
|
||||||
|
} else {
|
||||||
|
$dir = 1;
|
||||||
|
++$offset if lc($key) eq 'e';
|
||||||
|
}
|
||||||
|
$pattern = $self->{patterns}{$key};
|
||||||
|
$wrap = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dir > 0) {
|
||||||
|
NEXTDOWN: my $text = substr($line->t, $offset);
|
||||||
|
if ($text =~ m/$pattern/) {
|
||||||
|
$offset += $+[0] - 1;
|
||||||
|
$found = 1;
|
||||||
|
} elsif ($wrap && $line->end + 1 < $self->nrow) {
|
||||||
|
$cr = $line->end + 1;
|
||||||
|
$line = $self->line($cr);
|
||||||
|
$offset = 0;
|
||||||
|
if (lc($key) eq 'e') {
|
||||||
|
goto NEXTDOWN;
|
||||||
|
} else {
|
||||||
|
$found = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elsif ($dir < 0) {
|
||||||
|
NEXTUP: my $text = substr($line->t, 0, $offset);
|
||||||
|
if ($text =~ m/$pattern/) {
|
||||||
|
$offset += $+[0] - length($text) - 1;
|
||||||
|
$found = 1;
|
||||||
|
} elsif ($wrap) {
|
||||||
|
if ($offset > 0) {
|
||||||
|
$offset = 0;
|
||||||
|
$found = 1;
|
||||||
|
} elsif ($line->beg > $self->top_row) {
|
||||||
|
$cr = $line->beg - 1;
|
||||||
|
$line = $self->line($cr);
|
||||||
|
$offset = $line->l;
|
||||||
|
goto NEXTUP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($found) {
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
$self->{offset} = $offset;
|
||||||
|
$self->screen_cur($line->coord_of($offset));
|
||||||
|
$self->want_refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub find_next {
|
||||||
|
my ($self, $dir) = @_;
|
||||||
|
|
||||||
|
return if not $self->{pattern};
|
||||||
|
$dir = $self->{search_dir} if not $dir;
|
||||||
|
|
||||||
|
my ($cr, $cc) = $self->screen_cur();
|
||||||
|
my $line = $self->line($cr);
|
||||||
|
my $offset = $line->offset_of($cr, $cc);
|
||||||
|
my $text;
|
||||||
|
my $found = 0;
|
||||||
|
|
||||||
|
++$offset if $dir > 0;
|
||||||
|
|
||||||
|
while (not $found) {
|
||||||
|
if ($dir > 0) {
|
||||||
|
$text = substr($line->t, $offset);
|
||||||
|
if ($text =~ m/$self->{pattern}/) {
|
||||||
|
$found = 1;
|
||||||
|
$offset += $-[0];
|
||||||
|
} else {
|
||||||
|
last if $line->end >= $self->nrow;
|
||||||
|
$line = $self->line($line->end + 1);
|
||||||
|
$offset = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$text = substr($line->t, 0, $offset);
|
||||||
|
if ($text =~ m/$self->{pattern}/) {
|
||||||
|
$found = 1;
|
||||||
|
$offset = $-[0] while $text =~ m/$self->{pattern}/g;
|
||||||
|
} else {
|
||||||
|
last if $line->beg <= $self->top_row;
|
||||||
|
$line = $self->line($line->beg - 1);
|
||||||
|
$offset = $line->l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($found) {
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
$self->{offset} = $offset;
|
||||||
|
$self->screen_cur($line->coord_of($offset));
|
||||||
|
status_area($self);
|
||||||
|
$self->want_refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $found;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub tt_write {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub refresh {
|
||||||
|
my ($self) = @_;
|
||||||
|
my ($cr, $cc) = $self->screen_cur();
|
||||||
|
|
||||||
|
# scroll the current cursor position into visible area
|
||||||
|
if ($cr < $self->view_start()) {
|
||||||
|
$self->view_start($cr);
|
||||||
|
} elsif ($cr >= $self->view_start() + $self->nrow) {
|
||||||
|
$self->view_start($cr - $self->nrow + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{select}) {
|
||||||
|
my ($hl, $reverse_cursor);
|
||||||
|
my ($br, $bc, $er, $ec) = calc_span($self);
|
||||||
|
|
||||||
|
if ($self->x_resource('highlightColor')) {
|
||||||
|
$hl = urxvt::RS_Sel;
|
||||||
|
$reverse_cursor = 0;
|
||||||
|
} else {
|
||||||
|
$hl = urxvt::RS_RVid;
|
||||||
|
$reverse_cursor = $self->{select} ne 'l';
|
||||||
|
}
|
||||||
|
if ($self->{select} eq 'b') {
|
||||||
|
my $co = $self->line($cr)->offset_of($cr, $cc);
|
||||||
|
my $dollar = $self->{dollar} && $co >= $self->{dollar} - 1;
|
||||||
|
|
||||||
|
my $r = $br;
|
||||||
|
while ($r <= $er) {
|
||||||
|
my $line = $self->line($r);
|
||||||
|
if ($bc < $line->l) {
|
||||||
|
$ec = $line->l if $dollar;
|
||||||
|
my ($br, $bc) = $line->coord_of($bc);
|
||||||
|
my ($er, $ec) = $line->coord_of($ec <= $line->l ? $ec : $line->l);
|
||||||
|
$self->scr_xor_span($br, $bc, $er, $ec, $hl);
|
||||||
|
} elsif ($r == $cr) {
|
||||||
|
$reverse_cursor = 0;
|
||||||
|
}
|
||||||
|
$r = $line->end + 1;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$self->scr_xor_span($br, $bc, $er, $ec, $hl);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($reverse_cursor) {
|
||||||
|
# make the cursor visible again
|
||||||
|
$self->scr_xor_span($cr, $cc, $cr, $cc + 1, $hl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub activate {
|
||||||
|
my ($self, $search) = @_;
|
||||||
|
|
||||||
|
$self->{active} = 1;
|
||||||
|
|
||||||
|
$self->{select} = '';
|
||||||
|
$self->{dollar} = 0;
|
||||||
|
$self->{move_to} = 0;
|
||||||
|
|
||||||
|
if ($search) {
|
||||||
|
$self->{search} = '?';
|
||||||
|
$self->{search_dir} = -1;
|
||||||
|
$self->{search_mode} = 1;
|
||||||
|
} else {
|
||||||
|
$self->{search} = '';
|
||||||
|
$self->{search_mode} = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
($self->{oldcr}, $self->{oldcc}) = $self->screen_cur();
|
||||||
|
($self->{srhcr}, $self->{srhcc}) = $self->screen_cur();
|
||||||
|
$self->{old_view_start} = $self->view_start();
|
||||||
|
$self->{old_pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE);
|
||||||
|
|
||||||
|
my $line = $self->line($self->{oldcr});
|
||||||
|
$self->{offset} = $line->offset_of($self->{oldcr}, $self->{oldcc});
|
||||||
|
|
||||||
|
$self->selection_beg(1, 0);
|
||||||
|
$self->selection_end(1, 0);
|
||||||
|
|
||||||
|
$self->enable(
|
||||||
|
key_press => \&key_press,
|
||||||
|
refresh_begin => \&refresh,
|
||||||
|
refresh_end => \&refresh,
|
||||||
|
tt_write => \&tt_write,
|
||||||
|
);
|
||||||
|
|
||||||
|
if ($self->{offset} >= $line->l) {
|
||||||
|
$self->{offset} = $line->l > 0 ? $line->l - 1 : 0;
|
||||||
|
$self->screen_cur($line->coord_of($self->{offset}));
|
||||||
|
$self->want_refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{overlay_len} = 0;
|
||||||
|
status_area($self);
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub deactivate {
|
||||||
|
my ($self) = @_;
|
||||||
|
|
||||||
|
$self->selection_beg(1, 0);
|
||||||
|
$self->selection_end(1, 0);
|
||||||
|
|
||||||
|
delete $self->{overlay} if $self->{overlay};
|
||||||
|
|
||||||
|
$self->disable("key_press", "refresh_begin", "refresh_end", "tt_write");
|
||||||
|
$self->screen_cur($self->{oldcr}, $self->{oldcc});
|
||||||
|
$self->view_start($self->{old_view_start});
|
||||||
|
$self->pty_ev_events($self->{old_pty_ev_events});
|
||||||
|
|
||||||
|
$self->want_refresh();
|
||||||
|
|
||||||
|
$self->{active} = 0;
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub status_area {
|
||||||
|
my ($self, $extra) = @_;
|
||||||
|
my ($stat, $stat_len);
|
||||||
|
|
||||||
|
if ($self->{search}) {
|
||||||
|
$stat_len = $self->ncol;
|
||||||
|
$stat = $self->{search} . ' ' x ($stat_len - length($self->{search}));
|
||||||
|
} else {
|
||||||
|
if ($self->{select}) {
|
||||||
|
$stat = "-V" . ($self->{select} ne 'n' ? uc($self->{select}) : "") . "- ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->top_row == 0) {
|
||||||
|
$stat .= "All";
|
||||||
|
} elsif ($self->view_start() == $self->top_row) {
|
||||||
|
$stat .= "Top";
|
||||||
|
} elsif ($self->view_start() == 0) {
|
||||||
|
$stat .= "Bot";
|
||||||
|
} else {
|
||||||
|
$stat .= sprintf("%2d%%",
|
||||||
|
($self->top_row - $self->view_start) * 100 / $self->top_row);
|
||||||
|
}
|
||||||
|
|
||||||
|
$stat = "$extra $stat" if $extra;
|
||||||
|
$stat_len = length($stat);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$self->{overlay} || $self->{overlay_len} != $stat_len) {
|
||||||
|
delete $self->{overlay} if $self->{overlay};
|
||||||
|
$self->{overlay} = $self->overlay(-1, -1, $stat_len, 1,
|
||||||
|
urxvt::OVERLAY_RSTYLE, 0);
|
||||||
|
$self->{overlay_len} = $stat_len;
|
||||||
|
}
|
||||||
|
|
||||||
|
$self->{overlay}->set(0, 0, $self->special_encode($stat));
|
||||||
|
$self->{overlay}->show();
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub toggle_select {
|
||||||
|
my ($self, $mode) = @_;
|
||||||
|
|
||||||
|
if ($self->{select} eq $mode) {
|
||||||
|
$self->{select} = '';
|
||||||
|
} else {
|
||||||
|
if (not $self->{select}) {
|
||||||
|
($self->{ar}, $self->{ac}) = $self->screen_cur();
|
||||||
|
}
|
||||||
|
$self->{select} = $mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
status_area($self);
|
||||||
|
$self->want_refresh();
|
||||||
|
|
||||||
|
()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub calc_span {
|
||||||
|
my ($self) = @_;
|
||||||
|
my ($cr, $cc) = $self->screen_cur();
|
||||||
|
my ($br, $bc, $er, $ec);
|
||||||
|
|
||||||
|
if ($self->{select} eq 'b') {
|
||||||
|
$br = $self->line($cr)->beg;
|
||||||
|
$bc = $self->line($cr)->offset_of($cr, $cc);
|
||||||
|
$er = $self->line($self->{ar})->beg;
|
||||||
|
$ec = $self->line($self->{ar})->offset_of($self->{ar}, $self->{ac});
|
||||||
|
($br, $er) = ($er, $br) if $br > $er;
|
||||||
|
($bc, $ec) = ($ec, $bc) if $bc > $ec;
|
||||||
|
} else {
|
||||||
|
if ($cr < $self->{ar}) {
|
||||||
|
($br, $bc, $er, $ec) = ($cr, $cc, $self->{ar}, $self->{ac});
|
||||||
|
} elsif ($cr > $self->{ar}) {
|
||||||
|
($br, $bc, $er, $ec) = ($self->{ar}, $self->{ac}, $cr, $cc);
|
||||||
|
} else {
|
||||||
|
($br, $er) = ($cr, $cr);
|
||||||
|
($bc, $ec) = $cc < $self->{ac} ? ($cc, $self->{ac}) : ($self->{ac}, $cc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($self->{select} eq 'l') {
|
||||||
|
($br, $er) = ($self->line($br)->beg, $self->line($er)->end);
|
||||||
|
($bc, $ec) = (0, $self->ncol);
|
||||||
|
} else {
|
||||||
|
++$ec;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ($br, $bc, $er, $ec);
|
||||||
|
}
|
|
@ -1 +1 @@
|
||||||
Pillow==5.0.0
|
Pillow==6.2.1
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Colorizer.vmb: call delete('/home/tuan/.vim/plugin/ColorizerPlugin.vim')|call delete('/home/tuan/.vim/doc/Colorizer.txt')|call delete('/home/tuan/.vim/autoload/Colorizer.vim')
|
File diff suppressed because it is too large
Load Diff
395
vim/.vim/cursess
395
vim/.vim/cursess
|
@ -1,395 +0,0 @@
|
||||||
let SessionLoad = 1
|
|
||||||
if &cp | set nocp | endif
|
|
||||||
map :!clear; python %
|
|
||||||
noremap :tabedit
|
|
||||||
nnoremap
|
|
||||||
let s:cpo_save=&cpo
|
|
||||||
set cpo&vim
|
|
||||||
nnoremap <NL> <NL>
|
|
||||||
nnoremap
|
|
||||||
nnoremap
|
|
||||||
nnoremap :later
|
|
||||||
omap <silent> % <Plug>(MatchitOperationForward)
|
|
||||||
xmap <silent> % <Plug>(MatchitVisualForward)
|
|
||||||
nmap <silent> % <Plug>(MatchitNormalForward)
|
|
||||||
nmap 0 ^
|
|
||||||
nnoremap J :bn
|
|
||||||
nnoremap K :bp
|
|
||||||
map Q gq
|
|
||||||
noremap Y "+y
|
|
||||||
omap <silent> [% <Plug>(MatchitOperationMultiBackward)
|
|
||||||
xmap <silent> [% <Plug>(MatchitVisualMultiBackward)
|
|
||||||
nmap <silent> [% <Plug>(MatchitNormalMultiBackward)
|
|
||||||
nnoremap \ctf :-read $HOME/.vim/skeleton/writeup.md
A
|
|
||||||
omap <silent> ]% <Plug>(MatchitOperationMultiForward)
|
|
||||||
xmap <silent> ]% <Plug>(MatchitVisualMultiForward)
|
|
||||||
nmap <silent> ]% <Plug>(MatchitNormalMultiForward)
|
|
||||||
xmap a% <Plug>(MatchitVisualTextObject)
|
|
||||||
vmap gx <Plug>NetrwBrowseXVis
|
|
||||||
nmap gx <Plug>NetrwBrowseX
|
|
||||||
omap <silent> g% <Plug>(MatchitOperationBackward)
|
|
||||||
xmap <silent> g% <Plug>(MatchitVisualBackward)
|
|
||||||
nmap <silent> g% <Plug>(MatchitNormalBackward)
|
|
||||||
vnoremap <silent> <Plug>NetrwBrowseXVis :call netrw#BrowseXVis()
|
|
||||||
nnoremap <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())
|
|
||||||
noremap <F1> :ter
|
|
||||||
vmap <silent> <Plug>(MatchitVisualTextObject) <Plug>(MatchitVisualMultiBackward)o<Plug>(MatchitVisualMultiForward)
|
|
||||||
onoremap <silent> <Plug>(MatchitOperationMultiForward) :call matchit#MultiMatch("W", "o")
|
|
||||||
onoremap <silent> <Plug>(MatchitOperationMultiBackward) :call matchit#MultiMatch("bW", "o")
|
|
||||||
vnoremap <silent> <Plug>(MatchitVisualMultiForward) :call matchit#MultiMatch("W", "n")
m'gv``
|
|
||||||
vnoremap <silent> <Plug>(MatchitVisualMultiBackward) :call matchit#MultiMatch("bW", "n")
m'gv``
|
|
||||||
nnoremap <silent> <Plug>(MatchitNormalMultiForward) :call matchit#MultiMatch("W", "n")
|
|
||||||
nnoremap <silent> <Plug>(MatchitNormalMultiBackward) :call matchit#MultiMatch("bW", "n")
|
|
||||||
onoremap <silent> <Plug>(MatchitOperationBackward) :call matchit#Match_wrapper('',0,'o')
|
|
||||||
onoremap <silent> <Plug>(MatchitOperationForward) :call matchit#Match_wrapper('',1,'o')
|
|
||||||
vnoremap <silent> <Plug>(MatchitVisualBackward) :call matchit#Match_wrapper('',0,'v')
m'gv``
|
|
||||||
vnoremap <silent> <Plug>(MatchitVisualForward) :call matchit#Match_wrapper('',1,'v')
m'gv``
|
|
||||||
nnoremap <silent> <Plug>(MatchitNormalBackward) :call matchit#Match_wrapper('',0,'n')
|
|
||||||
nnoremap <silent> <Plug>(MatchitNormalForward) :call matchit#Match_wrapper('',1,'n')
|
|
||||||
inoremap u
|
|
||||||
inoremap A" Ä
|
|
||||||
inoremap O" Ö
|
|
||||||
inoremap U" Ü
|
|
||||||
imap \ifm if __name__ == '__main__':
|
|
||||||
inoremap \e €
|
|
||||||
inoremap \s ß
|
|
||||||
inoremap a" ä
|
|
||||||
inoremap o" ö
|
|
||||||
inoremap u" ü
|
|
||||||
let &cpo=s:cpo_save
|
|
||||||
unlet s:cpo_save
|
|
||||||
set autowrite
|
|
||||||
set backspace=indent,eol,start
|
|
||||||
set backupdir=~/.cache/vim/backup//
|
|
||||||
set directory=~/.cache/vim/swap//
|
|
||||||
set display=truncate
|
|
||||||
set expandtab
|
|
||||||
set fileencodings=ucs-bom,utf-8,default,latin1
|
|
||||||
set helplang=en
|
|
||||||
set history=200
|
|
||||||
set hlsearch
|
|
||||||
set incsearch
|
|
||||||
set langnoremap
|
|
||||||
set nolangremap
|
|
||||||
set mouse=a
|
|
||||||
set nrformats=bin,hex
|
|
||||||
set ruler
|
|
||||||
set runtimepath=~/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim81,/usr/share/vim/vim81/pack/dist/opt/matchit,/usr/share/vim/vimfiles/after,~/.vim/after
|
|
||||||
set scrolloff=5
|
|
||||||
set shiftwidth=4
|
|
||||||
set showcmd
|
|
||||||
set smartcase
|
|
||||||
set softtabstop=4
|
|
||||||
set splitbelow
|
|
||||||
set splitright
|
|
||||||
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
|
|
||||||
set suffixes=.bak,~,.o,.info,.swp,.aux,.bbl,.blg,.brf,.cb,.dvi,.idx,.ilg,.ind,.inx,.jpg,.log,.out,.png,.toc
|
|
||||||
set tabstop=4
|
|
||||||
set ttimeout
|
|
||||||
set ttimeoutlen=100
|
|
||||||
set undodir=~/.cache/vim/undo//
|
|
||||||
set wildignore=*.pyc
|
|
||||||
set wildmenu
|
|
||||||
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0
|
|
||||||
let v:this_session=expand("<sfile>:p")
|
|
||||||
silent only
|
|
||||||
silent tabonly
|
|
||||||
cd ~/workspace_l/discordbot
|
|
||||||
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
|
|
||||||
let s:wipebuf = bufnr('%')
|
|
||||||
endif
|
|
||||||
set shortmess=aoO
|
|
||||||
argglobal
|
|
||||||
%argdel
|
|
||||||
$argadd main.py
|
|
||||||
set stal=2
|
|
||||||
tabnew
|
|
||||||
tabrewind
|
|
||||||
edit main.py
|
|
||||||
set splitbelow splitright
|
|
||||||
wincmd t
|
|
||||||
set winminheight=0
|
|
||||||
set winheight=1
|
|
||||||
set winminwidth=0
|
|
||||||
set winwidth=1
|
|
||||||
argglobal
|
|
||||||
setlocal keymap=
|
|
||||||
setlocal noarabic
|
|
||||||
setlocal autoindent
|
|
||||||
setlocal backupcopy=
|
|
||||||
setlocal balloonexpr=
|
|
||||||
setlocal nobinary
|
|
||||||
setlocal nobreakindent
|
|
||||||
setlocal breakindentopt=
|
|
||||||
setlocal bufhidden=
|
|
||||||
setlocal buflisted
|
|
||||||
setlocal buftype=
|
|
||||||
setlocal nocindent
|
|
||||||
setlocal cinkeys=0{,0},0),0],:,!^F,o,O,e
|
|
||||||
setlocal cinoptions=
|
|
||||||
setlocal cinwords=if,else,while,do,for,switch
|
|
||||||
setlocal colorcolumn=
|
|
||||||
setlocal comments=b:#,fb:-
|
|
||||||
setlocal commentstring=#\ %s
|
|
||||||
setlocal complete=.,w,b,u,t,i
|
|
||||||
setlocal concealcursor=
|
|
||||||
setlocal conceallevel=0
|
|
||||||
setlocal completefunc=
|
|
||||||
setlocal nocopyindent
|
|
||||||
setlocal cryptmethod=
|
|
||||||
setlocal nocursorbind
|
|
||||||
setlocal nocursorcolumn
|
|
||||||
setlocal nocursorline
|
|
||||||
setlocal define=
|
|
||||||
setlocal dictionary=
|
|
||||||
setlocal nodiff
|
|
||||||
setlocal equalprg=
|
|
||||||
setlocal errorformat=
|
|
||||||
setlocal expandtab
|
|
||||||
if &filetype != 'python'
|
|
||||||
setlocal filetype=python
|
|
||||||
endif
|
|
||||||
setlocal fixendofline
|
|
||||||
setlocal foldcolumn=0
|
|
||||||
setlocal foldenable
|
|
||||||
setlocal foldexpr=0
|
|
||||||
setlocal foldignore=#
|
|
||||||
setlocal foldlevel=0
|
|
||||||
setlocal foldmarker={{{,}}}
|
|
||||||
setlocal foldmethod=manual
|
|
||||||
setlocal foldminlines=1
|
|
||||||
setlocal foldnestmax=20
|
|
||||||
setlocal foldtext=foldtext()
|
|
||||||
setlocal formatexpr=
|
|
||||||
setlocal formatoptions=tcq
|
|
||||||
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
|
||||||
setlocal formatprg=
|
|
||||||
setlocal grepprg=
|
|
||||||
setlocal iminsert=0
|
|
||||||
setlocal imsearch=-1
|
|
||||||
setlocal include=^\\s*\\(from\\|import\\)
|
|
||||||
setlocal includeexpr=substitute(substitute(substitute(v:fname,b:grandparent_match,b:grandparent_sub,''),b:parent_match,b:parent_sub,''),b:child_match,b:child_sub,'g')
|
|
||||||
setlocal indentexpr=GetPythonIndent(v:lnum)
|
|
||||||
setlocal indentkeys=0{,0},0),0],:,!^F,o,O,e,<:>,=elif,=except
|
|
||||||
setlocal noinfercase
|
|
||||||
setlocal iskeyword=@,48-57,_,192-255
|
|
||||||
setlocal keywordprg=pydoc
|
|
||||||
setlocal nolinebreak
|
|
||||||
setlocal nolisp
|
|
||||||
setlocal lispwords=
|
|
||||||
setlocal nolist
|
|
||||||
setlocal makeencoding=
|
|
||||||
setlocal makeprg=
|
|
||||||
setlocal matchpairs=(:),{:},[:]
|
|
||||||
setlocal modeline
|
|
||||||
setlocal modifiable
|
|
||||||
setlocal nrformats=bin,hex
|
|
||||||
setlocal nonumber
|
|
||||||
setlocal numberwidth=4
|
|
||||||
setlocal omnifunc=python3complete#Complete
|
|
||||||
setlocal path=
|
|
||||||
setlocal nopreserveindent
|
|
||||||
setlocal nopreviewwindow
|
|
||||||
setlocal quoteescape=\\
|
|
||||||
setlocal noreadonly
|
|
||||||
setlocal norelativenumber
|
|
||||||
setlocal norightleft
|
|
||||||
setlocal rightleftcmd=search
|
|
||||||
setlocal noscrollbind
|
|
||||||
setlocal scrolloff=-1
|
|
||||||
setlocal shiftwidth=4
|
|
||||||
setlocal noshortname
|
|
||||||
setlocal sidescrolloff=-1
|
|
||||||
setlocal signcolumn=auto
|
|
||||||
setlocal nosmartindent
|
|
||||||
setlocal softtabstop=4
|
|
||||||
setlocal nospell
|
|
||||||
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
|
|
||||||
setlocal spellfile=
|
|
||||||
setlocal spelllang=en
|
|
||||||
setlocal statusline=
|
|
||||||
setlocal suffixesadd=.py
|
|
||||||
setlocal swapfile
|
|
||||||
setlocal synmaxcol=3000
|
|
||||||
if &syntax != 'python'
|
|
||||||
setlocal syntax=python
|
|
||||||
endif
|
|
||||||
setlocal tabstop=8
|
|
||||||
setlocal tagcase=
|
|
||||||
setlocal tagfunc=
|
|
||||||
setlocal tags=
|
|
||||||
setlocal termwinkey=
|
|
||||||
setlocal termwinscroll=10000
|
|
||||||
setlocal termwinsize=
|
|
||||||
setlocal textwidth=0
|
|
||||||
setlocal thesaurus=
|
|
||||||
setlocal noundofile
|
|
||||||
setlocal undolevels=-123456
|
|
||||||
setlocal varsofttabstop=
|
|
||||||
setlocal vartabstop=
|
|
||||||
setlocal wincolor=
|
|
||||||
setlocal nowinfixheight
|
|
||||||
setlocal nowinfixwidth
|
|
||||||
setlocal wrap
|
|
||||||
setlocal wrapmargin=0
|
|
||||||
silent! normal! zE
|
|
||||||
let s:l = 10 - ((9 * winheight(0) + 28) / 57)
|
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
|
||||||
exe s:l
|
|
||||||
normal! zt
|
|
||||||
10
|
|
||||||
normal! 0
|
|
||||||
tabnext
|
|
||||||
edit requirements.txt
|
|
||||||
set splitbelow splitright
|
|
||||||
wincmd t
|
|
||||||
set winminheight=0
|
|
||||||
set winheight=1
|
|
||||||
set winminwidth=0
|
|
||||||
set winwidth=1
|
|
||||||
argglobal
|
|
||||||
setlocal keymap=
|
|
||||||
setlocal noarabic
|
|
||||||
setlocal noautoindent
|
|
||||||
setlocal backupcopy=
|
|
||||||
setlocal balloonexpr=
|
|
||||||
setlocal nobinary
|
|
||||||
setlocal nobreakindent
|
|
||||||
setlocal breakindentopt=
|
|
||||||
setlocal bufhidden=
|
|
||||||
setlocal buflisted
|
|
||||||
setlocal buftype=
|
|
||||||
setlocal nocindent
|
|
||||||
setlocal cinkeys=0{,0},0),0],:,0#,!^F,o,O,e
|
|
||||||
setlocal cinoptions=
|
|
||||||
setlocal cinwords=if,else,while,do,for,switch
|
|
||||||
setlocal colorcolumn=
|
|
||||||
setlocal comments=fb:-,fb:*,n:>
|
|
||||||
setlocal commentstring=
|
|
||||||
setlocal complete=.,w,b,u,t,i
|
|
||||||
setlocal concealcursor=
|
|
||||||
setlocal conceallevel=0
|
|
||||||
setlocal completefunc=
|
|
||||||
setlocal nocopyindent
|
|
||||||
setlocal cryptmethod=
|
|
||||||
setlocal nocursorbind
|
|
||||||
setlocal nocursorcolumn
|
|
||||||
setlocal nocursorline
|
|
||||||
setlocal define=
|
|
||||||
setlocal dictionary=
|
|
||||||
setlocal nodiff
|
|
||||||
setlocal equalprg=
|
|
||||||
setlocal errorformat=
|
|
||||||
setlocal expandtab
|
|
||||||
if &filetype != 'text'
|
|
||||||
setlocal filetype=text
|
|
||||||
endif
|
|
||||||
setlocal fixendofline
|
|
||||||
setlocal foldcolumn=0
|
|
||||||
setlocal foldenable
|
|
||||||
setlocal foldexpr=0
|
|
||||||
setlocal foldignore=#
|
|
||||||
setlocal foldlevel=0
|
|
||||||
setlocal foldmarker={{{,}}}
|
|
||||||
setlocal foldmethod=manual
|
|
||||||
setlocal foldminlines=1
|
|
||||||
setlocal foldnestmax=20
|
|
||||||
setlocal foldtext=foldtext()
|
|
||||||
setlocal formatexpr=
|
|
||||||
setlocal formatoptions=tcq
|
|
||||||
setlocal formatlistpat=^\\s*\\d\\+[\\]:.)}\\t\ ]\\s*
|
|
||||||
setlocal formatprg=
|
|
||||||
setlocal grepprg=
|
|
||||||
setlocal iminsert=0
|
|
||||||
setlocal imsearch=-1
|
|
||||||
setlocal include=
|
|
||||||
setlocal includeexpr=
|
|
||||||
setlocal indentexpr=
|
|
||||||
setlocal indentkeys=0{,0},0),0],:,0#,!^F,o,O,e
|
|
||||||
setlocal noinfercase
|
|
||||||
setlocal iskeyword=@,48-57,_,192-255
|
|
||||||
setlocal keywordprg=
|
|
||||||
setlocal nolinebreak
|
|
||||||
setlocal nolisp
|
|
||||||
setlocal lispwords=
|
|
||||||
setlocal nolist
|
|
||||||
setlocal makeencoding=
|
|
||||||
setlocal makeprg=
|
|
||||||
setlocal matchpairs=(:),{:},[:]
|
|
||||||
setlocal modeline
|
|
||||||
setlocal modifiable
|
|
||||||
setlocal nrformats=bin,hex
|
|
||||||
setlocal nonumber
|
|
||||||
setlocal numberwidth=4
|
|
||||||
setlocal omnifunc=
|
|
||||||
setlocal path=
|
|
||||||
setlocal nopreserveindent
|
|
||||||
setlocal nopreviewwindow
|
|
||||||
setlocal quoteescape=\\
|
|
||||||
setlocal noreadonly
|
|
||||||
setlocal norelativenumber
|
|
||||||
setlocal norightleft
|
|
||||||
setlocal rightleftcmd=search
|
|
||||||
setlocal noscrollbind
|
|
||||||
setlocal scrolloff=-1
|
|
||||||
setlocal shiftwidth=4
|
|
||||||
setlocal noshortname
|
|
||||||
setlocal sidescrolloff=-1
|
|
||||||
setlocal signcolumn=auto
|
|
||||||
setlocal nosmartindent
|
|
||||||
setlocal softtabstop=4
|
|
||||||
setlocal nospell
|
|
||||||
setlocal spellcapcheck=[.?!]\\_[\\])'\"\ \ ]\\+
|
|
||||||
setlocal spellfile=
|
|
||||||
setlocal spelllang=en
|
|
||||||
setlocal statusline=
|
|
||||||
setlocal suffixesadd=
|
|
||||||
setlocal swapfile
|
|
||||||
setlocal synmaxcol=3000
|
|
||||||
if &syntax != 'text'
|
|
||||||
setlocal syntax=text
|
|
||||||
endif
|
|
||||||
setlocal tabstop=4
|
|
||||||
setlocal tagcase=
|
|
||||||
setlocal tagfunc=
|
|
||||||
setlocal tags=
|
|
||||||
setlocal termwinkey=
|
|
||||||
setlocal termwinscroll=10000
|
|
||||||
setlocal termwinsize=
|
|
||||||
setlocal textwidth=0
|
|
||||||
setlocal thesaurus=
|
|
||||||
setlocal noundofile
|
|
||||||
setlocal undolevels=-123456
|
|
||||||
setlocal varsofttabstop=
|
|
||||||
setlocal vartabstop=
|
|
||||||
setlocal wincolor=
|
|
||||||
setlocal nowinfixheight
|
|
||||||
setlocal nowinfixwidth
|
|
||||||
setlocal wrap
|
|
||||||
setlocal wrapmargin=0
|
|
||||||
silent! normal! zE
|
|
||||||
let s:l = 2 - ((1 * winheight(0) + 28) / 57)
|
|
||||||
if s:l < 1 | let s:l = 1 | endif
|
|
||||||
exe s:l
|
|
||||||
normal! zt
|
|
||||||
2
|
|
||||||
normal! 011|
|
|
||||||
tabnext 2
|
|
||||||
set stal=1
|
|
||||||
badd +0 main.py
|
|
||||||
badd +0 requirements.txt
|
|
||||||
if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0
|
|
||||||
silent exe 'bwipe ' . s:wipebuf
|
|
||||||
endif
|
|
||||||
unlet! s:wipebuf
|
|
||||||
set winheight=1 winwidth=20 shortmess=filnxtToOS
|
|
||||||
set winminheight=1 winminwidth=1
|
|
||||||
let s:sx = expand("<sfile>:p:r")."x.vim"
|
|
||||||
if file_readable(s:sx)
|
|
||||||
exe "source " . fnameescape(s:sx)
|
|
||||||
endif
|
|
||||||
let &so = s:so_save | let &siso = s:siso_save
|
|
||||||
nohlsearch
|
|
||||||
doautoall SessionLoadPost
|
|
||||||
unlet SessionLoad
|
|
||||||
" vim: set ft=vim :
|
|
|
@ -0,0 +1,520 @@
|
||||||
|
*Colorizer.txt* A plugin to color colornames and codes
|
||||||
|
|
||||||
|
Author: Christian Brabandt <cb@256bit.org>
|
||||||
|
Version: 0.11 Thu, 15 Jan 2015 21:49:17 +0100
|
||||||
|
Copyright: (c) 2009-2013 by Christian Brabandt
|
||||||
|
The VIM LICENSE applies to Colorizer.txt
|
||||||
|
(see |copyright|) except use ColorizerPlugin instead of "Vim".
|
||||||
|
NO WARRANTY, EXPRESS OR IMPLIED. USE AT-YOUR-OWN-RISK.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
Contents *Colorizer*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
1. Colorizer Manual.............................|Colorizer-manual|
|
||||||
|
1.1 :ColorHighlight......................|:ColorHighlight|
|
||||||
|
1.2 :ColorClear..........................|:ColorClear|
|
||||||
|
1.3 :RGB2Term............................|:RGB2Term|
|
||||||
|
1.4 :HSL2RGB.............................|:HSL2RGB|
|
||||||
|
1.5 :Term2RGB............................|:Term2RGB|
|
||||||
|
1.6 :ColorContrast.......................|:ColorContrast|
|
||||||
|
1.7 :ColorSwapFgBg.......................|:ColorSwapFgBg|
|
||||||
|
1.8 :ColorToggle.........................|:ColorToggle|
|
||||||
|
2. Configuration................................|Colorizer-config|
|
||||||
|
2.1 Automatic loading...................|Colorizer-auto|
|
||||||
|
2.2 Automatically highlight filetypes...|Colorizer-hl-ft|
|
||||||
|
2.3 Skip coloring comments..............|Colorizer-comments|
|
||||||
|
2.4 Adjust the contrast.................|Colorizer-contrast|
|
||||||
|
2.5 Highlight colornames................|Colorizer-hl-names|
|
||||||
|
2.6 Use X11 colornames..................|Colorizer-names|
|
||||||
|
2.7 Use syntax highlighting.............|Colorizer-syntax|
|
||||||
|
2.8 Specify patterns to highlight.......|Colorizer-pattern|
|
||||||
|
2.9 Colorizing Taskwarrior files........|Colorizer-taskwarrior-files|
|
||||||
|
2.10 Colorizing vim syntax files.........|Colorizer-vim-files|
|
||||||
|
2.11 Use custom colornames...............|Colorizer-custom-colornames|
|
||||||
|
2.12 Colorizing :hi statements...........|Colorizer-vim-hi|
|
||||||
|
3. Colorizer Mappings...........................|Colorizer-maps|
|
||||||
|
4. Colorizer Tips...............................|Colorizer-tips|
|
||||||
|
5. Colorizer Feedback...........................|Colorizer-feedback|
|
||||||
|
6. Colorizer History............................|Colorizer-history|
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
1. Colorizer Manual *Colorizer-manual*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
Functionality
|
||||||
|
|
||||||
|
This plugin is based on the css_color plugin by Nikolaus Hofer. The idea is to
|
||||||
|
highlight color names and codes in the same color that they represent.
|
||||||
|
|
||||||
|
The plugin understands the W3C colors (used for CSS files for example), the
|
||||||
|
color names from the X11 Window System and also codes in hex notation, like
|
||||||
|
#FF0000 (which represents Red in the RGB color system). Additionally, it
|
||||||
|
supports the CSS color specifications, e.g. rgb(RR,GG,BB) color representation
|
||||||
|
in either absolute or percentage values and also the HVL color
|
||||||
|
representation like hvl(H,V,L)
|
||||||
|
|
||||||
|
It works best in the gui version of Vim, but the plugin also supports 256 and
|
||||||
|
88 color terminals and translates the colors to those supported by the
|
||||||
|
terminal. 16 and 8 color terminals should work theoretically too, but have not
|
||||||
|
been widely tested. Note that translating the colors to the terminal might
|
||||||
|
impose a performance penalty, depending on the terminal type and the number of
|
||||||
|
matches in the file.
|
||||||
|
|
||||||
|
This plugin defines the following commands:
|
||||||
|
|
||||||
|
*:ColorHighlight*
|
||||||
|
:[range]ColorHighlight[!] [args]
|
||||||
|
|
||||||
|
Scan the lines given by [range] for color code names and highlight those. If
|
||||||
|
[range] is omitted, the whole file will be scanned. If the ! is used, the
|
||||||
|
plugin will redefine all highlighting groups. If ! is not used, it will
|
||||||
|
skip patterns, that would take too long and make Vim unresponsive.
|
||||||
|
|
||||||
|
[args] can by any of "syntax" or "match". "syntax" means to convert the
|
||||||
|
highlighting to syntax highlighting. This is useful, so a plugin like
|
||||||
|
|2html.vim| can convert the colors correctly to HTML. The default is
|
||||||
|
"match", which uses the |matchadd()| function. (Prepending "no" is
|
||||||
|
supported and will disable that setting and use the opposite).
|
||||||
|
|
||||||
|
*:ColorClear*
|
||||||
|
:ColorClear Turn off color highlighting.
|
||||||
|
|
||||||
|
*:RGB2Term*
|
||||||
|
:RGB2Term <color> Translate the color code given as argument to
|
||||||
|
the closest color that can be displayed in the
|
||||||
|
terminal. The color must be given in the
|
||||||
|
format #RRGGBB (the hex format of the colors red,
|
||||||
|
green and blue (the '#' is optional), or
|
||||||
|
alternatively like rgb(X,X,X)
|
||||||
|
|
||||||
|
Uses the number of colors your terminal is capable
|
||||||
|
of (or 256 colors for gVim).
|
||||||
|
|
||||||
|
*:HSL2RGB*
|
||||||
|
:HSL2RGB hsl(h,v,l) Translate the HVL color defined by the string
|
||||||
|
'hsl(h,v%,l%)' into a color that the current
|
||||||
|
terminal can display. Note that the color must be
|
||||||
|
given in the format 'hsl(HH, V, L)' where HH
|
||||||
|
defines the Hue as absolute value between 0 and
|
||||||
|
255 and V and L represent a percentage for value
|
||||||
|
and Lightness.
|
||||||
|
|
||||||
|
*:Term2RGB*
|
||||||
|
:Term2RGB number Translate terminal color <number> to an RGB color
|
||||||
|
(using the xterm 256 color cube).
|
||||||
|
|
||||||
|
*:ColorContrast*
|
||||||
|
:ColorContrast Switch between all different color contrast
|
||||||
|
settings (foreground colors).
|
||||||
|
*:ColorSwapFgBg*
|
||||||
|
:ColorSwapFgBg Switch between foreground and background colors.
|
||||||
|
This will toggle in 3 ways. From Swapping
|
||||||
|
foreground and background colors, to only
|
||||||
|
highlighting the foreground color back to normal
|
||||||
|
foreground background color.
|
||||||
|
|
||||||
|
*:ColorToggle*
|
||||||
|
:ColorToggle Switch between highlighting colors and no
|
||||||
|
highlighting.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
2 Colorizer Configuration *Colorizer-config*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
2.1 Automatic loading *Colorizer-auto*
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
The Colorizer plugin can be configured to automatically load when opening a
|
||||||
|
new file. Note that this might slow down the loading process, especially on
|
||||||
|
the terminal. To enable this, simply set the variable 'g:colorizer_auto_color'
|
||||||
|
to 1, e.g. by defining it in your |.vimrc| >
|
||||||
|
|
||||||
|
:let g:colorizer_auto_color = 1
|
||||||
|
<
|
||||||
|
(Not recommended, see below at |Colorizer-hl-ft| for the preferred way)
|
||||||
|
|
||||||
|
2.2 Automatically highlight filetypes *Colorizer-hl-ft*
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
If you want to have certain filetypes automatically highlighted, you can use
|
||||||
|
the variable g:colorizer_auto_filetype, e.g. to enable highlighting for
|
||||||
|
HTML and CSS files by default, add the following to your |.vimrc|: >
|
||||||
|
|
||||||
|
:let g:colorizer_auto_filetype='css,html'
|
||||||
|
<
|
||||||
|
After restarting Vim, the plugin will become active whenever the filetype is
|
||||||
|
set to either html or css.
|
||||||
|
|
||||||
|
2.3 Skip coloring comments *Colorizer-comments*
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
You can skip comments from being colored by setting the variable
|
||||||
|
g:colorizer_skip_comments to 1: >
|
||||||
|
|
||||||
|
:let g:colorizer_skip_comments = 1
|
||||||
|
<
|
||||||
|
The plugin will skip all matches of color codes and names that appear inside
|
||||||
|
comments (this only works when syntax highlighting is enabled |:syn-on|)
|
||||||
|
|
||||||
|
Note however, that if the same color is used inside comments and outside
|
||||||
|
comments, it will also be highlighted inside the comments, because
|
||||||
|
coloring is done matching only the color pattern and once this is done outside
|
||||||
|
of comments, this will also match inside comments.
|
||||||
|
|
||||||
|
2.4 Adjust the contrast *Colorizer-contrast*
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Colorizer can be adjusted to blur the contrast between foreground and
|
||||||
|
background color. For this, the variable 'g:colorizer_fgcontrast' can be used.
|
||||||
|
It can be given any value between -1 and 2 with 2 being the default. Each
|
||||||
|
smaller value will decrease the contrast a little bit, with -1 being special,
|
||||||
|
as there is the foreground color equals the background color. Use
|
||||||
|
|:ColorContrast| to cycle through the different values.
|
||||||
|
|
||||||
|
2.5 Highlight colornames *Colorizer-hl-names*
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
If for any reason you don't want the plugin to highlight colornames, you can
|
||||||
|
prevent this by setting the g:colorizer_colornames variable to 0, e.g. put >
|
||||||
|
|
||||||
|
:let g:colorizer_colornames = 0
|
||||||
|
<
|
||||||
|
into your |.vimrc|
|
||||||
|
|
||||||
|
2.6 Use X11 colornames *Colorizer-names*
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
Colorizer can be configured to support all color names defined by the X11
|
||||||
|
Window System. By default it only supports the colors defined by the W3C for
|
||||||
|
the CSS specification. To use the X11 color names, set the variable
|
||||||
|
'g:colorzer_x11_names' to 1, e,g. put in your |.vimrc| >
|
||||||
|
|
||||||
|
let g:colorizer_x11_names = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
2.7 Use syntax highlighting *Colorizer-syntax*
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
The plugin by default uses the |matchadd()| functions for highlighting colors
|
||||||
|
on the fly. Unfortunately, this is a problem, if you want to have the result
|
||||||
|
successfully transformed to a HTML file using the |2html.vim| plugin. Therefore,
|
||||||
|
the Colorizer plugin can also convert the highlighting to correct syntax
|
||||||
|
highlighting. Use either the >
|
||||||
|
|
||||||
|
:ColorHighlight syntax
|
||||||
|
<
|
||||||
|
command (see |:ColorHighlight|) or set the variable 'g:colorizer_syntax' to 1,
|
||||||
|
e.g. in your |.vimrc| put >
|
||||||
|
|
||||||
|
let g:colorizer_syntax = 1
|
||||||
|
<
|
||||||
|
|
||||||
|
2.8 Specify pattern to highlight *Colorizer-pattern*
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
By default, Colorizer detects the following patterns and highlights them as
|
||||||
|
hex colors (for better readability it is separated into 3 parts): >
|
||||||
|
|
||||||
|
# %(\x\{3}\|\x\{6}\) \%(\>\|[-_]\)\@=/'
|
||||||
|
<
|
||||||
|
|
||||||
|
This means it always looks for a '#' followed by either a 3 or 6 hexadecimal
|
||||||
|
digits denoting the RGB hex color codes, followed by either the word-boundary
|
||||||
|
(|/\>|), a hyphen or a underscore. But only the first and middle part will be
|
||||||
|
highlighted (i.e. the RGB color codes).
|
||||||
|
|
||||||
|
You can of course specify a different pattern for your needs by setting the
|
||||||
|
g:colorizer_hex_pattern variable. e.g. to display '#RRGGBB' and have all of it
|
||||||
|
highlighted, use >
|
||||||
|
|
||||||
|
let g:colorizer_hex_pattern = ['#', '\%(\x\{3}\|\x\{6}\)', '']
|
||||||
|
|
||||||
|
2.9 Colorizing Taskwarrior files *Colorizer-taskwarrior-files*
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
For taskwarrior files, this plugin can also highlight those colors. By
|
||||||
|
default, this will only work, if the file name ends with '.theme'
|
||||||
|
|
||||||
|
For an example, see this website:
|
||||||
|
http://taskwarrior.org/news/182
|
||||||
|
|
||||||
|
2.10 Colorizing vim syntax files *Colorizer-vim-files*
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Colorizer also supports highlighting vim syntax files. For this to work, the
|
||||||
|
'filetype' must be set to vim, then the plugin tries to identify the colors
|
||||||
|
and highlight them.
|
||||||
|
|
||||||
|
2.11 Use custom colornames *Colorizer-custom-colornames*
|
||||||
|
--------------------------
|
||||||
|
|
||||||
|
You can add separate colornames to be colored. For this to work, set the
|
||||||
|
variable g:colorizer_custom_colors to your liking, e.g. like this: >
|
||||||
|
|
||||||
|
let g:colorizer_custom_colors = { 'blue': '#ff0000'}
|
||||||
|
|
||||||
|
Guess what, this will color the word blue in red.
|
||||||
|
|
||||||
|
2.12 Colorizing :highlight statements *Colorizer-vim-hi*
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Colorizer also supports highlighting |:hi| statements, that are used by vim
|
||||||
|
colorschemes and syntax files as well as a dump of the |:hi| command
|
||||||
|
To colorizer :hi statements, the 'filetype' must be set to vim, while for :hi
|
||||||
|
dumps, the 'filetype' must be empty.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
3. Colorizer Mappings *Colorizer-maps*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
By default, the Colorizer plugin does not map any key, so that it won't
|
||||||
|
pollute the global mapping namespace. If you want however to have the
|
||||||
|
following default maps set up, set the global variable g:colorizer_auto_map
|
||||||
|
in your |.vimrc| like this: >
|
||||||
|
|
||||||
|
:let g:colorizer_auto_map = 1
|
||||||
|
|
||||||
|
<
|
||||||
|
This will set up the following key mappings (if they are not already taken):
|
||||||
|
|
||||||
|
Keys Name Function
|
||||||
|
---- ---- --------
|
||||||
|
<Leader>cC <Plug>Colorizer Toggle highlighting of Colors. In visual
|
||||||
|
mode it only highlights the colors in the
|
||||||
|
selected region (normal and visual mode).
|
||||||
|
<Leader>cT <Plug>ColorContrast Cycle through contrast setting
|
||||||
|
|:ColorContrast| (normal and visual mode)
|
||||||
|
<Leader>cF <Plug>ColorFgBg Toggle foreground and background color
|
||||||
|
|:ColorSwapFgBg|
|
||||||
|
|
||||||
|
It uses the prefix <leader>c to set all functionality up. By default, <Leader>
|
||||||
|
is defined as '\' (|<Leader>|). Use the name provided in the second column to
|
||||||
|
map the function to a different key.
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
4. Colorizer Tips *Colorizer-tips*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
You can enable the plugin to be loaded for certain filetypes automatically.
|
||||||
|
This makes sense for example for CSS files or HTML files. To do so, create the
|
||||||
|
following autocommand in your |.vimrc| >
|
||||||
|
|
||||||
|
:au BufNewFile,BufRead *.css,*.html,*.htm :ColorHighlight!
|
||||||
|
<
|
||||||
|
This will automatically highlight all existing color codes and names if you
|
||||||
|
edit either a HTML file or a CSS file. Note that this does not update the
|
||||||
|
highlighting, after you have been changing the file.
|
||||||
|
|
||||||
|
The recommended way to do this is to use the g:colorizer_auto_filetype
|
||||||
|
variable and set this to the desired filetypes. |Colorizer-hl-ft|
|
||||||
|
|
||||||
|
*Colorizer-slowdown*
|
||||||
|
----------------
|
||||||
|
Slow performance
|
||||||
|
----------------
|
||||||
|
Depending on your file, any of the highlighting functions might cause an
|
||||||
|
performance decrease. This can be analyed, by setting the variable
|
||||||
|
g:colorizer_debug to 1 in e.g. your |.vimrc| like this: >
|
||||||
|
|
||||||
|
:let g:colorizer_debug = 1
|
||||||
|
<
|
||||||
|
The next time, you call |:ColorHighlight|, the plugin will output runtime
|
||||||
|
statistics, from which you can see, which function caused the slowdowns.
|
||||||
|
Consider this output:
|
||||||
|
|
||||||
|
Colorstatistics at: 12:20 `
|
||||||
|
Duration: 0.034110 `
|
||||||
|
colornames: 0.030865s `
|
||||||
|
hex: 0.000968s `
|
||||||
|
hsla: 0.000350s `
|
||||||
|
rgb: 0.000354s `
|
||||||
|
rgba: 0.000491s `
|
||||||
|
taskwarrior: 0.000020s `
|
||||||
|
term: 0.000219s `
|
||||||
|
term_conceal: 0.000105s `
|
||||||
|
vimcolors: 0.000036s `
|
||||||
|
vimhighl_dump: 0.000025s `
|
||||||
|
vimhighlight: 0.000025s `
|
||||||
|
|
||||||
|
From this you can see, that the colorname highlighting caused the largest
|
||||||
|
slowdown, it took 0.03 seconds to complete. This is expected, as the
|
||||||
|
colornames pattern is long and contains many branches.
|
||||||
|
|
||||||
|
Functions with a value less then 100 have probably been skipped and were not
|
||||||
|
being executed.
|
||||||
|
|
||||||
|
If you want to skip certain functions, you can set the variable
|
||||||
|
g:colorizer_<name>_disable and then those functions won't be called anymore
|
||||||
|
(e.g. do disable the colorname highlighting, put in your |.vimrc| this: >
|
||||||
|
|
||||||
|
let g:colorizer_colornames_disable = 1
|
||||||
|
<
|
||||||
|
If the slowdown is still noticeable, you might want to create
|
||||||
|
a new issue at the plugins repository (|Colorizer-feedback|). You should
|
||||||
|
provide a sample file, so that I will be able to reproduce the issue.
|
||||||
|
|
||||||
|
Note, this needs a Vim with the |+reltime| feature.
|
||||||
|
==============================================================================
|
||||||
|
5. Colorizer Feedback *Colorizer-feedback*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
Feedback is always welcome. If you like the plugin, please rate it at the
|
||||||
|
vim-page: http://www.vim.org/scripts/script.php?script_id=3963
|
||||||
|
|
||||||
|
You can also follow the development of the plugin at github:
|
||||||
|
http://github.com/chrisbra/color_highlight
|
||||||
|
|
||||||
|
Bugs can also be reported there:
|
||||||
|
https://github.com/chrisbra/color_highlight/issues
|
||||||
|
|
||||||
|
Alternatively, you can also report any bugs to the maintainer, mentioned in
|
||||||
|
the third line of this document. Please don't hesitate to contact me, I
|
||||||
|
won't bite ;)
|
||||||
|
|
||||||
|
If you like the plugin, write me an email (look in the third line for my mail
|
||||||
|
address). And if you are really happy, vote for the plugin and consider
|
||||||
|
looking at my Amazon whishlist: http://www.amazon.de/wishlist/2BKAHE8J7Z6UW
|
||||||
|
|
||||||
|
==============================================================================
|
||||||
|
6. Colorizer History *Colorizer-history*
|
||||||
|
==============================================================================
|
||||||
|
|
||||||
|
0.12 (unreleased) {{{1
|
||||||
|
- TermConceal should also conceal [K
|
||||||
|
- properly escape terminal colors, so that |Colorizer-syntax| works correctly
|
||||||
|
- use matchaddpos() for highlighting ansi term colors (should speed up vim
|
||||||
|
highlighting considerably)
|
||||||
|
- only reset TermConceal syntax group (reported by audriusk in
|
||||||
|
https://github.com/chrisbra/Colorizer/issues/41, thanks!)
|
||||||
|
- correctly check for patch 7.4.083 (:keeppatterns modifier, reported by
|
||||||
|
gbell12 in https://github.com/chrisbra/Colorizer/issues/42, thanks!)
|
||||||
|
- disable BufLeave autocommand to disable colors
|
||||||
|
- basic Neovim support (also should work with TrueColor in Terminal)
|
||||||
|
- Make |:RGB2term| always init colortable, so that when resetting 't_Co'
|
||||||
|
it will work correctly
|
||||||
|
- Make it work with Vims Term Truecolor feature (patch 7.4.1770)
|
||||||
|
- Make it work with neovim fixes https://github.com/chrisbra/Colorizer/issues/45
|
||||||
|
and https://github.com/chrisbra/Colorizer/issues/46
|
||||||
|
- Support css colors: #rrggbbaa format
|
||||||
|
- handle hsla values correctly
|
||||||
|
- clear css cssColor syntax rule when ":ColorHighlight syntax" in css files is
|
||||||
|
used. fixes https://github.com/chrisbra/Colorizer/issues/50 reported by
|
||||||
|
msva, thanks!
|
||||||
|
- make TermConceal also hide the sgr0 attributes (to reset the terminal)
|
||||||
|
fixes https://github.com/chrisbra/Colorizer/issues/53 reported by
|
||||||
|
LucHermitte, thanks!
|
||||||
|
- also conceal and highlight nroff sequences like T^HT (as bold) and _^HT (as
|
||||||
|
underlined)
|
||||||
|
|
||||||
|
0.11 Jan 15, 2015 {{{1
|
||||||
|
- use |TextChanged| autocommand if possible
|
||||||
|
- Support Ansi True Color support if possible
|
||||||
|
- Hide ^[[K$ for terminal colors (reported by masukomi at
|
||||||
|
https://github.com/chrisbra/Colorizer/issues/36, thanks!)
|
||||||
|
- Do not expand() to expand shellvars (fixed by Daniel Hahler in
|
||||||
|
https://github.com/chrisbra/Colorizer/issues/37, thanks!)
|
||||||
|
- Document, how to analyze slowdown |Colorizer-slowdown|
|
||||||
|
- |:ColorContrast| would error, if the plugin has not been initialized
|
||||||
|
(reported by Daniel Hahler in
|
||||||
|
https://github.com/chrisbra/Colorizer/issues/38, thanks!)
|
||||||
|
- always define reltime variable (reported by mantislin in
|
||||||
|
https://github.com/chrisbra/Colorizer/issues/39, thanks!)
|
||||||
|
- Only call conceal function once for ansiterm colors
|
||||||
|
- reduce calls to DoColor in autocommands (to only do, when something changed)
|
||||||
|
|
||||||
|
0.10 Mar 27, 2014 {{{1
|
||||||
|
- Also highlight Ansi Term sequences
|
||||||
|
- Match colornames using the "old" RE Engine, if Vim supports it.
|
||||||
|
- Make |:RGB2Xterm| output the color name in its color
|
||||||
|
- Rename |:RGB2Xterm| to |:RGB2Term|
|
||||||
|
- Highlight Taskwarrior file
|
||||||
|
- Code refactoring
|
||||||
|
- Make |:ColorSwapFgBg| work as expected (did not always toggle reliably
|
||||||
|
between all states)
|
||||||
|
- Correctly parse Ansi Term colors
|
||||||
|
- |:Term2RGB|
|
||||||
|
- Highlight Vim color files correctly
|
||||||
|
- merge colorhighlight plugin https://github.com/blueyed/colorhighlight.vim
|
||||||
|
|
||||||
|
0.9: Aug 14, 2013: {{{1
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/15 (rgba highlighting
|
||||||
|
didn't work for floating point value of alpha, reported by LiTuX.S, thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/16 (rgb() pattern did
|
||||||
|
match too much, reported by taecilla, thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/19 (error on calling
|
||||||
|
ColorWinEnter() command, reported by wedgwood, thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/20 and
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/21
|
||||||
|
(also color on split commands, reported by wedgwood and Andri Möll, Thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/22 (Make sure, patterns
|
||||||
|
like white-space won't get colored, reported by Andri Möll, Thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/23 (ColorToggle got
|
||||||
|
confused when several windows with highlighting exists, reported by Andri
|
||||||
|
Möll, Thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/24 (turning off coloring
|
||||||
|
should also remove the autocommands, reported by Andri Möll, Thanks!)
|
||||||
|
|
||||||
|
0.8: Dec 14, 2012 {{{1
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/13 (colorizing should not
|
||||||
|
stop at word-boundaries, reported by teschmitz, thanks!)
|
||||||
|
- https://github.com/chrisbra/color_highlight/issues/14 (convert highlighting
|
||||||
|
to syntax groups, so TOhtml works, reported by teschmitz, thanks!)
|
||||||
|
|
||||||
|
0.7: Jul 25, 2012 {{{1
|
||||||
|
- Highlight rgb colors with whitespace after comma (reported by sergey-vlasov
|
||||||
|
in https://github.com/chrisbra/color_highlight/issues/12, thanks!)
|
||||||
|
- Save and restore the search register, so the plugin doesn't clobber it
|
||||||
|
- check for 'ed' and 'gd' defaults
|
||||||
|
|
||||||
|
0.6: May 17, 2012 {{{1
|
||||||
|
- Fix various issues with hsl coloring (reported by teschmitz in
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/9, thanks!)
|
||||||
|
- Make it possible, to skip coloring comments (reported by teschmitz in
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/10, thanks!)
|
||||||
|
- search highlighting should overrule color highlighting(reported by teschmitz
|
||||||
|
in https://github.com/chrisbra/color_highlight/issues/11, thanks!)
|
||||||
|
- updated documentation (suggested by teschmitz, thanks!)
|
||||||
|
|
||||||
|
0.5: Apr 03, 2012 {{{1
|
||||||
|
- Fix issue 7 (reported by teschmitz in
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/7, thanks!)
|
||||||
|
0.4: Mar, 23, 2012 {{{1
|
||||||
|
- |:ColorSwapFgBg| (suggested by teschmitz, in
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/3, thanks!)
|
||||||
|
- make automatic color loading work (reported by wedgwood in
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/6, thanks!)
|
||||||
|
|Colorizer-auto| and |Colorizer-hl-ft|
|
||||||
|
- more documentation updates
|
||||||
|
- added Mappings (suggested by Ingo Karkat, thanks!) |Colorizer-maps|
|
||||||
|
- prevent highlighting of color names (suggested by Tarlika Schmitz in
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/5, thanks!)
|
||||||
|
|Colorizer-hl-names|
|
||||||
|
- enable filetype specific autocommands, so that for certain filetypes
|
||||||
|
colors are highlighted automatically |Colorizer-hl-ft|
|
||||||
|
(suggested by Tarlika Schmitz, thanks!)
|
||||||
|
|
||||||
|
0.3: Mar 15, 2012 {{{1
|
||||||
|
- Use the g:colorizer_fgcontrast variable to have lesser contrast between
|
||||||
|
foreground and background colors (patch by Ingo Karkat, thanks!)
|
||||||
|
- gvim did not color rgb(...) codes
|
||||||
|
- did not correctly highlight 3 letter color codes (issue
|
||||||
|
https://github.com/chrisbra/color_highlight/issues/1,
|
||||||
|
reported by Taybin Rutkin, thanks!)
|
||||||
|
- support autoloading (requested by Ingo Karkat, thanks!)
|
||||||
|
- add |GLVS| support
|
||||||
|
- |:ColorContrast| to interactively switch between contrast settings
|
||||||
|
(suggested by Ingo Karkat, thanks!)
|
||||||
|
0.2: Mar 02, 2012 {{{1
|
||||||
|
|
||||||
|
- Initial upload
|
||||||
|
- development versions are available at the github repository
|
||||||
|
- put plugin on a public repository
|
||||||
|
(http://github.com/chrisbra/color_highlight)
|
||||||
|
|
||||||
|
0.1: Mar 02, 2012 {{{1
|
||||||
|
- first internal version
|
||||||
|
}}}
|
||||||
|
==============================================================================
|
||||||
|
Modeline:
|
||||||
|
vim:tw=78:ts=8:ft=help:et:fdm=marker:fdl=0:norl
|
|
@ -0,0 +1,29 @@
|
||||||
|
:ColorClear Colorizer.txt /*:ColorClear*
|
||||||
|
:ColorContrast Colorizer.txt /*:ColorContrast*
|
||||||
|
:ColorHighlight Colorizer.txt /*:ColorHighlight*
|
||||||
|
:ColorSwapFgBg Colorizer.txt /*:ColorSwapFgBg*
|
||||||
|
:ColorToggle Colorizer.txt /*:ColorToggle*
|
||||||
|
:HSL2RGB Colorizer.txt /*:HSL2RGB*
|
||||||
|
:RGB2Term Colorizer.txt /*:RGB2Term*
|
||||||
|
:Term2RGB Colorizer.txt /*:Term2RGB*
|
||||||
|
Colorizer Colorizer.txt /*Colorizer*
|
||||||
|
Colorizer-auto Colorizer.txt /*Colorizer-auto*
|
||||||
|
Colorizer-comments Colorizer.txt /*Colorizer-comments*
|
||||||
|
Colorizer-config Colorizer.txt /*Colorizer-config*
|
||||||
|
Colorizer-contrast Colorizer.txt /*Colorizer-contrast*
|
||||||
|
Colorizer-custom-colornames Colorizer.txt /*Colorizer-custom-colornames*
|
||||||
|
Colorizer-feedback Colorizer.txt /*Colorizer-feedback*
|
||||||
|
Colorizer-history Colorizer.txt /*Colorizer-history*
|
||||||
|
Colorizer-hl-ft Colorizer.txt /*Colorizer-hl-ft*
|
||||||
|
Colorizer-hl-names Colorizer.txt /*Colorizer-hl-names*
|
||||||
|
Colorizer-manual Colorizer.txt /*Colorizer-manual*
|
||||||
|
Colorizer-maps Colorizer.txt /*Colorizer-maps*
|
||||||
|
Colorizer-names Colorizer.txt /*Colorizer-names*
|
||||||
|
Colorizer-pattern Colorizer.txt /*Colorizer-pattern*
|
||||||
|
Colorizer-slowdown Colorizer.txt /*Colorizer-slowdown*
|
||||||
|
Colorizer-syntax Colorizer.txt /*Colorizer-syntax*
|
||||||
|
Colorizer-taskwarrior-files Colorizer.txt /*Colorizer-taskwarrior-files*
|
||||||
|
Colorizer-tips Colorizer.txt /*Colorizer-tips*
|
||||||
|
Colorizer-vim-files Colorizer.txt /*Colorizer-vim-files*
|
||||||
|
Colorizer-vim-hi Colorizer.txt /*Colorizer-vim-hi*
|
||||||
|
Colorizer.txt Colorizer.txt /*Colorizer.txt*
|
|
@ -0,0 +1,95 @@
|
||||||
|
" Plugin: Highlight Colornames and Values
|
||||||
|
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||||
|
" URL: http://www.github.com/chrisbra/color_highlight
|
||||||
|
" Last Change: Thu, 15 Jan 2015 21:49:17 +0100
|
||||||
|
" Licence: Vim License (see :h License)
|
||||||
|
" Version: 0.11
|
||||||
|
" GetLatestVimScripts: 3963 11 :AutoInstall: Colorizer.vim
|
||||||
|
"
|
||||||
|
" This plugin was inspired by the css_color.vim plugin from Nikolaus Hofer.
|
||||||
|
" Changes made: - make terminal colors work more reliably and with all
|
||||||
|
" color terminals
|
||||||
|
" - performance improvements, coloring is almost instantenously
|
||||||
|
" - detect rgb colors like this: rgb(R,G,B)
|
||||||
|
" - detect hsl coloring: hsl(H,V,L)
|
||||||
|
" - fix small bugs
|
||||||
|
|
||||||
|
" Init some variables "{{{1
|
||||||
|
" Plugin folklore "{{{2
|
||||||
|
if v:version < 700 || exists("g:loaded_colorizer") || &cp
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
let g:loaded_colorizer = 1
|
||||||
|
|
||||||
|
let s:cpo_save = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
|
" helper functions "{{{1
|
||||||
|
fu! ColorHiArgs(A,L,P)
|
||||||
|
return "syntax\nmatch\nnosyntax\nnomatch"
|
||||||
|
endfu
|
||||||
|
|
||||||
|
" define commands "{{{1
|
||||||
|
command! -bang -range=% -nargs=? -complete=custom,ColorHiArgs ColorHighlight
|
||||||
|
\ :call Colorizer#DoColor(<q-bang>, <q-line1>, <q-line2>, <q-args>)
|
||||||
|
command! -bang -nargs=1 RGB2Term
|
||||||
|
\ :call Colorizer#RGB2Term(<q-args>, <q-bang>)
|
||||||
|
command! -nargs=1 Term2RGB :call Colorizer#Term2RGB(<q-args>)
|
||||||
|
|
||||||
|
command! -bang ColorClear :call Colorizer#ColorOff()
|
||||||
|
command! -bang ColorToggle :call Colorizer#ColorToggle()
|
||||||
|
command! -nargs=1 HSL2RGB :call Colorizer#HSL2Term(<q-args>)
|
||||||
|
command! ColorContrast :call Colorizer#SwitchContrast()
|
||||||
|
command! ColorSwapFgBg :call Colorizer#SwitchFGBG()
|
||||||
|
|
||||||
|
" define mappings "{{{1
|
||||||
|
nnoremap <Plug>Colorizer :<C-U>ColorToggle<CR>
|
||||||
|
xnoremap <Plug>Colorizer :ColorHighlight<CR>
|
||||||
|
nnoremap <Plug>ColorContrast :<C-U>ColorContrast<CR>
|
||||||
|
xnoremap <Plug>ColorContrast :<C-U>ColorContrast<CR>
|
||||||
|
nnoremap <Plug>ColorFgBg :<C-U>ColorSwapFgBg<CR>
|
||||||
|
xnoremap <Plug>ColorFgBg :<C-U>ColorSwapFgBg<CR>
|
||||||
|
|
||||||
|
if get(g:, 'colorizer_auto_map', 0)
|
||||||
|
" only map, if the mapped keys are not yet taken by a different plugin
|
||||||
|
" and the user hasn't mapped the function to different keys
|
||||||
|
if empty(maparg('<Leader>cC', 'n')) && empty(hasmapto('<Plug>Colorizer', 'n'))
|
||||||
|
nmap <silent> <Leader>cC <Plug>Colorizer
|
||||||
|
endif
|
||||||
|
if empty(maparg('<Leader>cC', 'x')) && empty(hasmapto('<Plug>Colorizer', 'x'))
|
||||||
|
xmap <silent> <Leader>cC <Plug>Colorizer
|
||||||
|
endif
|
||||||
|
if empty(maparg('<Leader>cT', 'n')) && empty(hasmapto('<Plug>ColorContrast', 'n'))
|
||||||
|
nmap <silent> <Leader>cT <Plug>ColorContrast
|
||||||
|
endif
|
||||||
|
if empty(maparg('<Leader>cT', 'x')) && empty(hasmapto('<Plug>ColorContrast', 'n'))
|
||||||
|
xmap <silent> <Leader>cT <Plug>ColorContrast
|
||||||
|
endif
|
||||||
|
if empty(maparg('<Leader>cF', 'n')) && empty(hasmapto('<Plug>ColorFgBg', 'n'))
|
||||||
|
nmap <silent> <Leader>cF <Plug>ColorFgBg
|
||||||
|
endif
|
||||||
|
if empty(maparg('<Leader>cF', 'x')) && empty(hasmapto('<Plug>ColorFgBg', 'x'))
|
||||||
|
xmap <silent> <Leader>cF <Plug>ColorFgBg
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Enable Autocommands "{{{1
|
||||||
|
if exists("g:colorizer_auto_color")
|
||||||
|
" Prevent autoloading
|
||||||
|
exe "call Colorizer#AutoCmds(g:colorizer_auto_color)"
|
||||||
|
endif
|
||||||
|
|
||||||
|
if exists("g:colorizer_auto_filetype")
|
||||||
|
" Setup some autocommands for specific filetypes.
|
||||||
|
aug FT_ColorizerPlugin
|
||||||
|
au!
|
||||||
|
exe "au Filetype" g:colorizer_auto_filetype
|
||||||
|
\ "call Colorizer#LocalFTAutoCmds(1)\|
|
||||||
|
\ :ColorHighlight"
|
||||||
|
aug END
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Plugin folklore and Vim Modeline " {{{1
|
||||||
|
let &cpo = s:cpo_save
|
||||||
|
unlet s:cpo_save
|
||||||
|
" vim: set foldmethod=marker et fdl=0:
|
|
@ -24,3 +24,10 @@ endfunction
|
||||||
|
|
||||||
" So we can use :BackgroundCommand to call our function.
|
" So we can use :BackgroundCommand to call our function.
|
||||||
command! -nargs=+ -complete=shellcmd RunBackgroundCommand call RunBackgroundCommand(<q-args>)
|
command! -nargs=+ -complete=shellcmd RunBackgroundCommand call RunBackgroundCommand(<q-args>)
|
||||||
|
|
||||||
|
function! GetCWD()
|
||||||
|
let l:cwd = system('pwd | rev |cut -d- -f1 | rev | xargs | sed "s/[[:space:]]/\\\\&/g\"')
|
||||||
|
echo l:cwd
|
||||||
|
call setline('.', l:cwd)
|
||||||
|
unlet l:cwd
|
||||||
|
endfunction
|
||||||
|
|
|
@ -10,8 +10,10 @@ nnoremap <C-U> :later<CR>
|
||||||
noremap Y "+y
|
noremap Y "+y
|
||||||
noremap <C-E> :tabedit **/*
|
noremap <C-E> :tabedit **/*
|
||||||
noremap <F1> :ter<CR>
|
noremap <F1> :ter<CR>
|
||||||
|
noremap <F12> :tabedit<CR>:ter<CR><C-w><C-w>:q<CR>
|
||||||
noremap == ==j
|
noremap == ==j
|
||||||
nmap 0 ^
|
nmap 0 ^
|
||||||
|
nmap ' `
|
||||||
|
|
||||||
" Diaeresis for e.g. german
|
" Diaeresis for e.g. german
|
||||||
inoremap a" ä
|
inoremap a" ä
|
||||||
|
@ -20,5 +22,5 @@ inoremap u" ü
|
||||||
inoremap A" Ä
|
inoremap A" Ä
|
||||||
inoremap U" Ü
|
inoremap U" Ü
|
||||||
inoremap O" Ö
|
inoremap O" Ö
|
||||||
inoremap <leader>s ß
|
inoremap s" ß
|
||||||
inoremap <leader>e €
|
inoremap e" €
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
Category:
|
**Category:**
|
||||||
|
**Points:**
|
||||||
# Challenge
|
|
||||||
|
|
||||||
# Solution
|
## Challenge
|
||||||
|
>
|
||||||
|
|
||||||
# Flag
|
## Solution
|
||||||
|
|
||||||
|
### Flag
|
||||||
``
|
``
|
||||||
|
|
|
@ -805,3 +805,15 @@ Rümeysa
|
||||||
Orhan
|
Orhan
|
||||||
AStAs
|
AStAs
|
||||||
Brinda
|
Brinda
|
||||||
|
Prüfungsauschüsse
|
||||||
|
LuDI
|
||||||
|
Berufungskomission
|
||||||
|
Hoßfeld
|
||||||
|
Systemadministration
|
||||||
|
Gremienplätze
|
||||||
|
#rschritten
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#a
|
||||||
|
#S
|
||||||
|
#b
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue