Skip to content

Instantly share code, notes, and snippets.

@rosscooperman
Created March 4, 2019 15:48
Show Gist options
  • Save rosscooperman/71da3fe90b6ee28882c3968bf1122fd8 to your computer and use it in GitHub Desktop.
Save rosscooperman/71da3fe90b6ee28882c3968bf1122fd8 to your computer and use it in GitHub Desktop.
total 0
drwxr-xr-x@ 40 ross staff 1280 Feb 8 16:03 .
drwxr-xr-x@ 9 ross staff 288 Aug 21 2012 ..
drwxr-xr-x@ 9 ross staff 288 Aug 21 2012 ack.vim
drwxr-xr-x@ 9 ross staff 288 Jul 16 2015 base16-vim
drwxr-xr-x@ 7 ross staff 224 Aug 1 2017 brightscript.vim
drwxr-xr-x@ 8 ross staff 256 Aug 21 2012 ctrlp.vim
drwxr-xr-x@ 6 ross staff 192 Sep 24 2014 greplace.vim
drwxr-xr-x@ 8 ross staff 256 Nov 22 2013 handlebars
drwxr-xr-x@ 12 ross staff 384 Sep 23 2014 html5.vim
drwxr-xr-x@ 7 ross staff 224 Aug 21 2012 nerdcommenter
drwxr-xr-x@ 11 ross staff 352 Aug 21 2012 nerdtree
drwxr-xr-x@ 6 ross staff 192 Dec 8 2013 php.vim
drwxr-xr-x@ 5 ross staff 160 Mar 19 2014 sh.vim
drwxr-xr-x@ 12 ross staff 384 Jun 16 2015 swift.vim
drwxr-xr-x@ 10 ross staff 320 Aug 27 2012 textile.vim
drwxr-xr-x@ 8 ross staff 256 Aug 29 2012 tlib
drwxr-xr-x@ 7 ross staff 224 Aug 29 2012 vim-addon-mw-utils
drwxr-xr-x@ 13 ross staff 416 Jul 24 2014 vim-airline
drwxr-xr-x@ 8 ross staff 256 Oct 13 2012 vim-arduino
drwxr-xr-x@ 18 ross staff 576 Aug 29 2012 vim-coffee-script
drwxr-xr-x@ 8 ross staff 256 Apr 22 2013 vim-colors-solarized
drwxr-xr-x@ 14 ross staff 448 Jan 23 2016 vim-elixir
drwxr-xr-x@ 7 ross staff 224 Aug 21 2012 vim-fugitive
drwxr-xr-x@ 16 ross staff 512 Aug 20 2014 vim-go
drwxr-xr-x@ 6 ross staff 192 May 22 2013 vim-indent-object
drwxr-xr-x@ 11 ross staff 352 Jul 15 2015 vim-javascript
drwxr-xr-x@ 14 ross staff 448 Mar 6 2018 vim-jsx-improve
drwxr-xr-x@ 8 ross staff 256 Oct 25 13:05 vim-pug
drwxr-xr-x@ 8 ross staff 256 Aug 21 2012 vim-rails
drwxr-xr-x@ 10 ross staff 320 Aug 31 2012 vim-rdoc
drwxr-xr-x@ 21 ross staff 672 Apr 16 2015 vim-ruby
drwxr-xr-x@ 10 ross staff 320 Feb 4 2018 vim-stylus
drwxr-xr-x@ 10 ross staff 320 May 24 2017 vim-submode
drwxr-xr-x@ 7 ross staff 224 Feb 3 2014 vim-surround
drwxr-xr-x@ 24 ross staff 768 Jun 12 2015 vim-terraform
drwxr-xr-x@ 8 ross staff 256 Jul 16 2015 vim-tmux-navigator
drwxr-xr-x@ 7 ross staff 224 Jul 16 2015 vim-unimpaired
drwxr-xr-x@ 8 ross staff 256 Feb 8 16:03 vim-varnish
drwxr-xr-x@ 11 ross staff 352 Jul 11 2015 yajs.vim
drwxr-xr-x@ 5 ross staff 160 Apr 25 2013 zoom.vim
"" load plugins from ~/.vim/bundle
call pathogen#infect()
"" general settings
set hidden
let mapleader = ","
set nowrap
set autoread
set history=1000
if has("gui_running")
set guioptions=egmt
endif
set backupdir=~/.vimtmp
set directory=~/.vimtmp
"" cursor settings
if !has("gui_running")
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
endif
"" statusline settings
function! Current_branch(...)
if !exists('b:git_dir')
return ''
endif
return ' (' . fugitive#head(7) . ')'
endfunction
set laststatus=2
set statusline=%h%w\ %f\ (#%n)\ %y\ [%l:%c]\ %LL\ (%p%%)%{Current_branch()}\ %m
"" function to modernize Ruby code
function! ModernizeRuby()
%s/:\(\w\+\)\(\s*=>\s*\)/\1: /gce
endfunction
command! ModernizeRuby call ModernizeRuby()
"" indentation settings
filetype plugin on
filetype indent on
set autoindent
set expandtab
set shiftwidth=2
set tabstop=2
set softtabstop=2
set backspace=indent,eol,start
set pastetoggle=<F2>
"" tab completion settings
set wildmenu
set wildmode=list:longest,full
"" look and feel (margins, colors, etc)
set t_Co=256
let base16colorspace=256
colorscheme base16-eighties
syntax enable
set background=dark
set number
set cul
set guifont=Source\ Code\ Pro\ for\ Powerline:h13
set textwidth=100
set colorcolumn=120
set wrapmargin=0
set list listchars=trail:·,tab:~\ ,extends:#,nbsp:.
"" customize the default color scheme a little bit
set fillchars=vert:\|,stl:\ ,stlnc:\
hi StatusLine guibg=#DDDDDD guifg=#222222
hi StatusLineNC guibg=#BBBBBB guifg=#222222
hi VertSplit guibg=#DDDDDD
hi Search guibg=LightBlue
hi Normal ctermbg=Black
"" customize file type associations
au BufRead,BufNewFile *.rss.erb let b:eruby_subtype="xml"
au BufRead,BufNewFile *.rss.erb setf eruby
au BufRead,BufNewFile *.rabl setf ruby
au BufRead,BufNewFile Fastfile setf ruby
au BufRead,BufNewFile *.pde setf c
"" search settings
set hlsearch
nnoremap <silent> <Space> :nohlsearch<Bar>:echo<CR>
set grepprg="ack -H --nocolor --nogroup --column --type-set log=.log --nolog --ignore-dir=tmp --ignore-dir=node_modules --ignore-dir=vendor --ignore-dir=coverage --ignore-dir=bower_components --ignore-dir=dist"
let g:grep_cmd_opts = '--noheading'
"" mappings
map <D-F> :Ack
map <leader>t :set ft=
map <leader>m :ModernizeRuby<CR>
imap jj <esc>
imap <leader>w ysiw
noremap <leader>a :Ack! "<cword>"<CR>
nmap <silent> <leader>s :set spell!<CR>
noremap <leader>j :%!python -m json.tool<CR>
map <C-c> "*y
call submode#enter_with('grow/shrink', 'n', '', '<leader>=', '<C-w>+')
call submode#enter_with('grow/shrink', 'n', '', '<leader>-', '<C-w>-')
call submode#map('grow/shrink', 'n', '', '=', '<C-w>+')
call submode#map('grow/shrink', 'n', '', '-', '<C-w>-')
"" automatically strip trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
"" custom settings for Go
autocmd filetype go set nolist
let g:go_fmt_command = "goimports"
"" NERDTree plugin configuration
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
nmap <leader>n :NERDTreeToggle<CR>
nmap <leader>N :NERDTreeFind<CR>
let NERDTreeShowHidden=1
"" Ack.vim plugin configuration
let g:ackprg="ack -H --nocolor --nogroup --column --type-set log=.log --nolog --ignore-dir=dist --ignore-dir=build --ignore-dir=tmp --ignore-dir=node_modules --ignore-dir=vendor --ignore-dir=coverage --ignore-dir=bower_components"
"" CtrlP plugin configuration
let g:ctrlp_open_new_file = "t"
let g:ctrlp_custom_ignore = { 'dir': '\v[\/](\.git|dist|log|tmp|vendor|node_modules|bower_components|coverage|public\/docs|public\/uploads|db\/fixtures|Godeps\/_workspace)$', 'file': '\v\.(gitkeep)$' }
"" airline plugin configuration
let g:airline_theme='powerlineish'
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:airline#extensions#tabline#enabled = 1
let airline#extensions#tabline#show_buffers = 0
"" vim-javascript configuration
let g:javascript_plugin_flow = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment