diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ff272f4..c3ae94d 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -58,6 +58,7 @@ Plug 'darfink/vim-plist' Plug 'vim-ruby/vim-ruby' Plug 'kchmck/vim-coffee-script' Plug 'jceb/vim-orgmode' +Plug 'bfontaine/Brewfile.vim' " For vim-orgmode Plug 'tpope/vim-speeddating' call plug#end() @@ -110,7 +111,7 @@ command! -bang -nargs=* Rg call fzf#vim#grep('rg --column --line-number --no-hea noremap / :Rg "noremap / :Rg -function s:get_buffer_git_root(...) +function! s:get_buffer_git_root(...) let root = fugitive#repo().tree(expand('%:p:h')) if empty(root) return s:warn('Not in git repo') @@ -155,12 +156,35 @@ noremap fed :e ~/.config/nvim/init.vim " TODO quickfix for ripgrep results " TODO quickfix for autolint and rake stuff +"autocmd QuickFixCmdPost * botright cwindow 6 +" quickfix things like '-' +"nmap cwc :cclose +"nmap cwo :botright copen 5p +"nmap cn :cnext +"nmap cp :cprevious +"nmap - :cnext +"nmap _ :cprev +"nmap :colder +"nmap :cnewer +" neomake uses the location window rather than quickfix window +noremap - :lnext +noremap _ :lprev +" See ToggleLocationList below " Only lint when leaving insert or changing text in command mode call neomake#configure#automake({ \ 'InsertLeave': {'delay': 0}, \ 'TextChanged': {}, \ }, 500) +let g:neomake_ruby_rubocop_maker = { + \ 'args': ['exec', 'rubocop', '--format', 'emacs', '--force-exclusion', '--display-cop-names'], + \ 'exe': 'bundle', + \ 'errorformat': '%f:%l:%c: %t: %m,%E%f:%l: %m', + \ 'postprocess': function('neomake#makers#ft#ruby#RubocopEntryProcess'), + \ 'output_stream': 'stdout', + \ } +let g:neomake_ruby_rubocop_rails_maker = { + \ } let g:deoplete#enable_at_startup = 1 @@ -186,33 +210,64 @@ nmap :Denite neoyank "vmap y :'<,'>! cat \| tee ~/.local/share/nvim/yank.txt "nmap p o:.!cat ~/.local/share/nvim/yank.txt -" ^n Show number and fold columns in windows {{{2 -if has("eval") - function! FoldNumbers() - " If we're in a wide window, enable line numbers. - "if winwidth(0) >= 76 " 72 + 4, or should I use tw? - " Add folds, or cycle through number schemes - if &foldlevel < 99 && &foldenable && &foldcolumn == 0 - setlocal foldcolumn=1 - elseif (&foldlevel == 99 || ! &foldenable) && &foldcolumn != 0 - setlocal foldcolumn=0 - elseif ! &rnu && ! &nu - setlocal relativenumber - elseif &rnu - setlocal number - setlocal norelativenumber - elseif &nu - setlocal nonumber - endif - "else - " setlocal norelativenumber - " setlocal nonumber - " setlocal foldcolumn=0 - "endif - endfun - "autocmd WinEnter,BufWinEnter,BufNew * :call FoldNumbers() - noremap :call FoldNumbers() -endif + +function! GetBufferList() + redir =>buflist + silent! ls! + redir END + return buflist +endfunction + +function! ToggleLocationList() + let buflist = GetBufferList() + " Close if it's open + for bufnum in map(filter(split(buflist, '\n'), 'v:val =~ "Location List"'), 'str2nr(matchstr(v:val, "\\d\\+"))') + if bufwinnr(bufnum) != -1 + exec('lclose') + return + endif + endfor + " Don't open if it's empty + if len(getloclist(0)) == 0 + echohl ErrorMsg + echo "Location List is Empty." + return + endif + " Open it + let winnr = winnr() + exec('lopen') + " Go back to window + if winnr() != winnr + wincmd p + endif +endfunction +noremap - :call ToggleLocationList() + +" ^n Show number and fold columns in windows +function! FoldNumbers() + " If we're in a wide window, enable line numbers. + "if winwidth(0) >= 76 " 72 + 4, or should I use tw? + " Add folds, or cycle through number schemes + if &foldlevel < 99 && &foldenable && &foldcolumn == 0 + setlocal foldcolumn=1 + elseif (&foldlevel == 99 || ! &foldenable) && &foldcolumn != 0 + setlocal foldcolumn=0 + elseif ! &rnu && ! &nu + setlocal relativenumber + elseif &rnu + setlocal number + setlocal norelativenumber + elseif &nu + setlocal nonumber + endif + "else + " setlocal norelativenumber + " setlocal nonumber + " setlocal foldcolumn=0 + "endif +endfun +"autocmd WinEnter,BufWinEnter,BufNew * :call FoldNumbers() +noremap :call FoldNumbers() " Case insensitivity for searching set ignorecase diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..6884934 --- /dev/null +++ b/Brewfile @@ -0,0 +1,63 @@ +# Work fun +tap "d12frosted/emacs-plus" ; brew "emacs-plus" +cask "blue-jeans-launcher" +cask "docker" # docker docker +cask "hipchat" # Work chat +cask "slack" # Work/fun chat +cask "tunnelblick" # Work vpn +cask "virtualbox" # vms +cask "vagrant" # all the vms +brew "git" # Newer than what brew installs +brew "gnupg" # Crypto, not currency +brew "pinentry-mac" # gpg card pin entry +brew "htop" # L33t +brew "hub" # git, for github +brew "ncdu" # Find big files +brew "neovim" # Edit stuff +brew "ripgrep" # Faster grep/ack/ag +brew "socat" # Better netcat +brew "tmux" # Terminal thingy +brew "reattach-to-user-namespace" # For tmux +brew "unrar" # Rar happens +brew "unzip" # Zip happens +brew "nmap" # Port scanner +brew "p0f" # Passive scanner +cask "minikube" # k8s in a box + +# Mac fun +cask "aerial" # Screensaver +cask "alfred" # Launcher +tap "crisidev/chunkwm" ; brew "chunkwm" # Window manager +tap "koekeishiya/formulae" ; brew "khd" # Keyboard shortcuts +cask "cathode" # Silly terminal +cask "ubersicht" # UI bar +cask "font-hack" # I don't think I use this any more +cask "font-liberation-mono-for-powerline" # For neovim + +# Game fun +cask "angband" # Morgoth +cask "brogue" # Less goth +cask "steam" # Meta game + +# Life fun +cask "1password" # Family accounts +cask "adobe-creative-cloud" # Family pictures +brew "ddrescue" # Photo recover +brew "exiftool" # Photo munge +brew "imagemagick" # manipulation +cask "arq" # Family backups +cask "discord" # Friend chat +cask "dropbox" # File sync +cask "onedrive" # File sync +cask "little-snitch" # Personal egress filtering +cask "vlc" # Music videos +brew "youtube-dl" # Music videos +cask "zerotier-one" # Personal network +# cask microsoft-office # Not 365 apparently + +# Browsers +cask "brave" # For bt +cask "firefox" # Personal browsing +cask "firefoxnightly" # Work browsing +cask "multifirefox" # Profile manager +cask "google-chrome" # Flash/music