Skip to content

Instantly share code, notes, and snippets.

@justinkelly
Last active July 30, 2017 05:17
Show Gist options
  • Save justinkelly/77de91d101cdf3845ac66bb75179aeab to your computer and use it in GitHub Desktop.
Save justinkelly/77de91d101cdf3845ac66bb75179aeab to your computer and use it in GitHub Desktop.
Tmux Conf
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
# Highlight active window
set-window-option -g window-status-current-bg red
set -g default-terminal "screen-256color"
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
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
set-option -g mouse on
# make scrolling with wheels work
#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
#bind -n WheelDownPane select-pane -t= \; send-keys -M
setw -g monitor-activity on
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 M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-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 M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-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
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind r source-file ~/.tmux.conf
# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'<Paste>
" first some settings copied from Debian config
set nocompatible " no compatibility with old-skool vi
set backspace=indent,eol,start " define behavior of backspace key
set history=1000 " keep more history (was 50 in" Debian config)
" and some other default options, just to be sure
set encoding=utf-8 " by default set the encoding to" UTF-8
set fileformats=unix,dos,mac " also read mac files correctly, just in case we are dealing with that
"
set nowrap " disable wrapping of text
set number " show line numbers by default
set t_Co=256 " force the terminal to use 256 colors
set showcmd " show the current command in the statusline
set foldlevelstart=99 " by default, open all folds
set foldmethod=indent " indent fold method by default
set mouse=a " enable the mouse
set mousemodel=popup " produce pop up for right click
"set list " show special chars, such as tab and eol
set laststatus=2 " always show the statusline
set title " set the title
"set ruler " show cursor position in left bottom corner
set splitbelow " open a new horizontal window below the current window instead of above
set scrolloff=3 " minimal number of screen lines to keep above and below the cursor.
set sidescrolloff=3 " minimal number of screen columns to keep next to the cursor
set sidescroll=5 " horizontally scroll 5 characters, instead of centering the cursor
set wildmenu " show command line completions
set wildmode=longest:full " complete mode for wildmenu
set wildmode+=full " when pressing tab a second time, fully complete
set wildignorecase " ignore case when completing filenames
set linebreak " only wrap after words, not inside words
set cursorline " highlight the current line
"set cursorcolumn " highlight the current column
set completeopt=menu,longest,preview " options for insert mode completion
set spell " enable spell check by default
set tabstop=2 " number of spaces that a tab counts for
set shiftwidth=2 " number of spaces to use for each step of indent
set softtabstop=2 " number of spaces that a tab counts for while editing
set shiftround " round the indent to a multiple of shiftwidth
set expandtab " expand tabs to spaces
set autoindent " automatically indent a new line
set formatoptions+=r " automatic formatting: auto insert current comment leader after enter
set virtualedit=block,onemore " allow cursor after end of line in visual block mode and allow cursor one char after line end
set display+=lastline " display wrapped lines at bottom instead of @ symbols
if v:version > '702'
set colorcolumn=80,120 " show a vertical line at these positions
endif
set fillchars=vert:\ ,fold:- " fill vertical splitlines with spaces instead of the ugly |-char; Default - for folds
set diffopt+=iwhite " diff options: ignore whitespace
set incsearch " while searching, immediately show first match
set ignorecase " ignore case in (search) patterns
set smartcase " when the (search) pattern contains uppercase chars, don't ignore case
set hlsearch " highlight all the matches for the search (disable until next search with :noh)
set directory=~/.vimswaps,.,/tmp " where to store the swap files
set noswapfile " disable swap files, most of the time they are just annoying
set nobackup " don't make a (permanent) backup when saving files
set writebackup " make a (temporary) backup while saving files
set backupcopy=yes " make a copy and overwrite the original file
if v:version > '702'
set undodir=~/.vimundo,.,/tmp " where to save undo history files
endif
"Sao instead of ctrl-w then j, it’s just ctrl-j:
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"More natural split opening
"Open new split panes to right and bottom, which feels more natural than Vim’s default:
set splitbelow
set splitright
"slow scrol
set lazyredraw
set re=1
set ttyfast
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
"Plug 'https://github.com/plan9-for-vimspace/acme-colors'
Plug 'https://github.com/igungor/schellar'
Plug 'https://github.com/morhetz/gruvbox'
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
"Plug 'junegunn/vim-easy-align'
"Plug 'flazz/vim-colorschemes'
Plug 'tpope/vim-fugitive'
Plug 'https://github.com/itchyny/lightline.vim'
Plug 'https://github.com/scrooloose/syntastic'
Plug 'airblade/vim-gitgutter'
" Group dependencies, vim-snippets depends on ultisnips
"Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" Add plugins to &runtimepath
call plug#end()
let g:lightline = {
\ 'colorscheme': 'wombat',
\ }
set laststatus=2
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
let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd']
let g:syntastic_quiet_messages = { "type": "style" }
set background=dark
colorscheme gruvbox
" set cursorline
" hi CursorLine ctermbg=8 ctermfg=15 "8 = dark gray, 15 = white
" hi Cursor ctermbg=15 ctermfg=8
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
" Shorthand notation; fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
"Plug 'https://github.com/airblade/vim-gitgutter'
"Plug 'mhinz/vim-signify'
Plug 'jpo/vim-railscasts-theme'
Plug 'morhetz/gruvbox'
Plug 'romainl/Apprentice'
Plug 'sickill/vim-monokai'
Plug 'albertorestifo/github.vim'
Plug 'encody/nvim'
Plug 'vim-syntastic/syntastic'
" Add plugins to &runtimepath
call plug#end()
colorscheme gruvbox
set background=dark
set number
set tabstop=2
set shiftwidth=2
set expandtab
let g:syntastic_php_checkers = ['php']
nmap <silent> <A-Up> :wincmd k<CR>
nmap <silent> <A-Down> :wincmd j<CR>
nmap <silent> <A-Left> :wincmd h<CR>
nmap <silent> <A-Right> :wincmd l<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment