From f5415905d4cca82109f5001daed4cd2437944af2 Mon Sep 17 00:00:00 2001 From: grscheller Date: Thu, 1 Dec 2022 12:37:40 -0700 Subject: [PATCH] More Neovim config tweaks - final adjustments grsSwap - also added grsSwap abbriviation - some monkey-see-monkey-do configuration - config/nvim/lua/grs/devel/tooling.lua - sumnekop_lua section, based on - https://github.com/sumneko/lua-language-server/issues/259 --- config/fish/conf.d/abbrs.fish | 3 +++ config/nvim/lua/grs/devel/tooling.lua | 15 +++++---------- grsSwap | 17 ++++++++--------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/config/fish/conf.d/abbrs.fish b/config/fish/conf.d/abbrs.fish index 3f867c4c..e723afdc 100644 --- a/config/fish/conf.d/abbrs.fish +++ b/config/fish/conf.d/abbrs.fish @@ -33,6 +33,9 @@ if not set -q fish_abbr_initialized # Restart SSH key-agent adding your private key: ~/.ssh/id_rsa abbr -a addkey 'eval (ssh-agent -c); and ssh-add' + # For dotfiles repo + abbr -a grsSwap '~/devel/dotfiles/grsSwap' + # Shell environment cmds abbr -a re 'cd; unguard_universals; REDO_ENV=yes fish -l' abbr -a ue UPDATE_ENV=yes fish diff --git a/config/nvim/lua/grs/devel/tooling.lua b/config/nvim/lua/grs/devel/tooling.lua index 2c3bae8a..d8e1a332 100644 --- a/config/nvim/lua/grs/devel/tooling.lua +++ b/config/nvim/lua/grs/devel/tooling.lua @@ -74,13 +74,13 @@ local BuiltinTools = { }, } -local grsUtils = require 'grs.lib.libVim' +local grsVim = require 'grs.lib.libVim' local grsLspconf = require 'grs.devel.core.lspconfig' local grsMason = require 'grs.devel.core.mason' local grsDap = require 'grs.devel.core.dap' local grsNullLs = require 'grs.devel.core.nullLs' -local msg = grsUtils.msg_hit_return_to_continue +local msg = grsVim.msg_hit_return_to_continue local keybindings = require 'grs.core.keybindings' local cmd = vim.api.nvim_command @@ -106,15 +106,10 @@ end --[[ Lua Configuration - geared to Neovim configs ]] --- Tweak sumneko_lua's notion of runtimepath to help it find runtime files in --- the repo you are editing, before locations like ~/.config/nvim or random --- plugins. When editing the repo containing your neovim dotfiles, make sure --- you start nvim in the directory containing init.lua. ---cmd [[set rtp^=lua rtp^=.]] local sumneko_runtime_path = vim.api.nvim_get_runtime_file('', true) ---table.insert(sumneko_runtime_path, 1, '?/?.lua') ---table.insert(sumneko_runtime_path, 1, '?/init.lua') ---table.insert(sumneko_runtime_path, 1, '?/?.lua') +table.insert(sumneko_runtime_path, 1, '?.lua') +table.insert(sumneko_runtime_path, 1, '?/init.lua') +table.insert(sumneko_runtime_path, 1, '?/?.lua') lspconf['sumneko_lua'].setup { capabilities = capabilities, diff --git a/grsSwap b/grsSwap index 1546a4ae..f272a83c 100755 --- a/grsSwap +++ b/grsSwap @@ -6,11 +6,8 @@ # path, will put ~/.config/nvim files into its "workspace" in ways # which override the corresponding source repo source files. # -# This script is a temporary hack until I better understand how -# to configure sumneko_lua not to do this. -# -# TODO: Make this a function, otherwise cd commands don't work. -# This is is due to script running in another process. +# This script is a "temporary" hack until I better understand +# how to configure sumneko_lua not to do this. # set -q XDG_CONFIG_HOME; or set -lx XDG_CONFIG_HOME ~/.config @@ -19,13 +16,15 @@ set -q DOTFILE_GIT_REPO; or set -gx DOTFILE_GIT_REPO ~/devel/dotfiles if test -d ~/.config/nvim_lua_grs_backup rm $XDG_CONFIG_HOME/nvim/lua/grs mv $XDG_CONFIG_HOME/nvim_lua_grs_backup $XDG_CONFIG_HOME/nvim/lua/grs - printf '\nEdit Neovim config files directly in %s.' $DOTFILE_GIT_REPO - printf '\nIssue git commands from dotfiles repo, %s.\n' $DOTFILE_GIT_REPO + printf '\nEdit nvim config files directly in %s.' $DOTFILE_GIT_REPO + printf '\nIssue git commands from dotfiles repo, %s.' $DOTFILE_GIT_REPO + printf '\nThe dotfileInstall script will now work.\n' cd $DOTFILE_GIT_REPO else mv ~/.config/nvim/lua/grs ~/.config/nvim_lua_grs_backup ln -s $DOTFILE_GIT_REPO/config/nvim/lua/grs $XDG_CONFIG_HOME/nvim/lua/grs - printf '\nEdit Neovim config files thru %s/nvim link.' $XDG_CONFIG_HOME - printf '\nStill issue git commands from %s.\n' $DOTFILE_GIT_REPO + printf '\nEdit nvim config files thru %s/nvim/lua/grs.' $XDG_CONFIG_HOME + printf '\nStill issue git commands from %s.' $DOTFILE_GIT_REPO + printf '\nThe dotfileInstall script will fail!!!\n' cd $XDG_CONFIG_HOME/nvim end