Commit 766d0f9
Changed files (1)
vimrc
@@ -62,18 +62,6 @@ set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
set showmatch " briefly jump to the matching bracket.
-nnoremap / /\v
-vnoremap / /\v
-nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
-command! -nargs=+ -complete=file -bar FindInFiles silent! grep! <args>|cwindow|redraw!
-nnoremap F :FindInFiles<SPACE>
-nnoremap <C-p> :FZF<cr>
-
-if executable('ag')
- let g:ackprg = 'ag --nogroup --nocolor --column'
- set grepprg=ag\ --nogroup\ --nocolor " the silver searcher
-endif
-
" }}}}
"" Wild settings {{{{
@@ -111,73 +99,31 @@ set backupdir=/tmp//
set directory=/tmp//
" }}}}
-"" Helpers {{{{
-""
-
-" Some file types should wrap their text
-function! s:setupWrapping()
- set wrap
- set linebreak
- set textwidth=80
- set nolist
-endfunction
-
-" }}}}
-
"" File type-specific settings {{{{
""
filetype plugin indent on " Turn on filetype plugins (:help filetype-plugin)
if has("autocmd")
- " In Makefiles, use real tabs, not tabs expanded to spaces
- au FileType make setlocal noexpandtab
-
- " This actually might be confusing, but the plugin +ruby+ already does
- " this, so we want to do it only if the plugin +ruby+ is disabled for
- " some reason
- " Set the Ruby filetype for a number of common Ruby files without .rb
- au BufRead,BufNewFile {Gemfile,Rakefile,RakeFile,Vagrantfile,Thorfile,Procfile,Guardfile,config.ru,*.rake} set ft=ruby
-
- " Make sure all mardown files have the correct filetype set and setup wrapping
- au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} setf markdown
- au FileType markdown call s:setupWrapping()
-
- " Treat JSON files like JavaScript
+ au BufNewFile,BufRead *.hql set ft=hive expandtab
+ au BufNewFile,BufRead *.html set nowrap
au BufNewFile,BufRead *.json set ft=javascript
-
- " make Python follow PEP8 for whitespace ( http://www.python.org/dev/peps/pep-0008/ )
- au FileType python setlocal softtabstop=4 tabstop=4 shiftwidth=4
-
- " for .hql files
- au BufNewFile,BufRead *.hql set filetype=hive expandtab
-
- " for .q files
- au BufNewFile,BufRead *.q set filetype=hive expandtab
-
+ au BufNewFile,BufRead *.q set ft=hive expandtab
+ au BufRead,BufNewFile *.eco set ft=html
+ au BufRead,BufNewFile *.es6 set ft=javascript
+ au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn,txt} set ft=markdown
au BufRead,BufNewFile {*.handlebars,*.hbs} set ft=handlebars syntax=handlebars
-
- " Remember last location in file, but not for commit messages.
- " see :help last-position-jump
- au BufReadPost * if &filetype !~ '^git\c' && line("'\"") > 0 && line("'\"") <= line("$")
- \| exe "normal! g`\"" | endif
-
+ au BufRead,BufNewFile {Gemfile,Rakefile,RakeFile,Vagrantfile,Thorfile,Procfile,Guardfile,config.ru,*.rake} set ft=ruby
au FocusLost * :w
- autocmd BufNewFile *.rb :write
- autocmd BufNewFile,BufRead *.html setlocal nowrap
" \c comment out line.
- autocmd FileType javascript nnoremap <buffer> <localleader>c I//<esc>
- autocmd FileType python nnoremap <buffer> <localleader>c I#<esc>
- autocmd FileType ruby nnoremap <buffer> <localleader>c I#<esc>
- autocmd FileType html nnoremap <buffer> <localleader>c I<!--<esc>A--><esc>
-
- " turn on spell checker
- autocmd FileType markdown nnoremap setlocal spell
-
- autocmd FileType html :iabbrev <buffer> r' ’
- autocmd BufRead,BufNewFile *.es6 setfiletype javascript
- autocmd BufRead,BufNewFile *.eco setfiletype html
+ au FileType javascript nnoremap <buffer> <localleader>c I// <esc>
+ au FileType python nnoremap <buffer> <localleader>c I# <esc>
+ au FileType ruby nnoremap <buffer> <localleader>c I# <esc>
+ au FileType html nnoremap <buffer> <localleader>c I<!--<esc>A--><esc>
+ au FileType make setlocal noexpandtab
+ au FileType python setlocal softtabstop=4 tabstop=4 shiftwidth=4
+ au FileType markdown nnoremap setlocal spell
endif
augroup filetype_vim
@@ -248,7 +194,7 @@ noremap <Up> gk
nnoremap <leader>hs :set hlsearch! hlsearch?<CR>
" Adjust viewports to the same size
-noremap <Leader>= <C-w>=
+noremap <leader>= <C-w>=
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
nnoremap <leader>sv :source $MYVIMRC<cr>
@@ -292,17 +238,30 @@ nnoremap L $
" escape
inoremap jk <esc>
nnoremap <C-e> :e#<cr>
-nnoremap <localleader>f :Ack<space>
" NERDComToggleComment
nmap <localleader>/ <leader>c<space>
vmap <localleader>/ <leader>c<space>
-" redraw the screen
-nnoremap <leader>f :redraw!<cr>
" git fugitive
nnoremap <leader>gs :Gstatus<cr>
nnoremap <leader>gb :Gblame<cr>
+nnoremap / /\v
+vnoremap / /\v
+nnoremap K :grep! "\b<C-R><C-W>\b"<CR>:cw<CR>
+command! -nargs=+ -complete=file -bar FindInFiles silent! grep! <args>|cwindow|redraw!
+nnoremap <localleader>F :Ag<space>
+nnoremap <localleader>f :Ack<space>
+nnoremap <C-n> :GFiles<cr>
+nnoremap <C-p> :FZF<cr>
+nnoremap <leader>b :Buffers<cr>
+
+if executable('ag')
+ let g:ackprg = 'ag --nogroup --nocolor --column'
+ set grepprg=ag\ --nogroup\ --nocolor " the silver searcher
+endif
+
+
" }}}}
"" Status Line {{{{