From b53f430f59155f5cee67ce0bd29f00fd48f37b60 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Wed, 16 Oct 2024 11:24:23 -0500 Subject: [PATCH] Boomeranging back to Neovim Been playing with new color schemes as I've switched to Alacritty. Ran into a scenario where there was a color scheme for Neovim and not Vim. New color scheme is solid, so my previous color scheme issues are now null and void. Instead of juggling around with a shared configuration, I've committed to a separate configuration for Vim and Neovim. --- alacritty/.config/alacritty/alacritty.toml | 2 +- git/.gitconfig | 2 +- vim/.config/nvim/init.vim | 70 +++++++++++++++++++++- zsh/.aliases | 4 ++ zsh/.env | 2 +- 5 files changed, 74 insertions(+), 6 deletions(-) diff --git a/alacritty/.config/alacritty/alacritty.toml b/alacritty/.config/alacritty/alacritty.toml index e86724e..a14218c 100644 --- a/alacritty/.config/alacritty/alacritty.toml +++ b/alacritty/.config/alacritty/alacritty.toml @@ -1,4 +1,4 @@ -import = ['~/.config/alacritty/themes/solarized_dark.toml'] +import = ['~/.config/alacritty/themes/solarized_osaka.toml'] [window] padding.x = 5 diff --git a/git/.gitconfig b/git/.gitconfig index 9cc1dce..aaec6b6 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -14,7 +14,7 @@ status = auto [core] - editor = vim + editor = nvim [diff] compactionHeuristic = true diff --git a/vim/.config/nvim/init.vim b/vim/.config/nvim/init.vim index f182e5b..4ef2567 100644 --- a/vim/.config/nvim/init.vim +++ b/vim/.config/nvim/init.vim @@ -1,3 +1,67 @@ -set runtimepath^=~/.vim runtimepath+=~/.vim/after -let &packpath = &runtimepath -source ~/.vimrc +" Download vim-plug if it's not already present +if empty(glob('~/.local/share/nvim/site/autoload/plug.vim')) + silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs + \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim +endif + +" A humble list of plugins +call plug#begin() + " Solarized Osaka + Plug 'craftzdog/solarized-osaka.nvim' + " File exploration and navigation + Plug 'junegunn/fzf.vim' + " Languages and syntax + Plug 'sheerun/vim-polyglot' + " Style guide and linting + Plug 'dense-analysis/ale' + Plug 'editorconfig/editorconfig-vim' + " TypeScript + Plug 'leafgarland/typescript-vim' + Plug 'Quramy/tsuquyomi' + Plug 'Shougo/vimproc.vim', {'do' : 'make'} + " GitHub integration + Plug 'github/copilot.vim' + Plug 'ruanyl/vim-gh-line' +call plug#end() + +" Color scheme and syntax highlighting +syntax on +colorscheme solarized-osaka +set background=dark +" Ensures misspellings are highlighted +highlight SpellBad ctermfg=white ctermbg=red + +" Global settings +set autoindent +set colorcolumn=80,100,120 +set expandtab +set hidden +set hlsearch +set ignorecase +set incsearch +set laststatus=2 +set number +set relativenumber +set shiftwidth=2 +set smartindent +set softtabstop=2 +set tabstop=2 +set undofile + +" Filetype-specific settings +autocmd FileType gitcommit setl colorcolumn=50,72 textwidth=72 +autocmd FileType gitcommit,markdown,text setl nosmartindent spell +autocmd FileType markdown,text setl textwidth=80 wrapmargin=2 +autocmd FileType php,python setl shiftwidth=4 softtabstop=4 tabstop=4 + +" Strip trailing whitespace on save +autocmd BufWritePre * :%s/\s\+$//e + +" Set the runtime path for fzf based on OS +if has('mac') + set rtp+=/opt/homebrew/opt/fzf +elseif executable('apt') + set rtp+=/usr/share/doc/fzf/examples +elseif executable('pacman') + set rtp+=~/.fzf +endif diff --git a/zsh/.aliases b/zsh/.aliases index 86ec3d1..b0082b0 100644 --- a/zsh/.aliases +++ b/zsh/.aliases @@ -88,3 +88,7 @@ alias grb='git rebase' alias grbm='git rebase $(git_default_branch)' alias grm='git rm' alias gst='git status' + +# Use nvim in place of vim +alias vim='nvim' +alias vimdiff='nvim -d' diff --git a/zsh/.env b/zsh/.env index 232b24e..090c8d8 100644 --- a/zsh/.env +++ b/zsh/.env @@ -1,5 +1,5 @@ export CLICOLOR=1 -export EDITOR=vim +export EDITOR=vvim export KEYTIMEOUT=1 export QUOTING_STYLE=literal export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/gcr/ssh