Skip to content

Instantly share code, notes, and snippets.

@lbragstad
Last active December 4, 2018 21:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lbragstad/f6f1b2e07aaa776c2d268426dfbf977e to your computer and use it in GitHub Desktop.
Save lbragstad/f6f1b2e07aaa776c2d268426dfbf977e to your computer and use it in GitHub Desktop.
Dotfiles
" Set tabs to 4 spaces
set tabstop=4
" Use 4 spaces for auto indentation
set shiftwidth=4
" Use 4 spaces for tabs when editing
set softtabstop=4
" Number of space to use when replacing tabs
set expandtab
" insert or remove blanks according to shiftwidth,
" tabstop, and softtabstop
set smarttab
" Highlight all the python things
let g:python_highlight_all = 1
" Make it easier to see differences between spaces and tabs
set list
" Automatically set line wrapping to 79 characters for pep8 and
" set a highlighter at 79 characters
set textwidth=79
if exists("&colorcolumn")
set colorcolumn=79
hi ColorColumn ctermbg=darkgrey
endif
" Mappings
vmap <C-c><C-c> <Plug>SendSelectionToTmux
nmap <C-c><C-c> <Plug>NormalModeSendToTmux
nmap <C-c>r <Plug>SetTmuxVars
nnoremap <space> za
vnoremap <space> zf
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
inoremap <C-j> <Esc>:m .+1<CR>==gi
inoremap <C-k> <Esc>:m .-2<CR>==gi
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
" Run python linter when writing files
" FIXME: This should be a conditional operation and only
" done if flake8 is actually installed.
autocmd BufWritePost *.py call Flake8()
filetype off
set nocompatible
execute pathogen#infect()
filetype plugin on
filetype plugin indent on
" Use a custom color scheme
colorscheme synthetic
" Appearance
syntax on
syntax enable
set number
set t_Co=256
set background=dark
set cursorline
" Behavior
set hlsearch
set noerrorbells
" Don't beep or flash
set vb t_vb=
" Don't wrap long lines
set nowrap
" Attempt to do smart indentation
set smartindent
set autoindent
" Add pair matching for <>
set matchpairs+=<:>
" Use 2 spaces for tabs
set softtabstop=2
set shiftround
" Cursor buffer
set scrolloff=100
" use `~` as a trailing character
set listchars=trail:~
" Perform search while typing
set incsearch
" Make search case insensitive
set ignorecase
" Override 'ignorecase' if using upper case characters
set smartcase
" Allow backspacing over auto-indentation, line breaks, and insert
set backspace=indent,eol,start
" Show line and column number of cursor
set ruler
" Put the full file path in the status line
set statusline+=%F
" Look for location of tags
set tags=./TAGS;/,TAGS;/
" Fold based on indentation
set foldmethod=indent
" Maximum of 3 folds
set foldnestmax=5
" Set word wrapping at 70 characters when writing commit messages
let filename = expand("%")
if matchend(filename, "COMMIT_EDITMSG") > 0
set tw=70
set colorcolumn=70
hi ColorColumn ctermbg=darkgrey
endif
" Highlight in Visual mode
highlight Visual ctermbg=Grey ctermfg=NONE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment