Fixed some vimrc stuff
This commit is contained in:
parent
804c920cda
commit
509096059a
@ -7,7 +7,6 @@ ln -s $(pwd)/hushlogin ~/.hushlogin
|
|||||||
ln -s $(pwd)/vim ~/.vim
|
ln -s $(pwd)/vim ~/.vim
|
||||||
ln -s $(pwd)/vimrc ~/.vimrc
|
ln -s $(pwd)/vimrc ~/.vimrc
|
||||||
ln -s $(pwd)/vimrc.bundles ~/.vimrc.bundles
|
ln -s $(pwd)/vimrc.bundles ~/.vimrc.bundles
|
||||||
ln -s $(pwd)/vimrc.local ~/.vimrc.local
|
|
||||||
ln -s $(pwd)/zshrc ~/.zshrc
|
ln -s $(pwd)/zshrc ~/.zshrc
|
||||||
|
|
||||||
# Setup vim
|
# Setup vim
|
||||||
|
67
vimrc
67
vimrc
@ -1,6 +1,7 @@
|
|||||||
" Use Vim settings, rather then Vi settings. This setting must be as early as
|
" Use Vim settings, rather then Vi settings. This setting must be as early as
|
||||||
" possible, as it has side effects.
|
" possible, as it has side effects.
|
||||||
set nocompatible
|
set nocompatible
|
||||||
|
colorscheme monokai
|
||||||
|
|
||||||
" Leader
|
" Leader
|
||||||
let mapleader = " "
|
let mapleader = " "
|
||||||
@ -18,9 +19,7 @@ set autowrite " Automatically :write before running commands
|
|||||||
|
|
||||||
" Switch syntax highlighting on, when the terminal has colors
|
" Switch syntax highlighting on, when the terminal has colors
|
||||||
" Also switch on highlighting the last used search pattern.
|
" Also switch on highlighting the last used search pattern.
|
||||||
if (&t_Co > 2 || has("gui_running")) && !exists("syntax_on")
|
|
||||||
syntax on
|
syntax on
|
||||||
endif
|
|
||||||
|
|
||||||
if filereadable(expand("~/.vimrc.bundles"))
|
if filereadable(expand("~/.vimrc.bundles"))
|
||||||
source ~/.vimrc.bundles
|
source ~/.vimrc.bundles
|
||||||
@ -39,27 +38,16 @@ augroup vimrcEx
|
|||||||
\ exe "normal g`\"" |
|
\ exe "normal g`\"" |
|
||||||
\ endif
|
\ endif
|
||||||
|
|
||||||
" Cucumber navigation commands
|
|
||||||
autocmd User Rails Rnavcommand step features/step_definitions -glob=**/* -suffix=_steps.rb
|
|
||||||
autocmd User Rails Rnavcommand config config -glob=**/* -suffix=.rb -default=routes
|
|
||||||
|
|
||||||
" Set syntax highlighting for specific file types
|
" Set syntax highlighting for specific file types
|
||||||
autocmd BufRead,BufNewFile Appraisals set filetype=ruby
|
|
||||||
autocmd BufRead,BufNewFile *.md set filetype=markdown
|
autocmd BufRead,BufNewFile *.md set filetype=markdown
|
||||||
|
|
||||||
" Enable spellchecking for Markdown
|
|
||||||
autocmd FileType markdown setlocal spell
|
|
||||||
|
|
||||||
" Automatically wrap at 80 characters for Markdown
|
|
||||||
autocmd BufRead,BufNewFile *.md setlocal textwidth=80
|
|
||||||
|
|
||||||
" Allow stylesheets to autocomplete hyphenated words
|
" Allow stylesheets to autocomplete hyphenated words
|
||||||
autocmd FileType css,scss,sass setlocal iskeyword+=-
|
autocmd FileType css,scss,sass setlocal iskeyword+=-
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Softtabs, 2 spaces
|
" Softtabs, 2 spaces
|
||||||
set tabstop=2
|
set tabstop=4
|
||||||
set shiftwidth=2
|
set shiftwidth=4
|
||||||
set shiftround
|
set shiftround
|
||||||
set expandtab
|
set expandtab
|
||||||
|
|
||||||
@ -76,54 +64,17 @@ if executable('ag')
|
|||||||
let g:ctrlp_use_caching = 0
|
let g:ctrlp_use_caching = 0
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Color scheme
|
|
||||||
colorscheme github
|
|
||||||
highlight NonText guibg=#060606
|
|
||||||
highlight Folded guibg=#0A0A0A guifg=#9090D0
|
|
||||||
|
|
||||||
" Make it obvious where 80 characters is
|
" Make it obvious where 80 characters is
|
||||||
set textwidth=80
|
set textwidth=80
|
||||||
set colorcolumn=+1
|
set colorcolumn=+1
|
||||||
|
|
||||||
" Numbers
|
" Numbers
|
||||||
set number
|
set number
|
||||||
set numberwidth=5
|
set numberwidth=4
|
||||||
|
|
||||||
" Tab completion
|
|
||||||
" will insert tab at beginning of line,
|
|
||||||
" will use completion if not at beginning
|
|
||||||
set wildmode=list:longest,list:full
|
|
||||||
function! InsertTabWrapper()
|
|
||||||
let col = col('.') - 1
|
|
||||||
if !col || getline('.')[col - 1] !~ '\k'
|
|
||||||
return "\<tab>"
|
|
||||||
else
|
|
||||||
return "\<c-p>"
|
|
||||||
endif
|
|
||||||
endfunction
|
|
||||||
inoremap <Tab> <c-r>=InsertTabWrapper()<cr>
|
|
||||||
inoremap <S-Tab> <c-n>
|
|
||||||
|
|
||||||
" Exclude Javascript files in :Rtags via rails.vim due to warnings when parsing
|
|
||||||
let g:Tlist_Ctags_Cmd="ctags --exclude='*.js'"
|
|
||||||
|
|
||||||
" Index ctags from any project, including those outside Rails
|
|
||||||
map <Leader>ct :!ctags -R .<CR>
|
|
||||||
|
|
||||||
" Switch between the last two files
|
" Switch between the last two files
|
||||||
nnoremap <leader><leader> <c-^>
|
nnoremap <leader><leader> <c-^>
|
||||||
|
|
||||||
" Get off my lawn
|
|
||||||
nnoremap <Left> :echoe "Use h"<CR>
|
|
||||||
nnoremap <Right> :echoe "Use l"<CR>
|
|
||||||
nnoremap <Up> :echoe "Use k"<CR>
|
|
||||||
nnoremap <Down> :echoe "Use j"<CR>
|
|
||||||
|
|
||||||
" vim-rspec mappings
|
|
||||||
nnoremap <Leader>t :call RunCurrentSpecFile()<CR>
|
|
||||||
nnoremap <Leader>s :call RunNearestSpec()<CR>
|
|
||||||
nnoremap <Leader>l :call RunLastSpec()<CR>
|
|
||||||
|
|
||||||
" Run commands that require an interactive shell
|
" Run commands that require an interactive shell
|
||||||
nnoremap <Leader>r :RunInInteractiveShell<space>
|
nnoremap <Leader>r :RunInInteractiveShell<space>
|
||||||
|
|
||||||
@ -144,12 +95,12 @@ nnoremap <C-l> <C-w>l
|
|||||||
let g:syntastic_check_on_open=1
|
let g:syntastic_check_on_open=1
|
||||||
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
|
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute \"ng-"]
|
||||||
|
|
||||||
" Set spellfile to location that is guaranteed to exist, can be symlinked to
|
|
||||||
" Dropbox or kept in Git and managed outside of thoughtbot/dotfiles using rcm.
|
|
||||||
set spellfile=$HOME/.vim-spell-en.utf-8.add
|
|
||||||
|
|
||||||
" Local config
|
" Local config
|
||||||
if filereadable($HOME . "/.vimrc.local")
|
if filereadable($HOME . "/.vimrc.local")
|
||||||
source ~/.vimrc.local
|
source ~/.vimrc.local
|
||||||
endif
|
endif
|
||||||
colorscheme monokai
|
" Fix for airline fonts
|
||||||
|
let g:airline_powerline_fonts = 1
|
||||||
|
|
||||||
|
set paste
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
colorscheme monokai
|
|
||||||
let g:airline_powerline_fonts = 1
|
|
||||||
set paste
|
|
Loading…
Reference in New Issue
Block a user