+
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ isort==4.2.2
requests==2.9.1
speedtest-cli==0.3.4
venmo==0.3.6
virtualenv==14.0.6
virtualenv==15.0.0
## The following requirements were added by pip freeze:
appnope==0.1.0
awscli==1.10.10
awscli==1.10.12
boto3==1.2.6
botocore==1.4.1
botocore==1.4.3
colorama==0.3.3
configobj==5.0.6
decorator==4.0.9
Expand Down
5 changes: 5 additions & 0 deletions tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,8 @@ set-window-option -g window-status-current-bg default
# message text
set-option -g message-bg default
set-option -g message-fg brightred

# don't wait for an escape sequence after hitting
# Esc. fixes insert mode exit lag in vim
set -sg escape-time 0

103 changes: 101 additions & 2 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ set smarttab " be smart when using tabs
set tabstop=4 " 1 tab == 2 spaces

set splitbelow " all horizontal splits open to the bottom
set ru " shows ruler for cursor
set sc " showcmd shows incomplete commands
set foldmethod=syntax " set a foldmethod
set foldnestmax=1
set splitright " all vertical splits open to the right

set mouse=a " enable mouse
Expand All @@ -43,6 +47,7 @@ augroup END

" MacVim
set guifont=Inconsolata-dz:h13
"remove all scroll bars
set guioptions-=r
set guioptions-=L

Expand All @@ -69,6 +74,20 @@ map <C-k> <C-w>k
map <C-h> <C-w>h
map <C-l> <C-w>l

noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>

" But I like navigating in insert mode
inoremap <C-h> <C-o>h
inoremap <C-j> <C-o>j
inoremap <C-k> <C-o>k
inoremap <C-l> <C-o>l

" A little hack to redraw the cursor when exiting insert mode.
" Places the cursor at the character from which we exited insert mode.
inoremap <silent> <Esc> <Esc>`^
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" PLUGINS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Expand All @@ -93,6 +112,8 @@ Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'ludovicchabant/vim-gutentags'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets' " snippet library

" Git
Plug 'tpope/vim-fugitive'
Expand All @@ -118,6 +139,8 @@ Plug 'pangloss/vim-javascript'
Plug 'saltstack/salt-vim'
Plug 'stephpy/vim-yaml'
Plug 'evanmiller/nginx-vim-syntax'
" Man page navigation
"Plug 'bruno-/vim-man'

" Python
Plug 'klen/python-mode'
Expand Down Expand Up @@ -175,6 +198,13 @@ let g:pymode_rope = 0
let g:pymode_rope_completion = 0
let g:pymode_lint_checkers = ['flake8']

" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger="<S-Enter>"
"let g:UltiSnipsJumpForwardTrigger="<C-b>"
let g:UltiSnipsJumpForwardTrigger="<C-k>"
"let g:UltiSnipsJumpBackwardTrigger="<c-z>"
let g:UltiSnipsJumpBackwardTrigger="<C-j>"

""""""""""""""""""""""""""""""
" FZF
""""""""""""""""""""""""""""""
Expand All @@ -186,8 +216,14 @@ autocmd VimEnter * command! -nargs=* Ag call fzf#vim#ag

noremap <silent> <Leader><Leader> :silent FZF <CR>

" Search word under cursor by using Ag | leader + a
noremap <silent> <leader>a :silent Ag <C-r>=expand('<cword>')<CR><CR>
" If you want :UltiSnipsEdit to split your window.
let g:UltiSnipsEditSplit="vertical"
" Create Blank Newlines and stay in Normal mode
nnoremap <leader>j o<Esc>
nnoremap <leader>k O<Esc>

" Ctrl-Space will toggle folds!
nnoremap <C-Space> za

" Search tags in buffer by using leader + t
noremap <silent> <leader>t :silent BTags<CR>
Expand Down Expand Up @@ -215,3 +251,66 @@ nnoremap <silent> <Leader><Enter> :silent call fzf#run({
\ 'options': '+m',
\ 'tmux_height': '40%'
\ })<CR>
" Remap ;w to escape in insert mode.
inoremap ;; ;<Esc>:w<Enter>
inoremap ;w <Esc>:w<Enter>

" Swap ; and : Convenient.
nnoremap ; :
nnoremap : ;

" Clear the highlighting
nnoremap <Esc> <Esc>:noh<Enter>


" remember things yanked in a special register, so we can delete at will
" without concerns
nnoremap <Leader>p "0p
nnoremap <Leader>P "0P

" often I want to find the next _
onoremap W f_
nnoremap W f_l
onoremap E t_
nnoremap E lt_
onoremap B T_
nnoremap B hT_

" In my mind, p means parentheses
onoremap p i(

" Usually, when making the header file, I want to just copy the original file,
" and append a ; to the end of each declaration and delete the body of the
" (folded) function. This automatically does just that.
nmap <Leader>h A;<Esc>jddj

" Make Y like D and every other cap command
nnoremap Y y$

" Next Tab
nnoremap <silent> <C-Right> :tabnext<CR>

" Previous Tab
nnoremap <silent> <C-Left> :tabprevious<CR>

" Edit vimrc \ev
nnoremap <silent> <Leader>ev :tabnew<CR>:e ~/.vimrc<CR>

" ctags
nnoremap <C-\> :vsp <Enter>:exec("tag ".expand("<cword>"))<Enter>zz

" Search mappings: These will make it so that going to the next one in a
" search will center on the line it's found in.
map N Nzz
map n nzz

" Make it so there are always several lines visible above and below the cursor
set scrolloff=10

" Properly display man pages
" ==========================
runtime ftplugin/man.vim
if has("gui_running")
nnoremap K :<C-U>exe "Man" v:count "<C-R><C-W>"<CR>
endif

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载