Skip to content
Browse files

Some stuff

  • Loading branch information...
1 parent 3d58d66 commit df320a3353326859279a0ef44e1fdc542cbdf125 Marius Gawrisch committed Apr 19, 2016
Showing with 39 additions and 7 deletions.
  1. +24 −6 .vimrc
  2. +15 −1 .zshrc
View
30 .vimrc
@@ -14,6 +14,7 @@ NeoBundle "tpope/vim-surround"
"NeoBundle "tpope/vim-ragtag"
NeoBundle "tpope/vim-fugitive"
NeoBundle "tpope/vim-commentary"
+NeoBundle "tpope/vim-endwise"
NeoBundle "vim-pandoc/vim-pandoc"
NeoBundle "vim-pandoc/vim-pandoc-syntax"
NeoBundle "groenewege/vim-less"
@@ -44,6 +45,7 @@ NeoBundleCheck
syntax on
set thesaurus+=$HOME/Downloads/OpenThesaurus-Textversion/openthesaurus.txt
+" setlocal spell spelllang=en_gb
" {{{ Only enable the quick-scope plugin's highlighting when using the f/F/t/T movements
let g:qs_enable = 0
@@ -92,7 +94,7 @@ let g:ragtag_global_maps = 1
" delimitMate settings
" do not match <:> because of xml.vim
-let delimitMate_matchpairs = "(:),[:],{:},„:“,‚:‘,‘:’"
+let delimitMate_matchpairs = "(:),[:],{:},“:”,‘:’"
au Filetype markdown let delimitMate_quotes = "\" ' ` * $"
au Filetype tex let delimitMate_quotes = "$"
au Filetype ruby let delimitMate_quotes = "\" ' ` |"
@@ -103,10 +105,10 @@ let g:pandoc#syntax#conceal#use = 0
let g:pandoc#syntax#style#emphases = 0
" textobj-quote settings
-let g:textobj#quote#doubleDefault = '„“'
-let g:textobj#quote#singleDefault = '‚‘'
-let g:textobj#quote#doubleMotion = 'q'
-let g:textobj#quote#singleMotion = 'Q'
+let g:textobj#quote#doubleDefault = '“”'
+let g:textobj#quote#singleDefault = '‘’'
+let g:textobj#quote#doubleMotion = 'Q'
+let g:textobj#quote#singleMotion = 'q'
let g:textobj#quote#matchit = 1
let g:textobj#quote#educate = 0
call textobj#quote#init()
@@ -140,6 +142,7 @@ set wildmenu
set ttyfast
set laststatus=0
set linebreak
+set breakindent
set clipboard=unnamed
set listchars=tab:\ ,trail:·,nbsp:_
" TODO set list only in normal mode
@@ -182,6 +185,7 @@ cnoremap <c-a> <c-b>
xnoremap Q :normal @q<CR>
xnoremap ; :s///g<Left><Left><Left>
xnoremap  gq
+xnoremap - ~
nnoremap ∆ d{
nnoremap º d}
@@ -236,7 +240,8 @@ inoremap ° \begin{proposition} \end{proposition}<C-O>O
\end{definition}<Esc>kA[]<Left>
inoremap\begin{proof}\fixmargins
\end{proof}<C-O>O
-" S-A-Ü
+" S-A-Ü
+inoremap ° \begin{proposition}
\end{proposition}<C-O>O
inoremap\begin{lemma}
\end{lemma}<C-O>O\label{lemma:}<Left>
@@ -270,6 +275,7 @@ let mapleader = ","
inoremap ² „
inoremap ³ “
inoremap % <% %><Left><Left><Left>
+inoremap = <%= %><Left><Left><Left>
" }}}
nnoremap  :w<CR>:!pandoc --filter pandoc-citeproc --output="/Users/marius/Desktop/<C-R>=expand("%:t:r")<CR>.pdf" --template=nice.latex -V wordcount="<C-R>=MWC()<CR>" "%" && open -a Preview<CR><CR>
@@ -299,6 +305,18 @@ endfunction
return system(cmd)
endfunction
+function! WC()
+ let filename = expand("%")
+ let cmd = "cat " . filename . " | wc -w | tr -d [:space:]"
+ let result = system(cmd)
+ echo result . " words"
+endfunction
+
+command WC call WC()
+
+" http://vim.wikia.com/wiki/Insert_current_date_or_time
+" ds short for date stamp
+abbrev ds <C-R>=strftime("%Y-%m-%d %H:%M")<CR>
abbrev ddate <C-R>=strftime("%c")<CR>
" ld for long date like in blackberry
abbrev ld <C-R>=strftime("%a, %b %d, %Y")<CR>
View
16 .zshrc
@@ -39,8 +39,13 @@ alias ...="cd ../.."
alias serve="python -m SimpleHTTPServer"
alias hn="hnews home | less -RX"
alias hno="hnews open"
-alias play="/Applications/VLC.app/Contents/MacOS/VLC -I rc --play-and-exit --volume=200"
+#alias play="mpg123 -q"
+#alias play="/Applications/VLC.app/Contents/MacOS/VLC -I rc --play-and-exit --volume=200 --quiet"
+alias play="mplayer -really-quiet -novideo"
+alias youtube-dl="noglob youtube-dl"
alias you="youtube-dl -x --audio-format=mp3"
+alias y="youtube-dl -x --audio-format=mp3 \"$(pbpaste)\""
+# youtube-dl -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]"
function mk {
mkdir $1 && cd $1
@@ -82,3 +87,12 @@ pdflo () { pdflatex $1 && open $1.pdf }
# pandoc --output="kon.html" --template=default.html --mathjax kon.tex && open kon.html
#export PS1="SIGNAL> "
+
+function yplay {
+ youtube-dl --default-search=ytsearch: \
+ --youtube-skip-dash-manifest \
+ --output="${TMPDIR:-/tmp/}%(title)-s%(id)s.%(ext)s" \
+ --restrict-filenames \
+ --format="bestaudio[ext!=webm]" \
+ --exec=open -vvv "$*"
+}

0 comments on commit df320a3

Please sign in to comment.
Something went wrong with that request. Please try again.