Skip to content

Instantly share code, notes, and snippets.

@mattparrilla
Created December 8, 2017 16:44
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 mattparrilla/ee8c18f505906c0c4d3a3a54aaa995d7 to your computer and use it in GitHub Desktop.
Save mattparrilla/ee8c18f505906c0c4d3a3a54aaa995d7 to your computer and use it in GitHub Desktop.
My .vimrc for my debian stretch machine
execute pathogen#infect()
" turn on filetype plugin for csv-vim to work
:filetype plugin on
" enable helptags for command-t
call pathogen#helptags()
" Enable syntax highlighting.
syntax on
" Auto Indent to same level as previos line
set ai
" Change terminal title to name of open file
set title
" Automatically indent when adding a curly bracket, etc. (extended via autocmd below)
set smartindent
set diffopt+=vertical
" Indent 1 tab after any line that starts with 1 of the cinwords if in .py file
autocmd BufRead *.py set smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class
" Use UTF-8.
set encoding=utf-8
" Tabs should be converted to a group of 4 spaces.
set shiftwidth=2
set tabstop=2
set softtabstop=2
set shiftround
set expandtab
set smarttab
" Spacing for C makefiles
autocmd FileType make setlocal noexpandtab
" Disable automatic comment insertion
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" Search as you type.
set incsearch
" highlight matches
set hlsearch
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
set guitablabel=%N:%M%t " Show tab numbers
" Ignore case when searching.
set ignorecase
" Show autocomplete menus.
set wildmenu
" Sets F5 to toggle NerdTree
map <F5> :NERDTreeToggle<CR>
" Sets F8 to toggle Tagbar
nmap <F8> :TagbarToggle<CR>
" Set font and fontsize for MacVim
" open Ack with Leader-a
map <leader>a :Ack! --ignore-dir=build<Space>
" allows you to copy and paste to outside programs easily
set clipboard=unnamedplus
" sort function to a key
map <Leader>s :sort i<CR>
" delete buffer shortcut
map <Leader>d :bdelete<Space>
" easier horizontal movement of code blocks
map < <gv
map > >gv
" Show line numbers and length
set number
" show colored column at character 80
set colorcolumn=80
highlight ColorColumn guibg=#073642
" disable backup and swap files
set nobackup
set nowritebackup
set noswapfile
" prevent minibufexplorer from losing undo history
set hid
" enable control + [hjkl] to window movement commands
let g:miniBufExplMapWindowNavVim = 1
" Enter values if ever want to turn off filetypes in syntastic
let g:syntastic_mode_map={'mode': 'active', 'passive_filetypes': ['html']}
""ignore line too long and bad visual indent for too long lines in syntastic
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_python_flake8_args='--ignore=E501,E128,E127,E403'
" use clang_check for c++ files
let g:syntastic_cpp_checkers = ['gcc']
"tell command-t to search current directory down
let g:CommandTTraverseSCM='pwd'
" tell command-t to ignore certain directories
let g:CommandTWildIgnore=&wildignore . "**/bower_components/*,**/node_modules/*,**/venv/*,**/build/*"
" Per-directory .vimrc files
set exrc
set secure
" Set color scheme
if has("gui_running")
colorscheme solarized
set background=dark
set lines=60
set columns=100
set guioptions-=m "remove menu bar
set guioptions-=T "remove toolbar
set guioptions-=r "remove right hand scroll bar
set guioptions-=L "remove right hand scroll bar
endi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment