From e4ff941e25de8ef01371eef9fd291c47245aa272 Mon Sep 17 00:00:00 2001 From: Fran Date: Thu, 5 Aug 2021 12:40:22 -0500 Subject: [PATCH] Switch to neovim, update skhd, iterm, yabai --- .config/nvim/coc.vim | 36 ++++++++++ .config/nvim/init.vim | 7 ++ .config/skhd/skhdrc | 4 +- .config/tmux/com.googlecode.iterm2.plist | 18 ++--- .config/yabai/yabairc | 2 + .vim/vimrc | 88 +++++++++++++----------- .zshrc | 27 +++++++- 7 files changed, 125 insertions(+), 57 deletions(-) create mode 100644 .config/nvim/coc.vim create mode 100644 .config/nvim/init.vim diff --git a/.config/nvim/coc.vim b/.config/nvim/coc.vim new file mode 100644 index 0000000..33694be --- /dev/null +++ b/.config/nvim/coc.vim @@ -0,0 +1,36 @@ +" COC Edits +" Use tab for trigger completion with characters ahead and navigate. +" NOTE: Use command ':verbose imap ' to make sure tab is not mapped by +" other plugin before putting this into your config. +inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() +inoremap pumvisible() ? "\" : "\" + +function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +" Use to trigger completion. +if has('nvim') + inoremap coc#refresh() +else + inoremap coc#refresh() +endif + + +" 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) + +set runtimepath^=/home/xyvs/.vim/plugged/coc.nvim +filetype plugin indent on +syntax on diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim new file mode 100644 index 0000000..1d8d916 --- /dev/null +++ b/.config/nvim/init.vim @@ -0,0 +1,7 @@ +set runtimepath^=~/.vim runtimepath+=~/.vim/after +let &packpath=&runtimepath + +source ~/.vim/vimrc +source ~/.config/nvim/coc.vim + +lua require('telescope').load_extension('coc') diff --git a/.config/skhd/skhdrc b/.config/skhd/skhdrc index 25cad88..1f79d13 100644 --- a/.config/skhd/skhdrc +++ b/.config/skhd/skhdrc @@ -9,7 +9,7 @@ alt - tab : yabai -m display --focus next || yabai -m display --focus first cmd - o : yabai -m space --create && \ index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')" && \ yabai -m space --focus "${index}" -cmd - p : yabai -m space --destroy +# cmd - p : yabai -m space --destroy # Doesn't work # switch spaces cmd - 1 : yabai -m space --focus 1 @@ -59,7 +59,7 @@ cmd + shift - 4 : yabai -m window --space 4 cmd + shift - 5 : yabai -m window --space 5 # toggle full screen windows -cmd - f : yabai -m window --toggle zoom-fullscreen +cmd - s : yabai -m window --toggle zoom-fullscreen # toogle floating windows cmd - d : yabai -m window --toggle float diff --git a/.config/tmux/com.googlecode.iterm2.plist b/.config/tmux/com.googlecode.iterm2.plist index 8c4f075..4ee2c5a 100644 --- a/.config/tmux/com.googlecode.iterm2.plist +++ b/.config/tmux/com.googlecode.iterm2.plist @@ -4,16 +4,6 @@ AlternateMouseScroll - AppleAntiAliasingThreshold - 1 - ApplePressAndHoldEnabled - - AppleScrollAnimationEnabled - 0 - AppleSmoothFixedFontsSizeThreshold - 1 - AppleWindowTabbingMode - manual BadgeRightMargin 10 BadgeTopMargin @@ -721,13 +711,13 @@ Alpha Component 1 Blue Component - 0.066666670143604279 + 0.029576778411865234 Color Space sRGB Green Component - 0.066666670143604279 + 0.029576778411865234 Red Component - 0.066666670143604279 + 0.029576778411865234 Background Image Location @@ -1296,6 +1286,8 @@ 30 VisualIndicatorForEsc + findMode_iTerm + 0 kCPKSelectionViewPreferredModeKey 0 kCPKSelectionViewShowHSBTextFieldsKey diff --git a/.config/yabai/yabairc b/.config/yabai/yabairc index 61e7423..7e37844 100755 --- a/.config/yabai/yabairc +++ b/.config/yabai/yabairc @@ -58,5 +58,7 @@ yabai -m rule --add app="^Hyperkey$" manage=off yabai -m rule --add app="^Finder$" manage=off yabai -m rule --add app="^IINA$" manage=off yabai -m rule --add app="^mpv$" manage=off +yabai -m rule --add app="^LastPass$" manage=off +yabai -m rule --add app="^Calendar$" manage=off echo "yabai configuration loaded.." diff --git a/.vim/vimrc b/.vim/vimrc index 50af30b..46c6dc3 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -1,44 +1,33 @@ -" Plugins will be downloaded under the specified directory. call plug#begin('~/.vim/plugged') -" Declare the list of plugins -" List ends here. Plugins become visible to Vim after this call. - -" Themes -Plug 'arcticicestudio/nord-vim' -Plug 'sonph/onehalf', {'rtp': 'vim/'} +" themes Plug 'fxn/vim-monochrome' +Plug 'dylanaraps/wal.vim' -" Finder -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' - -" Snippets -Plug 'sheerun/vim-polyglot' -Plug 'MarcWeber/vim-addon-mw-utils' -Plug 'tomtom/tlib_vim' -Plug 'https://github.com/honza/vim-snippets' - -" Autocomplete -Plug 'ervandew/supertab' +" autocomplete Plug 'neoclide/coc.nvim', {'branch': 'release'} -Plug 'mattn/emmet-vim' -" Other +" other Plug 'preservim/nerdcommenter' Plug 'scrooloose/nerdtree' Plug '907th/vim-auto-save' -Plug 'airblade/vim-gitgutter' + +" telescope +Plug 'nvim-lua/popup.nvim' +Plug 'nvim-lua/plenary.nvim' +Plug 'nvim-telescope/telescope.nvim' +Plug 'fannheyward/telescope-coc.nvim' + +" debugging +Plug 'puremourning/vimspector' call plug#end() -" Theme settings for tmux +" theme settings set termguicolors let &t_8f = "\[38;2;%lu;%lu;%lum" let &t_8b = "\[48;2;%lu;%lu;%lum" -set background=dark - if (empty($TMUX)) if (has("nvim")) let $NVIM_TUI_ENABLE_TRUE_COLOR=1 @@ -48,43 +37,64 @@ if (empty($TMUX)) endif endif -"Set syntax highlighter" +set background=dark colorscheme minochrome -" Windows Splits +" new leader key +nnoremap +let mapleader=" " + +" windows splits nnoremap nnoremap nnoremap nnoremap -" No Arrow Keys +" no arrow keys noremap noremap noremap noremap -" Fuzzy Map Key -nnoremap :Files -nnoremap :GFiles -nnoremap :Rg! -nnoremap :NERDTreeToggle +" telescope essentials +nnoremap ff Telescope find_files +nnoremap fg Telescope live_grep +nnoremap fb Telescope buffers +nnoremap ft Telescope -" Replace command +" telescope git +nnoremap gs Telescope git_status +nnoremap gb Telescope git_branches +nnoremap gc Telescope git_commits + +" telescope coc +nmap gd Telescope coc definitions +nmap gr Telescope coc references + +" debugging keys +nmap dd VimspectorContinue +nmap ds VimspectorStop +nmap dr VimpectorRestart +nmap dv VimspectorToggleBreakpoint + +" replace command vnoremap "hy:%s/h//gc -" Emmet Key Binding +" emmet key binding let g:user_emmet_leader_key=',' -" Build Commands +" build commands nnoremap :w:!clear;python3 % nnoremap :w:!clear;pipenv run pytest -v -" VIM Settings -set rtp+=/usr/local/opt/fzf - +" vim settings set number +set hidden +set nohlsearch +set nocompatible set relativenumber set tabstop=4 softtabstop=0 expandtab shiftwidth=4 set backspace=indent,eol,start let g:auto_save = 1 + diff --git a/.zshrc b/.zshrc index c618bbf..739169f 100644 --- a/.zshrc +++ b/.zshrc @@ -71,7 +71,18 @@ ZSH_THEME="robbyrussell" # Custom plugins may be added to $ZSH_CUSTOM/plugins/ # Example format: plugins=(rails git textmate ruby lighthouse) # Add wisely, as too many plugins slow down shell startup. -plugins=(git) +# Append a command directly + +zvm_after_init_commands+=('[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh') + +plugins=( + zsh-autosuggestions + git + sudo + dirhistory + osx + k +) source $ZSH/oh-my-zsh.sh @@ -101,11 +112,21 @@ source $ZSH/oh-my-zsh.sh # alias zshconfig="mate ~/.zshrc" # alias ohmyzsh="mate ~/.oh-my-zsh" +alias v="nvim" + export LDFLAGS="-L/usr/local/opt/openssl/lib" export CPPFLAGS="-I/usr/local/opt/openssl/include" - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh export PATH="/usr/local/opt/openjdk/bin:$PATH" +# fuzzy finder +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +# nvm config export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + +# enhancd +export ENHANCD_DISABLE_DOT=1 +export ENHANCD_DISABLE_HOME=1 +export ENHANCD_HYPHEN_ARG=1 +source ~/.enhancd/init.sh