diff --git a/install.sh b/install.sh index 0c0caec..9daaaab 100755 --- a/install.sh +++ b/install.sh @@ -30,7 +30,8 @@ then starship \ nodejs \ ripgrep \ - fd + fd \ + typos-bin fi echo "== zplug" diff --git a/nvim/init.vim b/nvim/init.vim index 52b62ce..e251f60 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -14,7 +14,7 @@ Plug 'tpope/vim-obsession' Plug 'tmux-plugins/vim-tmux-focus-events' " Look Plug 'vim-airline/vim-airline' -Plug 'sonph/onehalf', { 'rtp': 'vim' } +Plug 'sainnhe/edge' Plug 'Yggdroot/indentLine' " Git Plug 'airblade/vim-gitgutter' @@ -43,6 +43,7 @@ let g:coc_global_extensions = [ \ 'coc-pairs', \ 'coc-prisma', \ 'coc-sh', + \ 'coc-typos', \ ] if isdirectory('./node_modules') && isdirectory('./node_modules/prettier') let g:coc_global_extensions += ['coc-prettier'] @@ -51,6 +52,11 @@ if isdirectory('./node_modules') && isdirectory('./node_modules/eslint') let g:coc_global_extensions += ['coc-eslint'] endif +" Make to accept selected completion item or notify coc.nvim to format +" u breaks current undo, please make your own choice. +inoremap coc#pum#visible() ? coc#pum#confirm() + \: "\u\\=coc#on_enter()\" + " Diagnostic list nnoremap d :CocList diagnostics " Symbols list @@ -193,7 +199,7 @@ set incsearch " search as you type set ignorecase set smartcase set mouse=a -set spell spelllang=en_us +"set spell spelllang=en_us set updatetime=300 set cmdheight=2 set hidden @@ -229,6 +235,13 @@ nnoremap fcdi Telescope coc diagnostics nnoremap fcde Telescope coc definitions nnoremap fcds Telescope coc document_symbols nnoremap fcws Telescope coc workspace_symbols +" Typos coc +" Move to next misspelled word after the cursor, 'wrapscan' applies. +nmap ]s (coc-typos-next) +" Move to previous misspelled word after the cursor, 'wrapscan' applies. +nmap [s (coc-typos-prev) +" Fix typo at cursor position +nmap z= (coc-typos-fix) """"" "- Visuals @@ -237,7 +250,29 @@ set number set cursorline set hlsearch " highlight all results set signcolumn=number " always show git diff column -colorscheme onehalflight + +"Credit joshdick +"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux. +"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support +"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.) +if (empty($TMUX)) + if (has("nvim")) + "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 > + let $NVIM_TUI_ENABLE_TRUE_COLOR=1 + endif + "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 > + "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd > + " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 > + if (has("termguicolors")) + set termguicolors + endif +endif +set background=light +let g:edge_enable_italic = 1 +let g:edge_background = 'hard' +let g:edge_diagnostic_line_highlight = 1 +let g:edge_better_performance = 1 +colorscheme edge if !exists('g:airline_symbols') let g:airline_symbols = {} @@ -252,4 +287,4 @@ let g:airline_right_sep='' let g:airline_detect_spell=0 let g:airline#extensions#coc#enabled = 1 let g:airline#parts#ffenc#skip_expected_string='utf-8[unix]' -let g:airline_theme = 'onehalflight' +let g:airline_theme = 'edge'