Restructuring a bit

This commit is contained in:
Josh Sherman 2016-10-09 22:59:55 -05:00
parent 6f2fcc141a
commit e1790b60e2
7 changed files with 0 additions and 0 deletions

View file

@ -1,2 +0,0 @@
highlight ExtraWhitespace ctermbg=red ctermfg=white

View file

@ -1,2 +0,0 @@
*
!.gitignore

2
vim/swap/.gitignore vendored
View file

@ -1,2 +0,0 @@
*
!.gitignore

2
vim/undo/.gitignore vendored
View file

@ -1,2 +0,0 @@
*
!.gitignore

245
vim/vimrc
View file

@ -1,245 +0,0 @@
filetype detect
filetype plugin on
filetype indent on
" All those configuration variables
set autoindent
set autoread
set background=dark
set backspace=eol,start,indent
set colorcolumn=80
set cursorline
set encoding=utf8
set expandtab
set foldmethod=marker
set hidden
set history=1000
set hlsearch
set ignorecase
set incsearch
set laststatus=2
set lazyredraw
set list
set listchars=tab:└─,trail:•
set magic
set mat=2
set nocindent
set nocompatible
set noerrorbells
set novisualbell
set pastetoggle=<F2>
set rtp+=~/.dotfiles/.vundle/
set shiftwidth=4
set showmatch
set smartcase
set so=7
set softtabstop=4
set t_Co=256
set tabstop=4
set title
"set titlestring=%t%(\ %M%)%(\ (%{expand(\"%:p:h\")})%)%(\ %a%)
set tm=500
set ttyfast
set undolevels=1000
set wildmenu
set wildmode=list:longest
" Sets up our filetypes
autocmd BufNewFile,BufRead *.dust,*.dustjs,*.tl set filetype=dustjs
autocmd BufNewFile,BufRead *.less set filetype=less
autocmd BufNewFile,BufRead nginx.conf set filetype=nginx
autocmd BufNewFile,BufRead *.mustache,*.hogan,*.hulk,*.hjs set filetype=html.mustache syntax=mustache
autocmd BufNewFile,BufRead *.handlebars,*.hbs set filetype=html.handlebars syntax=mustache
autocmd FileType javascript,dustjs,handlebars,css,scss setlocal tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType go setlocal noexpandtab
" Automatically wraps markdown and text to 80 columns
if &filetype == 'markdown' || &filetype == 'text'
set textwidth=80
set wrapmargin=2
else
set smartindent
set textwidth=0
endif
set backupdir=~/.vim/backup//,/tmp
set directory=~/.vim/swap//,/tmp
set undodir=~/.vim/undo//,/tmp
set undofile
call vundle#rc()
Plugin 'gmarik/vundle'
Plugin 'bling/vim-airline'
Plugin 'bling/vim-bufferline'
Plugin 'cakebaker/scss-syntax.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'ervandew/supertab'
Plugin 'garbas/vim-snipmate'
Plugin 'groenewege/vim-less'
Plugin 'hail2u/vim-css3-syntax'
Plugin 'honza/vim-snippets'
Plugin 'jimmyhchan/dustjs.vim'
Plugin 'joshtronic/php.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'nanotech/jellybeans.vim'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'pangloss/vim-javascript.git'
"Plugin 'SirVer/ultisnips'
Plugin 'scrooloose/syntastic'
Plugin 'shawncplus/phpcomplete.vim'
Plugin 'tmux-plugins/vim-tmux'
Plugin 'tomtom/tlib_vim'
"Plugin 'Valloric/YouCompleteMe'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'vim-scripts/AfterColors.vim'
Plugin 'vim-scripts/matchit.zip'
call vundle#end()
filetype plugin indent on
syntax enable
set background=dark
colorscheme jellybeans
autocmd BufEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhiteSpace /\s\+$/
highlight ExtraWhitespace ctermbg=red guibg=red
highlight LineTooLong ctermbg=red guibg=red
match LineTooLong /\%121v.\+/
let mapleader = ','
let g:airline_powerline_fonts = 1
let g:airline_section_c = '%t'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline#extensions#tabline#show_tab_nr = 0
let g:airline#extensions#tabline#buffer_idx_mode = 1
nmap <leader>1 <Plug>AirlineSelectTab1
nmap <leader>2 <Plug>AirlineSelectTab2
nmap <leader>3 <Plug>AirlineSelectTab3
nmap <leader>4 <Plug>AirlineSelectTab4
nmap <leader>5 <Plug>AirlineSelectTab5
nmap <leader>6 <Plug>AirlineSelectTab6
nmap <leader>7 <Plug>AirlineSelectTab7
nmap <leader>8 <Plug>AirlineSelectTab8
nmap <leader>9 <Plug>AirlineSelectTab9
let b:match_words = '<:>,<tag>:</tag>'
let g:SuperTabDefaultCompletionType = 'context'
"let g:indent_guides_start_level = 2
"let g:indent_guides_guide_size = 1
" Auto pastetoggle
" let &t_SI .= "\<Esc>[?2004h"
" let &t_EI .= "\<Esc>[?2004l"
" inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
" Not entirely sure I need this. Auto pastetoggle within tmux
"
" function! XTermPasteBegin()
" set pastetoggle=<Esc>[201~
" set paste
" return ""
" endfunction
"
" function! WrapForTmux(s)
" if !exists('$TMUX')
" return a:s
" endif
"
" let tmux_start = "\<Esc>Ptmux;"
" let tmux_end = "\<Esc>\\"
"
" return tmux_start . substitute(a:s, "\<Esc>", "\<Esc>\<Esc>", 'g') . tmux_end
" endfunction
"
" let &t_SI .= WrapForTmux("\<Esc>[?2004h")
" let &t_EI .= WrapForTmux("\<Esc>[?2004l")
"
" function! XTermPasteBegin()
" set pastetoggle=<Esc>[201~
" set paste
" return ""
" endfunction
"
" inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
nmap <silent> ,/ :nohlsearch<CR>
nnoremap ; :
nnoremap <Leader>[ :bprevious<CR>
nnoremap <Leader>] :bnext<CR>
nnoremap <Leader>f :set nolist<CR>
nnoremap <Leader>F :set list<CR>
nnoremap <Leader>3 :set nonumber<CR>
nnoremap <Leader># :set number<CR>
nnoremap <Leader>b :BundleUpdate<CR>:q<CR>
nnoremap <Leader>c :w<CR>:!wc %<CR>
nnoremap <Leader>v :so ~/.vim/vimrc<CR>
nnoremap <Leader>ss / $<CR>
nnoremap <Leader>tt /\t$<CR>
nnoremap <leader>d "_d
vnoremap <leader>d "_d
vnoremap <leader>p "_dP
" nnoremap <Leader>w :wa<CR>
" nnoremap <Leader>ww :wa!<CR>
" nnoremap <Leader>q :qa<CR>
syntax on
syntax sync fromstart
vnoremap * :<C-u>call <SID>VSetSearch()<CR>//<CR>
" vnoremap # :<C-u>call <SID>VSetSearch()<CR>??<CR>
" Jumps to last cursor position except on commit messages
autocmd BufReadPost * call SetCursorPosition()
function! SetCursorPosition()
if &filetype !~ 'svn\|commit\|issue\c'
if line("'\"") > 0 && line("'\"") <= line("$")
exe "normal! g`\""
normal! zz
endif
endif
endfunction
" Search for selected text
function! s:VSetSearch()
let temp = @@
norm! gvy
let @/ = '\V' . substitute(escape(@@, '\'), '\n', '\\n', 'g')
let @@ = temp
endfunction
" Ignore some folders and files for CtrlP indexing
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.yardoc\|public$|log\|tmp$',
\ 'file': '\.so$\|\.dat$|\.DS_Store$'
\ }
" if executable('ag')
" let g:ctrlp_user_command = 'ag --ignore-case --nogroup --hidden --follow
" \ -U -p ~/.agignore
" \ -l -m 50000
" \ %s -g ""'
" endif