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') require('blake.plugins')
-- basic settings: ~/.config/nvim/lua/blake/settings.lua -- basic settings: ~/.config/nvim/lua/blake/settings.lua
require('blake.settings') require('blake.settings')
vim.cmd 'colorscheme tokyonight'
-- TODO: -- TODO:
-- Make plugins more modular -- Make plugins more modular

View file

@ -152,18 +152,6 @@ M.cmp = function()
{ name = 'cmdline' }, { name = 'cmdline' },
{ name = 'emoji' }, { 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 = { formatting = {
format = function(entry, vim_item) format = function(entry, vim_item)
-- fancy icons and a name of kind -- fancy icons and a name of kind
@ -196,6 +184,28 @@ M.cmp = function()
ghost_text = true, 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 -- <<< end -- <<<
-- lspconfig >>> -- lspconfig >>>

View file

@ -53,10 +53,12 @@ return require('packer').startup({function()
config = function() config = function()
-- vim.g.onedark_transparent_background = true -- vim.g.onedark_transparent_background = true
vim.cmd [[ 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 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, end,
} }
use { -- newspring: Good light theme for writing use { -- newspring: Good light theme for writing
@ -70,14 +72,10 @@ return require('packer').startup({function()
end, end,
} }
use { -- nvim-tabline use { -- nvim-tabline
'seblj/nvim-tabline', 'alvarosevilla95/luatab.nvim',
requires = 'kyazdani42/nvim-web-devicons', requires = 'kyazdani42/nvim-web-devicons',
config = function() config = function()
require('tabline').setup { require('luatab').setup()
-- Disable icons (and clickable buttons)
modified_icon = '',
close_icon = '',
}
end end
} }
use { -- css color tag highlighter (ex: #FFB13B) use { -- css color tag highlighter (ex: #FFB13B)
@ -356,16 +354,16 @@ return require('packer').startup({function()
require('cleanfold').setup() require('cleanfold').setup()
end, end,
} }
use { -- lewis6991: sattelite: small scroll bar -- use { -- lewis6991: sattelite: small scroll bar
'lewis6991/satellite.nvim', -- 'lewis6991/satellite.nvim',
config = function() -- config = function()
require('satellite').setup() -- require('satellite').setup()
vim.cmd [[ -- vim.cmd [[
nnoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR> -- nnoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR>
inoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR> -- inoremap <C-l> <cmd>nohlsearch\|diffupdate\|SatelliteRefresh<CR>
]] -- ]]
end, -- end,
} -- }
use { -- tpope: surround use { -- tpope: surround
'tpope/vim-surround' 'tpope/vim-surround'
} }

View file

@ -7,7 +7,7 @@
# usage: sitepath # usage: sitepath
# usage: sitepath <fd commands> -- you can search with 'fd' if you put in a command # 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" SITE_DIR="/home/blake/docker/blakenorth.net/site"
SEPERATOR='~' # Make this a character you don't use in filenames. It's for sed. 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 # 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 # credit for the basic outline of this script 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)
DOTFILES_REPO_DIR="$HOME/git/dotfiles" DOTFILES_REPO_DIR="$HOME/git/dotfiles"
DOTFILES_REPO_URL="https://git.blakenorth.net/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 set -e
printf "\n Installing dotfiles from $DOTFILES_REPO_URL\n\n"
# check for the git command and exit if it doesn't exist # check for the git command and exit if it doesn't exist
if ! command -v git > /dev/null;then 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 exit 1
fi fi
git clone --bare "$DOTFILES_REPO_URL" "$DOTFILES_REPO_DIR" git clone --bare "$DOTFILES_REPO_URL" "$DOTFILES_REPO_DIR" || echo "Resuming installation"
dot() { dot() {
git --git-dir="$DOTFILES_REPO_DIR" --work-tree="$HOME" "$@" git --git-dir="$DOTFILES_REPO_DIR" --work-tree="$HOME" "$@"
} }
# remove the '&> /dev/null' part if things don't seem to work right # remove the '> /dev/null' part if things don't seem to work right
if dot checkout > /dev/null 2>&1; then if ! dot checkout > /dev/null 2>&1; then
echo "Checked out dotfiles."
else
echo "Backing up pre-existing dotfiles." echo "Backing up pre-existing dotfiles."
mkdir -p "$DOTFILES_BACKUP_DIR"
# get the list of files that need to be backed up # get the list of files that need to be backed up
DOTFILES_BACKUP_LIST=($(dot checkout 2>&1 | grep -Po "(?<=\t)(.*)$")) while read -r LINE; do
# create directories for everything that needs one LINE_DIR="$(dirname "$LINE")" # No file
mkdir -p "$DOTFILES_BACKUP_DIR" $(printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | grep -Po '.*/' | sed "s#.*#$DOTFILES_BACKUP_DIR/&#g") mkdir -p "$DOTFILES_BACKUP_DIR/$LINE_DIR"
# backup existing files to avoid them being overwritten mv "$HOME/$LINE" "$DOTFILES_BACKUP_DIR/$LINE_DIR"
printf '%s\n' "${DOTFILES_BACKUP_LIST[@]}" | xargs -I{} mv "$HOME"/{} "$DOTFILES_BACKUP_DIR"/{} done <<< "$(dot checkout 2>&1 | grep -Po '\t\K.*$')"
fi fi
dot checkout dot checkout
dot config status.showUntrackedFiles no dot config status.showUntrackedFiles no
printf "\nInstallation complete!\n"