Skip to content

Instantly share code, notes, and snippets.

@dipta10
Last active November 16, 2021 17:36
Show Gist options
  • Select an option

  • Save dipta10/30290dd42e8ac6cc11fada48bd5f82c8 to your computer and use it in GitHub Desktop.

Select an option

Save dipta10/30290dd42e8ac6cc11fada48bd5f82c8 to your computer and use it in GitHub Desktop.
Environment Setup: Vim, Tmux, Zsh, Vifm.
PATH=/opt/local/bin:$PATH
export PATH=/usr/local/bin:$PATH
source ~/.bashrc
#source ~/.vimrc
#source ~/.tmux.conf
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
if [ -n "$BASH_VERSION" ] && [ -f $HOME/.bashrc ];then
source $HOME/.bashrc
fi
[ -f "$HOME/.bashrc" ] && source "$HOME/.bashrc"
alias vi=vim
alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'
alias hello='echo hello world'
alias vi=vim
alias vim='/Applications/MacVim.app/Contents/MacOS/Vim'
alias brc='vim ~/.bashrc'
alias src='source ~/.bashrc';
#Compiling C++ files
alias rn='g++ -std=c++14 test.cpp;
./a.out'
alias rni='g++ -std=c++14 test.cpp;
./a.out < input'
#input 1-5
alias rni1='g++ -std=c++14 test.cpp;
./a.out < input1'
alias rni2='g++ -std=c++14 test.cpp;
./a.out < input2'
alias rni3='g++ -std=c++14 test.cpp;
./a.out < input3'
alias rni4='g++ -std=c++14 test.cpp;
./a.out < input4'
alias rni5='g++ -std=c++14 test.cpp;
./a.out < input5'
alias rns='./test.swift'
alias run='g++ -std=c++14'
alias out='./a.out'
rnf () {
g++ -std=c++14 $1;
./a.out;
}
alias match='diff myoutput answer'
#Compiling Java Files
alias rnj='javac test.java
java test';
rnjf () {
x="$1"
#echo "${x: : -5}"
javac $1
java "${x: : -5}"
}
alias rnji='javac test.java
java test < input';
#Compiling Java Files
alias rnp='python3 test.py'
alias rnpi='python3 test.py < input'
#bookmarking directory
alias practice="cd /Users/dipta10/dropbox/practice"
alias programming="cd /Users/dipta10/dropbox/programming\\ diary"
alias algo="cd /Users/dipta10/dropbox/programming\\ diary/algorithm\\ template"
alias sol="cd /Users/dipta10/dropbox/programming\\ diary/solved\\ problems"
alias tutorial="cd /Users/dipta10/dropbox/programming\\ diary/tutorialProb"
alias code="cd /Users/dipta10/dropbox/programming\\ diary/code"
alias desktop="cd /Users/dipta10/Desktop";
#alias programming="cd /Users/dipta10/"
# Set prefix to space
unbind C-b
set -g prefix C-a
# show the current pane highlighted
set-option -g pane-active-border-fg red
set-window-option -g window-status-current-bg blue
# Vim-like key bindings for pane navigation (default uses cursor keys).
#unbind h
#bind h select-pane -L
#unbind j
#bind j select-pane -D
#unbind k
#bind k select-pane -U
#unbind l # normally used for last-window
#bind l select-pane -R
#fix scrolling for tmux with xterm2
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
#@error: for some reason the mouse mode doesn't work here!
#mouse mode
# Mouse support - set to on if you want to use the mouse
#setw -g mode-mouse off
#set -g mouse-select-pane off
#set -g mouse-resize-pane off
#set -g mouse-select-window off
set-window-option -g automatic-rename on
#set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
setw -g mode-keys vi
#setw -g mode-mouse on
#for mouse scrolling
set-option -g mouse on
setw -g monitor-activity on
#vim vi mode default
#set-window-option -g mode-keys vi
bind-key v split-window -h
bind-key s split-window -v
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key C-j resize-pane -D
bind-key C-k resize-pane -U
bind-key C-h resize-pane -L
bind-key C-l resize-pane -R
# Vim style pane selection
#bind h select-pane -L
#bind j select-pane -D
#bind k select-pane -U
#bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n C-h select-pane -L
bind -n C-j select-pane -D
bind -n C-k select-pane -U
bind -n C-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
#bind -n M-Left select-pane -L
#bind -n M-Right select-pane -R
#bind -n M-Up select-pane -U
#bind -n M-Down select-pane -D
# Shift arrow to switch windows
#bind -n S-Left previous-window
#bind -n S-Right next-window
# Shift arrow to switch windows
bind -n C-b previous-window
bind -n C-n next-window
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind r source-file ~/.tmux.conf
bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# save before reboot plugin!
set -g @continuum-boot 'on'
#set -g @continuum-boot-options 'iterm'
set -g @continuum-boot-options 'iterm,fullscreen'
#set -g default-command "reattach-to-user-namespace -l ${SHELL}"
#unbind -t vi-copy Enter
#bind -t vi-copy Enter copy-pipe "pbcopy"
#bind -t vi-copy y copy-pipe "pbcopy"
#bind -t vi-copy MouseDragEnd1Pane copy-pipe "pbcopy"
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com/user/plugin'
# set -g @plugin 'git@bitbucket.com/user/plugin'
#copy to system clipboard
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
set runtimepath+=~/.vim_runtime
"auto-reloading-a-file-in-vim-as-soon-as-it-changes-on-disk
set autoread | au CursorHold * checktime | call feedkeys("lh")
nmap <CR> :w<CR>
"nmap <C-s> :w<CR>
"inoremap <C-x> <Esc>O<Esc>jA
"inoremap <Backspace-C> <Esc>ldge
"nnoremap <Backspace-C> <Esc>ldge
"CR = Enter Key
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
"Map Ctrl-Backspace to delete the previous word in insert mode.
":imap <C-BS> <C-W>
"inoremap <C-BS> <C-W>
:set backspace=indent,eol,start
"nnoremap <C-w> i<C-\><C-o>dB
"inoremap <C-w> <C-\><C-o>dB
"inoremap <C-BS> <C-\><C-o>db
let macvim_skip_colorscheme = 1
syntax enable
"set background=dark
let g:airline_powerline_fonts = 1
let g:syntastic_swift_checkers = ['swiftpm', 'swiftlint']
set guifont=Ubuntu\ Mono\ derivative\ Powerline\ Bold:h20
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
"vundle starts
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}
"Plugin 'Valloric/YouCompleteMe'
Plugin 'edkolev/tmuxline.vim'
"./ultisnips snippet starts here
" Track the engine.
Plugin 'SirVer/ultisnips'
" Snippets are separated from the engine. Add this if you want them:
Plugin 'honza/vim-snippets'
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger = "<nop>"
inoremap <expr> <CR> pumvisible() ? "<C-R>=UltiSnips#ExpandSnippetOrJump()<CR>" : "\<CR>"
"let g:UltiSnipsJumpForwardTrigger="<>"
"let g:UltiSnipsJumpBackwardTrigger="<>"
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
"./ultisnips snippet ends here
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"vundle ends
set number
set relativenumber
syntax enable
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
let g:go_version_warning = 0
"set spell spelllang=en_us
"ctrl-backspace
"noremap <BS> <Esc>db
" this allows you to copy from vim to the system clipboard.
set clipboard=unnamed
"don't know what it does
set mouse=a
"inoremap <C-space> <C-n>
"using ctrl-space for autocomplete
if has("gui_running")
" C-Space seems to work under gVim on both Linux and win32
" inoremap <C-Space> <C-n>
else " no gui
if has("unix")
" inoremap <Nul> <C-n>
else
" I have no idea of the name of Ctrl-Space elsewhere
endif
endif
"Pathogen
execute pathogen#infect()
let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_SR = "\<Esc>]50;CursorShape=2\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
try
source ~/.vim_runtime/my_configs.vim
catch
endtry
# Partially stolen from https://bitbucket.org/mblum/libgp/src/2537ea7329ef/.ycm_extra_conf.py
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
#'-Wc++98-compat',
'-Wno-long-long',
'-Wno-variadic-macros',
'-fexceptions',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c++14',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x', 'c++',
# This path will only work on OS X, but extra paths that don't exist are not
# harmful
'-isystem', '/System/Library/Frameworks/Python.framework/Headers',
'-isystem', '/usr/local/include',
'-isystem', '/usr/local/include/eigen3',
'-I', 'include'
'-I.'
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
#
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
if compilation_database_folder:
database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
database = None
def DirectoryOfThisScript():
return os.path.dirname( os.path.abspath( __file__ ) )
def MakeRelativePathsInFlagsAbsolute( flags, working_directory ):
if not working_directory:
return list( flags )
new_flags = []
make_next_absolute = False
path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ]
for flag in flags:
new_flag = flag
if make_next_absolute:
make_next_absolute = False
if not flag.startswith( '/' ):
new_flag = os.path.join( working_directory, flag )
for path_flag in path_flags:
if flag == path_flag:
make_next_absolute = True
break
if flag.startswith( path_flag ):
path = flag[ len( path_flag ): ]
new_flag = path_flag + os.path.join( working_directory, path )
break
if new_flag:
new_flags.append( new_flag )
return new_flags
def FlagsForFile( filename ):
if database:
# Bear in mind that compilation_info.compiler_flags_ does NOT return a
# python list, but a "list-like" StringVec object
compilation_info = database.GetCompilationInfoForFile( filename )
final_flags = MakeRelativePathsInFlagsAbsolute(
compilation_info.compiler_flags_,
compilation_info.compiler_working_dir_ )
else:
relative_to = DirectoryOfThisScript()
final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to )
return {
'flags': final_flags,
'do_cache': True
}
# Path to your oh-my-zsh installation.
export ZSH=/Users/dipta10/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git npm ssh-agent)
# Rupa z
# https://www.youtube.com/watch?v=qbNn5zJLZU0&index=10&list=PLu8EoSxDXHP7tXPJp5ZmUpuT7sFvrswzf
# brew install z
. `brew --prefix`/etc/profile.d/z.sh
# User configuration
# Always work in a tmux session if tmux is installed
# https://github.com/chrishunt/dot-files/blob/master/.zshrc
if which tmux 2>&1 >/dev/null; then
if [ $TERM != "screen-256color" ] && [ $TERM != "screen" ]; then
tmux attach -t hack || tmux new -s hack; exit
fi
fi
export EDITOR='vim'
source $ZSH/oh-my-zsh.sh
####### BASH PROFILE #######
export HOME_FOLDER="/Users/dimitar.danailov"
export PATH="/Users/dimitar.danailov/.rvm/gems/ruby-2.1.5/bin:/Users/dimitar.danailov/.rvm/gems/ruby-2.1.5@global/bin:/Users/dimitar.danailov/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dimitar.danailov/.rvm/bin"
# export MANPATH="/usr/local/man:$MANPATH"
source ~/.bash_profile
source ~/.bashrc
source ~/.profile
export NVM_DIR="/Users/$USER/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/dipta10/.oh-my-zsh"
#Here I have to source my bash_profile
source ~/.bash_profile
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"
# Set list of themes to pick from when loading at random
# Setting this variable when ZSH_THEME=random will cause zsh to load
# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/
# If set to an empty array, this variable will have no effect.
# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion.
# Case-sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# You can set one of the optional three formats:
# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# or set a custom format using the strftime function format specifications,
# see 'man strftime' for details.
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
--VIM:
Vundle.vim
YCM-Generator
YouCompleteMe
command-t
commentary
fonts
iCompleteMe
output
sparkup
swift.vim
syntastic
tlib_vim
tmuxline.vim
ultisnips
vim
vim-addon-mw-utils
vim-airline
vim-airline-themes
vim-colors-solarized
vim-fugitive
vim-iterm-settings
vim-matchmaker
vim-sensible
vim-snipmate
vim-snippets
--TMUX:
output
plugins
resurrect
" VIFM COLORS
" solarized dark
" based on: https://github.com/istib/dotfiles/blob/master/vifm/vifm-colors
" Default = -1 = None, can be used for transparency or default color
" Black = 0
" Red = 1
" Green = 2
" Yellow = 3
" Blue = 4
" Magenta = 5
" Cyan = 6
" White = 7
" STYLES
" bold
" underline
" reverse or inverse
" standout
" none
highlight clear
highlight Win cterm=none ctermfg=default ctermbg=none
highlight TopLine cterm=none ctermfg=blue ctermbg=none
highlight TopLineSel cterm=none ctermfg=blue ctermbg=none
highlight StatusLine cterm=none ctermfg=blue ctermbg=none
highlight Border cterm=none ctermfg=blue ctermbg=none
highlight Selected cterm=bold ctermfg=magenta ctermbg=blue
highlight CurrLine cterm=bold ctermfg=default ctermbg=blue
highlight WildMenu cterm=underline,reverse ctermfg=white ctermbg=black
highlight CmdLine cterm=none ctermfg=white ctermbg=black
highlight ErrorMsg cterm=none ctermfg=red ctermbg=black
highlight Directory cterm=none ctermfg=cyan ctermbg=default
highlight Link cterm=none ctermfg=yellow ctermbg=default
highlight BrokenLink cterm=none ctermfg=red ctermbg=default
highlight Socket cterm=none ctermfg=magenta ctermbg=default
highlight Device cterm=none ctermfg=red ctermbg=default
highlight Fifo cterm=none ctermfg=cyan ctermbg=default
highlight Executable cterm=none ctermfg=green ctermbg=default
" vim: filetype=vifm :
" Sample configuration file for vifm on OSX (last updated: 21 January, 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=vim
set vicmd='/Applications/MacVim.app/Contents/MacOS/Vim'
" 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 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<tab>).
" 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 solarized-dark
" 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
set slowfs=curlftpfs
" 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! 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.
" Spaces in an app name will have to be escaped e.g. QuickTime\ Player.app
" 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
filetype *.pdf
\ {Open in Preview}
\ open -a Preview.app,
\ {Open in Skim}
\ open -a Skim.app,
fileviewer *.pdf pdftotext -nopgbrk %c -
" PostScript
filetype *.ps,*.eps open -a Preview.app
" Djvu
filetype *.djvu open -a MacDjView.app
" Audio
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
\ {Play using MPlayerX}
\ open -a MPlayerX.app,
\ {Open in iTunes}
\ open -a iTunes.app,
\ {Open in QuickTime Player}
\ open -a QuickTime\ Player.app,
fileviewer *.mp3 mp3info
fileviewer *.flac soxi
" Video
filetype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\*.as[fx]
\ {Open in VLC}
\ open -a VLC.app,
\ {Open in QuickTime Player}
\ open -a QuickTime\ Player.app,
\ {Open in MPlayerX}
\ open -a MPlayerX.app,
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
filetype *.html,*.htm
\ {Open in Safari}
\ open -a Safari.app,
\ {Open in Firefox}
\ open -a Firefox.app,
\ {Open in Chrome}
\ open -a Google\ Chrome.app,
\ {Open in vim}
\ vim,
fileviewer *.html,*.htm w3m -dump -T text/html
" Object
filetype *.o nm %f | less
" Man page
filetype *.[1-8] man ./%c
fileviewer *.[1-8] man ./%c | col -b
" Image
filetype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
\ open -a Preview.app,
fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
\ convert -identify %f -verbose /dev/null
" 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,
" Torrent
filetype *.torrent open -a Transmission.app
fileviewer *.torrent dumptorrent -v %c
" Extract zip files
filetype *.zip unzip %f
fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c
" Extract tar archives
filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz tar -xf %f
fileviewer *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz tar -tf %f
" Extract .bz2 archives
filetype *.bz2 bzip2 -d %f
" Extract .gz files
filetype *.gz gunzip %f
" Mount .dmg archives
filetype *.dmg open
" Mount disk .img
filetype *.img open
" Open .pkg binaries
filetype *.pkg open
" Office files
filetype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ppt open -a LibreOffice.app
fileviewer *.doc antiword -
fileviewer *.docx, docx2txt.pl %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 OS X:
" filetype * open
" ------------------------------------------------------------------------------
" 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<cr>
" Display sorting dialog
nnoremap S :sort<cr>
" Toggle visibility of preview window
nnoremap w :view<cr>
vnoremap w :view<cr>gv
" Open file in new MacVim tab
nnoremap o :!mvim --remote-tab-silent %f<cr>
" Open file in new MacVim window
nnoremap O :!mvim %f<cr>
" Open file in the background using its default program
nnoremap gb :!open -g %f<cr>
" Yank current directory path into the clipboard
nnoremap yd :!printf %d | pbcopy<cr>
" Yank current file path into the clipboard
nnoremap yf :!printf %c:p | pbcopy<cr>
" View preview in Quick Look
nnoremap q :!qlmanage -p %f > /dev/null 2>&1<cr>
" Mappings for faster renaming
nnoremap I cw<c-a>
nnoremap cc cw<c-u>
nnoremap A cw
" Open editor to edit vifmrc and apply settings after returning to vifm
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
" Open MacVim to edit vifmrc
nnoremap ,C :!mvim --remote-tab-silent $MYVIFMRC &<cr>
" Toggle wrap setting on ,w key
nnoremap ,w :set wrap!<cr>
" Example of standard two-panel file managers mappings
nnoremap <f3> :!less %f<cr>
nnoremap <f4> :edit<cr>
nnoremap <f5> :copy<cr>
nnoremap <f6> :move<cr>
nnoremap <f7> :mkdir<space>
nnoremap <f8> :delete<cr>
" ------------------------------------------------------------------------------
" 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 <left> <nop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment