Cleaning up my_confs.
This commit is contained in:
parent
bcbbdb653e
commit
6929e35b00
3 changed files with 54 additions and 166 deletions
|
@ -1,114 +0,0 @@
|
|||
" set up pathogen, https://github.com/tpope/vim-pathogen
|
||||
filetype on " without this vim emits a zero exit status, later, because of :ft off
|
||||
filetype off
|
||||
call pathogen#infect()
|
||||
filetype plugin indent on
|
||||
|
||||
" don't bother with vi compatibility
|
||||
set nocompatible
|
||||
|
||||
" enable syntax highlighting
|
||||
syntax enable
|
||||
|
||||
set autoindent
|
||||
set autoread " reload files when changed on disk, i.e. via `git checkout`
|
||||
set backspace=2 " Fix broken backspace in some setups
|
||||
set backupcopy=yes " see :help crontab
|
||||
set clipboard=unnamed " yank and paste with the system clipboard
|
||||
set directory-=. " don't store swapfiles in the current directory
|
||||
set encoding=utf-8
|
||||
set expandtab " expand tabs to spaces
|
||||
set ignorecase " case-insensitive search
|
||||
set incsearch " search as you type
|
||||
set laststatus=2 " always show statusline
|
||||
set list " show trailing whitespace
|
||||
set listchars=tab:▸\ ,trail:▫
|
||||
set number " show line numbers
|
||||
set ruler " show where you are
|
||||
set scrolloff=3 " show context above/below cursorline
|
||||
set shiftwidth=2 " normal mode indentation commands use 2 spaces
|
||||
set showcmd
|
||||
set smartcase " case-sensitive search if any caps
|
||||
set softtabstop=2 " insert mode tab and backspace use 2 spaces
|
||||
set tabstop=8 " actual tabs occupy 8 characters
|
||||
set wildignore=log/**,node_modules/**,target/**,tmp/**,*.rbc
|
||||
set wildmenu " show a navigable menu for tab completion
|
||||
set wildmode=longest,list,full
|
||||
|
||||
" Enable basic mouse behavior such as resizing buffers.
|
||||
set mouse=a
|
||||
if exists('$TMUX') " Support resizing in tmux
|
||||
set ttymouse=xterm2
|
||||
endif
|
||||
|
||||
" keyboard shortcuts
|
||||
let mapleader = ','
|
||||
map <C-h> <C-w>h
|
||||
map <C-j> <C-w>j
|
||||
map <C-k> <C-w>k
|
||||
map <C-l> <C-w>l
|
||||
map <leader>l :Align
|
||||
nmap <leader>a :Ack
|
||||
nmap <leader>b :CtrlPBuffer<CR>
|
||||
nmap <leader>d :NERDTreeToggle<CR>
|
||||
nmap <leader>f :NERDTreeFind<CR>
|
||||
nmap <leader>t :CtrlP<CR>
|
||||
nmap <leader>T :CtrlPClearCache<CR>:CtrlP<CR>
|
||||
nmap <leader>] :TagbarToggle<CR>
|
||||
nmap <leader><space> :call whitespace#strip_trailing()<CR>
|
||||
nmap <leader>g :GitGutterToggle<CR>
|
||||
nmap <leader>c <Plug>Kwbd
|
||||
map <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
|
||||
|
||||
" plugin settings
|
||||
let g:ctrlp_match_window = 'order:ttb,max:20'
|
||||
let g:NERDSpaceDelims=1
|
||||
let g:gitgutter_enabled = 0
|
||||
|
||||
" Use The Silver Searcher https://github.com/ggreer/the_silver_searcher
|
||||
if executable('ag')
|
||||
let g:ackprg = 'ag --nogroup --column'
|
||||
|
||||
" Use Ag over Grep
|
||||
set grepprg=ag\ --nogroup\ --nocolor
|
||||
|
||||
" Use ag in CtrlP for listing files. Lightning fast and respects .gitignore
|
||||
let g:ctrlp_user_command = 'ag %s -l --nocolor -g ""'
|
||||
endif
|
||||
|
||||
" fdoc is yaml
|
||||
autocmd BufRead,BufNewFile *.fdoc set filetype=yaml
|
||||
" md is markdown
|
||||
autocmd BufRead,BufNewFile *.md set filetype=markdown
|
||||
" extra rails.vim help
|
||||
autocmd User Rails silent! Rnavcommand decorator app/decorators -glob=**/* -suffix=_decorator.rb
|
||||
autocmd User Rails silent! Rnavcommand observer app/observers -glob=**/* -suffix=_observer.rb
|
||||
autocmd User Rails silent! Rnavcommand feature features -glob=**/* -suffix=.feature
|
||||
autocmd User Rails silent! Rnavcommand job app/jobs -glob=**/* -suffix=_job.rb
|
||||
autocmd User Rails silent! Rnavcommand mediator app/mediators -glob=**/* -suffix=_mediator.rb
|
||||
autocmd User Rails silent! Rnavcommand stepdefinition features/step_definitions -glob=**/* -suffix=_steps.rb
|
||||
" automatically rebalance windows on vim resize
|
||||
autocmd VimResized * :wincmd =
|
||||
|
||||
" Fix Cursor in TMUX
|
||||
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
|
||||
|
||||
" Go crazy!
|
||||
if filereadable(expand("~/.vimrc.local"))
|
||||
" In your .vimrc.local, you might like:
|
||||
"
|
||||
" set autowrite
|
||||
" set nocursorline
|
||||
" set nowritebackup
|
||||
" set whichwrap+=<,>,h,l,[,] " Wrap arrow keys between lines
|
||||
"
|
||||
" autocmd! bufwritepost .vimrc source ~/.vimrc
|
||||
" noremap! jj <ESC>
|
||||
source ~/.vimrc.local
|
||||
endif
|
|
@ -1,4 +1,4 @@
|
|||
set mouse=a
|
||||
"set mouse=a
|
||||
colorscheme molokai
|
||||
set background=dark
|
||||
let g:molokai_original = 1
|
||||
|
@ -6,89 +6,88 @@ let g:molokai_original = 1
|
|||
"syntax enable
|
||||
"set background=dark
|
||||
let g:airline_theme = 'molokai'
|
||||
set smartindent
|
||||
autocmd BufWritePre * :FixWhitespace
|
||||
"set smartindent
|
||||
"autocmd BufWritePre * :FixWhitespace
|
||||
set timeoutlen=2000
|
||||
set pastetoggle=<F6>
|
||||
inoremap jk <ESC>
|
||||
nnoremap ; :
|
||||
"inoremap jk <ESC>
|
||||
"nnoremap ; :
|
||||
#set colorcolumn=80
|
||||
" Open Vim, be able to undo
|
||||
set undodir=$HOME/.vim/undo
|
||||
set undolevels=1000
|
||||
set undoreload=10000
|
||||
"set undodir=$HOME/.vim/undo
|
||||
"set undolevels=1000
|
||||
"set undoreload=10000
|
||||
|
||||
" System wide copy paste
|
||||
set clipboard=unnamedplus
|
||||
"set clipboard=unnamedplus
|
||||
|
||||
" Make Y behave like other capitals
|
||||
map Y y$
|
||||
"map Y y$
|
||||
"
|
||||
" " Start scrolling 3 lines before the border
|
||||
set scrolloff=3
|
||||
"
|
||||
" " Automatically reread files that have been changed externally
|
||||
set autoread
|
||||
"set autoread
|
||||
"
|
||||
" " Make ^e and ^y scroll 3 lines instead of 1
|
||||
nnoremap <C-e> 3<C-e>
|
||||
nnoremap <C-y> 3<C-y>
|
||||
"nnoremap <C-e> 3<C-e>
|
||||
"nnoremap <C-y> 3<C-y>
|
||||
"
|
||||
" " don't move the cursor after pasting
|
||||
" " (by jumping to back start of previously changed text)
|
||||
noremap p p`[
|
||||
noremap P P`[
|
||||
"noremap p p`[
|
||||
"noremap P P`[
|
||||
"
|
||||
" " Reselect visual block after indent/outdent
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
"vnoremap < <gv
|
||||
"vnoremap > >gv
|
||||
|
||||
" Turn off the christmas lights
|
||||
nnoremap <cr> :nohlsearch<cr>
|
||||
"nnoremap <cr> :nohlsearch<cr>
|
||||
" Allow saving as root by w!!
|
||||
cmap w!! %!sudo tee > /dev/null %
|
||||
"cmap w!! %!sudo tee > /dev/null %
|
||||
|
||||
" Finde merge conflict markers
|
||||
nmap <silent> <leader>cf <ESC>/\v^[<=>]{7}( .*\|$)<CR>
|
||||
"nmap <silent> <leader>cf <ESC>/\v^[<=>]{7}( .*\|$)<CR>
|
||||
|
||||
" Use Marked.app to preview Markdown files...
|
||||
function! s:setupMarkup()
|
||||
nnoremap <leader>p :silent !open -a Marked.app '%:p'<cr>
|
||||
endfunction
|
||||
"function! s:setupMarkup()
|
||||
" nnoremap <leader>p :silent !open -a Marked.app '%:p'<cr>
|
||||
"endfunction
|
||||
|
||||
" Navigate splits more easily
|
||||
map <C-h> <C-w>h
|
||||
map <C-j> <C-w>j
|
||||
map <C-k> <C-w>k
|
||||
map <C-l> <C-w>l
|
||||
"map <C-h> <C-w>h
|
||||
"map <C-j> <C-w>j
|
||||
"map <C-k> <C-w>k
|
||||
"map <C-l> <C-w>l
|
||||
|
||||
" " These makes j/k move up/down a screen line instead of a physical file line (for wrapped lines)
|
||||
nmap k gk
|
||||
nmap j gj
|
||||
"nmap k gk
|
||||
"nmap j gj
|
||||
|
||||
" autocmd BufEnter * if &modifiable | NERDTreeFind | wincmd p | endif
|
||||
|
||||
" Easymotion {{{
|
||||
let g:EasyMotion_do_mapping = 0
|
||||
"let g:EasyMotion_do_mapping = 0
|
||||
|
||||
nnoremap <silent> <Leader>f :call EasyMotion#F(0, 0)<CR>
|
||||
onoremap <silent> <Leader>f :call EasyMotion#F(0, 0)<CR>
|
||||
vnoremap <silent> <Leader>f :<C-U>call EasyMotion#F(1, 0)<CR>
|
||||
"nnoremap <silent> <Leader>f :call EasyMotion#F(0, 0)<CR>
|
||||
"onoremap <silent> <Leader>f :call EasyMotion#F(0, 0)<CR>
|
||||
"vnoremap <silent> <Leader>f :<C-U>call EasyMotion#F(1, 0)<CR>
|
||||
|
||||
nnoremap <silent> <Leader>F :call EasyMotion#F(0, 1)<CR>
|
||||
onoremap <silent> <Leader>F :call EasyMotion#F(0, 1)<CR>
|
||||
vnoremap <silent> <Leader>F :<C-U>call EasyMotion#F(1, 1)<CR>
|
||||
"nnoremap <silent> <Leader>F :call EasyMotion#F(0, 1)<CR>
|
||||
"onoremap <silent> <Leader>F :call EasyMotion#F(0, 1)<CR>
|
||||
"vnoremap <silent> <Leader>F :<C-U>call EasyMotion#F(1, 1)<CR>
|
||||
|
||||
onoremap <silent> <Leader>t :call EasyMotion#T(0, 0)<CR>
|
||||
onoremap <silent> <Leader>T :call EasyMotion#T(0, 1)<CR>
|
||||
"onoremap <silent> <Leader>t :call EasyMotion#T(0, 0)<CR>
|
||||
"onoremap <silent> <Leader>T :call EasyMotion#T(0, 1)<CR>
|
||||
" }}}
|
||||
|
||||
|
||||
source ~/.vim_runtime/maximum_awesome_vimrc
|
||||
"source ~/.vim_runtime/maximum_awesome_vimrc
|
||||
|
||||
|
||||
set tabstop=2
|
||||
set shiftwidth=2
|
||||
set expandtab
|
||||
set smartindent
|
||||
set autoindent
|
||||
"set tabstop=2
|
||||
"set shiftwidth=2
|
||||
"set expandtab
|
||||
"set smartindentl:s
|
||||
|
|
|
@ -176,7 +176,6 @@ set nobackup
|
|||
set nowb
|
||||
set noswapfile
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Text, tab and indent related
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
@ -283,6 +282,9 @@ set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\
|
|||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" => Editing mappings
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Remap ; to :
|
||||
nnoremap ; :
|
||||
|
||||
" Remap VIM 0 to first non-blank character
|
||||
map 0 ^
|
||||
|
||||
|
@ -300,13 +302,14 @@ if has("mac") || has("macunix")
|
|||
endif
|
||||
|
||||
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
|
||||
func! DeleteTrailingWS()
|
||||
exe "normal mz"
|
||||
%s/\s\+$//ge
|
||||
exe "normal `z"
|
||||
endfunc
|
||||
autocmd BufWrite *.py :call DeleteTrailingWS()
|
||||
autocmd BufWrite *.coffee :call DeleteTrailingWS()
|
||||
"func! DeleteTrailingWS()
|
||||
"exe "normal mz"
|
||||
"%s/\s\+$//ge
|
||||
"exe "normal `z"
|
||||
"endfunc
|
||||
"autocmd BufWrite *.py :call DeleteTrailingWS()
|
||||
"autocmd BufWrite *.coffee :call DeleteTrailingWS()
|
||||
autocmd BufWritePre * :FixWhitespace
|
||||
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
|
Loading…
Reference in a new issue