From 3c4561d9e7647cd891a98ca241f686f498624643 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 12 Jun 2022 05:12:39 -0700 Subject: [PATCH 1/6] nvim: remove satellite (it caused problems) --- .config/nvim/lua/blake/plugins.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 9922730..2670462 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -356,16 +356,16 @@ return require('packer').startup({function() require('cleanfold').setup() end, } - use { -- lewis6991: sattelite: small scroll bar - 'lewis6991/satellite.nvim', - config = function() - require('satellite').setup() - vim.cmd [[ - nnoremap nohlsearch\|diffupdate\|SatelliteRefresh - inoremap nohlsearch\|diffupdate\|SatelliteRefresh - ]] - end, - } + -- use { -- lewis6991: sattelite: small scroll bar + -- 'lewis6991/satellite.nvim', + -- config = function() + -- require('satellite').setup() + -- vim.cmd [[ + -- nnoremap nohlsearch\|diffupdate\|SatelliteRefresh + -- inoremap nohlsearch\|diffupdate\|SatelliteRefresh + -- ]] + -- end, + -- } use { -- tpope: surround 'tpope/vim-surround' } From 24d89b6ac68856c8e7b5305de1dda86ba4825439 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Sun, 12 Jun 2022 23:44:08 -0700 Subject: [PATCH 2/6] sitepath: change url to add 'www.' --- .config/shell/bin/sitepath | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/shell/bin/sitepath b/.config/shell/bin/sitepath index fc41f24..7dc59b8 100755 --- a/.config/shell/bin/sitepath +++ b/.config/shell/bin/sitepath @@ -7,7 +7,7 @@ # usage: sitepath # usage: sitepath -- you can search with 'fd' if you put in a command -BASE_URL="https://blakenorth.net" +BASE_URL="https://www.blakenorth.net" SITE_DIR="/home/blake/docker/blakenorth.net/site" SEPERATOR='~' # Make this a character you don't use in filenames. It's for sed. From 4f78647c51d43d4524d15db3696bf05b802f5c46 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Jun 2022 19:51:37 -0700 Subject: [PATCH 3/6] dotfiles-install: now handles file paths with spaces --- .local/bin/dotfiles-install.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.local/bin/dotfiles-install.sh b/.local/bin/dotfiles-install.sh index 0028d69..65cb028 100755 --- a/.local/bin/dotfiles-install.sh +++ b/.local/bin/dotfiles-install.sh @@ -1,18 +1,22 @@ -#!/bin/bash +#!/bin/sh # this script will install the dotfiles from the target git repository, and back up any conflicting files # credit for this idea and basic script outline goes to https://www.atlassian.com/git/tutorials/dotfiles -# TODO: make it so line 31 (DOTFILES_BACKUP_LIST) can handle spaces (do it in a for loop) +## shellcheck +# Allow variables in single quotes +# shellcheck disable=SC2016 +# read -d is not posix-complient (but it exists in sh on my machine, so it's probably fine) +# shellcheck disable=SC3045 DOTFILES_REPO_DIR="$HOME/git/dotfiles" DOTFILES_REPO_URL="https://git.blakenorth.net/dotfiles" -DOTFILES_BACKUP_DIR="$HOME/.dotfiles-backup" # cannot contain the character '#' +DOTFILES_BACKUP_DIR="$HOME/.dotfiles-backup" set -e # check for the git command and exit if it doesn't exist if ! command -v git > /dev/null;then - echo 'git is not installed or could not be found in $PATH, please install git to proceed' + echo 'git is not installed or could not be found in PATH, please install git to proceed' exit 1 fi @@ -22,19 +26,21 @@ dot() { git --git-dir="$DOTFILES_REPO_DIR" --work-tree="$HOME" "$@" } -# remove the '&> /dev/null' part if things don't seem to work right -if dot checkout > /dev/null 2>&1; then - echo "Checked out dotfiles." -else +# remove the '> /dev/null' part if things don't seem to work right +if ! dot checkout > /dev/null 2>&1; then echo "Backing up pre-existing dotfiles." + mkdir -p "$DOTFILES_BACKUP_DIR" + # get the list of files that need to be backed up - DOTFILES_BACKUP_LIST=($(dot checkout 2>&1 | grep -Po "(?<=\t)(.*)$")) - # create directories for everything that needs one - mkdir -p "$DOTFILES_BACKUP_DIR" $(printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | grep -Po '.*/' | sed "s#.*#$DOTFILES_BACKUP_DIR/&#g") - # backup existing files to avoid them being overwritten - printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | xargs -I{} mv "$HOME"/{} "$DOTFILES_BACKUP_DIR"/{} + dot checkout 2>&1 | grep -Po "(?<=\t)(.*)$" | + while read -rd '' LINE; do + LINE_DIR="${LINE%%/*}" + mkdir -p "$DOTFILES_BACKUP_DIR/${LINE_DIR#"$HOME"}/${LINE##*/}" + mv "$FILE" "$DOTFILES_BACKUP_DIR" + done fi dot checkout dot config status.showUntrackedFiles no +echo "Done" From 9008b443242bed87cc8363c966fcfb1815919331 Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Wed, 15 Jun 2022 19:53:05 -0700 Subject: [PATCH 4/6] nvim: fix cmdline path completions --- .config/nvim/lua/blake/lsp.lua | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.config/nvim/lua/blake/lsp.lua b/.config/nvim/lua/blake/lsp.lua index 681849e..776ba27 100644 --- a/.config/nvim/lua/blake/lsp.lua +++ b/.config/nvim/lua/blake/lsp.lua @@ -152,18 +152,6 @@ M.cmp = function() { name = 'cmdline' }, { name = 'emoji' }, }, - cmp.setup.cmdline('/', { - sources = { - { name = 'buffer' } - } - }), - cmp.setup.cmdline(':', { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = 'path' }, - { name = 'cmdline' } - }), - }), formatting = { format = function(entry, vim_item) -- fancy icons and a name of kind @@ -196,6 +184,28 @@ M.cmp = function() ghost_text = true, } } + + -- Thanks to iwataka on github for this bit + local search_config = { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' }, + } + } + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline('/', search_config) + cmp.setup.cmdline('?', search_config) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) end -- <<< -- lspconfig >>> From 24463705ee2dded4073f52474da0dd00a0c227dc Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 17 Jun 2022 00:47:58 -0700 Subject: [PATCH 5/6] dotfiles-install: handle directories with spaces properly, auto resume installation, friendly information messages --- .local/bin/dotfiles-install.sh | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/.local/bin/dotfiles-install.sh b/.local/bin/dotfiles-install.sh index 65cb028..bd2550c 100755 --- a/.local/bin/dotfiles-install.sh +++ b/.local/bin/dotfiles-install.sh @@ -1,26 +1,22 @@ #!/bin/sh # this script will install the dotfiles from the target git repository, and back up any conflicting files -# credit for this idea and basic script outline goes to https://www.atlassian.com/git/tutorials/dotfiles - -## shellcheck -# Allow variables in single quotes -# shellcheck disable=SC2016 -# read -d is not posix-complient (but it exists in sh on my machine, so it's probably fine) -# shellcheck disable=SC3045 +# credit for the basic outline of this script goes to https://www.atlassian.com/git/tutorials/dotfiles DOTFILES_REPO_DIR="$HOME/git/dotfiles" DOTFILES_REPO_URL="https://git.blakenorth.net/dotfiles" -DOTFILES_BACKUP_DIR="$HOME/.dotfiles-backup" +DOTFILES_BACKUP_DIR="$HOME/.dotfiles-backup_$(date +'%Y-%m-%d_%H:%m:%S')" set -e +printf "\n Installing dotfiles from $DOTFILES_REPO_URL\n\n" + # check for the git command and exit if it doesn't exist if ! command -v git > /dev/null;then echo 'git is not installed or could not be found in PATH, please install git to proceed' exit 1 fi -git clone --bare "$DOTFILES_REPO_URL" "$DOTFILES_REPO_DIR" +git clone --bare "$DOTFILES_REPO_URL" "$DOTFILES_REPO_DIR" || echo "Resuming installation" dot() { git --git-dir="$DOTFILES_REPO_DIR" --work-tree="$HOME" "$@" @@ -32,15 +28,14 @@ if ! dot checkout > /dev/null 2>&1; then mkdir -p "$DOTFILES_BACKUP_DIR" # get the list of files that need to be backed up - dot checkout 2>&1 | grep -Po "(?<=\t)(.*)$" | - while read -rd '' LINE; do - LINE_DIR="${LINE%%/*}" - mkdir -p "$DOTFILES_BACKUP_DIR/${LINE_DIR#"$HOME"}/${LINE##*/}" - mv "$FILE" "$DOTFILES_BACKUP_DIR" - done + while read -r LINE; do + LINE_DIR="$(dirname "$LINE")" # No file + mkdir -p "$DOTFILES_BACKUP_DIR/$LINE_DIR" + mv "$HOME/$LINE" "$DOTFILES_BACKUP_DIR/$LINE_DIR" + done <<< "$(dot checkout 2>&1 | grep -Po '\t\K.*$')" fi dot checkout dot config status.showUntrackedFiles no -echo "Done" +printf "\nInstallation complete!\n" From 49b2be2fca915cb75c117e088bd58e516f812f6e Mon Sep 17 00:00:00 2001 From: PowerUser64 Date: Fri, 17 Jun 2022 01:36:55 -0700 Subject: [PATCH 6/6] nvim: fix tabline highlights --- .config/nvim/init.lua | 1 - .config/nvim/lua/blake/plugins.lua | 14 ++++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 35e1990..738b07d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,7 +4,6 @@ require('blake.plugins') -- basic settings: ~/.config/nvim/lua/blake/settings.lua require('blake.settings') -vim.cmd 'colorscheme tokyonight' -- TODO: -- Make plugins more modular diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 2670462..85f633d 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -53,10 +53,12 @@ return require('packer').startup({function() config = function() -- vim.g.onedark_transparent_background = true vim.cmd [[ - "au ColorScheme tokyonight hi TabLine gui=none guibg='#24283B' guifg='#5C6370' " all tabs color + au ColorScheme tokyonight hi TabLine gui=none guibg='#1D202F' guifg='#565F89' " all tabs color au ColorScheme tokyonight hi TabLineSel guibg='#24283B' guifg='#C0CAF5' " Highlighted tab color - "au ColorScheme tokyonight hi TabLineFill guibg='#24283B' " tabline portion without tabs (right-hand side) + au ColorScheme tokyonight hi TabLineFill guibg='#1D202F' " tabline portion without tabs (right-hand side) ]] + -- Has to be put here so it runs synchronously + vim.cmd 'colorscheme tokyonight' end, } use { -- newspring: Good light theme for writing @@ -70,14 +72,10 @@ return require('packer').startup({function() end, } use { -- nvim-tabline - 'seblj/nvim-tabline', + 'alvarosevilla95/luatab.nvim', requires = 'kyazdani42/nvim-web-devicons', config = function() - require('tabline').setup { - -- Disable icons (and clickable buttons) - modified_icon = '', - close_icon = '', - } + require('luatab').setup() end } use { -- css color tag highlighter (ex: #FFB13B)