Mostly vim stuff
This commit is contained in:
parent
e419081db0
commit
e16b75347d
@ -1,3 +1,6 @@
|
|||||||
|
alias vi="vim"
|
||||||
|
alias v="vim"
|
||||||
|
|
||||||
alias reload! ". $HOME/.config/fish/config.fish"
|
alias reload! ". $HOME/.config/fish/config.fish"
|
||||||
alias b "bundle exec"
|
alias b "bundle exec"
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
set -x PATH /usr/local/bin $PATH
|
set -x PATH /usr/local/bin $PATH
|
||||||
set -x PATH /usr/local/sbin $PATH
|
set -x PATH /usr/local/sbin $PATH
|
||||||
set -x PATH /usr/local/share/npm/bin $PATH
|
set -x PATH /usr/local/share/npm/bin $PATH
|
||||||
set -x PATH /usr/local/share/python $PATH
|
|
||||||
set -x PATH $HOME/.dotfiles/bin $PATH
|
set -x PATH $HOME/.dotfiles/bin $PATH
|
||||||
set -x PATH $HOME/.rbenv/plugins/ruby-build/bin $PATH
|
set -x PATH $HOME/.rbenv/plugins/ruby-build/bin $PATH
|
||||||
set -x PATH $HOME/.rbenv/bin $PATH
|
set -x PATH $HOME/.rbenv/bin $PATH
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
br = checkout -b
|
br = checkout -b
|
||||||
st = status -sb
|
st = status -sb
|
||||||
ci = commit
|
ci = commit
|
||||||
up = !sh -c 'git pull --rebase --prune && git log --pretty=format:\"%Cred%ae %Creset- %C(yellow)%s %Creset(%ar)\" HEAD@{1}..'
|
rd = rebase -i development
|
||||||
|
rh = rebase -i HEAD~5
|
||||||
[color]
|
[color]
|
||||||
diff = auto
|
diff = auto
|
||||||
status = auto
|
status = auto
|
||||||
|
@ -13,3 +13,4 @@ vendor/gems
|
|||||||
|
|
||||||
# Vim
|
# Vim
|
||||||
*.swp
|
*.swp
|
||||||
|
*.swo
|
||||||
|
File diff suppressed because it is too large
Load Diff
4
osx.bash
4
osx.bash
@ -150,10 +150,10 @@ defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
|
|||||||
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
||||||
|
|
||||||
# Set a small before-repeat delay
|
# Set a small before-repeat delay
|
||||||
defaults write NSGlobalDomain InitialKeyRepeat -int 2
|
defaults write NSGlobalDomain InitialKeyRepeat -int 15
|
||||||
|
|
||||||
# Set a blazingly fast keyboard repeat rate
|
# Set a blazingly fast keyboard repeat rate
|
||||||
defaults write NSGlobalDomain KeyRepeat -int 0
|
defaults write NSGlobalDomain KeyRepeat -int 2
|
||||||
|
|
||||||
# Automatically illuminate built-in MacBook keyboard in low light
|
# Automatically illuminate built-in MacBook keyboard in low light
|
||||||
defaults write com.apple.BezelServices kDim -bool true
|
defaults write com.apple.BezelServices kDim -bool true
|
||||||
|
@ -16,3 +16,4 @@ ln -s ~/.dotfiles/ruby/aprc ~/.aprc
|
|||||||
# THE VIM
|
# THE VIM
|
||||||
ln -s ~/.dotfiles/vim/vim ~/.vim
|
ln -s ~/.dotfiles/vim/vim ~/.vim
|
||||||
ln -s ~/.dotfiles/vim/vimrc ~/.vimrc
|
ln -s ~/.dotfiles/vim/vimrc ~/.vimrc
|
||||||
|
mkdir -p ~/.dotfiles/vim/bundle
|
||||||
|
142
vim/vimrc
142
vim/vimrc
@ -2,12 +2,7 @@ set nocompatible " vi improved
|
|||||||
filetype off " do not load Filetype file
|
filetype off " do not load Filetype file
|
||||||
set shell=/bin/bash
|
set shell=/bin/bash
|
||||||
|
|
||||||
" Uncomment this when ready for hardcore
|
|
||||||
for prefix in ['i', 'n', 'v']
|
|
||||||
for key in ['<Up>', '<Down>', '<Left>', '<Right>']
|
|
||||||
exe prefix . "noremap " . key . " <Nop>"
|
|
||||||
endfor
|
|
||||||
endfor
|
|
||||||
|
|
||||||
" ####################
|
" ####################
|
||||||
" ### Vundle setup ###
|
" ### Vundle setup ###
|
||||||
@ -17,18 +12,42 @@ set rtp+=~/.vim/bundle/vundle/
|
|||||||
call vundle#rc()
|
call vundle#rc()
|
||||||
Bundle 'gmarik/vundle'
|
Bundle 'gmarik/vundle'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ##############
|
" ##############
|
||||||
" ### Colors ###
|
" ### Colors ###
|
||||||
" ##############
|
" ##############
|
||||||
|
|
||||||
Bundle "daylerees/colour-schemes", { "rtp": "vim-themes/" }
|
Bundle "daylerees/colour-schemes", { "rtp": "vim-themes/" }
|
||||||
Bundle "chriskempson/tomorrow-theme", { "rtp": "vim/" }
|
Bundle "chriskempson/tomorrow-theme", { "rtp": "vim/" }
|
||||||
|
" Bundle "altercation/solarized", { "rtp": "vim-colors-solarized/" }
|
||||||
|
Bundle "thinkpixellab/flatland", { "rtp": "Vim/" }
|
||||||
|
Bundle "sjl/badwolf"
|
||||||
|
Bundle "tomasr/molokai"
|
||||||
|
Bundle "nanotech/jellybeans.vim"
|
||||||
|
Bundle "chriskempson/base16-vim"
|
||||||
|
|
||||||
syntax on
|
syntax on
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
filetype indent on
|
filetype indent on
|
||||||
|
|
||||||
colorscheme Peacock
|
function! SetRandomColorScheme()
|
||||||
|
let schemes ='peacock grunge freshcut molokai badwolf flatland jellybeans Tomorrow-Night Tomorrow-Night-Eighties '
|
||||||
|
let schemes.='base16-eighties '
|
||||||
|
let seconds=str2nr(strftime('%S'))
|
||||||
|
|
||||||
|
let scheme=split(schemes)[seconds%10]
|
||||||
|
set background=dark
|
||||||
|
execute 'colorscheme '.scheme
|
||||||
|
redraw
|
||||||
|
echo 'Color scheme is now set to "'.scheme.'"'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" call SetRandomColorScheme()
|
||||||
|
colorscheme peacock
|
||||||
|
nmap <Leader>cs :call SetRandomColorScheme()<CR>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" #################
|
" #################
|
||||||
" ### Powerline ###
|
" ### Powerline ###
|
||||||
@ -39,13 +58,15 @@ let g:Powerline_symbols = 'compatible' " (compatible, unicode, fancy)
|
|||||||
set laststatus=2
|
set laststatus=2
|
||||||
set noshowmode
|
set noshowmode
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" #################
|
" #################
|
||||||
" ### Nerd Tree ###
|
" ### Nerd Tree ###
|
||||||
" #################
|
" #################
|
||||||
|
|
||||||
Bundle 'scrooloose/nerdtree'
|
Bundle 'scrooloose/nerdtree'
|
||||||
nmap <C-n> :NERDTreeToggle<CR>
|
nmap <silent> <C-n> :NERDTreeToggle<CR>
|
||||||
let NERDTreeIgnore=['\.DS_Store$', '\.swp$', '\.git$', '\.bundle$', '\.pyc$']
|
let NERDTreeIgnore=['\.DS_Store$', '\.swp$', '\.git$', '\.bundle$', '\.pyc$', '\.sass-cache']
|
||||||
let NERDTreeHighlightCursorline=1
|
let NERDTreeHighlightCursorline=1
|
||||||
let NERDTreeShowHidden=1
|
let NERDTreeShowHidden=1
|
||||||
let NERDTreeMinimalUI=1
|
let NERDTreeMinimalUI=1
|
||||||
@ -53,7 +74,9 @@ let NERDTreeDirArrows=1
|
|||||||
let NERDChristmasTree=1
|
let NERDChristmasTree=1
|
||||||
let NERDTreeChDirMode=2
|
let NERDTreeChDirMode=2
|
||||||
let NERDTreeQuitOnOpen=1
|
let NERDTreeQuitOnOpen=1
|
||||||
let g:NERDTreeWinSize=50
|
let g:NERDTreeWinSize=40
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ######################
|
" ######################
|
||||||
" ### Nerd Commenter ###
|
" ### Nerd Commenter ###
|
||||||
@ -63,40 +86,73 @@ Bundle 'scrooloose/nerdcommenter'
|
|||||||
let g:NERDCreateDefaultMappings=0
|
let g:NERDCreateDefaultMappings=0
|
||||||
let g:NERDCompactSexyComs=1
|
let g:NERDCompactSexyComs=1
|
||||||
let g:NERDSpaceDelims=1
|
let g:NERDSpaceDelims=1
|
||||||
nmap <Leader>/ <plug>NERDCommenterToggle
|
nmap <silent> <Leader>/ <plug>NERDCommenterToggle
|
||||||
vmap <Leader>/ <plug>NERDCommenterToggle
|
vmap <silent> <Leader>/ <plug>NERDCommenterToggle
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" #########################
|
" #########################
|
||||||
" ### Fuzzy File Search ###
|
" ### Fuzzy File Search ###
|
||||||
" #########################
|
" #########################
|
||||||
|
|
||||||
Bundle 'kien/ctrlp.vim'
|
Bundle 'kien/ctrlp.vim'
|
||||||
let g:ctrlp_match_window_bottom=0
|
let g:ctrlp_match_window_bottom=1
|
||||||
let g:ctrlp_match_window_reversed=0
|
let g:ctrlp_match_window_reversed=1
|
||||||
|
|
||||||
" ###########################
|
|
||||||
" ### Ruby Syntax Support ###
|
|
||||||
" ###########################
|
" ######################
|
||||||
|
" ### Syntax Support ###
|
||||||
|
" ######################
|
||||||
|
|
||||||
Bundle 'vim-ruby/vim-ruby'
|
Bundle 'vim-ruby/vim-ruby'
|
||||||
|
Bundle 'tpope/vim-markdown'
|
||||||
|
|
||||||
|
|
||||||
|
" Sugar
|
||||||
|
Bundle 'wavded/vim-stylus'
|
||||||
|
Bundle 'kchmck/vim-coffee-script'
|
||||||
|
Bundle 'slim-template/vim-slim'
|
||||||
|
|
||||||
" ###################
|
" ###################
|
||||||
" ### Rails Tools ###
|
" ### Rails Tools ###
|
||||||
" ###################
|
" ###################
|
||||||
|
|
||||||
Bundle 'tpope/vim-rails'
|
Bundle 'tpope/vim-rails'
|
||||||
|
" Usage
|
||||||
|
" :Rmodel, :Rcontroller, :Rspec
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ###########################
|
" ###########################
|
||||||
" ### Magic Code Aligning ###
|
" ### Magic Code Aligning ###
|
||||||
" ###########################
|
" ###########################
|
||||||
|
|
||||||
Bundle 'godlygeek/tabular'
|
Bundle 'godlygeek/tabular'
|
||||||
|
" Usage
|
||||||
|
" :Tabularize /=
|
||||||
|
|
||||||
|
nmap <silent> <Leader>t :Tabularize /
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ###################
|
" ###################
|
||||||
" ### Git Wrapper ###
|
" ### Git Wrapper ###
|
||||||
" ###################
|
" ###################
|
||||||
|
|
||||||
Bundle 'tpope/vim-fugitive'
|
Bundle 'tpope/vim-fugitive'
|
||||||
|
" Usage
|
||||||
|
" :Gblame, :Gdiff, :Gcommit etc.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
" ###########################
|
||||||
|
" ### The Silver Searcher ###
|
||||||
|
" ###########################
|
||||||
|
|
||||||
|
Bundle 'rking/ag.vim'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ###################
|
" ###################
|
||||||
" ### Preferences ###
|
" ### Preferences ###
|
||||||
@ -129,7 +185,13 @@ set mousehide " Hide mouse when typing
|
|||||||
set guioptions-=L " Disable scrollbars
|
set guioptions-=L " Disable scrollbars
|
||||||
set guioptions-=r " Disable scrollbars
|
set guioptions-=r " Disable scrollbars
|
||||||
set wildignore+=*/tmp/* " Index ignoresa
|
set wildignore+=*/tmp/* " Index ignoresa
|
||||||
set gfn=Menlo:h14 " Set font family and size
|
set gfn=Inconsolata:h18 " Set font family and size
|
||||||
|
set hidden " Allow switching unsaved buffers
|
||||||
|
|
||||||
|
" Sexy highlighting colors
|
||||||
|
highlight Search cterm=none ctermbg=198 ctermfg=7
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ########################
|
" ########################
|
||||||
" ### MacVim Specific ###
|
" ### MacVim Specific ###
|
||||||
@ -143,6 +205,8 @@ if has("gui_macvim")
|
|||||||
let macvim_hig_shift_movement=1
|
let macvim_hig_shift_movement=1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ################
|
" ################
|
||||||
" ### Triggers ###
|
" ### Triggers ###
|
||||||
" ################
|
" ################
|
||||||
@ -155,12 +219,23 @@ if has("autocmd")
|
|||||||
" When vimrc is edited, reload it
|
" When vimrc is edited, reload it
|
||||||
autocmd! BufWritePost $MYVIMRC source $MYVIMRC
|
autocmd! BufWritePost $MYVIMRC source $MYVIMRC
|
||||||
|
|
||||||
|
" Cleanup trailing whitespaces before save
|
||||||
|
autocmd BufWritePre * :call PreservePosition('%s/\s\+$//e')
|
||||||
|
|
||||||
|
" Line number (relative/absolute) magic
|
||||||
autocmd FocusLost * :set number
|
autocmd FocusLost * :set number
|
||||||
autocmd FocusGained * :set relativenumber
|
autocmd FocusGained * :set relativenumber
|
||||||
autocmd InsertEnter * :set number
|
autocmd InsertEnter * :set number
|
||||||
autocmd InsertLeave * :set relativenumber
|
autocmd InsertLeave * :set relativenumber
|
||||||
|
|
||||||
|
autocmd BufNewFile,BufRead *.styl set syntax=stylus
|
||||||
|
autocmd BufNewFile,BufRead *.slim set syntax=slim
|
||||||
|
autocmd BufNewFile,BufRead *.coffee set syntax=coffee
|
||||||
|
autocmd BufNewFile,BufRead *.md set syntax=markdown
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
" ##########################
|
" ##########################
|
||||||
" ### Follow Your Leader ###
|
" ### Follow Your Leader ###
|
||||||
" ##########################
|
" ##########################
|
||||||
@ -171,11 +246,11 @@ let mapleader = ","
|
|||||||
nmap <Leader>v :e $MYVIMRC<CR>
|
nmap <Leader>v :e $MYVIMRC<CR>
|
||||||
|
|
||||||
nmap <Leader>s :w<CR>
|
nmap <Leader>s :w<CR>
|
||||||
nmap <Leader>qq :q!<CR>
|
nmap <Leader>x :q!<CR>
|
||||||
nmap <Leader>rr :source $MYVIMRC<CR>
|
nmap <Leader>rr :source $MYVIMRC<CR>
|
||||||
|
|
||||||
nmap <Leader>gu :!git up<CR>
|
" Search for the word under cursor
|
||||||
nmap <Leader>mkb :!mkbundle<CR>
|
nmap <Leader>d /<C-r><C-w><CR>zz
|
||||||
|
|
||||||
" Toggle search highlight
|
" Toggle search highlight
|
||||||
nmap <Leader>h :set hlsearch!<CR>
|
nmap <Leader>h :set hlsearch!<CR>
|
||||||
@ -190,18 +265,6 @@ nmap <Leader>rm :Rmodel
|
|||||||
nmap <Leader>rc :Rcontroller
|
nmap <Leader>rc :Rcontroller
|
||||||
nmap <Leader>rs :Rspec
|
nmap <Leader>rs :Rspec
|
||||||
|
|
||||||
" Splitting windows iTerm style
|
|
||||||
nmap <D-d> :vs<CR>
|
|
||||||
nmap <D-D> :sp<CR>
|
|
||||||
|
|
||||||
" Vertical window resizing
|
|
||||||
map <M-<gt>> :vertical res +1^M<CR>
|
|
||||||
nmap <M-<lt>> :vertical res -1^M<CR>
|
|
||||||
|
|
||||||
" Horizontal window rezising
|
|
||||||
nmap <M-=> :res +1^M<CR>
|
|
||||||
nmap <M--> :res -1^M<CR>
|
|
||||||
|
|
||||||
" Center line with the find occurance
|
" Center line with the find occurance
|
||||||
nmap n nzz
|
nmap n nzz
|
||||||
nmap N Nzz
|
nmap N Nzz
|
||||||
@ -213,22 +276,23 @@ nmap <Leader>ev :vsp <C-R>=expand("%:p:h")."/"<CR>
|
|||||||
nmap <Leader>et :tabedit <C-R>=expand("%:p:h")."/"<CR>
|
nmap <Leader>et :tabedit <C-R>=expand("%:p:h")."/"<CR>
|
||||||
|
|
||||||
" Convert Ruby 1.8 hash syntax to 1.9
|
" Convert Ruby 1.8 hash syntax to 1.9
|
||||||
nmap <Leader>r18 :%s/:\(\w\+\)\(\s\+\)=>/\1:\2/ge<CR>
|
nmap <Leader>r18 :%s/:\(\w\+\)\(\s\+\)=>\s\+/\1:\2/ge<CR>
|
||||||
|
|
||||||
|
" Buffers
|
||||||
|
nmap <Leader>b :ls<CR>:b
|
||||||
|
|
||||||
|
|
||||||
" #######################
|
" #######################
|
||||||
" ### Visual Mappings ###
|
" ### Visual Mappings ###
|
||||||
" #######################
|
" #######################
|
||||||
|
|
||||||
" Indentation TextMate style
|
" Indentation TextMate style
|
||||||
vmap <D-[> <gv
|
vmap <M-[> <gv
|
||||||
vmap <D-]> >gv
|
vmap <M-]> >gv
|
||||||
|
|
||||||
" Sudo to write
|
" Sudo to write
|
||||||
cmap w!! w !sudo tee % >/dev/null
|
cmap w!! w !sudo tee % >/dev/null
|
||||||
|
|
||||||
" Centerize current line
|
|
||||||
nmap j jzz
|
|
||||||
nmap k kzz
|
|
||||||
" Move 10 lines with Option key
|
" Move 10 lines with Option key
|
||||||
nmap <Esc>j 10j
|
nmap <Esc>j 10j
|
||||||
nmap <Esc>k 10k
|
nmap <Esc>k 10k
|
||||||
|
Loading…
x
Reference in New Issue
Block a user