Skip to content

Instantly share code, notes, and snippets.

@jacoborus
Last active July 23, 2017 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jacoborus/2ca57c8b4a24c88f279c to your computer and use it in GitHub Desktop.
Save jacoborus/2ca57c8b4a24c88f279c to your computer and use it in GitHub Desktop.
tmux + vim configuration
# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# UTF is great, let us use that
set -g utf8
set-window-option -g utf8 on
# Tmux should be pretty, we need 256 color for that
set -g default-terminal "screen-256color"
# Tmux uses a 'control key', let's set it to 'Ctrl-a'
# Reason: 'Ctrl-a' is easier to reach than 'Ctrl-b'
set -g prefix C-a
unbind C-b
# command delay? We don't want that, make it short
set -sg escape-time 1
# Set the numbering of windows to go from 1 instead
# of 0 - silly programmers :|
set-option -g base-index 1
setw -g pane-base-index 1
# Allow us to reload our Tmux configuration while
# using Tmux
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Getting interesting now, we use the vertical and horizontal
# symbols to split the screen
bind | split-window -h
bind - split-window -v
# enable scrolling with mouse
set -g mode-mouse on
# Mouse mode
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on
set -g pane-border-fg colour243
set -g pane-active-border-fg colour243
set -g pane-active-border-bg colour243
# status bar
set -g status-bg colour243
set -g status-fg black
# enable activity alerts
setw -g monitor-activity on
set -g visual-activity on
# Center the window list
set -g status-justify centre
# Scrollback/History limit
set -g history-limit 2048
set -g @fpp-key 'm'
set -g @yank_selction 'clipboard'
# List of plugins
# Supports `github_username/repo` or full git repo URLs
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-yank \
tmux-plugins/tpm \
jbnicolai/tmux-fpp \
'
# Other examples:
# github_username/plugin_name \
# git@github.com/user/plugin \
# git@bitbucket.com/user/plugin \
# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell '~/.tmux/plugins/tpm/tpm'
set nocompatible " be iMproved, required
filetype off " required
set nocompatible
filetype plugin on
runtime macros/matchit.vim
" show quotes in json files
let g:vim_json_syntax_conceal = 0
" Highlight current line
set cursorline
" Open new split panes to right and bottom
set splitbelow
set splitright
" Fold indentation, but not at start
set foldmethod=indent
set nofoldenable
" Set to auto read when a file is changed from the outside
set autoread
" Enable mouse scrolling
set mouse=a
" Indent guides color and character
let g:indentLine_color_term = 239
let g:indentLine_char = ''
set number
set relativenumber
let g:localvimrc_ask=0
set tabstop=2 softtabstop=2 expandtab shiftwidth=2 smarttab
" 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 'gmarik/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'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" 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/'}
" Avoid a name conflict with L9
"Plugin 'user/L9', {'name': 'newL9'}
Plugin 'airblade/vim-gitgutter'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-fugitive'
Plugin 'itchyny/lightline.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'tpope/vim-surround'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'moll/vim-node'
Plugin 'myusuf3/numbers.vim'
Plugin 'digitaltoad/vim-jade'
Plugin 'embear/vim-localvimrc'
Plugin 'arecarn/fold-cycle.vim'
" Plugin 'garbas/vim-snipmate'
Plugin 'tpope/vim-commentary'
Plugin 'scrooloose/nerdtree'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'Raimondi/delimitMate'
Plugin 'dyng/ctrlsf.vim'
Plugin 'Yggdroot/indentLine'
Plugin 'regedarek/ZoomWin'
Plugin 'mattn/emmet-vim'
Plugin 'pricco/vim-monokai'
Plugin 'suan/vim-instant-markdown'
Plugin 'terryma/vim-multiple-cursors'
" SYNTASTIC
set statusline+=%#WARNINGMSG#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" 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
colorscheme monokai
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" status line
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'mode_map': { 'ñ': 'NORMAL' },
\ 'component': {
\ 'readonly': '%{&readonly?"":""}',
\ },
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
\ },
\ 'component_function': {
\ 'modified': 'MyModified',
\ 'readonly': 'MyReadonly',
\ 'fugitive': 'MyFugitive',
\ 'fileformat': 'MyFileFormat',
\ 'filename': 'MyFilename',
\ 'filetype': 'MyFiletype',
\ 'fileencoding': 'MyFileencoding',
\ 'mode': 'MyMode',
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\ }
function! MyModified()
return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! MyReadonly()
return &ft !~? 'help\|vimfiler\|gundo' && &readonly ? '' : ''
endfunction
function! MyFilename()
return ('' != MyReadonly() ? MyReadonly() . ' ' : '') .
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != MyModified() ? ' ' . MyModified() : '')
endfunction
function! MyFugitive()
if winwidth(0) > 90
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
let _ = fugitive#head()
return strlen(_) ? ''._ : ''
endif
endif
return ''
endfunction
function! MyFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! MyFiletype()
return winwidth(0) > 60 ? (strlen(&filetype) ? &filetype : 'no ft') : ''
endfunction
function! MyFileencoding()
return winwidth(0) > 100 ? (strlen(&fenc) ? &fenc : &enc) : ''
endfunction
function! MyMode()
return winwidth(0) > 120 ? lightline#mode() : ''
endfunction
highlight ExtraWhitespace ctermbg=52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment