Merge branch 'master' of git.blakenorth.net/home/git/dotfiles

This commit is contained in:
PowerUser64 2022-06-17 12:41:45 -07:00
commit ad8df81748
5 changed files with 56 additions and 48 deletions

View file

@ -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

View file

@ -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 >>>

View file

@ -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)
@ -356,16 +354,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 <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR>
inoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR>
]]
end,
}
-- use { -- lewis6991: sattelite: small scroll bar
-- 'lewis6991/satellite.nvim',
-- config = function()
-- require('satellite').setup()
-- vim.cmd [[
-- nnoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR>
-- inoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR>
-- ]]
-- end,
-- }
use { -- tpope: surround
'tpope/vim-surround'
}

View file

@ -7,7 +7,7 @@
# usage: sitepath
# usage: sitepath <fd commands> -- 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.

View file

@ -1,40 +1,41 @@
#!/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)
# 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" # cannot contain the character '#'
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'
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" "$@"
}
# 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"/{}
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
printf "\nInstallation complete!\n"