From e82275dd0ce058aae86fb4c6f6345483915e868b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Gremaud?= Date: Sat, 6 Jun 2020 22:52:14 +0200 Subject: [PATCH] Remove old zshrc, add prezto, vifm, move vim colors --- create_symlinks.sh | 26 +- prompt_sorin_setup | 197 ++++++++ vifmrc | 475 ++++++++++++++++++ vim/colors/{archman.vim.vifm => archman.vim} | 0 vim/colors/{grb256.vim.vifm => grb256.vim} | 0 .../{ir_black.vim.vifm => ir_black.vim} | 0 zpreztorc | 230 +++++++++ zshrc_old | 69 --- 8 files changed, 927 insertions(+), 70 deletions(-) create mode 100644 prompt_sorin_setup create mode 100644 vifmrc rename vim/colors/{archman.vim.vifm => archman.vim} (100%) rename vim/colors/{grb256.vim.vifm => grb256.vim} (100%) rename vim/colors/{ir_black.vim.vifm => ir_black.vim} (100%) create mode 100644 zpreztorc delete mode 100644 zshrc_old diff --git a/create_symlinks.sh b/create_symlinks.sh index 39ca0fd..abcc7d9 100755 --- a/create_symlinks.sh +++ b/create_symlinks.sh @@ -10,7 +10,7 @@ dir=~/Documents/dotfiles # dotfiles directory olddir=~/dotfiles_old # old dotfiles backup directory -files="vim vimrc zsh zshrc tmux.conf" # list of files/folders to symlink in homedir +files="vim vimrc zsh zshrc tmux.conf zpreztorc" # list of files/folders to symlink in homedir ########## # create dotfiles_old in homedir @@ -32,3 +32,27 @@ for file in $files; do ln -s $dir/$file ~/.$file done + +# Copy particular stuff + +## Prezto +echo -n "Creating folder for prezto" + mkdir -p "~/.zprezto/modules/prompt/functions/" + +echo -n "Moving existing prompt_sorin_setup into $oldir" + mv ~/.zprezto/modules/prompt/functions/prompt_sorin_setup "$olddir/prompt_sorin_setup" + +echo -n "Creating symlink to prompt_sorin_setup file" + +ln -s $dir/prompt_sorin_setup. ~/.zprezto/modules/prompt/functions/prompt_sorin_setup + +## Vifm +echo -n "Creating folder for vifm" + mkdir -p "~/.config/vifm/" + +echo -n "Moving existing vifmrc file into $olddir" + mv "~/.config/vifm/vifmrc" "$olddir/vifmrc" + +echo -n "Creating symlink to vifmrc file" + +ln -s $dir/vifmrc. ~/.config/vifm/vifmrc diff --git a/prompt_sorin_setup b/prompt_sorin_setup new file mode 100644 index 0000000..ba5b426 --- /dev/null +++ b/prompt_sorin_setup @@ -0,0 +1,197 @@ +# +# A simple theme that displays relevant, contextual information. +# +# Authors: +# Sorin Ionescu +# +# Screenshots: +# http://i.imgur.com/nrGV6pg.png +# + +# +# 16 Terminal Colors +# -- --------------- +# 0 black +# 1 red +# 2 green +# 3 yellow +# 4 blue +# 5 magenta +# 6 cyan +# 7 white +# 8 bright black +# 9 bright red +# 10 bright green +# 11 bright yellow +# 12 bright blue +# 13 bright magenta +# 14 bright cyan +# 15 bright white +# + +# Load dependencies. +pmodload 'helper' + +function prompt_sorin_async_callback { + case $1 in + prompt_sorin_async_git) + # We can safely split on ':' because it isn't allowed in ref names. + IFS=':' read _git_target _git_post_target <<<"$3" + + # The target actually contains 3 space separated possibilities, so we need to + # make sure we grab the first one. + _git_target=$(coalesce ${(@)${(z)_git_target}}) + + if [[ -z "$_git_target" ]]; then + # No git target detected, flush the git fragment and redisplay the prompt. + if [[ -n "$_prompt_sorin_git" ]]; then + _prompt_sorin_git='' + zle && zle reset-prompt + fi + else + # Git target detected, update the git fragment and redisplay the prompt. + _prompt_sorin_git="${_git_target}${_git_post_target}" + zle && zle reset-prompt + fi + ;; + esac +} + +function prompt_sorin_async_git { + cd -q "$1" + if (( $+functions[git-info] )); then + git-info + print ${git_info[status]} + fi +} + +function prompt_sorin_async_tasks { + # Initialize async worker. This needs to be done here and not in + # prompt_sorin_setup so the git formatting can be overridden by other prompts. + if (( !${prompt_prezto_async_init:-0} )); then + async_start_worker prompt_sorin -n + async_register_callback prompt_sorin prompt_sorin_async_callback + typeset -g prompt_prezto_async_init=1 + fi + + # Kill the old process of slow commands if it is still running. + async_flush_jobs prompt_sorin + + # Compute slow commands in the background. + async_job prompt_sorin prompt_sorin_async_git "$PWD" +} + +function prompt_sorin_precmd { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + + # Format PWD. + _prompt_sorin_pwd=$(prompt-pwd) + + # Handle updating git data. We also clear the git prompt data if we're in a + # different git root now. + if (( $+functions[git-dir] )); then + local new_git_root="$(git-dir 2> /dev/null)" + if [[ $new_git_root != $_sorin_cur_git_root ]]; then + _prompt_sorin_git='' + _sorin_cur_git_root=$new_git_root + fi + fi + + # Run python info (this should be fast and not require any async) + if (( $+functions[python-info] )); then + python-info + fi + + prompt_sorin_async_tasks +} + +function prompt_sorin_setup { + setopt LOCAL_OPTIONS + unsetopt XTRACE KSH_ARRAYS + prompt_opts=(cr percent sp subst) + + # Load required functions. + autoload -Uz add-zsh-hook + autoload -Uz async && async + + # Add hook for calling git-info before each command. + add-zsh-hook precmd prompt_sorin_precmd + + # Tell prezto we can manage this prompt + zstyle ':prezto:module:prompt' managed 'yes' + + # Set editor-info parameters. + zstyle ':prezto:module:editor:info:completing' format '%B%F{7}...%f%b' + zstyle ':prezto:module:editor:info:keymap:primary' format ' %B%F{2}#%f%b' + zstyle ':prezto:module:editor:info:keymap:primary:overwrite' format ' %F{3}♺%f' + zstyle ':prezto:module:editor:info:keymap:alternate' format ' %B%F{2}❮%F{3}❮%F{1}❮%f%b' + + # Set git-info parameters. + zstyle ':prezto:module:git:info' verbose 'yes' + zstyle ':prezto:module:git:info:action' format '%F{7}:%f%%B%F{9}%s%f%%b' + zstyle ':prezto:module:git:info:added' format ' %%B%F{2}Added%f%%b' + zstyle ':prezto:module:git:info:ahead' format ' %%B%F{13}Ahead%f%%b' + zstyle ':prezto:module:git:info:behind' format ' %%B%F{13}Behind%f%%b' + zstyle ':prezto:module:git:info:branch' format ' %%B%F{2}%b%f%%b' + zstyle ':prezto:module:git:info:commit' format ' %%B%F{3}%.7c%f%%b' + zstyle ':prezto:module:git:info:deleted' format ' %%B%F{1}Deleted%f%%b' + zstyle ':prezto:module:git:info:modified' format ' %%B%F{4}Modified%f%%b' + zstyle ':prezto:module:git:info:position' format ' %%B%F{13}%p%f%%b' + zstyle ':prezto:module:git:info:renamed' format ' %%B%F{5}Renamed%f%%b' + zstyle ':prezto:module:git:info:stashed' format ' %%B%F{6}Staged%f%%b' + zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{3}Unmerged%f%%b' + zstyle ':prezto:module:git:info:untracked' format ' %%B%F{7}LOCAL%f%%b' + zstyle ':prezto:module:git:info:keys' format \ + 'status' '%b %p %c:%s%A%B%S%a%d%m%r%U%u' +# zstyle ':prezto:module:git:info:action' format '%F{7}:%f%%B%F{9}%s%f%%b' +# zstyle ':prezto:module:git:info:added' format ' %%B%F{2}✚%f%%b' +# zstyle ':prezto:module:git:info:ahead' format ' %%B%F{13}⬆%f%%b' +# zstyle ':prezto:module:git:info:behind' format ' %%B%F{13}⬇%f%%b' +# zstyle ':prezto:module:git:info:branch' format ' %%B%F{2}%b%f%%b' +# zstyle ':prezto:module:git:info:commit' format ' %%B%F{3}%.7c%f%%b' +# zstyle ':prezto:module:git:info:deleted' format ' %%B%F{1}✖%f%%b' +# zstyle ':prezto:module:git:info:modified' format ' %%B%F{4}✱%f%%b' +# zstyle ':prezto:module:git:info:position' format ' %%B%F{13}%p%f%%b' +# zstyle ':prezto:module:git:info:renamed' format ' %%B%F{5}➜%f%%b' +# zstyle ':prezto:module:git:info:stashed' format ' %%B%F{6}✭%f%%b' +# zstyle ':prezto:module:git:info:unmerged' format ' %%B%F{3}═%f%%b' +# zstyle ':prezto:module:git:info:untracked' format ' %%B%F{7}◼%f%%b' +# zstyle ':prezto:module:git:info:keys' format \ +# 'status' '%b %p %c:%s%A%B%S%a%d%m%r%U%u' + + # Set python-info parameters. + zstyle ':prezto:module:python:info:virtualenv' format '%f%F{3}(%v)%F{7} ' + + # Set up non-zero return value display + local show_return="✘ " + # Default is to show the return value + if zstyle -T ':prezto:module:prompt' show-return-val; then + show_return+='%? ' + fi + + # Get the async worker set up. + _sorin_cur_git_root='' + + _prompt_sorin_git='' + _prompt_sorin_pwd='' + + # Define prompts. + PROMPT='${SSH_TTY:+"%F{9}%n%f%F{7}@%f%F{3}%m%f "}%F{4}${_prompt_sorin_pwd}%(!. %B%F{1}#%f%b.)${editor_info[keymap]} ' + RPROMPT='$python_info[virtualenv]${editor_info[overwrite]}%(?:: %F{1}' + RPROMPT+=${show_return} + RPROMPT+='%f)${VIM:+" %B%F{6}V%f%b"}${_prompt_sorin_git}' + SPROMPT='zsh: correct %F{1}%R%f to %F{2}%r%f [nyae]? ' +} + +function prompt_sorin_preview { + local +h PROMPT='' + local +h RPROMPT='' + local +h SPROMPT='' + + editor-info 2> /dev/null + prompt_preview_theme 'sorin' +} + +prompt_sorin_setup "$@" +# vim: ft=zsh diff --git a/vifmrc b/vifmrc new file mode 100644 index 0000000..9de663b --- /dev/null +++ b/vifmrc @@ -0,0 +1,475 @@ +" vim: filetype=vifm : +" Sample configuration file for vifm (last updated: 20 July, 2018) +" You can edit this file by hand. +" The " character at the beginning of a line comments out the line. +" Blank lines are ignored. +" The basic format for each item is shown with an example. + +" ------------------------------------------------------------------------------ + +" This is the actual command used to start vi. The default is vim. +" If you would like to use another vi clone such as Elvis or Vile +" you will need to change this setting. + +set vicmd=nvim +" set vicmd=elvis\ -G\ termcap +" set vicmd=vile + +" This makes vifm perform file operations on its own instead of relying on +" standard utilities like `cp`. While using `cp` and alike is a more universal +" solution, it's also much slower when processing large amounts of files and +" doesn't support progress measuring. + +set syscalls + +" Trash Directory +" The default is to move files that are deleted with dd or :d to +" the trash directory. If you change this you will not be able to move +" files by deleting them and then using p to put the file in the new location. +" I recommend not changing this until you are familiar with vifm. +" This probably shouldn't be an option. + +set trash + +" This is how many directories to store in the directory history. + +set history=100 + +" Automatically resolve symbolic links on l or Enter. + +set nofollowlinks + +" With this option turned on you can run partially entered commands with +" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te). + +" set fastrun + +" Natural sort of (version) numbers within text. + +set sortnumbers + +" Maximum number of changes that can be undone. + +set undolevels=100 + +" If you installed the vim.txt help file set vimhelp. +" If would rather use a plain text help file set novimhelp. + +set novimhelp + +" If you would like to run an executable file when you +" press return on the file name set this. + +set norunexec + +" Selected color scheme + +colorscheme default +highlight win cterm=none ctermfg=white ctermbg=none +highlight StatusLine cterm=none ctermfg=white ctermbg=none + +nnoremap :q! + +" Format for displaying time in file list. For example: +" TIME_STAMP_FORMAT=%m/%d-%H:%M +" See man date or man strftime for details. + +set timefmt=%m/%d\ %H:%M + +" Show list of matches on tab completion in command-line mode + +set wildmenu + +" Display completions in a form of popup with descriptions of the matches + +set wildstyle=popup + +" Display suggestions in normal, visual and view modes for keys, marks and +" registers (at most 5 files). In other view, when available. + +set suggestoptions=normal,visual,view,otherpane,keys,marks,registers + +" Ignore case in search patterns unless it contains at least one uppercase +" letter + +set ignorecase +set smartcase + +" Don't highlight search results automatically + +set nohlsearch + +" Use increment searching (search while typing) +set incsearch + +" Try to leave some space from cursor to upper/lower border in lists + +set scrolloff=4 + +" Don't do too many requests to slow file systems + +if !has('win') + set slowfs=curlftpfs +endif + +" Set custom status line look + +set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d " + +" ------------------------------------------------------------------------------ + +" :mark mark /full/directory/path [filename] + +mark b ~/bin/ +mark h ~/ + +" ------------------------------------------------------------------------------ + +" :com[mand][!] command_name action +" The following macros can be used in a command +" %a is replaced with the user arguments. +" %c the current file under the cursor. +" %C the current file under the cursor in the other directory. +" %f the current selected file, or files. +" %F the current selected file, or files in the other directory. +" %b same as %f %F. +" %d the current directory name. +" %D the other window directory name. +" %m run the command in a menu window + +command! df df -h %m 2> /dev/null +command! diff vim -d %f %F +command! zip zip -r %f.zip %f +command! run !! ./%f +command! make !!make %a +command! mkcd :mkdir %a | cd %a +command! vgrep vim "+grep %a" +command! reload :write | restart + +" ------------------------------------------------------------------------------ + +" The file type is for the default programs to be used with +" a file extension. +" :filetype pattern1,pattern2 defaultprogram,program2 +" :fileviewer pattern1,pattern2 consoleviewer +" The other programs for the file type can be accessed with the :file command +" The command macros %f, %F, %d, %F may be used in the commands. +" The %a macro is ignored. To use a % you must put %%. + +" For automated FUSE mounts, you must register an extension with :file[x]type +" in one of following formats: +" +" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables +" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime. +" A sample line might look like this: +" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR +" +" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables +" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime. +" A sample line might look like this: +" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR +" %PARAM value is filled from the first line of file (whole line). +" Example first line for SshMount filetype: root@127.0.0.1:/ +" +" You can also add %CLEAR if you want to clear screen before running FUSE +" program. + +" Pdf +filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c +fileviewer *.pdf pdftotext -nopgbrk %c - + +" PostScript +filextype *.ps,*.eps,*.ps.gz + \ {View in zathura} + \ zathura %f, + \ {View in gv} + \ gv %c %i &, + +" Djvu +filextype *.djvu + \ {View in zathura} + \ zathura %f, + \ {View in apvlv} + \ apvlv %f, + +" Audio +filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus + \ {Play using ffplay} + \ ffplay -nodisp -autoexit %c, + \ {Play using MPlayer} + \ mplayer %f, +fileviewer *.mp3 mp3info +fileviewer *.flac soxi + +" Video +filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, + \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, + \*.as[fx] + \ {View using ffplay} + \ ffplay -fs -autoexit %f, + \ {View using Dragon} + \ dragon %f:p, + \ {View using mplayer} + \ mplayer %f, +fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, + \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, + \*.as[fx] + \ ffprobe -pretty %c 2>&1 + +" Web +filextype *.html,*.htm + \ {Open with dwb} + \ dwb %f %i &, + \ {Open with firefox} + \ firefox %f &, + \ {Open with uzbl} + \ uzbl-browser %f %i &, +filetype *.html,*.htm links, lynx + +" Object +filetype *.o nm %f | less + +" Man page +filetype *.[1-8] man ./%c +fileviewer *.[1-8] man ./%c | col -b + +" Images +filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm + \ {View in sxiv} + \ sxiv %f, + \ {View in gpicview} + \ gpicview %c, + \ {View in shotwell} + \ shotwell, +fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm + \ convert -identify %f -verbose /dev/null + +" OpenRaster +filextype *.ora + \ {Edit in MyPaint} + \ mypaint %f, + +" Mindmap +filextype *.vym + \ {Open with VYM} + \ vym %f &, + +" MD5 +filetype *.md5 + \ {Check MD5 hash sum} + \ md5sum -c %f %S, + +" SHA1 +filetype *.sha1 + \ {Check SHA1 hash sum} + \ sha1sum -c %f %S, + +" SHA256 +filetype *.sha256 + \ {Check SHA256 hash sum} + \ sha256sum -c %f %S, + +" SHA512 +filetype *.sha512 + \ {Check SHA512 hash sum} + \ sha512sum -c %f %S, + +" GPG signature +filetype *.asc + \ {Check signature} + \ !!gpg --verify %c, + +" Torrent +filetype *.torrent ktorrent %f & +fileviewer *.torrent dumptorrent -v %c + +" FuseZipMount +filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg + \ {Mount with fuse-zip} + \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, + \ {View contents} + \ zip -sf %c | less, + \ {Extract here} + \ tar -xf %c, +fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c + +" ArchiveMount +filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz + \ {Mount with archivemount} + \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR, +fileviewer *.tgz,*.tar.gz tar -tzf %c +fileviewer *.tar.bz2,*.tbz2 tar -tjf %c +fileviewer *.tar.txz,*.txz xz --list %c +fileviewer *.tar tar -tf %c + +" Rar2FsMount and rar archives +filetype *.rar + \ {Mount with rar2fs} + \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR, +fileviewer *.rar unrar v %c + +" IsoMount +filetype *.iso + \ {Mount with fuseiso} + \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR, + +" SshMount +filetype *.ssh + \ {Mount with sshfs} + \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND, + +" FtpMount +filetype *.ftp + \ {Mount with curlftpfs} + \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND, + +" Fuse7z and 7z archives +filetype *.7z + \ {Mount with fuse-7z} + \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR, +fileviewer *.7z 7z l %c + +" Office files +filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f & +fileviewer *.doc catdoc %c +fileviewer *.docx docx2txt.pl %f - + +" TuDu files +filetype *.tudu tudu -f %c + +" Qt projects +filextype *.pro qtcreator %f & + +" Directories +filextype */ + \ {View in thunar} + \ Thunar %f &, + +" Syntax highlighting in preview +" +" Explicitly set highlight type for some extensions +" +" 256-color terminal +" fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c +" fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c +" +" 16-color terminal +" fileviewer *.c,*.h highlight -O ansi -s dante %c +" +" Or leave it for automatic detection +" +" fileviewer *[^/] pygmentize -O style=monokai -f console256 -g + +" Displaying pictures in terminal +" +" fileviewer *.jpg,*.png shellpic %c + +" Open all other files with default system programs (you can also remove all +" :file[x]type commands above to ensure they don't interfere with system-wide +" settings). By default all unknown files are opened with 'vi[x]cmd' +" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option +" for unknown file types. +" For *nix: +" filetype * xdg-open +" For OS X: +" filetype * open +" For Windows: +" filetype * start, explorer + +" ------------------------------------------------------------------------------ + +" What should be saved automatically between vifm runs +" Like in previous versions of vifm +" set vifminfo=options,filetypes,commands,bookmarks,dhistory,state,cs +" Like in vi +set vifminfo=dhistory,savedirs,chistory,state,tui,shistory, + \phistory,fhistory,dirstack,registers,bookmarks,bmarks + +" ------------------------------------------------------------------------------ + +" Examples of configuring both panels + +" Customize view columns a bit (enable ellipsis for truncated file names) +" +" set viewcolumns=-{name}..,6{}. + +" Filter-out build and temporary files +" +" filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/ + +" ------------------------------------------------------------------------------ + +" Sample mappings + +" Start shell in current directory +nnoremap s :shell + +" Display sorting dialog +nnoremap S :sort + +" Toggle visibility of preview window +nnoremap w :view +vnoremap w :viewgv + +" Open file in existing instance of gvim +nnoremap o :!gvim --remote-tab-silent %f +" Open file in new instance of gvim +nnoremap O :!gvim %f + +" Open file in the background using its default program +nnoremap gb :file &l + +" Yank current directory path into the clipboard +nnoremap yd :!echo %d | xclip %i + +" Yank current file path into the clipboard +nnoremap yf :!echo %c:p | xclip %i + +" Mappings for faster renaming +nnoremap I cw +nnoremap cc cw +nnoremap A cw + +" Open console in current directory +nnoremap ,t :!xterm & + +" Open editor to edit vifmrc and apply settings after returning to vifm +nnoremap ,c :write | edit $MYVIFMRC | restart +" Open gvim to edit vifmrc +nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC & + +" Toggle wrap setting on ,w key +nnoremap ,w :set wrap! + +" Example of standard two-panel file managers mappings +nnoremap :!less %f +nnoremap :edit +nnoremap :copy +nnoremap :move +nnoremap :mkdir +nnoremap :delete + +" ------------------------------------------------------------------------------ + +" Various customization examples + +" Use ag (the silver searcher) instead of grep +" +" set grepprg='ag --line-numbers %i %a %s' + +" Add additional place to look for executables +" +" let $PATH = $HOME.'/bin/fuse:'.$PATH + +" Block particular shortcut +" +" nnoremap + +" Export IPC name of current instance as environment variable and use it to +" communicate with the instance later. +" +" It can be used in some shell script that gets run from inside vifm, for +" example, like this: +" vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'" +" +" let $VIFM_SERVER_NAME = v:servername diff --git a/vim/colors/archman.vim.vifm b/vim/colors/archman.vim similarity index 100% rename from vim/colors/archman.vim.vifm rename to vim/colors/archman.vim diff --git a/vim/colors/grb256.vim.vifm b/vim/colors/grb256.vim similarity index 100% rename from vim/colors/grb256.vim.vifm rename to vim/colors/grb256.vim diff --git a/vim/colors/ir_black.vim.vifm b/vim/colors/ir_black.vim similarity index 100% rename from vim/colors/ir_black.vim.vifm rename to vim/colors/ir_black.vim diff --git a/zpreztorc b/zpreztorc new file mode 100644 index 0000000..bcc031d --- /dev/null +++ b/zpreztorc @@ -0,0 +1,230 @@ +# +# Sets Prezto options. +# +# Authors: +# Sorin Ionescu +# + +# +# General +# + +# Set case-sensitivity for completion, history lookup, etc. +# zstyle ':prezto:*:*' case-sensitive 'yes' + +# Color output (auto set to 'no' on dumb terminals). +zstyle ':prezto:*:*' color 'yes' + +# Add additional directories to load prezto modules from +# zstyle ':prezto:load' pmodule-dirs $HOME/.zprezto-contrib + +# Allow module overrides when pmodule-dirs causes module name collisions +# zstyle ':prezto:load' pmodule-allow-overrides 'yes' + +# Set the Zsh modules to load (man zshmodules). +# zstyle ':prezto:load' zmodule 'attr' 'stat' + +# Set the Zsh functions to load (man zshcontrib). +# zstyle ':prezto:load' zfunction 'zargs' 'zmv' + +# Set the Prezto modules to load (browse modules). +# The order matters. +zstyle ':prezto:load' pmodule \ + 'environment' \ + 'terminal' \ + 'editor' \ + 'history' \ + 'directory' \ + 'spectrum' \ + 'utility' \ + 'completion' \ + 'prompt' \ + 'git' \ + 'ssh' \ + 'python' + +# +# Autosuggestions +# + +# Set the query found color. +# zstyle ':prezto:module:autosuggestions:color' found '' + +# +# Completions +# + +# Set the entries to ignore in static */etc/hosts* for host completion. +# zstyle ':prezto:module:completion:*:hosts' etc-host-ignores \ +# '0.0.0.0' '127.0.0.1' + +# +# Editor +# + +# Set the key mapping style to 'emacs' or 'vi'. +zstyle ':prezto:module:editor' key-bindings 'emacs' + +# Auto convert .... to ../.. +# zstyle ':prezto:module:editor' dot-expansion 'yes' + +# Allow the zsh prompt context to be shown. +#zstyle ':prezto:module:editor' ps-context 'yes' + +# +# Git +# + +# submodules when they are 'dirty', 'untracked', 'all', or 'none'. +zstyle ':prezto:module:git:status:ignore' submodules 'all' + +# +# GNU Utility +# + +# Set the command prefix on non-GNU systems. +# zstyle ':prezto:module:gnu-utility' prefix 'g' + +# +# History Substring Search +# + +# Set the query found color. +zstyle ':prezto:module:history-substring-search:color' found '' + +# Set the query not found color. +zstyle ':prezto:module:history-substring-search:color' not-found '' + +# Set the search globbing flags. +zstyle ':prezto:module:history-substring-search' globbing-flags '' + +# +# macOS +# + +# Set the keyword used by `mand` to open man pages in Dash.app +# zstyle ':prezto:module:osx:man' dash-keyword 'manpages' + +# +# Pacman +# + +# Set the Pacman frontend. +# zstyle ':prezto:module:pacman' frontend 'yaourt' + +# +# Prompt +# + +# Set the prompt theme to load. +# Setting it to 'random' loads a random theme. +# Auto set to 'off' on dumb terminals. +zstyle ':prezto:module:prompt' theme 'sorin' + +# Set the working directory prompt display length. +# By default, it is set to 'short'. Set it to 'long' (without '~' expansion) +# for longer or 'full' (with '~' expansion) for even longer prompt display. +# zstyle ':prezto:module:prompt' pwd-length 'short' + +# Set the prompt to display the return code along with an indicator for non-zero +# return codes. This is not supported by all prompts. +# zstyle ':prezto:module:prompt' show-return-val 'yes' + +# +# Python +# + +# Auto switch the Python virtualenv on directory change. +zstyle ':prezto:module:python:virtualenv' auto-switch 'yes' + +# Automatically initialize virtualenvwrapper if pre-requisites are met. +zstyle ':prezto:module:python:virtualenv' initialize 'yes' + +# +# Ruby +# + +# Auto switch the Ruby version on directory change. +# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes' + +# +# Screen +# + +# Auto start a session when Zsh is launched in a local terminal. +# zstyle ':prezto:module:screen:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +# zstyle ':prezto:module:screen:auto-start' remote 'yes' + +# +# SSH +# + +# Set the SSH identities to load into the agent. +zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github' 'id_ed25519' + +# +# Syntax Highlighting +# + +# Set syntax highlighters. +# By default, only the main highlighter is enabled. +# zstyle ':prezto:module:syntax-highlighting' highlighters \ +# 'main' \ +# 'brackets' \ +# 'pattern' \ +# 'line' \ +# 'cursor' \ +# 'root' +# +# Set syntax highlighting styles. +# zstyle ':prezto:module:syntax-highlighting' styles \ +# 'builtin' 'bg=blue' \ +# 'command' 'bg=blue' \ +# 'function' 'bg=blue' +# +# Set syntax pattern styles. +# zstyle ':prezto:module:syntax-highlighting' pattern \ +# 'rm*-rf*' 'fg=white,bold,bg=red' + +# +# Terminal +# + +# Auto set the tab and window titles. +# zstyle ':prezto:module:terminal' auto-title 'yes' + +# Set the window title format. +# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s' + +# Set the tab title format. +# zstyle ':prezto:module:terminal:tab-title' format '%m: %s' + +# Set the terminal multiplexer title format. +# zstyle ':prezto:module:terminal:multiplexer-title' format '%s' + +# +# Tmux +# + +# Auto start a session when Zsh is launched in a local terminal. +zstyle ':prezto:module:tmux:auto-start' local 'yes' + +# Auto start a session when Zsh is launched in a SSH connection. +zstyle ':prezto:module:tmux:auto-start' remote 'yes' + +# Integrate with iTerm2. +# zstyle ':prezto:module:tmux:iterm' integrate 'yes' + +# Set the default session name: +zstyle ':prezto:module:tmux:session' name 'BASE_SESSION' + +# +# Utility +# + +# Enabled safe options. This aliases cp, ln, mv and rm so that they prompt +# before deleting or overwriting files. Set to 'no' to disable this safer +# behavior. +# zstyle ':prezto:module:utility' safe-ops 'yes' diff --git a/zshrc_old b/zshrc_old deleted file mode 100644 index 02eada1..0000000 --- a/zshrc_old +++ /dev/null @@ -1,69 +0,0 @@ -# -# Executes commands at the start of an interactive session. -# -# Authors: -# Sorin Ionescu -# - -# Source Prezto. -if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then - source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" -fi - -export PATH=$HOME/Documents/Arcanite/git_ci_runner:$PATH - -cheat(){ curl cheat.sh/"$1" } -alias lla='ls -al' -plugins=(git) -alias mux='tmuxinator' -export PATH=~/miniconda3/bin:$PATH -alias 'mux'=tmuxinator -cda() { conda activate "$@" } -cdd() { conda deactivate "$@" } -cdc() { conda create --name "$@" python=3.5 pip } -cdi() { conda info --envs "$@" } -ca() { pygmentize -g "$@" } -grepf() { grep -rnw ./ -e "$@"} -amendnow() { GIT_COMMITTER_DATE="$(date +%d/%m/%Y' '%H:%M:%S)" git commit --amend --no-edit --date "$(date +%d/%m/%Y' '%H:%M:%S)" } -continous-running() { while true; do inotifywait $1 -r -e close_write && ${@:2}; done } - -make_venv() { - echo $(basename $(pwd) | awk '{print "conda activate "$1}') > $(pwd | awk '{print $1"/.autoenv.zsh"}') - echo $(basename $(pwd) | awk '{print "conda deactivate "$1}') > $(pwd | awk '{print $1"/.autoenv_leave.zsh"}') -} - -alias pm='python manage.py' -alias sp='python manage.py shell_plus' -alias mkmg='python manage.py makemigrations' -alias mg='python manage.py migrate' -alias gp='git push' -alias rs='python manage.py runserver' -alias rs2='python manage.py runserver 127.0.0.2' -alias ga!='git commit --amend --no-edit --date now' - -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/home/legrems/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" -if [ $? -eq 0 ]; then - eval "$__conda_setup" -else - if [ -f "/home/legrems/miniconda3/etc/profile.d/conda.sh" ]; then - . "/home/legrems/miniconda3/etc/profile.d/conda.sh" - else - export PATH="/home/legrems/miniconda3/bin:$PATH" - fi -fi -unset __conda_setup -#<<< conda initialize <<< - -cd ~/Documents/Arcanite -export NB_MINIONS=4 -export VISUAL=nvim -export EDITOR=nvim - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - -eval $(thefuck --alias) - -# Customize to your needs... -source ~/.dotfiles/lib/zsh-autoenv/autoenv.zsh