From c189c6cc756bf581ee96dce62990dc046737e339 Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Tue, 18 Jun 2024 06:40:28 -0500 Subject: [PATCH 1/2] vim+nvim --- outerheaven.init3.home/.config/nvim/init.vim | 12 +++++ outerheaven.init3.home/.vimrc | 57 ++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 outerheaven.init3.home/.config/nvim/init.vim create mode 100644 outerheaven.init3.home/.vimrc diff --git a/outerheaven.init3.home/.config/nvim/init.vim b/outerheaven.init3.home/.config/nvim/init.vim new file mode 100644 index 0000000..3e33676 --- /dev/null +++ b/outerheaven.init3.home/.config/nvim/init.vim @@ -0,0 +1,12 @@ +set mouse= +" use spaces instead of \t +set expandtab +" match indentation of previous line +set autoindent +set runtimepath^=~/.vim runtimepath+=~/.vim/after +let &packpath = &runtimepath +source ~/.vimrc + +if (has("termguicolors")) + set termguicolors +endif diff --git a/outerheaven.init3.home/.vimrc b/outerheaven.init3.home/.vimrc new file mode 100644 index 0000000..b490349 --- /dev/null +++ b/outerheaven.init3.home/.vimrc @@ -0,0 +1,57 @@ +" NOTE: don't add more LSPs here, use coc - it offers better completion +call plug#begin('~/.vim/exts') +Plug 'AlexvZyl/nordic.nvim', { 'branch': 'main' } +Plug 'neoclide/coc.nvim', {'branch': 'release'} +Plug 'powerman/vim-plugin-AnsiEsc' +Plug 'fladson/vim-kitty' +Plug 'pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh' } " sets filetype needed by coc-ansible +Plug 'ayu-theme/ayu-vim' " or other package manager +call plug#end() + +" misc. preferences +set cursorline +set nu +autocmd FileType yaml setlocal et ts=2 ai sw=2 nu sts=0 +set updatetime=750 +filetype plugin on +syntax on +" colorscheme nord +" colorscheme nordic +" colorscheme slate +" let ayucolor="light" " for light version of theme +" let ayucolor="mirage" " for mirage version of theme +let ayucolor="dark" " for dark version of theme +colorscheme ayu +match Error /\%xA0/ + +" coc.nvim/lsp setup +inoremap + \ coc#pum#visible() ? coc#pum#next(1) : + \ CheckBackspace() ? "\" : + \ coc#refresh() +inoremap coc#pum#visible() ? coc#pum#prev(1) : "\" + +" 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()\" + +function! CheckBackspace() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' +endfunction + +function! ShowDocumentation() + if CocAction('hasProvider', 'hover') + call CocActionAsync('doHover') + else + call feedkeys('K', 'in') + endif +endfunction + +let g:coc_filetype_map = { + \ 'yaml.ansible': 'ansible', + \ } + +" Use K to show documentation in preview window +nnoremap K :CocCommand ansible.ansbileDoc.showInfo From 49f94bb424acc0c7e9391b7626947d291903924f Mon Sep 17 00:00:00 2001 From: Josh Lay Date: Tue, 18 Jun 2024 06:40:44 -0500 Subject: [PATCH 2/2] update.sh: init --- update.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 update.sh diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..c0f37cb --- /dev/null +++ b/update.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# minimal dotfile manager +# tracks files / copies them into the repo, sorted by hostname +# + +# array of files [relative to home] to include +DOTS=( + '.vimrc' + '.config/nvim/init.vim' + '.config/nvim/coc-settings.json' + # '.config/sway' +) + +# ensure the host running this script/updating dotfiles has a directory +# ... then temporarily change into it for working, or exit. +# if it couldn't be made/entered [for whatever reason], we won't be able to copy. +[ -d "$HOSTNAME" ] || mkdir -v "$HOSTNAME" +pushd "$HOSTNAME" || exit + +# now that the host/working dir is managed, process the dotfiles +# ensure their directory structure is retained, then recursively copy +for DOT in "${DOTS[@]}"; do + DOT_DIR="$(dirname "$DOT")" + [ -d "$DOT_DIR" ] || mkdir -vp "$DOT_DIR" + # naively copy; rely on git to tell us about changes + cp -ravp "$HOME/$DOT" "$DOT" +done + +# return where we were +popd || exit