diff --git a/bin/refresh-os b/bin/refresh-os
new file mode 100755
index 0000000..3e26932
--- /dev/null
+++ b/bin/refresh-os
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+curl -sf "https://api.opensea.io/api/v1/asset/$1/$2/?force_update=true" > /dev/null
diff --git a/brew/Brewfile.symlink b/brew/Brewfile.symlink
index 4f395b0..2306303 100644
--- a/brew/Brewfile.symlink
+++ b/brew/Brewfile.symlink
@@ -32,9 +32,6 @@ brew "zsh-syntax-highlighting"
tap "homebrew/services"
-tap "mongodb/brew"
-brew "mongodb-community"
-
tap "federico-terzi/espanso"
brew "espanso"
@@ -44,6 +41,7 @@ tap "homebrew/cask"
cask "acorn"
cask "airtable"
cask "appzapper"
+cask "blackhole-2ch"
cask "dash"
cask "docker"
cask "dropshare"
diff --git a/git/gitconfig-elastic.symlink b/git/gitconfig-elastic.symlink
deleted file mode 100644
index 6684db1..0000000
--- a/git/gitconfig-elastic.symlink
+++ /dev/null
@@ -1,5 +0,0 @@
-; vim: set ft=gitconfig
-[user]
- name = Mikkel Malmberg
- email = mikkel@elastic.co
- signingkey = 9C9B52C885562C40
diff --git a/git/gitconfig.symlink b/git/gitconfig.symlink
index 6e3f57c..1a4aab8 100644
--- a/git/gitconfig.symlink
+++ b/git/gitconfig.symlink
@@ -56,8 +56,6 @@
helper = osxkeychain
[credential "https://github.com"]
username = mikker
-[includeIf "gitdir:~/dev/elastic/"]
- path = "~/.gitconfig-elastic"
[commit]
gpgsign = true
[merge]
diff --git a/git/gitignore.symlink b/git/gitignore.symlink
index 750ae88..a11f0c8 100644
--- a/git/gitignore.symlink
+++ b/git/gitignore.symlink
@@ -1,21 +1,3 @@
-.DS_Store
-*~
-.sass-cache
-node_modules
-jspm_packages
-
-## Xcode specific
-*.pbxuser
-!default.pbxuser
-*.mode1v3
-!default.mode1v3
-*.mode2v3
-!default.mode2v3
-*.perspectivev3
-!default.perspectivev3
-xcuserdata/
-
-tags
-tags.temp
-tags.lock
-
+artifacts/
+cache/
+.env
diff --git a/iterm/com.googlecode.iterm2.plist b/iterm/com.googlecode.iterm2.plist
index 7f0ccbb..1848a2c 100644
--- a/iterm/com.googlecode.iterm2.plist
+++ b/iterm/com.googlecode.iterm2.plist
@@ -3414,7 +3414,7 @@
Non-ASCII Anti Aliased
Normal Font
- VictorMono-SemiBold 16
+ MonoLisa-Light 16
Option Key Sends
0
Place Prompt at First Column
diff --git a/vim/vim.symlink/autoload/plug.vim b/vim/vim.symlink/autoload/plug.vim
index b6e4cbf..8a195d3 100644
--- a/vim/vim.symlink/autoload/plug.vim
+++ b/vim/vim.symlink/autoload/plug.vim
@@ -242,6 +242,8 @@ function! plug#begin(...)
let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p'))
elseif exists('g:plug_home')
let home = s:path(g:plug_home)
+ elseif has('nvim')
+ let home = stdpath('data') . '/plugged'
elseif !empty(&rtp)
let home = s:path(split(&rtp, ',')[0]) . '/plugged'
else
@@ -405,7 +407,7 @@ function! plug#end()
for [map, names] in items(lod.map)
for [mode, map_prefix, key_prefix] in
- \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
+ \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
execute printf(
\ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")',
\ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)
diff --git a/vim/vim.symlink/autoload/plug.vim.old b/vim/vim.symlink/autoload/plug.vim.old
index 6a958cb..ad95041 100644
--- a/vim/vim.symlink/autoload/plug.vim.old
+++ b/vim/vim.symlink/autoload/plug.vim.old
@@ -405,7 +405,7 @@ function! plug#end()
for [map, names] in items(lod.map)
for [mode, map_prefix, key_prefix] in
- \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
+ \ [['i', '', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
execute printf(
\ '%snoremap %s %s:call lod_map(%s, %s, %s, "%s")',
\ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)
@@ -1208,7 +1208,8 @@ function! s:update_impl(pull, force, args) abort
normal! 2G
silent! redraw
- let s:clone_opt = []
+ " Set remote name, overriding a possible user git config's clone.defaultRemoteName
+ let s:clone_opt = ['--origin', 'origin']
if get(g:, 'plug_shallow', 1)
call extend(s:clone_opt, ['--depth', '1'])
if s:git_version_requirement(1, 7, 10)
diff --git a/vim/vim.symlink/plugins.vim b/vim/vim.symlink/plugins.vim
index 93113d2..7d139bb 100644
--- a/vim/vim.symlink/plugins.vim
+++ b/vim/vim.symlink/plugins.vim
@@ -89,14 +89,14 @@ Plug 'tomlion/vim-solidity'
Plug 'vimwiki/vimwiki'
Plug 'etdev/vim-hexcolor'
-" Plug 'neoclide/coc.nvim', {'branch': 'release'}
+Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'yarn install --frozen-lockfile'}
if has("nvim") && !has("gui_vimr")
- Plug 'neovim/nvim-lspconfig'
- Plug 'kabouzeid/nvim-lspinstall'
+ " Plug 'neovim/nvim-lspconfig'
+ " Plug 'kabouzeid/nvim-lspinstall'
" Plug 'folke/lsp-colors.nvim'
" Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
- Plug 'nvim-lua/completion-nvim'
+ " Plug 'nvim-lua/completion-nvim'
" Plug 'glepnir/lspsaga.nvim'
endif
diff --git a/vim/vimrc.symlink b/vim/vimrc.symlink
index e913f40..a0c556c 100644
--- a/vim/vimrc.symlink
+++ b/vim/vimrc.symlink
@@ -359,9 +359,10 @@ let g:vrc_curl_opts = {
nnoremap F :Prettier
-if has('nvim') && !has("gui_vimr")
- luafile ~/.vim/lsp.lua
-endif
+" if has('nvim') && !has("gui_vimr")
+" luafile ~/.vim/lsp.lua
+" autocmd BufEnter * lua require'completion'.on_attach()
+" endif
" Auto-darkmode
let output = system("is-this-dark-mode")
@@ -371,21 +372,131 @@ else
set background=light
endif
-" let g:coc_global_extensions = ['coc-json', 'coc-tsserver', 'coc-css', 'coc-tailwindcss', 'coc-html', 'coc-elixir']
+command! -nargs=0 Rubyfmt %!rubyfmt %
+
+let g:coc_global_extensions = ['coc-tsserver', 'coc-css', 'coc-tailwindcss', 'coc-html']
-" Use and to navigate through popup menu
-inoremap pumvisible() ? "\" : "\"
-inoremap pumvisible() ? "\" : "\"
+" ---- COC
-" Set completeopt to have a better completion experience
-set completeopt=menuone,noinsert,noselect
+" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
+" delays and poor user experience.
+set updatetime=300
-" Avoid showing message extra message when using completion
+" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
-command! -nargs=0 Rubyfmt %!rubyfmt %
+" " Make auto-select the first completion item and notify coc.nvim to
+" " format on enter, could be remapped by other vim plugin
+" inoremap pumvisible() ? coc#_select_confirm()
+" \: "\u\\=coc#on_enter()\"
+
+" Use `[g` and `]g` to navigate diagnostics
+" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
+nmap [g (coc-diagnostic-prev)
+nmap ]g (coc-diagnostic-next)
+
+" GoTo code navigation.
+nmap gd (coc-definition)
+nmap gy (coc-type-definition)
+nmap gi (coc-implementation)
+nmap gr (coc-references)
+
+" Use K to show documentation in preview window.
+nnoremap K :call show_documentation()
+
+function! s:show_documentation()
+ if (index(['vim','help'], &filetype) >= 0)
+ execute 'h '.expand('')
+ elseif (coc#rpc#ready())
+ call CocActionAsync('doHover')
+ else
+ execute '!' . &keywordprg . " " . expand('')
+ endif
+endfunction
+
+" Highlight the symbol and its references when holding the cursor.
+autocmd CursorHold * silent call CocActionAsync('highlight')
+
+" Symbol renaming.
+nmap rn (coc-rename)
-if has('nvim') && !has("gui_vimr")
- autocmd BufEnter * lua require'completion'.on_attach()
+" Formatting selected code.
+" xmap f (coc-format-selected)
+" nmap f (coc-format-selected)
+
+augroup mygroup
+ autocmd!
+ " Setup formatexpr specified filetype(s).
+ autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
+ " Update signature help on jump placeholder.
+ autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
+augroup end
+
+" Applying codeAction to the selected region.
+" Example: `aap` for current paragraph
+xmap a (coc-codeaction-selected)
+nmap a (coc-codeaction-selected)
+
+" Remap keys for applying codeAction to the current buffer.
+nmap ac (coc-codeaction)
+" Apply AutoFix to problem on the current line.
+nmap qf (coc-fix-current)
+
+" Map function and class text objects
+" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
+xmap if (coc-funcobj-i)
+omap if (coc-funcobj-i)
+xmap af (coc-funcobj-a)
+omap af (coc-funcobj-a)
+xmap ic (coc-classobj-i)
+omap ic (coc-classobj-i)
+xmap ac (coc-classobj-a)
+omap ac (coc-classobj-a)
+
+" Remap and for scroll float windows/popups.
+if has('nvim-0.4.0') || has('patch-8.2.0750')
+ nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\"
+ nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\"
+ inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\"
+ inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\"
+ vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\"
+ vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\"
endif
+" Use CTRL-S for selections ranges.
+" Requires 'textDocument/selectionRange' support of language server.
+nmap (coc-range-select)
+xmap (coc-range-select)
+
+" Add `:Format` command to format current buffer.
+command! -nargs=0 Format :call CocAction('format')
+
+" Add `:Fold` command to fold current buffer.
+command! -nargs=? Fold :call CocAction('fold', )
+
+" Add `:OR` command for organize imports of the current buffer.
+command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport')
+
+" Add (Neo)Vim's native statusline support.
+" NOTE: Please see `:h coc-status` for integrations with external plugins that
+" provide custom statusline: lightline.vim, vim-airline.
+set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
+
+" Mappings for CoCList
+" Show all diagnostics.
+nnoremap a :CocList diagnostics
+" Manage extensions.
+" nnoremap e :CocList extensions
+" Show commands.
+nnoremap c :CocList commands
+" Find symbol of current document.
+nnoremap o :CocList outline
+" Search workspace symbols.
+nnoremap s :CocList -I symbols
+" Do default action for next item.
+" nnoremap j :CocNext
+" Do default action for previous item.
+" nnoremap k :CocPrev
+" Resume latest coc list.
+nnoremap p :CocListResume
+