Several modifications for vim, git, zsh
This commit is contained in:
parent
ff26c39b20
commit
9db74a80ff
10 changed files with 84 additions and 46 deletions
|
@ -19,5 +19,3 @@ require('plugins/metals')
|
||||||
|
|
||||||
-- Setup treesitter, select the configs to load, etc.
|
-- Setup treesitter, select the configs to load, etc.
|
||||||
require('plugins/treesitter')
|
require('plugins/treesitter')
|
||||||
|
|
||||||
require('plugins/lualine')
|
|
||||||
|
|
|
@ -3,4 +3,5 @@ vim.opt.background = 'dark'
|
||||||
--vim.opt.background = 'light'
|
--vim.opt.background = 'light'
|
||||||
|
|
||||||
-- Set the color scheme
|
-- Set the color scheme
|
||||||
vim.cmd 'colorscheme gruvbox-material'
|
--vim.cmd 'colorscheme gruvbox-material'
|
||||||
|
vim.cmd 'colorscheme melange'
|
||||||
|
|
|
@ -72,23 +72,14 @@ opt.autoindent = true
|
||||||
-- I don't use indentation when writing HTML, and autoindentation makes any form
|
-- I don't use indentation when writing HTML, and autoindentation makes any form
|
||||||
-- of editing flat out painful.
|
-- of editing flat out painful.
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = 'html',
|
pattern = { "*.html" },
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.opt_local.autoindent = false
|
vim.opt_local.autoindent = false
|
||||||
|
vim.opt_local.smarttab = false
|
||||||
vim.opt_local.indentexpr = ''
|
vim.opt_local.indentexpr = ''
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
-- Custom File Types
|
|
||||||
-----------------------------------------------------------
|
|
||||||
vim.api.nvim_create_autocmd({"BufRead", "BufNewFile"}, {
|
|
||||||
pattern = {'*.aum', '*.aui'},
|
|
||||||
callback = function()
|
|
||||||
vim.bo.filetype = "austral"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
-- Memory, CPU
|
-- Memory, CPU
|
||||||
-----------------------------------------------------------
|
-----------------------------------------------------------
|
||||||
|
|
|
@ -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', 'K', vim.lsp.buf.hover, { desc = 'Hover' })
|
||||||
map('n', 'gi', vim.lsp.buf.implementation, { desc = 'Go To Implementation' })
|
map('n', 'gi', vim.lsp.buf.implementation, { desc = 'Go To Implementation' })
|
||||||
map('n', 'gr', vim.lsp.buf.references, { desc = 'Go To References' })
|
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.definition, { desc = 'Go To Definition' })
|
||||||
map('n', 'gD', vim.lsp.buf.type_definition, { desc = 'Go To Type 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' })
|
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_prev({ wrap = false })<CR>', { desc = 'prev diagnostic' })
|
||||||
map('n', ']c', '<cmd>lua vim.diagnostic.goto_next({ wrap = false })<CR>', { desc = 'next 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>ls', ':Telescope lsp_document_symbols<CR>', { desc = 'Browse Document Symbols' })
|
||||||
|
map('n', '<leader>ld', ':Telescope lsp_dynamic_workspace_symbols<CR>', { desc = 'Browse Definitions' })
|
||||||
|
|
|
@ -16,6 +16,7 @@ require("lazy").setup({
|
||||||
-- -------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
'sainnhe/gruvbox-material',
|
'sainnhe/gruvbox-material',
|
||||||
|
lazy = true,
|
||||||
config = function(_)
|
config = function(_)
|
||||||
vim.g.gruvbox_material_palette = 'material'
|
vim.g.gruvbox_material_palette = 'material'
|
||||||
vim.g.gruvbox_material_background = 'hard'
|
vim.g.gruvbox_material_background = 'hard'
|
||||||
|
@ -26,6 +27,10 @@ require("lazy").setup({
|
||||||
'rebelot/kanagawa.nvim',
|
'rebelot/kanagawa.nvim',
|
||||||
lazy = true,
|
lazy = true,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'savq/melange-nvim',
|
||||||
|
lazy = true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'marko-cerovac/material.nvim',
|
'marko-cerovac/material.nvim',
|
||||||
lazy = true,
|
lazy = true,
|
||||||
|
@ -175,9 +180,6 @@ require("lazy").setup({
|
||||||
-- texlab = latex language server
|
-- texlab = latex language server
|
||||||
lsp.texlab.setup{}
|
lsp.texlab.setup{}
|
||||||
|
|
||||||
-- terraform-ls = terraform language server (Hashicorp stable)
|
|
||||||
lsp.terraformls.setup{}
|
|
||||||
|
|
||||||
-- tsserver = typescript language server, works for JS as well.
|
-- tsserver = typescript language server, works for JS as well.
|
||||||
lsp.tsserver.setup{}
|
lsp.tsserver.setup{}
|
||||||
|
|
||||||
|
@ -256,12 +258,30 @@ require("lazy").setup({
|
||||||
{
|
{
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
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
|
-- bufferline - shows a bar at the top with open buffers
|
||||||
-- -------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
'akinsho/bufferline.nvim',
|
'akinsho/bufferline.nvim',
|
||||||
|
version = '*',
|
||||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||||
opts = {
|
opts = {
|
||||||
options = {
|
options = {
|
||||||
|
@ -327,6 +347,15 @@ require("lazy").setup({
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Automatically close pairs such as {} [] ()
|
||||||
|
-- -------------------------------------------------------------------------
|
||||||
|
{
|
||||||
|
'm4xshen/autoclose.nvim',
|
||||||
|
config = function(_)
|
||||||
|
require("autoclose").setup()
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
-- Special highlighting and tracking for certain notable words
|
-- Special highlighting and tracking for certain notable words
|
||||||
-- -------------------------------------------------------------------------
|
-- -------------------------------------------------------------------------
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
-- Note that Metals _does not use nvim-lspconfig_.
|
-- Note that Metals _does not use nvim-lspconfig_.
|
||||||
-- It still uses the nvim LSP, however.
|
-- It still uses the nvim LSP, however.
|
||||||
|
|
||||||
|
|
||||||
-- Autocmd that will actually be in charging of starting the whole thing
|
-- Autocmd that will actually be in charging of starting the whole thing
|
||||||
local nvim_metals_group = vim.api.nvim_create_augroup(
|
local nvim_metals_group = vim.api.nvim_create_augroup(
|
||||||
'nvim-metals',
|
'nvim-metals',
|
||||||
|
@ -13,6 +14,8 @@ vim.api.nvim_create_autocmd('FileType', {
|
||||||
local metals_config = require('metals').bare_config()
|
local metals_config = require('metals').bare_config()
|
||||||
|
|
||||||
metals_config.settings = {
|
metals_config.settings = {
|
||||||
|
-- Comment this out to use latest stable.
|
||||||
|
serverVersion = "latest.snapshot",
|
||||||
showImplicitArguments = true,
|
showImplicitArguments = true,
|
||||||
showInferredType = true,
|
showInferredType = true,
|
||||||
superMethodLensesEnabled = false
|
superMethodLensesEnabled = false
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
-- One of "all", "maintained", or a list of languages
|
-- One of "all", "maintained", or a list of languages
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"c", "zig", "bash", "scala", "yaml", "css", "javascript",
|
"zig", "bash", "scala", "yaml", "css", "javascript", "clojure", "lua",
|
||||||
"latex", "clojure", "lua", "cpp", "hcl", "json", "ocaml", "toml",
|
"hcl", "json", "toml", "rust", "sql", "python", "gitcommit",
|
||||||
"rust", "sql", "python", "gitcommit", "gitignore", "html", "go"
|
"gitignore", "html", "go"
|
||||||
},
|
},
|
||||||
|
|
||||||
-- This will be populated after load.
|
-- This will be populated after load.
|
||||||
|
@ -30,6 +30,6 @@ require'nvim-treesitter.configs'.setup {
|
||||||
},
|
},
|
||||||
|
|
||||||
indent = {
|
indent = {
|
||||||
enable = true
|
enable = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
log = delta
|
log = delta
|
||||||
reflog = delta
|
reflog = delta
|
||||||
show = delta
|
show = delta
|
||||||
|
tag = false
|
||||||
[core]
|
[core]
|
||||||
excludesFile = ~/.gitignore
|
excludesFile = ~/.gitignore
|
||||||
[interactive]
|
[interactive]
|
||||||
|
|
47
.zshrc
47
.zshrc
|
@ -1,9 +1,32 @@
|
||||||
export HISTFILE="$HOME/.zsh_history"
|
|
||||||
export HISTSIZE=1000
|
|
||||||
export SAVEHIST=5000
|
|
||||||
|
|
||||||
local_install_dir="$HOME/.local/install"
|
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.
|
# Allow for menu-style tab completion.
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
|
@ -99,12 +122,20 @@ fi
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
# Aliases
|
# Aliases
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
if command -v exa > /dev/null 2>&1; then
|
if command -v eza > /dev/null 2>&1; then
|
||||||
alias ls='exa'
|
alias ls='eza'
|
||||||
alias ll='exa -l'
|
alias ll='eza -l'
|
||||||
else
|
else
|
||||||
if $logging_enabled; then
|
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
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue