Browse Source

Set key files

red-hat-laptop
Kevin Mok 6 years ago
parent
commit
16a16e71da
  1. 13
      .gitignore
  2. 19
      aliases/zsh_aliases
  3. 1
      configs/ranger/bookmarks
  4. 3
      configs/ranger/history
  5. 68
      configs/ranger/shortcuts.conf
  6. 0
      configs/ranger/tagged
  7. 10
      dotfiles/vimrc
  8. 4
      dotfiles/zshrc
  9. 24
      key_files.txt
  10. 8
      shortcuts.sh

13
.gitignore

@ -1,8 +1,13 @@
cp-*
*.sw*
*.html *.html
temp.sh
konsole.shortcuts
*.sw*
commit-msg.txt commit-msg.txt
core core
cp-*
ideas.md ideas.md
temp.sh
# ranger
bookmarks
history
tagged
shortcuts.conf

19
aliases/zsh_aliases

@ -115,24 +115,13 @@ function glc() { grep $1 ~/linux-config/aliases/zsh_aliases ; }
alias lca="f ~/linux-config/aliases" alias lca="f ~/linux-config/aliases"
source ~/.shortcuts source ~/.shortcuts
alias vv="ni ~/.vimrc"
alias vu="ni ~/.Xresources"
alias vzb="ni ~/.zshrc"
alias vz="ni ~/linux-config/aliases/zsh_aliases"
alias vr="ni ~/.config/ranger/rc.conf"
# i3 {{{ #
alias v3="ni ~/.config/i3/config"
alias v3b="ni ~/.config/i3blocks/i3blocks.conf"
# i3
alias i3b="f ~/i3blocks" alias i3b="f ~/i3blocks"
alias pipes="pipes.sh -t 2" alias pipes="pipes.sh -t 2"
# }}} i3 #
# UltiSnips {{{ # # UltiSnips {{{ #
usnp_dir="~/.vim/plugged/vim-snippets/UltiSnips" usnp_dir="~/.vim/plugged/vim-snippets/UltiSnips"
function vsnp() { ni ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; } function vsnp() { ni ~/.vim/plugged/vim-snippets/UltiSnips/"$1".snippets ; }
alias tm="ni $usnp_dir/texmath.snippets"
# }}} # # }}} #
# }}} config files # # }}} config files #
@ -140,7 +129,7 @@ alias tm="ni $usnp_dir/texmath.snippets"
# applications {{{ # # applications {{{ #
silent="> /dev/null 2>&1& " silent="> /dev/null 2>&1& "
alias rn="ranger"
alias r="ranger"
# okular # okular
# function ok() { nohup okular $1 > /dev/null 2>&1& ; } # function ok() { nohup okular $1 > /dev/null 2>&1& ; }
# zathura # zathura
@ -231,7 +220,6 @@ alias grbc="git rebase --continue"
# }}} update # # }}} update #
# edit {{{ # # edit {{{ #
alias vig="ni .gitignore"
alias vir="ni README.md" alias vir="ni README.md"
alias crm="mrk README.md" alias crm="mrk README.md"
# }}} edit # # }}} edit #
@ -279,8 +267,6 @@ coding_dir="~/coding"
alias cdn="$cd_coding_dir" alias cdn="$cd_coding_dir"
alias gx="ni ~/Documents/csgo-config/autoexec.cfg" alias gx="ni ~/Documents/csgo-config/autoexec.cfg"
alias jn="ni ~/Documents/journal/todo/11.md"
alias jnt="ni ~/Documents/journal/todo/todo.md"
# trapbot {{{ # # trapbot {{{ #
alias tb="$cd_coding_dir/trapbot" alias tb="$cd_coding_dir/trapbot"
@ -316,7 +302,6 @@ alias ureq="pip freeze > requirements.txt"
# scan history # scan history
alias hlg="cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1" alias hlg="cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1"
alias hlgf="ni $spv_dir/src/api/management/commands/update-history.log"
alias crnl="grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg" alias crnl="grep \"(kevin) CMD\" /var/log/syslog | tail -n 1 && hlg"
alias hs="$spv_dir/src/update-history.sh && hlg" alias hs="$spv_dir/src/update-history.sh && hlg"
# removes all but newest file # removes all but newest file

1
configs/ranger/bookmarks

@ -1 +0,0 @@
':/home/kevin/linux-config/configs/ranger

3
configs/ranger/history

@ -1,3 +0,0 @@
rename rocket-league
rename rocket-league.png
find d

68
configs/ranger/shortcuts.conf

@ -1,68 +0,0 @@
map gbg cd ~/Pictures/Backgrounds
map tbg tab_new ~/Pictures/Backgrounds
map mbg shell mv -v %s ~/Pictures/Backgrounds
map Ybg shell cp -rv %s ~/Pictures/Backgrounds
map gd cd ~/Downloads
map td tab_new ~/Downloads
map md shell mv -v %s ~/Downloads
map Yd shell cp -rv %s ~/Downloads
map gD cd ~/Documents
map tD tab_new ~/Documents
map mD shell mv -v %s ~/Documents
map YD shell cp -rv %s ~/Documents
map gho cd ~/
map tho tab_new ~/
map mho shell mv -v %s ~/
map Yho shell cp -rv %s ~/
map glc cd ~/linux-config/
map tlc tab_new ~/linux-config/
map mlc shell mv -v %s ~/linux-config/
map Ylc shell cp -rv %s ~/linux-config/
map gcd cd ~/coding
map tcd tab_new ~/coding
map mcd shell mv -v %s ~/coding
map Ycd shell cp -rv %s ~/coding
map gjnd cd ~/Documents/journal
map tjnd tab_new ~/Documents/journal
map mjnd shell mv -v %s ~/Documents/journal
map Yjnd shell cp -rv %s ~/Documents/journal
map glh cd ~/Music/spotify-history
map tlh tab_new ~/Music/spotify-history
map mlh shell mv -v %s ~/Music/spotify-history
map Ylh shell cp -rv %s ~/Music/spotify-history
map gsnp cd ~/.vim/plugged/vim-snippets/UltiSnips
map tsnp tab_new ~/.vim/plugged/vim-snippets/UltiSnips
map msnp shell mv -v %s ~/.vim/plugged/vim-snippets/UltiSnips
map Ysnp shell cp -rv %s ~/.vim/plugged/vim-snippets/UltiSnips
map gsv cd ~/coding/spotify-lib-vis/src
map tsv tab_new ~/coding/spotify-lib-vis/src
map msv shell mv -v %s ~/coding/spotify-lib-vis/src
map Ysv shell cp -rv %s ~/coding/spotify-lib-vis/src
map gswa cd ~/.local/share/nvim/swap
map tswa tab_new ~/.local/share/nvim/swap
map mswa shell mv -v %s ~/.local/share/nvim/swap
map Yswa shell cp -rv %s ~/.local/share/nvim/swap
map gwo cd ~/Documents/workout-logs/11
map two tab_new ~/Documents/workout-logs/11
map mwo shell mv -v %s ~/Documents/workout-logs/11
map Ywo shell cp -rv %s ~/Documents/workout-logs/11
map gsc cd ~/Documents/school
map tsc tab_new ~/Documents/school
map msc shell mv -v %s ~/Documents/school
map Ysc shell cp -rv %s ~/Documents/school
map gst cd ~/Documents/school/sta
map tst tab_new ~/Documents/school/sta
map mst shell mv -v %s ~/Documents/school/sta
map Yst shell cp -rv %s ~/Documents/school/sta
map g2 cd ~/Documents/school/236
map t2 tab_new ~/Documents/school/236
map m2 shell mv -v %s ~/Documents/school/236
map Y2 shell cp -rv %s ~/Documents/school/236
map ga3 cd ~/Documents/school/latex-notes/236/a3
map ta3 tab_new ~/Documents/school/latex-notes/236/a3
map ma3 shell mv -v %s ~/Documents/school/latex-notes/236/a3
map Ya3 shell cp -rv %s ~/Documents/school/latex-notes/236/a3
map g3 cd ~/Documents/school/343
map t3 tab_new ~/Documents/school/343
map m3 shell mv -v %s ~/Documents/school/343
map Y3 shell cp -rv %s ~/Documents/school/343

0
configs/ranger/tagged

10
dotfiles/vimrc

@ -28,12 +28,18 @@ set timeoutlen=500
set hlsearch set hlsearch
" }}} set x=y " " }}} set x=y "
" commands for file types {{{ "
autocmd VimResized * wincmd = autocmd VimResized * wincmd =
autocmd BufNewFile,BufRead .* set syntax=sh autocmd BufNewFile,BufRead .* set syntax=sh
autocmd Filetype css,htmldjango,html,tex,txt,markdown set tabstop=2 shiftwidth=2 expandtab autocmd Filetype css,htmldjango,html,tex,txt,markdown set tabstop=2 shiftwidth=2 expandtab
autocmd BufNewFile,BufRead *.md set filetype=markdown autocmd BufNewFile,BufRead *.md set filetype=markdown
autocmd Filetype markdown set textwidth=0 autocmd Filetype markdown set textwidth=0
autocmd BufWritePost key_*.txt !bash ~/linux-config/shortcuts.sh
" }}} commands for file types "
" vim-plug {{{ " " vim-plug {{{ "
" plug auto-install " plug auto-install
if empty(glob('~/.vim/autoload/plug.vim')) if empty(glob('~/.vim/autoload/plug.vim'))
@ -202,8 +208,10 @@ nnoremap <leader>rl q:i.s///g<left><left><left>
nnoremap <leader>rv :source $MYVIMRC<CR> nnoremap <leader>rv :source $MYVIMRC<CR>
" replace in entire file " replace in entire file
nnoremap <leader>R q:i%s///g<ESC>2F/i nnoremap <leader>R q:i%s///g<ESC>2F/i
" sort lines
nnoremap <leader>s q:i.,.+sort<ESC>Fsi
" set syntax to shell (for dotfiles) " set syntax to shell (for dotfiles)
nnoremap <leader>s :set syn=sh<CR>
nnoremap <leader>sh :set syn=sh<CR>
" format current line " format current line
nnoremap <leader>w Vgq nnoremap <leader>w Vgq
" format this and next line " format this and next line

4
dotfiles/zshrc

@ -2,8 +2,8 @@
# Path to your oh-my-zsh installation. # Path to your oh-my-zsh installation.
export ZSH=/home/kevin/.oh-my-zsh export ZSH=/home/kevin/.oh-my-zsh
export EDITOR=/usr/bin/vim
export VISUAL=/usr/bin/vim
export EDITOR=/usr/bin/nvim
export VISUAL=/usr/bin/nvim
# Set name of the theme to load. Optionally, if you set this to "random" # Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded. # it'll load a random theme each time that oh-my-zsh is loaded.

24
key_files.txt

@ -0,0 +1,24 @@
# sys {{{ *
kd ~/.key_directories
kf ~/.key_files
3 ~/.config/i3/config
3b ~/.config/i3blocks/i3blocks.conf
r ~/.config/ranger/rc.conf
u ~/.Xresources
v ~/.vimrc
z ~/linux-config/aliases/zsh_aliases
y ~/.zshrc
# }}} sys *
# cdn {{{ *
hlg ~/coding/spotify-lib-vis/src/api/management/commands/update-history.log
jn ~/Documents/journal/todo/11.md
jnt ~/Documents/journal/todo/todo.md
tm ~/.vim/plugged/vim-snippets/UltiSnips/texmath.snippets
ig ./.gitignore
# }}} cdn *

8
shortcuts.sh

@ -5,7 +5,7 @@ shellrc="$HOME/.zshrc"
# Config locations # Config locations
folders="$HOME/linux-config/key_dirs.txt" folders="$HOME/linux-config/key_dirs.txt"
configs="$HOME/.key_files"
configs="$HOME/linux-config/key_files.txt"
# Output locations # Output locations
shell_shortcuts="$HOME/.shortcuts" shell_shortcuts="$HOME/.shortcuts"
@ -23,8 +23,8 @@ ensure "source $HOME/.config/ranger/shortcuts.conf" "$HOME/.config/ranger/rc.con
# Format the `folders` file in the correct syntax and sent it to all three configs. # Format the `folders` file in the correct syntax and sent it to all three configs.
sed "s/#.*$//;/^$/d" "$folders" | tee >(awk '{print $1"=\"f "$2"\" \\"}' >> "$shell_shortcuts") \ sed "s/#.*$//;/^$/d" "$folders" | tee >(awk '{print $1"=\"f "$2"\" \\"}' >> "$shell_shortcuts") \
| awk '{print "map g"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts"
| awk '{print "map f"$1" cd "$2"\nmap t"$1" tab_new "$2"\nmap m"$1" shell mv -v %s "$2"\nmap Y"$1" shell cp -rv %s "$2}' >> "$ranger_shortcuts"
# Format the `configs` file in the correct syntax and sent it to both configs. # Format the `configs` file in the correct syntax and sent it to both configs.
# sed "s/#.*$//;/^$/d" "$configs" | tee >(awk '{print $1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \
# | awk '{print "map "$1" shell $EDITOR "$2}' >> "$ranger_shortcuts"
sed "s/#.*$//;/^$/d" "$configs" | tee >(awk '{print "v"$1"=\"$EDITOR "$2"\" \\"}' >> "$shell_shortcuts") \
| awk '{print "map v"$1" shell $EDITOR "$2}' >> "$ranger_shortcuts"
Loading…
Cancel
Save