Skip to content

Instantly share code, notes, and snippets.

@mrboli
Created June 17, 2020 18:14
Show Gist options
  • Save mrboli/00c69989a0acaed51c1884a8bccf0cc0 to your computer and use it in GitHub Desktop.
Save mrboli/00c69989a0acaed51c1884a8bccf0cc0 to your computer and use it in GitHub Desktop.
June 2020 dotfiles
# 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 set-titles-string '#S - #W'
set -g set-titles-string '~'
set -g status-keys vi
setw -g mode-keys vi
set -g history-limit 10000
setw -g monitor-activity on
set -sg escape-time 0
# Resizing Shortcuts
bind -nr C-Right resize-pane -R 3
bind -nr C-Left resize-pane -L 3
bind -nr C-Down resize-pane -D 3
bind -nr C-Up resize-pane -U 3
# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-\ select-pane -l
# Last Used Pane Zoom Swap
bind -nr C-g last-pane \; resize-pane -Z
bind -nr C-z resize-pane -Z
# Powerline
set-option -g default-terminal "screen-256color"
source /usr/local/lib/python2.7/dist-packages/powerline/bindings/tmux/powerline.conf
# Yank
run-shell ~/code/opensource/tmux-yank/yank.tmux
# Tmux Sessions
set -g @plugin 'tmux-plugins/tmux-resurrect'
set nocompatible
filetype indent on
filetype plugin on
syntax on
" Install Plugins via Pathogen
" execute pathogen#infect('~/.vim/bundle/{}')
execute pathogen#infect()
" Variables
let mapleader = "\<Space>"
" set timeoutlen = 200
nnoremap <C-\> :set invpaste paste?<CR>
set pastetoggle=<C-\>
set showmode
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
" Display
set number
set rnu
set showcmd
set cursorline
set colorcolumn=120
set wildmenu
set showmatch
set hlsearch
set noswapfile
set foldmethod=indent
set foldlevel=99
" Indent Guides
set background=dark
colorscheme default
let g:indent_guides_enable_on_vim_startup = 0
let g:indent_guides_auto_colors = 0
let g:indent_guides_guide_size = 1
let g:indent_guides_start_level = 2
hi IndentGuidesOdd ctermbg=236
hi IndentGuidesEven ctermbg=235
let g:indentLine_color_term = 239
let g:indentLine_char = '┊'
let g:indentLine_setConceal = 1
" COC
let g:coc_global_extensions = [
\ 'coc-tsserver'
\ ]
" Clear highlighting on escape in normal mode
nnoremap <esc> :noh<return><esc>
" nnoremap <esc>^[ <esc>^[
" Plugin Configurations
let NERDTreeShowHidden=1
nnoremap <Leader>3 :NERDTreeToggle<CR>
" Trigger a highlight in the appropriate direction when pressing these keys:
let g:qs_highlight_on_keys = ['f', 'F', 't', 'T']
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
nnoremap <leader>e :CtrlPMRUFiles<cr>
nnoremap <leader>b :CtrlPBuffer<cr>
nnoremap <leader>t :CtrlPBufTag<cr>
nnoremap <leader>T :CtrlPTag<cr>
" nnoremap <leader>r :CtrlPRTS<cr>
map <leader>r :NERDTreeFind<cr>
nnoremap <leader>l :CtrlPLine<cr>
nnoremap <leader>5 :CtrlPClearCache<cr>
let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_start_word_key = '<C-r>'
let g:multi_cursor_select_all_word_key = '<A-r>'
let g:multi_cursor_start_key = 'g<C-r>'
let g:multi_cursor_select_all_key = 'g<A-r>'
let g:multi_cursor_next_key = '<C-r>'
let g:multi_cursor_prev_key = '<C-S-r>'
let g:multi_cursor_skip_key = '<C-x>'
let g:multi_cursor_quit_key = '<Esc>'
" Powerline
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
" Always show statusline
set laststatus=2
" Use 256 colours (Use this setting only if your terminal supports 256 colours)
set t_Co=256
" Cntrl + hjkl mapping
imap <C-h> <C-o>h
imap <C-j> <C-o>j
imap <C-k> <C-o>k
imap <C-l> <C-o>l
" Scrappy way to space out JSX properties
let @f= 'Whs
W:let line = getline(".")
:if line !~ "/</" | exe "norm @f" | endif
'
" ReactGotoDef()
noremap <leader>D :call ReactGotoDef()<CR>
drwxr-xr-x 6 bo bo 4096 May 11 10:57 ctrlp.vim
drwxr-xr-x 8 bo bo 4096 May 11 15:46 dracula
drwxr-xr-x 8 bo bo 4096 Mar 21 21:00 emmet-vim
drwxr-xr-x 6 bo bo 4096 Mar 21 21:04 indentline
drwxr-xr-x 10 bo bo 4096 Mar 21 12:26 nerdtree
drwxr-xr-x 4 bo bo 4096 Mar 21 20:55 nerdtree-git-plugin
drwxr-xr-x 6 bo bo 4096 May 18 10:06 quick-scope
drwxr-xr-x 8 bo bo 4096 May 11 08:14 tagbar
drwxr-xr-x 8 bo bo 4096 May 11 10:41 tcomment_vim
drwxr-xr-x 5 bo bo 4096 Mar 21 12:23 tmux-navigator
drwxr-xr-x 10 bo bo 4096 Mar 21 12:32 tsuquyomi
drwxr-xr-x 8 bo bo 4096 Mar 21 19:53 typescript-vim
drwxr-xr-x 7 bo bo 4096 May 11 10:33 vim-closer
drwxr-xr-x 9 bo bo 4096 Mar 21 21:00 vim-fugitive
drwxr-xr-x 13 bo bo 4096 Mar 21 12:32 vim-graphql
drwxr-xr-x 5 bo bo 4096 Mar 21 20:05 vim-hybrid-material
drwxr-xr-x 7 bo bo 4096 Mar 21 12:29 vim-indent-guides-0
drwxr-xr-x 9 bo bo 4096 Mar 21 19:51 vim-javascript
drwxr-xr-x 7 bo bo 4096 Mar 21 12:32 vim-json
drwxr-xr-x 5 bo bo 4096 May 11 08:19 vim-jsx
drwxr-xr-x 5 bo bo 4096 May 11 15:31 vim-jsx-typescript
drwxr-xr-x 11 bo bo 4096 Mar 21 12:31 vim-markdown
drwxr-xr-x 8 bo bo 4096 Mar 21 20:56 vim-multiple-cursors
drwxr-xr-x 5 bo bo 4096 May 11 10:34 vim-react-goto-definition
drwxr-xr-x 4 bo bo 4096 May 11 10:33 vim-react-snippets
drwxr-xr-x 5 bo bo 4096 Mar 21 12:31 vim-repeat
drwxr-xr-x 5 bo bo 4096 May 11 15:30 vim-styled-components
drwxr-xr-x 6 bo bo 4096 Mar 21 12:26 vim-surround
drwxr-xr-x 5 bo bo 4096 Mar 21 20:14 xterm-color-table.vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment