Browse Source

Added snippets to help with math lectures

- snippets: Roman d, axes
- Vim: set fold to markers by default, jump to middle of line mapping
red-hat-laptop
Kevin Mok 7 years ago
parent
commit
9db2037c26
  1. 3
      .vimrc
  2. 9
      UltiSnips/all.snippets
  3. 8
      UltiSnips/sh.snippets
  4. 20
      UltiSnips/texmath.snippets
  5. 10
      aliases/.209_aliases
  6. 13
      aliases/.bash_aliases
  7. 2
      aliases/.my_pc_aliases
  8. 1
      aliases/.school_aliases

3
.vimrc

@ -10,6 +10,7 @@ set shiftwidth=4
set autoindent set autoindent
set mouse=c set mouse=c
set clipboard=unnamedplus set clipboard=unnamedplus
set foldmethod=marker
autocmd VimResized * wincmd = autocmd VimResized * wincmd =
autocmd BufNewFile,BufRead .*_aliases set syntax=sh autocmd BufNewFile,BufRead .*_aliases set syntax=sh
@ -62,7 +63,7 @@ map <S-Enter> O<ESC>
let mapleader="\<Space>" let mapleader="\<Space>"
nnoremap <leader>e o<ESC> nnoremap <leader>e o<ESC>
nnoremap <leader>ff :set foldmethod=marker<CR>
nnoremap <leader>f za nnoremap <leader>f za
nnoremap <leader>m :call cursor(0, len(getline('.'))/2)<CR>
nnoremap <leader>p :LLPStartPreview<CR> nnoremap <leader>p :LLPStartPreview<CR>
nnoremap <leader>s :set syn=sh<CR> nnoremap <leader>s :set syn=sh<CR>

9
UltiSnips/all.snippets

@ -15,3 +15,12 @@ endsnippet
snippet ltx "LaTeX" i snippet ltx "LaTeX" i
LaTeX LaTeX
endsnippet endsnippet
snippet evr "Var with escaped quotes" w
\"$${1:var}\"
endsnippet
snippet vr "Var with quotes" w
"$${1:var}"
endsnippet

8
UltiSnips/sh.snippets

@ -1,8 +0,0 @@
snippet evr "Var with escaped quotes" i
\"$${1:var}\"
endsnippet
snippet vr "Var with quotes" i
"$${1:var}"
endsnippet

20
UltiSnips/texmath.snippets

@ -1,9 +1,13 @@
snippet al "Align (math)" b
snippet ali "Align (math)" b
\begin{align*} \begin{align*}
$0 \\\\
$1 &= $2 \\\\
\end{align*} \end{align*}
endsnippet endsnippet
snippet al "Align line" b
&= $2 \\\\
endsnippet
snippet pwf "Piecewise function" b snippet pwf "Piecewise function" b
\[ \[
${1:name} = \left. ${1:name} = \left.
@ -45,3 +49,15 @@ endsnippet
snippet thus "Therefore" b snippet thus "Therefore" b
$\therefore$ $\therefore$
endsnippet endsnippet
snippet rd "Roman d" i
\mathrm{d}${1:x} $2
endsnippet
snippet xax "x-axis" i
$x$-axis
endsnippet
snippet yax "y-axis" i
$y$-axis
endsnippet

10
aliases/.209_aliases

@ -1,8 +1,10 @@
alias ll="ls -l" alias ll="ls -l"
alias 209="$cd_school/209"
alias 9r="$cd_school/209/mokkar"
alias l4="$cd_school/209/mokkar/lab4"
alias a1="$cd_school/209/mokkar/a1"
cd_209="d ~/Documents/School/209";
alias 209="$cd_209"
alias 9r="$cd_209/mokkar"
alias l5="$cd_209/mokkar/lab5"
alias a2="$cd_209/mokkar/a2"
# alias cdf="ssh -t mokkar@cdf.utoronto.ca '. ./.bashrc; bash -l'" # alias cdf="ssh -t mokkar@cdf.utoronto.ca '. ./.bashrc; bash -l'"
alias cdf="echo \". ./.bashrc\"&& ssh mokkar@cdf.utoronto.ca" alias cdf="echo \". ./.bashrc\"&& ssh mokkar@cdf.utoronto.ca"
mkex() { chmod 700 $1 ; } mkex() { chmod 700 $1 ; }

13
aliases/.bash_aliases

@ -22,10 +22,6 @@ d() { cd "$@" && ls -a ; }
cd_up() { d $(printf "%0.s../" $(seq 1 $1 )) ; } cd_up() { d $(printf "%0.s../" $(seq 1 $1 )) ; }
alias "d."="cd_up" alias "d."="cd_up"
alias cdd="d ~/Downloads" alias cdd="d ~/Downloads"
alias dsnp="d ~/.vim/plugged/vim-snippets/UltiSnips/"
alias csnp="d ~/.vim/UltiSnips/"
vdsnp() { vi ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; }
vsnp() { vi ~/.vim/UltiSnips/"$1".snippets ; }
# apps # apps
ok() { okular $1 ; } ok() { okular $1 ; }
@ -43,3 +39,12 @@ alias r=". ~/.bashrc"
# redshift # redshift
rs(){ redshift -O $(($1 * 1000)) ; } rs(){ redshift -O $(($1 * 1000)) ; }
alias rx="redshift -x" alias rx="redshift -x"
# UltiSnips
alias dsnp="d ~/.vim/plugged/vim-snippets/UltiSnips/"
alias csnp="d ~/.vim/UltiSnips/"
alias vsptm="vi ~/.vim/UltiSnips/texmath.snippets"
vdsnp() { vi ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; }
vsnp() { vi ~/.vim/UltiSnips/"$1".snippets ; }

2
aliases/.my_pc_aliases

@ -1,5 +1,5 @@
if [ "$(whoami)" == "kevin" ]; then if [ "$(whoami)" == "kevin" ]; then
alias vbn="cvlc --loop ~/Downloads/brown-noise.mp3"
alias vbn="cvlc --loop --alsa-gain 1 ~/Downloads/brown-noise.mp3"
alias mt="ok ~/Documents/School/calc-textbook.pdf" alias mt="ok ~/Documents/School/calc-textbook.pdf"
alias clc="gcalccmd" alias clc="gcalccmd"

1
aliases/.school_aliases

@ -28,4 +28,5 @@ cptp() {
# 136 # 136
alias 136="$cd_school/136" alias 136="$cd_school/136"
alias 136l="$cd_school/136/lecture"
alias pr2="$cd_school/136/par/2" alias pr2="$cd_school/136/par/2"
Loading…
Cancel
Save