This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autocmd FileType taglist setlocal nospell | | |
\ setlocal statusline=%f | | |
\ setlocal nofoldenable | | |
\ setlocal foldcolumn=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from dateutil import parser | |
>>> s = '2009 10 30 23:35:16+0400' | |
>>> parser.parse(s) | |
datetime.datetime(2009, 10, 30, 23, 35, 16, tzinfo=tzoffset(None, 14400)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from pyparsing import (Literal, White, Word, alphas, nums) | |
>>> matcher = Word(alphas) + Word(nums) + Literal('\\') + Word(alphas) + White() | |
>>> matcher.parseString('make 123\\match ') | |
(['make', '123', '\\', 'match', ' '], {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> re.findall(r' (\d+\\\w+) ', 'make 123\match ', re.DEBUG|re.LOCALE) | |
literal 32 | |
subpattern 1 | |
max_repeat 1 65535 | |
in | |
category category_digit | |
literal 92 | |
max_repeat 1 65535 | |
in | |
category category_word |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> re.findall(' ([0-9]+\\[a-z]+) ', 'make 123\match ', re.DEBUG) | |
literal 32 | |
subpattern 1 | |
max_repeat 1 65535 | |
in | |
range (48, 57) | |
literal 91 | |
literal 97 | |
literal 45 | |
literal 122 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import re | |
>>> re.findall(' ([0-9]+\\[a-z]+) ', 'make 123\match ') | |
[] | |
>>> # Whereas with raw strings this match will work | |
>>> re.findall(r' ([0-9]+\\[a-z]+) ', 'make 123\match ') | |
['123\\match'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload -U add-zsh-hook | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' actionformats \ | |
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' | |
zstyle ':vcs_info:*' formats \ | |
'%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' | |
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' | |
zstyle ':vcs_info:*' enable git | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload -U add-zsh-hook | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' actionformats \ | |
'%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' | |
zstyle ':vcs_info:*' formats \ | |
'%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' | |
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' | |
zstyle ':vcs_info:*' enable git | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add-zsh-hook precmd prompt_jnrowe_precmd | |
prompt_jnrowe_precmd () { | |
vcs_info | |
if [ "${vcs_info_msg_0_}" = "" ]; then | |
dir_status="%F{2}→%f" | |
elif [[ $(git cached --name-status 2>/dev/null ) != "" ]]; then | |
dir_status="%F{1}▶%f" | |
elif [[ $(git diff --name-status 2>/dev/null ) != "" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload -Uz vcs_info | |
# See the documentation for the format string definition | |
# This generates a fancy coloured string with $vcs:($branch) | |
zstyle ':vcs_info:*' formats '%F{2}%s%F{7}:%F{2}(%F{1}%b%F{2})%f ' | |
zstyle ':vcs_info:*' enable git hg |