Skip to content

Commit

Permalink
Update 5/7/16
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekreeki committed Jul 5, 2016
1 parent 09a97ff commit 4efcb9d
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 85 deletions.
2 changes: 1 addition & 1 deletion .completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters
zstyle ':completion:*' verbose yes
zstyle ':completion:*:descriptions' format '%B%d%b'
zstyle ':completion:*:messages' format '%d'
zstyle ':completion:*:warnings' format 'No matches for: %d'
# zstyle ':completion:*:warnings' format 'No matches for: %d'
zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b'
zstyle ':completion:*' group-name ''

Expand Down
5 changes: 5 additions & 0 deletions .custom.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@

# Setup fzf
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

# Always sets the tab title to current dir (requires DISABLE_AUTO_TITLE enabled in oh-my-zsh)
precmd() {
echo -ne "\e]1;${PWD##*/}\a"
}
8 changes: 0 additions & 8 deletions .functions.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ function e() {
fi
}

# Switch to subdirectory
function c() {
dir=$(ls | fzf --query="$1")
if [[ -n "$dir" ]]; then
cd $dir
fi
}

# Switch projects
function p() {
proj=$(ls ~/Projects | fzf --query="$1")
Expand Down
132 changes: 70 additions & 62 deletions .nvimrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-git'

" Building, Linters, Test Runners
" Plug 'benekastah/neomake'
Plug '~/Projects/neomake'
Plug 'benekastah/neomake'
Plug 'jaawerth/neomake-local-eslint-first'
Plug 'janko-m/vim-test'

Expand Down Expand Up @@ -93,14 +92,7 @@ Plug 'heavenshell/vim-jsdoc'
Plug 'marijnh/tern_for_vim', { 'do': 'npm install' }
" Plug 'carlitux/deoplete-ternjs'

" CoffeeScript Integration
Plug 'kchmck/vim-coffee-script'

" Elm Integration
Plug 'lambdatoast/elm.vim'

" CSS Integration
Plug 'wavded/vim-stylus'
Plug 'gorodinskiy/vim-coloresque'

" Other Languages
Expand All @@ -115,10 +107,8 @@ Plug 'xolox/vim-notes'
Plug 'kassio/neoterm'

" Colorschemes
" Plug 'mikekreeki/mikekreeki-colors.vim'
Plug '~/Projects/mikekreeki-colors.vim'
Plug 'mikekreeki/mikekreeki-colors.vim'

Plug 'vimyum/viske'
call plug#end()

filetype plugin indent on
Expand All @@ -128,8 +118,8 @@ set shell=/bin/zsh

let mapleader = ","

set encoding=utf-8
set fileencoding=utf-8
" set encoding=utf-8
" set fileencoding=utf-8
set hidden
set number
set nowrap
Expand Down Expand Up @@ -232,11 +222,11 @@ vmap <Down> ]egv
" Jump to previously edited line
nnoremap ů g;
" Shorcut to edit .vimrc
nnoremap <leader>V :e $MYVIMRC<CR>
" Jump to previous cursor position
nnoremap § ``
" Press Space to turn off highlighting and clear any message already displayed.
nnoremap <silent> <Space> :nohlsearch<Bar>:redraw<Bar>:echo<CR>
nnoremap <silent> <Space> :nohlsearch<Bar>:redraw!<Bar>:echo<CR>
" Visually select the text that was last edited/pasted
nnoremap gV `[v`]
Expand All @@ -260,6 +250,10 @@ nmap <TAB> <C-W>w
" Resize splits when the window is resized
autocmd VimResized * wincmd =

" Make horizontal scrolling less horrible.
set sidescroll=1
set sidescrolloff=10

cnoreabbrev W w
cnoreabbrev Q q

Expand All @@ -270,11 +264,6 @@ set guifont=Monaco:h12
set guicursor+=a:blinkon0
set guicursor+=i:ver10

" au InsertLeave * hi Cursor guifg=white guibg=steelblue
" au InsertEnter * hi Cursor guibg=grey

let g:ag_highlight=1

"Always open help files in a rightward vertical split
autocmd FileType help,gitcommit wincmd L

Expand All @@ -283,6 +272,7 @@ autocmd BufWritePost * :echo

nmap <silent> <C-l> ?function<cr>:noh<cr><Plug>(jsdoc)
nnoremap <silent> s vip:sort ui<CR>
vnoremap <silent> s :sort ui<CR>
hi NonText guifg=black ctermfg=black
Expand All @@ -293,6 +283,18 @@ if bufwinnr(1)
map - <C-W><
endif

function! PreserveCursor(command)
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction

augroup easymotion_config
autocmd!

Expand Down Expand Up @@ -392,7 +394,7 @@ augroup nerdtree_config
autocmd WinEnter * call s:CloseIfOnlyNerdTreeLeft()

" Hide NERDTree on small screen
function ToggleNERDTreeOnSmallScreen()
function! ToggleNERDTreeOnSmallScreen()
let breakpoint = 200

if &columns == 0
Expand Down Expand Up @@ -493,6 +495,8 @@ augroup quickfix_config
" Disable line numbers and colorcolumn in quickfix
autocmd FileType qf setlocal colorcolumn=0
autocmd FileType qf setlocal nonumber
autocmd Filetype qf setlocal nolist
autocmd Filetype qf setlocal nowrap

" Shortcuts for navigating between quickfix results
nnoremap ) :cnext<CR>
Expand Down Expand Up @@ -539,20 +543,9 @@ augroup trailing_whitespace_config
autocmd!

" Remove trailing whitespace before save
function! Preserve(command)
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
execute a:command
" Clean up: restore previous search history, and cursor position
let @/=_s
call cursor(l, c)
endfunction
nmap _$ :call Preserve("%s/\\s\\+$//e")<CR>
nmap _= :call Preserve("normal gg=G")<CR>
autocmd BufWritePre * :call Preserve("%s/\\s\\+$//e")
nmap _$ :call PreserveCursor("%s/\\s\\+$//e")<CR>
nmap _= :call PreserveCursor("normal gg=G")<CR>
autocmd BufWritePre * :call PreserveCursor("%s/\\s\\+$//e")
augroup END

augroup deoplete_config
Expand All @@ -577,8 +570,9 @@ augroup END
augroup splitjoin_config
autocmd!

nnoremap S :SplitjoinJoin<cr>
nnoremap s :SplitjoinSplit<cr>
" Disable temporarily as I don't use Ruby that much anymore
" nnoremap S :SplitjoinJoin<cr>
" nnoremap s :SplitjoinSplit<cr>
augroup END

augroup folding_config
Expand Down Expand Up @@ -643,7 +637,7 @@ augroup neoterm_config

let g:neoterm_position = 'vertical'

autocmd TermOpen * set number
autocmd TermOpen * set nonumber
autocmd TermOpen * set wfw

function! OpenTerminal()
Expand All @@ -656,27 +650,6 @@ augroup neoterm_config
:command! TT call OpenTerminal()
augroup END

augroup quickwrap_config
autocmd!

vnoremap ' <esc>:call QuickWrap("'")<CR>
vnoremap " <esc>:call QuickWrap('"')<CR>
function! QuickWrap(wrapper)
let b:autopairs_enabled = 0

let l:w = a:wrapper
let l:inside_or_around = (&selection == 'exclusive') ? ('i') : ('a')
normal `>
execute "normal " . inside_or_around . escape(w, '\')
normal `<
execute "normal i" . escape(w, '\')
normal `<

let b:autopairs_enabled = 1
endfunction
augroup END

augroup closetag_config
autocmd!

Expand Down Expand Up @@ -740,11 +713,46 @@ augroup END
augroup zoomwin_config
autocmd!

nmap <S-Enter> :ZoomWin<CR>
nnoremap <S-CR> :ZoomWin<CR>
augroup END

augroup syntax_attr_config
autocmd!

map <leader>x :call SyntaxAttr()<CR>
augroup END

augroup tern_for_vim_config
autocmd!

nmap <silent> D :TernDef<CR>
nmap R :TernRename<CR>
augroup END

augroup polyglot_config
autocmd!

let g:polyglot_disabled = ['javascript', 'jsx', 'ruby']
augroup END

augroup reload_vimrc_config
autocmd!

" Shorcut to edit .vimrc
nnoremap <leader>V :e $MYVIMRC<CR>
" Reload .vimrc on save
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END

augroup quickwrap_config
autocmd!

vnoremap ( <esc>`>a)<esc>`<i(<esc>
vnoremap ) <esc>`>a)<esc>`<i(<esc>
vnoremap [ <esc>`>a]<esc>`<i[<esc>
vnoremap ] <esc>`>a]<esc>`<i[<esc>
vnoremap { <esc>`>a}<esc>`<i{<esc>
vnoremap } <esc>`>a}<esc>`<i{<esc>
vnoremap " <esc>`>a"<esc>`<i"<esc>
vnoremap ' <esc>`>a'<esc>`<i'<esc>
augroup END
5 changes: 2 additions & 3 deletions .oh-my-zsh.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ZSH=$HOME/.oh-my-zsh
# CASE_SENSITIVE="true"

# Comment this out to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
DISABLE_AUTO_UPDATE="true"

# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
Expand All @@ -21,7 +21,7 @@ ZSH=$HOME/.oh-my-zsh
# DISABLE_LS_COLORS="true"

# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
ENABLE_CORRECTION="true"
Expand All @@ -34,7 +34,6 @@ ENABLE_CORRECTION="true"
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"


# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
Expand Down
11 changes: 0 additions & 11 deletions .setopt.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,6 @@ setopt HIST_FIND_NO_DUPS
# Remove extra blanks from each command line being added to history
setopt HIST_REDUCE_BLANKS

# Include more information about when the command was executed, etc
setopt EXTENDED_HISTORY

# ===== Completion

# Allow completion from within a word/phrase
setopt COMPLETE_IN_WORD

# When completing from the middle of a word, move the cursor to the end of the word
setopt ALWAYS_TO_END

# ===== Prompt

# Enable parameter expansion, command substitution, and arithmetic expansion in the prompt
Expand Down
11 changes: 11 additions & 0 deletions .tern-config
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"libs": [
"browser",
"ecma5",
"ecma6"
],
"plugins": {
"es_modules": {},
"node_resolve": {}
}
}

0 comments on commit 4efcb9d

Please sign in to comment.