Minor updates and switching to Starship

This commit is contained in:
pfm 2023-01-03 22:26:28 -06:00
parent e742161af3
commit a556b95829
4 changed files with 17 additions and 35 deletions

View file

@ -1,7 +1,7 @@
local lsp = require('lspconfig')
-- Use an on_attach function to configure after LSP attaches to buffer
local on_attach = function(client, bufnr)
local on_attach = function(_, bufnr)
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
end
@ -10,7 +10,7 @@ end
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- Add nvim-cmp support to the capabilities.
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- zls = zig language server
lsp.zls.setup {
@ -55,3 +55,6 @@ 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{}

View file

@ -15,11 +15,9 @@ vim.api.nvim_create_autocmd('FileType', {
local metals_config = require('metals').bare_config()
-- Capabilities for completion.
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
local capabilities = require('cmp_nvim_lsp').default_capabilities()
metals_config.settings = {
serverVersion = "0.11.8+167-188f3c7c-SNAPSHOT",
showImplicitArguments = true,
showInferredType = true,
superMethodLensesEnabled = false
@ -30,7 +28,7 @@ vim.api.nvim_create_autocmd('FileType', {
-- status bar somehow."
metals_config.init_options.statusBarProvider = 'on'
metals_config.capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
metals_config.capabilities = capabilities
require('metals').initialize_or_attach(metals_config)
end,
group = nvim_metals_group,

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ metals.sbt
.metals/
zig-cache/
zig-out/
jsconfig.json

38
.zshrc
View file

@ -1,31 +1,4 @@
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="spaceship"
SPACESHIP_TIME_SHOW=true
SPACESHIP_TIME_FORMAT="%D{%D %r}"
SPACESHIP_HG_SHOW=false
SPACESHIP_HG_BRANCH_SHOW=false
SPACESHIP_HG_STATUS_SHOW=false
SPACESHIP_XCODE_SHOW_LOCAL=false
SPACESHIP_SWIFT_SHOW_LOCAL=false
SPACESHIP_PHP_SHOW=false
SPACESHIP_AWS_SHOW=false
SPACESHIP_GCLOUD_SHOW=false
SPACESHIP_CONDA_SHOW=false
SPACESHIP_DOTNET_SHOW=false
SPACESHIP_EMBER_SHOW=false
SPACESHIP_BATTERY_SHOW=false
VI_MODE_RESET_PROMPT_ON_MODE_CHANGE=true
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
DISABLE_UNTRACKED_FILES_DIRTY="true"
plugins=(gitfast vi-mode)
source $ZSH/oh-my-zsh.sh
eval "$(starship init zsh)"
# =============================================================================
# Personalized Logging for Shell Setup
@ -43,7 +16,8 @@ fi
# =============================================================================
# Common Environment Configuration
# =============================================================================
export EDITOR=nvim
# Note: use vim here so that if Neovim isn't setup, we gracefully fall back.
export EDITOR=vim
# =============================================================================
# PATH
@ -89,6 +63,11 @@ if [ -d "$N_PREFIX/bin" ]; then
export PATH="$N_PREFIX/bin:$PATH"
fi
export GO_HOME="$HOME/go"
if [ -d "$GO_HOME/bin" ]; then
export PATH="$GO_HOME/bin:$PATH"
fi
# =============================================================================
# SSH Agent Management
# =============================================================================
@ -130,6 +109,7 @@ if command -v sbt > /dev/null 2>&1; then
export SBT_OPTS="-XX:+UseG1GC -Xmx2048m"
fi
# =============================================================================
# Enable Command Syntax Highlighting
# This must be the last item in this file.