Skip to content

Instantly share code, notes, and snippets.

@luisehk
Last active May 12, 2021 17:05
Show Gist options
  • Save luisehk/c44f8a35769696a88a5520772ccf98f1 to your computer and use it in GitHub Desktop.
Save luisehk/c44f8a35769696a88a5520772ccf98f1 to your computer and use it in GitHub Desktop.
.vimrc, .tmux.conf and .bash_aliases
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-cpu'
set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-online-status'
set -g status-right '#{prefix_highlight} Online: #{online_status} | Battery: #{battery_percentage} | #{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
set -g @prefix_highlight_bg 'blue'
# Restore all programs on restart
set -g @resurrect-processes ':all:'
# vi is good
setw -g mode-keys vi
set -g mouse off
# use vim-like keys for splits and windows
bind-key v split-window -h
bind-key s split-window -v
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key a last-pane
bind-key q display-panes
bind-key c new-window
bind-key t next-window
bind-key T previous-window
# resize panes
bind-key -r -T prefix M-k resize-pane -U 5
bind-key -r -T prefix M-j resize-pane -D 5
bind-key -r -T prefix M-h resize-pane -L 5
bind-key -r -T prefix M-l resize-pane -R 5
bind-key -r -T prefix C-k resize-pane -U
bind-key -r -T prefix C-j resize-pane -D
bind-key -r -T prefix C-h resize-pane -L
bind-key -r -T prefix C-l resize-pane -R
# Allow the arrow key to be used immediately after changing windows
set-option -g repeat-time 250
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
set nocompatible " 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 'gmarik/Vundle.vim'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
Plugin 'vim-scripts/indentpython.vim'
Plugin 'scrooloose/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'tpope/vim-fugitive'
Plugin 'kien/ctrlp.vim'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" general
set encoding=utf-8
let python_highlight_all=1
syntax on
set number
set clipboard=unnamed
set showcmd
set cursorline
set showmatch
set lazyredraw
" stop stupid sounds
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
" :W sudo saves the file
" (useful for handling the permission-denied error)
command W w !sudo tee % > /dev/null
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" themes
if has('gui_running')
set background=dark
colorscheme solarized
else
colorscheme zenburn
endif
call togglebg#map("<F5>")
" search
set incsearch
set hlsearch
set ignorecase
nnoremap <leader><space> :nohlsearch<CR>
" split screen
set splitbelow
set splitright
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>
" Useful mappings for managing tabs
map <C-c> :tabnew<cr>
" nerdtree auto open/close and key map
map <C-g> :NERDTreeToggle<CR>
let NERDTreeShowHidden=1
autocmd vimenter * NERDTree
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" python
au BufNewFile,BufRead *.py setlocal tabstop=4 softtabstop=4 shiftwidth=4 textwidth=79 expandtab autoindent fileformat=unix
" web
au BufNewFile,BufRead *.js setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.css setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
au BufNewFile,BufRead *.html setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
" hide pyc files from file tree
let NERDTreeIgnore=['\.pyc$', '\~$']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment