Skip to content

Instantly share code, notes, and snippets.

@onetwopunch
Last active May 11, 2017 22:03
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 onetwopunch/2ee5f24435ea36a93194e9292a10481d to your computer and use it in GitHub Desktop.
Save onetwopunch/2ee5f24435ea36a93194e9292a10481d to your computer and use it in GitHub Desktop.
"External plugins used:
" Pathogen
" NERDTree
" AutoComplPop
" DetectIndent
" L9 for autocomplete
" ACK
"
"Use Vim settings, rather than Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
let g:NERDTreeDirArrows=0
let g:go_fmt_autosave=0
" Allows everything extracted in ~/.vim/bundle to be added to runtimepath
" For installing plugins
execute pathogen#infect()
" set tags to hidden tag file
set tags=./.tags;
:nnoremap <C-]> <C-w><C-]><C-w>T
" Make backspace behave in a sane manner.
set backspace=indent,eol,start
set tabstop=2
set shiftwidth=2
set smartindent
set expandtab
" Switch syntax highlighting on
syntax enable
set number
let g:molokai_original = 1
let g:rehash256 = 1
colorscheme molokai
"let g:solarized_termcolors=256
"colorscheme desert
set background=dark
"colorscheme solarized
set gfn=Monaco:h13
" clipboard
vnoremap <C-c> "*y
vnoremap <C-x> "*d
" tabs
nnoremap <C-S-Right> :tabnext<CR>
nnoremap <C-S-Left> :tabprevious<CR>
inoremap <C-S-Right> <Esc>:tabnext<CR>i
inoremap <C-S-Left> <Esc>:tabprevious<CR>i
" incremental search
set incsearch
set hlsearch
"Indent and tabs
autocmd BufReadPost * :DetectIndent
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
" Remove trailing whitespace on save
autocmd BufWritePost * :s/\s\+$//ge
autocmd BufWritePost *.* :s/\t/ /ge
autocmd BufWritePost Makefile :s/ /\t/ge
"autocomplete
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <NUL> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
inoremap <expr> <M-,> pumvisible() ? '<C-n>' :
\ '<C-o><C-n><C-p><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
" Enable file type detection and do language-dependent indenting.
filetype plugin indent on
" Enable mouse for iTerm
if has("mouse")
set mouse=a
endif
"let g:nerdtree_tabs_open_on_console_startup=1
" mappings
map ; :
map <Leader>n <plug>NERDTreeTabsToggle<CR>
function Tags()
! ctags -R -f .tags; if [ -e .gitignore ] ; then echo ".tags" >> .gitignore ; fi ;
endfunction
"ctrlp
set wildignore+=*/tmp/*,*.so,*.swp,*.swo,*.zip,*/bower_components/*,*/node_modules/*
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files']
" ack
" brew install the_silver_searcher
if executable('ag')
let g:ackprg = 'ag --vimgrep'
cnoreabbrev ag Ack
cnoreabbrev aG Ack
cnoreabbrev Ag Ack
cnoreabbrev AG Ack
endif
let g:ack_autoclose = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment