Skip to content

Instantly share code, notes, and snippets.

@jamie-ga
Last active June 30, 2016 23:12
Show Gist options
  • Save jamie-ga/974fc72fd2ead60e99d5 to your computer and use it in GitHub Desktop.
Save jamie-ga/974fc72fd2ead60e99d5 to your computer and use it in GitHub Desktop.
Personal Vim Config for python development (still in progress)
# 0 is too far from ` ;)
set-option -g prefix F10
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
setw -g mode-mouse on
setw -g monitor-activity on
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
# 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
# copy into buffer mode
bind Escape copy-mode
bind -t vi-copy 'v' begin-selection
bind -t vi-copy 'y' copy-selection
# sync panes
bind m set synchronize-panes on
bind M set synchronize-panes off
set -g mouse-select-pane on
set -g mouse-resize-pane on
set -g mouse-select-window off
# tmux-vim-navigation
# uses Alt+arrow to navigate
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n M-Left if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n M-Down if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n M-Up if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n M-Right if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -n M-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
filetype off
"pathogen"
execute pathogen#infect()
"vim"
syntax on
filetype plugin indent on
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set number
set undofile
set wildignore=*.swp,*.bak,*.pyc,*.class
cabbr <expr> . expand('%:h')
"nnoremap / /\v
"vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
set wrap
set textwidth=89
set formatoptions=qrn1
"set colorcolumn=85
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
let mapleader=","
autocmd BufWritePre * :%s/\s\+$//e
"Disable arrow keys to use hjkl instead
"nnoremap <up> <nop>
"nnoremap <down> <nop>
"nnoremap <left> <nop>
"nnoremap <right> <nop>
"inoremap <up> <nop>
"inoremap <down> <nop>
"inoremap <left> <nop>
"inoremap <right> <nop>
"nnoremap j gj
"nnoremap k gk
"powerline"
set laststatus=2
set t_Co=256
let g:airline_powerline_fonts=1
"let g:airline_theme='papercolor'
"disable git-gutter from showing"
let g:airline#extensions#hunks#enabled=0
set statusline=%f "filename
set statusline+=\ %{fugitive#statusline()} "git indicator
set statusline+=\ %m "modified flag
set statusline+=\ %r "readonly flag
set statusline+=%= "left/right separator
set statusline+=%c, "cursor column
set statusline+=%l/%L "cursor line/total lines
set statusline+=\ %P "percent through file
" Flake8 ignores
" E121: continuation line under-indented for hanging indent
" E127: continuation line over-indented for visual indent
" E128: Continuation line under-indented for visual indent
" E302: Expected 2 blank lines, found 1
" E501: Line too long
" F999: Syntax error in doctest
" let g:syntastic_python_flake8_post_args = "--ignore=E121,E127,E128,E302,E501,F999"
let g:syntastic_python_flake8_post_args = "--ignore=E121,E127,E128,E501,F999"
" PyLint ignores
" C0301: Line too long
" C0103: Invalid name ... for type argument (should match [a-z_][a-z0-9_]{2,30}$)
" C010v3: Imports not grouped
" C0111: missing-docstring
" W0403: Relative Import
" E1101: no-member (usually django/inheritance based)
" C1001: old-style-class (`class Meta`)
" W0232: no-init (no __init__ method)
" R0903: too-few-public-methods (class Meta)
" C0103: invalid variable name (single letter)
let g:syntastic_python_pylint_post_args = '--msg-template="{path}:{line}:{column}:{C}: [{msg_id}:{symbol}] {msg}" --disable=C0301,W0142,C010v3,C0412,W0403,E1101,C1001,W0232,R0903,C0111,C0103'
"--msg-template='{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}' --disable=C0301,W0142,C010v3"
autocmd FileType python SyntasticCheck
" let g:syntastic_loc_list_height=3
@jamie-ga
Copy link
Author

jamie-ga commented Jul 15, 2015

autoload:

  • pathogen

bundles:

  • ag.vim
  • syntastic
  • vim-airline
  • vim-gitgutter
  • powerline
  • tabline.vim
  • vim-fugitive
  • vim-virtualenv
  • vim-tmux-navigator

Fonts: pathogen-fonts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment