Skip to content

Commit

Permalink
Update dotfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
llago-atlassian committed Aug 29, 2020
1 parent 3324e2c commit 6382384
Show file tree
Hide file tree
Showing 6 changed files with 236 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*

207 changes: 207 additions & 0 deletions init.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()

Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'morhetz/gruvbox'
Plug 'Raimondi/delimitMate'
Plug 'vim-airline/vim-airline'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'othree/yajs.vim'
Plug 'HerringtonDarkholme/yats.vim'
Plug 'janko/vim-test'
Plug 'hashivim/vim-terraform'
Plug 'tpope/vim-commentary'
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
Plug 'APZelos/blamer.nvim'
Plug 'liuchengxu/vim-which-key'

call plug#end()

set termguicolors
set hidden
set nobackup
set nowritebackup
set updatetime=300
set shortmess+=c
set signcolumn=yes
set relativenumber
set number
set textwidth=0
set wrapmargin=0
set wrap
set linebreak
set clipboard=unnamed
set noshowmode
set nolist
set lazyredraw
set ttyfast
let mapleader = ","
let g:blamer_enabled = 1
set vb t_vb= " no visual bell & flash
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
set splitbelow
set splitright
" Performance improvements for mac
if has("mac")
set nocursorline

if exists("+relativenumber")
set norelativenumber
endif

set foldlevel=0
set foldmethod=manual
endif

" COC CONFIG {
" Use tab for trigger completion with characters ahead and navigate.
" Use command ':verbose imap <tab>' to make sure tab is not mapped by other plugin.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction

" Use <c-space> to trigger completion.
inoremap <silent><expr> <c-space> coc#refresh()
" Use <cr> to confirm completion, `<C-g>u` means break undo chain at current position.
" Coc only does snippet and additional edit on confirm.
inoremap <expr> <cr> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
" Remap keys for gotos
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
else
call CocAction('doHover')
endif
endfunction


" Highlight symbol under cursor on CursorHold
autocmd CursorHold * silent call CocActionAsync('highlight')
" Remap for rename current word
nmap <leader>rn <Plug>(coc-rename)
"noremap <leader>b :CtrlPBuffer<CR>
noremap <leader>b :Buffers<CR>
noremap <leader>d :CocList diagnostics<CR>
noremap <leader>a :CocAction <CR>
" Remap for format selected region
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
nnoremap <silent> <Leader> :WhichKey ","<CR>
" } COC CONFIG

" Nerd tree Config
map <C-\> :NERDTreeToggle<CR>
" Airline config
let g:airline_powerline_fonts = 1
" don't count trailing whitespace since it lags in huge files
let g:airline#extensions#whitespace#enabled = 0
" disable to improve fugitive performance
let g:airline#extensions#branch#enabled = 0
" put a buffer list at the top
let g:airline#extensions#tabline#enabled = 1

set nocompatible
syntax enable
set background=dark
set expandtab
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
set list
set hlsearch
set incsearch
set showmatch
set noswapfile
set smartcase
set ignorecase
set autoindent
set smartindent
set smarttab
set ruler
set undolevels=1000
set backspace=indent,eol,start
set matchtime=0
colorscheme gruvbox
let g:airline_theme='gruvbox'
set t_Co=256

" Save files automatically when the focus is lost.
autocmd BufLeave,FocusLost * silent! wall
" }

" Fold settings {
set foldenable
set foldmethod=indent
set foldnestmax=10
set foldlevel=99
set conceallevel=0
inoremap <F7> <C-O>za
nnoremap <F7> za
onoremap <F7> <C-C>za
vnoremap <F7> zf
" }

noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
com! FormatJSON %!python -m json.tool

if executable('fzf')
" You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)
let g:fzf_layout = { 'window': 'enew' }
let g:fzf_layout = { 'window': '-tabnew' }
let g:fzf_layout = { 'window': '10new' }
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }
nnoremap <silent> <C-p> :GFiles<cr>
nnoremap <silent> <C-t> :Files <cr>
else
" CtrlP fallback
end

command! -nargs=0 Prettier :CocCommand prettier.formatFile
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocAction('format')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
File renamed without changes.
32 changes: 15 additions & 17 deletions .tmux.conf → tmux.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# enable 256color
set-option -ga terminal-overrides ",screen-256color:Tc"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set-option -sa terminal-overrides ',xterm-256color:RGB'
set -g default-terminal "screen-256color"
set -g history-limit 50000
# Remove annoying delay after pressing ESC.
Expand All @@ -10,6 +11,11 @@ set -g assume-paste-time 0
# vi
set-window-option -g mode-keys vi

# resize panes
bind -n M-S-up resize-pane -U 10
bind -n M-S-down resize-pane -D 10
bind -n M-S-left resize-pane -L 10
bind -n M-S-right resize-pane -R 10
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
Expand Down Expand Up @@ -58,22 +64,14 @@ set-option -g allow-rename off

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'jimeh/tmux-themepack'
set -g @themepack 'powerline/block/cyan'
set -g @plugin 'egel/tmux-gruvbox'

# Color scheme {
# Allows longer session names before the window tabs.
set -g status-left-length 30
set -g status-right-length 30
set -g status-left '#S ∞ '
# 0 is too far from ` ;)
set -g base-index 1
# Loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -g bell-action none
setw -g monitor-activity on # Watch for activity in background windows
# }
# 0 is too far from ` ;)
set -g base-index 1
# Loud or quiet?
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
set -g bell-action none

run '~/.tmux/plugins/tpm/tpm'
50 changes: 9 additions & 41 deletions .vimrc → vimrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@

if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif

call plug#begin()
set termguicolors

Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-surround'
Plug 'morhetz/gruvbox'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'valloric/youcompleteme'
Plug 'Yggdroot/indentLine'
Plug 'sheerun/vim-polyglot'
Plug 'Raimondi/delimitMate'
Plug 'rking/ag.vim'
Plug 'terryma/vim-multiple-cursors'
Plug 'pangloss/vim-javascript'
Plug 'vim-airline/vim-airline'
Plug 'elmcast/elm-vim', {'for': 'elm'}
Plug 'w0rp/ale'
Plug 'flowtype/vim-flow'
Plug 'dracula/vim', { 'as': 'dracula' }

call plug#end()

Expand All @@ -40,37 +40,6 @@ let g:airline#extensions#branch#enabled = 0
" put a buffer list at the top
let g:airline#extensions#tabline#enabled = 1

" ALE config
let g:ale_fixers = {
\ 'javascript': ['prettier', 'eslint'],
\ 'typescript': ['eslint', 'tslint']
\}

" Set this setting in vimrc if you want to fix files automatically on save.
" This is off by default.
let g:ale_fix_on_save = 1
let g:ale_linters = {
\ 'javascript': ['flow']
\}
highlight clear ALEErrorSign " otherwise uses error bg color (typically red)
highlight clear ALEWarningSign " otherwise uses error bg color (typically red)
" %linter% is the name of the linter that provided the message
" %s is the error or warning message
let g:ale_echo_msg_format = '%linter% says %s'
" Map keys to navigate between lines with errors and warnings.

" vim-flow config
"Use locally installed flow
let local_flow = finddir('node_modules', '.;') . '/.bin/flow'
if matchstr(local_flow, "^\/\\w") == ''
let local_flow= getcwd() . "/" . local_flow
endif
if executable(local_flow)
let g:flow#flowpath = local_flow
endif

nnoremap <leader>an :ALENextWrap<cr>
nnoremap <leader>ap :ALEPreviousWrap<cr>

" Default settings {
let mapleader = ","
Expand All @@ -82,7 +51,6 @@ set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
set number
set list
set hlsearch
" set colorcolumn=120
set incsearch
set textwidth=100
set showmatch
Expand Down
8 changes: 4 additions & 4 deletions .zshrc → zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/Users/llago/.oh-my-zsh"
export ZSH="/Users/$USER/.oh-my-zsh"
export PATH=~/bin:$PATH

# Set name of the theme to load --- if set to "random", it will
Expand Down Expand Up @@ -64,7 +64,7 @@ ZSH_THEME="robbyrussell"
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
npm nvm yarn git
npm nvm yarn git zsh-autosuggestions docker docker-compose
)

source $ZSH/oh-my-zsh.sh
Expand Down Expand Up @@ -104,8 +104,6 @@ export NVM_DIR="$HOME/.nvm"
export GIT_EDITOR=vim
export PATH=~/.local/bin:$PATH
export PATH=$PATH:/usr/local/go/bin
export AWS_SDK_LOAD_CONFIG=true


alias delete-branches="git branch --merged | grep -Ev '(^\*|master)' | xargs git branch -d"

Expand All @@ -117,3 +115,5 @@ function change-mac() {
echo "Your new physical address is $mac"
}

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -s "/Users/$USER/.jabba/jabba.sh" ] && source "/Users/$USER/.jabba/jabba.sh"

0 comments on commit 6382384

Please sign in to comment.