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

This commit is contained in:
PowerUser64 2021-11-27 13:31:13 -08:00
commit 85d460fbac
5 changed files with 95 additions and 54 deletions

View file

@ -1,9 +1,9 @@
-- Blake's neovim rc file
-- basic settings: ~/.config/nvim/lua/blake/settings.lua
require('blake.settings')
-- plugins and plugin settings: ~/.config/nvim/lua/blake/plugins.lua
require('blake.plugins')
-- basic settings: ~/.config/nvim/lua/blake/settings.lua
require('blake.settings')
-- TODO:
-- Plugins to install:

View file

@ -121,6 +121,10 @@ M.cmp = function()
behavior = cmp.ConfirmBehavior.Replace,
select = false,
},
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
-- select = true,
},
['<Tab>'] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
@ -138,14 +142,28 @@ M.cmp = function()
},
sources = {
{ name = 'path' },
{ name = 'buffer' },
{ name = 'calc' },
{ name = 'nvim_lsp' },
{ name = 'nvim_lua' },
{ name = 'spell' },
{ name = 'nvim_lsp' },
{ name = 'treesitter' },
{ name = 'calc' },
{ name = 'spell' },
{ name = 'buffer' },
{ name = 'cmdline' },
{ name = 'emoji' },
},
cmp.setup.cmdline('/', {
sources = {
{ name = 'buffer' }
}
}),
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
{ name = 'path' }
},
{
{ name = 'cmdline' }
})
}),
formatting = {
format = function(entry, vim_item)
-- fancy icons and a name of kind
@ -153,12 +171,13 @@ M.cmp = function()
-- set a name for each source
vim_item.menu = ({
path = "[Path]",
buffer = "[Buffer]",
calc = "[Calc]",
nvim_lsp = "[LSP]",
nvim_lua = "[Lua]",
spell = "[Spell]",
nvim_lsp = "[LSP]",
treesitter = "[TS]",
calc = "[Calc]",
spell = "[Spell]",
cmdline = "[cmdline]",
buffer = "[Buffer]",
})[entry.source.name]
return vim_item
end,
@ -201,6 +220,11 @@ M.lspconfig = function()
buf_set_keymap('n', '<leader>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
buf_set_keymap('n', '<leader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end -- <<<
local capabilities
if cmp ~= nil then -- only load this if cmp is loaded
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
end
-- Load servers >>>
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
@ -234,7 +258,7 @@ M.lspconfig = function()
end
-- From kickstart.nvim:
if (vim.fn.executable(sumneko_binary) == true) then
if (vim.fn.executable(sumneko_binary) == 1) then
-- Make runtime files discoverable to the server
local runtime_path = vim.split(package.path, ';')
table.insert(runtime_path, 'lua/?.lua')

View file

@ -8,11 +8,14 @@ if fn.empty(fn.glob(install_path)) > 0 then
end
-- }
return require('packer').startup(function()
return require('packer').startup({function()
-- Packer
use { -- packer
'wbthomason/packer.nvim'
'wbthomason/packer.nvim',
config = function() -- Map :PS to :PackerSync
vim.cmd 'command! PS PackerSync'
end
}
-- Colors
@ -25,7 +28,7 @@ return require('packer').startup(function()
use { -- onedark theme
'navarasu/onedark.nvim',
config = function()
vim.g.onedark_transparent_background = true
-- vim.g.onedark_transparent_background = true
require('onedark').setup()
end
}
@ -46,7 +49,7 @@ return require('packer').startup(function()
}
use { -- Default LSP configs
'neovim/nvim-lspconfig',
after = 'nvim-lspinstall',
after = {'nvim-lspinstall',},
config = function()
require('blake.lsp').lspconfig()
end
@ -56,15 +59,16 @@ return require('packer').startup(function()
config = function()
require('blake.lsp').cmp()
end,
requires = { -- nvim-cmp sources
requires = { -- nvim-cmp sources (not required by cmp, but reqired by my configuration)
'hrsh7th/cmp-path',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-nvim-lua',
'hrsh7th/cmp-latex-symbols',
'hrsh7th/cmp-emoji',
'hrsh7th/cmp-nvim-lsp',
'ray-x/cmp-treesitter',
'hrsh7th/cmp-calc',
'hrsh7th/cmp-look',
'f3fora/cmp-spell',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-emoji',
}
}
use { -- Icons for each entry in the completion menu
@ -157,6 +161,8 @@ return require('packer').startup(function()
-- Conveniences
use { -- Web browser integration
'raghur/vim-ghost',
opt = true,
cmd = {'GhostStart', 'GhostInstall', 'GhostStop', 'GhostSync', 'GhostToggleSync'},
config = function() -- Map :GS to :GhostStart
vim.cmd 'command! GS GhostStart'
end
@ -200,7 +206,10 @@ return require('packer').startup(function()
if packer_bootstrap then
require('packer').sync()
end -- }
end)
end,
config = {
display = { open_fn = require('packer.util').float }
}})
-- vim:fdm=marker:fmr={,}:expandtab:tabstop=3:sw=3
-- vim:fdm=marker:fmr={,}:fdl=1:expandtab:tabstop=3:sw=3

View file

@ -18,10 +18,9 @@ set.ignorecase = true
set.smartcase = true
set.wrap = false
set.linebreak = true
set.syntax = 'on'
set.redrawtime = 200
set.updatetime = 300
set.number = true --relativenumber
set.number = true
set.errorbells = false
set.encoding = 'UTF-8'
set.cursorline = true
@ -32,33 +31,18 @@ set.scrolloff = 5
--set.wildmode = full
set.hidden = true
set.shortmess = 'filnxtToOFc'
--set.spell = true
-- set.spell = true
set.spelllang = 'en_us'
set.showcmd = true
set.signcolumn = 'yes'
set.makeprg = 'make -j$(nproc)'
set.ruler = false
set.listchars = "eol:↵,trail:~,tab:>-,nbsp:␣"
-- Things that can't be translated to lua
vim.cmd 'syntax on'
vim.cmd "let g:markdown_fenced_languages = ['bash=sh', 'javascript', 'cpp=cpp', 'c++=cpp', 'js=javascript', 'json=javascript', 'typescript', 'ts=typescript', 'php', 'html', 'css']"
----------------------------------------------
--- Key bindings (needs to be translated?) ---
----------------------------------------------
--- autocmd's
-- Spell check in git commits by default
vim.cmd 'autocmd Filetype gitcommit setlocal spell'
-- Disable spell check in help files
vim.cmd 'autocmd FileType help setlocal nospell'
vim.cmd 'filetype plugin on'
-- Automatically disable line numbers when in terminal mode
vim.cmd 'autocmd TermOpen * setlocal nospell nonumber norelativenumber'
-- Automatically toggle relative line numbers
--vim.cmd 'autocmd InsertEnter * :set norelativenumber '
--vim.cmd 'autocmd InsertLeave * :set relativenumber '
--- Key bindings
vim.cmd 'let mapleader = " "'
-- *sigh*...
@ -114,7 +98,28 @@ vim.cmd "vnoremap K :m '<-2<CR>gv=gv"
-- Format text with Q, rather than gw
vim.cmd 'nnoremap Q gw'
vim.cmd 'colorscheme slate'
----------------------------------------------
--- Things that can't be translated to lua ---
----------------------------------------------
vim.cmd 'syntax enable'
vim.cmd "let g:markdown_fenced_languages = [ 'bash=sh', 'javascript', 'cpp=cpp', 'c++=cpp', 'js=javascript', 'json=javascript', 'typescript', 'ts=typescript', 'php', 'html', 'css' ]"
--- autocmd's ---
-- Spell check in git commits by default
vim.cmd 'autocmd Filetype gitcommit setlocal spell'
-- Disable spell check in help files
vim.cmd 'autocmd FileType help setlocal nospell'
vim.cmd 'filetype plugin on'
-- Automatically disable line numbers when in terminal mode
vim.cmd 'autocmd TermOpen * setlocal nospell nonumber norelativenumber'
-- Automatically toggle relative line numbers
--vim.cmd 'autocmd InsertEnter * :set norelativenumber '
--vim.cmd 'autocmd InsertLeave * :set relativenumber '
-- 24-bit color
vim.cmd [[
@ -166,9 +171,6 @@ vim.cmd [[
-- Automatically jump to the last position in a file when opening
vim.cmd [[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
-- Highlight trailing whitespace in red
set.listchars = "eol:↵,trail:~,tab:>-,nbsp:␣"
-- Highlight trailing whitespace in red
vim.cmd [[
highlight ExtraWhitespace ctermbg=red guibg=red

16
.zshrc
View file

@ -224,6 +224,12 @@
done
}
# edit file: Uses fzy to locate a file, and opens it in your favorite text editor
# Takes arguments for `fd`
ef() {
"$EDITOR" "$(fd $@ | fzy)"
}
# toggles whether a file or group of files is executable
chx() {
for FILE in "$@";do
@ -772,16 +778,16 @@ save_working_dir() {
autoload -U add-zsh-hook
add-zsh-hook chpwd save_working_dir
load_working_dir &&
cd - > /dev/null
load_working_dir && cd - > /dev/null
# Case insensitive globbing (fix for termux)
[ -n "$TERMUX_VERSION" ] && setopt nocaseglob
[ -n "$TERMUX_VERSION" ] &&
setopt nocaseglob # Case insensitive globbing (fix for termux)
# <<<
# <<<
# Optionally source the user's customized .zshrc
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || return 0
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" ] && source "${XDG_CONFIG_HOME:-$HOME/.config}/shell/zshrc.local" || true
# vim:fdm=marker:fmr=>>>,<<<:et:ft=sh:sw=3