Several modifications for vim, git, zsh

This commit is contained in:
Pat Garrity 2024-04-24 22:39:31 -05:00
parent ff26c39b20
commit 9db74a80ff
Signed by: pfm
GPG key ID: 5CA5D21BAB7F3A76
10 changed files with 84 additions and 46 deletions

View file

@ -19,5 +19,3 @@ require('plugins/metals')
-- Setup treesitter, select the configs to load, etc.
require('plugins/treesitter')
require('plugins/lualine')

View file

@ -3,4 +3,5 @@ vim.opt.background = 'dark'
--vim.opt.background = 'light'
-- Set the color scheme
vim.cmd 'colorscheme gruvbox-material'
--vim.cmd 'colorscheme gruvbox-material'
vim.cmd 'colorscheme melange'

View file

@ -72,23 +72,14 @@ opt.autoindent = true
-- I don't use indentation when writing HTML, and autoindentation makes any form
-- of editing flat out painful.
vim.api.nvim_create_autocmd("FileType", {
pattern = 'html',
pattern = { "*.html" },
callback = function()
vim.opt_local.autoindent = false
vim.opt_local.smarttab = false
vim.opt_local.indentexpr = ''
end,
})
-----------------------------------------------------------
-- Custom File Types
-----------------------------------------------------------
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
pattern = {'*.aum', '*.aui'},
callback = function()
vim.bo.filetype = "austral"
end,
})
-----------------------------------------------------------
-- Memory, CPU
-----------------------------------------------------------

View file

@ -48,8 +48,6 @@ map('i', '<C-o>', '<C-k>Ob', { desc = 'Enter the Function Composition ∘ Charac
map('n', 'K', vim.lsp.buf.hover, { desc = 'Hover' })
map('n', 'gi', vim.lsp.buf.implementation, { desc = 'Go To Implementation' })
map('n', 'gr', vim.lsp.buf.references, { desc = 'Go To References' })
map('n', 'gds', vim.lsp.buf.document_symbol, { desc = 'Document Symbol' })
map('n', 'gws', vim.lsp.buf.workspace_symbol, { desc = 'Workspace Symbol' })
map('n', 'gd', vim.lsp.buf.definition, { desc = 'Go To Definition' })
map('n', 'gD', vim.lsp.buf.type_definition, { desc = 'Go To Type Definition' })
map('n', '<leader>cl', vim.lsp.codelens.run, { desc = 'Code Lens' })
@ -58,3 +56,4 @@ map('n', '<leader>ca', vim.lsp.buf.code_action, { desc = 'Code Action' })
map('n', '[c', '<cmd>lua vim.diagnostic.goto_prev({ wrap = false })<CR>', { desc = 'prev diagnostic' })
map('n', ']c', '<cmd>lua vim.diagnostic.goto_next({ wrap = false })<CR>', { desc = 'next diagnostic' })
map('n', '<leader>ls', ':Telescope lsp_document_symbols<CR>', { desc = 'Browse Document Symbols' })
map('n', '<leader>ld', ':Telescope lsp_dynamic_workspace_symbols<CR>', { desc = 'Browse Definitions' })

View file

@ -16,6 +16,7 @@ require("lazy").setup({
-- -------------------------------------------------------------------------
{
'sainnhe/gruvbox-material',
lazy = true,
config = function(_)
vim.g.gruvbox_material_palette = 'material'
vim.g.gruvbox_material_background = 'hard'
@ -26,6 +27,10 @@ require("lazy").setup({
'rebelot/kanagawa.nvim',
lazy = true,
},
{
'savq/melange-nvim',
lazy = true,
},
{
'marko-cerovac/material.nvim',
lazy = true,
@ -175,9 +180,6 @@ require("lazy").setup({
-- texlab = latex language server
lsp.texlab.setup{}
-- terraform-ls = terraform language server (Hashicorp stable)
lsp.terraformls.setup{}
-- tsserver = typescript language server, works for JS as well.
lsp.tsserver.setup{}
@ -256,12 +258,30 @@ require("lazy").setup({
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
local function metals_status_for_lualine()
return vim.g["metals_status"] or ""
end
require('lualine').setup {
options = {
theme = 'gruvbox-material'
},
sections = {
lualine_c = {
'filename',
metals_status_for_lualine
}
}
}
end
},
-- bufferline - shows a bar at the top with open buffers
-- -------------------------------------------------------------------------
{
'akinsho/bufferline.nvim',
version = '*',
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
options = {
@ -327,6 +347,15 @@ require("lazy").setup({
end
},
-- Automatically close pairs such as {} [] ()
-- -------------------------------------------------------------------------
{
'm4xshen/autoclose.nvim',
config = function(_)
require("autoclose").setup()
end
},
-- Special highlighting and tracking for certain notable words
-- -------------------------------------------------------------------------
{

View file

@ -1,15 +0,0 @@
local function metals_status_for_lualine()
return vim.g["metals_status"] or ""
end
require('lualine').setup {
options = {
theme = 'gruvbox-material'
},
sections = {
lualine_c = {
'filename',
metals_status_for_lualine
}
}
}

View file

@ -1,6 +1,7 @@
-- Note that Metals _does not use nvim-lspconfig_.
-- It still uses the nvim LSP, however.
-- Autocmd that will actually be in charging of starting the whole thing
local nvim_metals_group = vim.api.nvim_create_augroup(
'nvim-metals',
@ -13,6 +14,8 @@ vim.api.nvim_create_autocmd('FileType', {
local metals_config = require('metals').bare_config()
metals_config.settings = {
-- Comment this out to use latest stable.
serverVersion = "latest.snapshot",
showImplicitArguments = true,
showInferredType = true,
superMethodLensesEnabled = false

View file

@ -1,9 +1,9 @@
require'nvim-treesitter.configs'.setup {
-- One of "all", "maintained", or a list of languages
ensure_installed = {
"c", "zig", "bash", "scala", "yaml", "css", "javascript",
"latex", "clojure", "lua", "cpp", "hcl", "json", "ocaml", "toml",
"rust", "sql", "python", "gitcommit", "gitignore", "html", "go"
"zig", "bash", "scala", "yaml", "css", "javascript", "clojure", "lua",
"hcl", "json", "toml", "rust", "sql", "python", "gitcommit",
"gitignore", "html", "go"
},
-- This will be populated after load.
@ -30,6 +30,6 @@ require'nvim-treesitter.configs'.setup {
},
indent = {
enable = true
enable = false
}
}

View file

@ -21,6 +21,7 @@
log = delta
reflog = delta
show = delta
tag = false
[core]
excludesFile = ~/.gitignore
[interactive]

47
.zshrc
View file

@ -1,9 +1,32 @@
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=1000
export SAVEHIST=5000
local_install_dir="$HOME/.local/install"
# =============================================================================
# History configuration.
# =============================================================================
export HISTFILE="$HOME/.zsh_history"
export HISTSIZE=10000
export SAVEHIST=10000
export HISTORY_IGNORE="(ls|cd|pwd|exit)*"
export HIST_STAMPS="yyyy-mm-dd"
setopt EXTENDED_HISTORY # Write the history file in the ':start:elapsed;command' format.
setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
setopt SHARE_HISTORY # Share history between all sessions.
setopt HIST_IGNORE_DUPS # Do not record an event that was just recorded again.
setopt HIST_IGNORE_ALL_DUPS # Delete an old recorded event if a new event is a duplicate.
setopt HIST_IGNORE_SPACE # Do not record an event starting with a space.
setopt HIST_SAVE_NO_DUPS # Do not write a duplicate event to the history file.
setopt HIST_VERIFY # Do not execute immediately upon history expansion.
setopt APPEND_HISTORY # append to history file (Default)
setopt HIST_NO_STORE # Don't store history commands
setopt HIST_REDUCE_BLANKS # Remove superfluous blanks from each command line being added to the history.
export FZF_CTRL_R_OPTS="
--preview 'echo {}' --preview-window up:3:hidden:wrap
--bind 'ctrl-/:toggle-preview'
--bind 'ctrl-y:execute-silent(echo -n {2..} | xclip -selection clipboard)+abort'
--color header:italic
--header 'Press CTRL-Y to copy command into clipboard'"
# =============================================================================
# Allow for menu-style tab completion.
# =============================================================================
@ -99,12 +122,20 @@ fi
# =============================================================================
# Aliases
# =============================================================================
if command -v exa > /dev/null 2>&1; then
alias ls='exa'
alias ll='exa -l'
if command -v eza > /dev/null 2>&1; then
alias ls='eza'
alias ll='eza -l'
else
if $logging_enabled; then
echo "[warn] exa is not setup! Using the system ls" >> "$log_file"
echo "[warn] eza is not setup! Attempting to use exa" >> "$log_file"
fi
if command -v exa > /dev/null 2>&1; then
alias ls='exa'
alias ll='exa -l'
else
if $logging_enabled; then
echo "[warn] exa is not setup! Using the system ls" >> "$log_file"
fi
fi
fi