Skip to content

Instantly share code, notes, and snippets.

@sheilatron
Created February 18, 2016 01:59
Show Gist options
  • Save sheilatron/83ccd0e5c4072210612b to your computer and use it in GitHub Desktop.
Save sheilatron/83ccd0e5c4072210612b to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/config/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
"Plugin 'andviro/flake8-vim'
"Plugin 'ervandew/supertab'
"Plugin 'klen/python-mode'
" See https://github.com/nvie/vim-flake8
Plugin 'nvie/vim-flake8'
let g:flake8_cmd="/usr/bin/flake8"
Plugin 'wincent/Command-T'
"Plugin 'mileszs/ack.vim'
call vundle#end()
" Misc ************************************************************************
"" Show line numbers
set number
" set vb t_vb= " Turn off the bell, this could be more annoying
"" Add matching for the % command below in addition to the defaults
set matchpairs+=<:>
" Terminal environment
set ttyfast
set ttyscroll=0
" Tabs ************************************************************************
set shiftwidth=4 " set shiftwidth to my code defaults (3 spaces)
set expandtab " auto expand tabs
set smarttab
set shiftround
set tabstop=4
set softtabstop=4
" Auto identation ************************************************************
set autoindent
" Cursor highlights ***********************************************************
set nocursorline " Ensure that the cursor's line is not highlighted
"set cursorcolumn
if has("autocmd")
au InsertEnter * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
au InsertLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape block"
au VimLeave * silent execute "!gconftool-2 --type string --set /apps/gnome-terminal/profiles/Default/cursor_shape ibeam"
endif
" Searching * *****************************************************************
"set incsearch " incremental search, search as you type
set hlsearch " highlight search
"set ignorecase " Ignore case when searching
"set smartcase " Ignore case when searching lowercase
"set gdefault " Use 'g' flag by default with :s/foo/bar/.
"This unsets the "last search pattern" register by hitting return
command Unsearch :let @/ = ""
" Vim UI *****************************************************************
"set showcmd " shows what you type for a command
"set modeline " Enable modeline display
"set ruler " Show ruler
"set noerrorbells
"set cmdheight=1 " the command bar is 1 high
"set laststatus=2
"set statusline=%F%m%r%h%w\ (%{&ff}){%Y}\ [%l,%v][%p%%]
" Plugins *********************************************************************
" pathogen to manage plugins
"set nocp
"set rtp+=/home/sallen/config/.vim/autoload
"source ~/config/.vim/autoload/pathogen.vim
"execute pathogen#infect()
" Load filetype plugins from my .vim/ files
":filetype on
:filetype plugin indent on
" Enable syntax highlighting
:syntax on
" Useful Abbreviations ******************************************************
" NOTE: map works in command mode
" NOTE: map! works in insert mode
"" Miscellaneous finger-savers
"map q :q<CR> " exit vim with q if no changes were made
"map ;N :set number<CR> " toggle line numbers on with ;N
"map ;n :set nonumber<CR> " toggle line numbers off with ;n
"temp disable: imap jk <Esc>
inoremap <C-s> <esc>:w<cr>a<esc> " control-s saves all buffers at once
nnoremap <C-s> :w<cr>a<esc>
"" Coding shortcuts... auto close parens and brackets
"map! ( ()<ESC>ha
"map! [ []<ESC>ha
""HTML Hacks
" Print an empty <a> tag.
"map! ;h <a href=""></a><ESC>5hi
" Wrap an <a> tag around the URL under the cursor... cursor must be at the
" beginning of the url
" map ;H lBi<a href="<ESC>Ea"></a><ESC>3hi
" Paths ****************************************************************
" command shortcut CDC = Change to Directory of Current file
command CDC cd %:p:h
" command shortcut CDCE = Change to Directory of Current file, edit
" current dir.
command CDCE cd %:p:h:e.
" On Save **************************************************************
" auto delete trailing whitespace for particular file types
autocmd FileType c,cpp,java,php,py autocmd BufWritePre <buffer> :%s/\s\+$//e
"SmartIndent (fror Python)
"im :<CR> :<CR><TAB>
set background=dark
colorscheme solarized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment