Commit Graph

254 Commits

Author SHA1 Message Date
Paul Stemmet ee4fac3834
nvim/init.early: move &background, &termguicolors into early
As many plugins use these when setting colors and highlights, leading to
poor coloring now that truecolor support is fixed in tmux
2022-10-02 18:59:18 +00:00
Paul Stemmet d6827a4fe5
nvim/init.post: set colorscheme to g.my_color_scheme 2022-10-02 18:59:18 +00:00
Paul Stemmet c815f5aa25
tmux: fix truecolor in tmux
So story time, I discovered :checkhealth in Neovim, and it gave a fairly
decent explanation of how to fix terminal truecolor support.

Namely, use `tmux-256color` (or `screen-256color`) for the
default-terminal, then force truecolor (Tc) in the terminal-overrides

It also mentioned that `focus-events` needs to be enabled for n/vim to
detect changes to its buffers. Notably, this allows vim to rerender
changed content when switching into a tmux pane containing a vim
session.
2022-10-02 18:59:17 +00:00
Paul Stemmet 138e66f245
zshrc: remove plugins.cargo
as the upstream has merged its functionality into plugins.rust, which is
already set.

See ohmyzsh/ohmyzsh#10270 , ohmyzsh/ohmyzsh@89a740b
2022-10-02 18:59:17 +00:00
psox cf932c2051 tmux: add ctrl-shift movement fragment file 2022-09-29 16:41:46 +01:00
psox fdba97e517
update formatting 2022-09-24 06:31:32 +00:00
psox 9c82dc25b4
recursive update 2022-09-24 06:29:05 +00:00
psox 1715cac996
fix grep error 2022-09-24 06:21:49 +00:00
Paul Stemmet 47e1dc2dd6
merge: develop <--- fix/coc-confirm-on-enter
* HEAD
| \
| * 1222c11 <github@luxolus.com> nvim/plug/coc: use <C-Space> instead of <CR> for pum inserts
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-30 13:40:34 +00:00
Paul Stemmet 1222c115c9
nvim/plug/coc: use <C-Space> instead of <CR> for pum inserts
Unfortunately pear-tree seems to conflict with coc in utilizing <CR>
(enter). Also the previous function assigned to <C-Space> wasn't very
useful (triggering autocompletion menu) as <TAB> already handles that.
2022-08-30 13:37:01 +00:00
Paul Stemmet 632e40a40d
merge: develop <--- fix/coc-config
* HEAD
| \
| * 03f670a <github@luxolus.com> nvim/plug/coc: disable loading when NodeJS is missing
| * 24aa253 <github@luxolus.com> nvim/plug/coc: fix K, <CR> keymaps
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-26 20:31:03 +00:00
Paul Stemmet 03f670a9f4
nvim/plug/coc: disable loading when NodeJS is missing
Rather than just disabling configuration, we instead simply disable the
entire plugin before it loads.
2022-08-26 20:01:31 +00:00
Paul Stemmet 24aa253790
nvim/plug/coc: fix K, <CR> keymaps
The help (K) keymap was referencing a helper object that was spuriously
left in during the development of e5909ca. This fixes that mistake, and
should remove the 'global object coc is undefined' errors that occurred
in pressing the keybind.

This commit also fixes a 1 character mistake in the pum selection logic
for confirming selection. It should now just autocomplete every item as
they are <TAB>'d through.
2022-08-26 19:51:09 +00:00
Paul Stemmet 917b5739e1
merge: develop <--- fix/vimrc-suppress-coc-warning
* HEAD
| \
| * 01e7d83 <github@luxolus.com> vimrc: coc_disable_startup_warning = 1
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-18 14:54:22 +00:00
Paul Stemmet 01e7d8349d
vimrc: coc_disable_startup_warning = 1
On Vim v8.2.0750 and older, coc.nvim adds a super annoying, unskippable
start up message.

This fixes that.
2022-08-18 14:51:05 +00:00
Paul Stemmet cd06580e00
merge: develop <--- fix/vimrc-coc-v0080
* HEAD
| \
| * f84cf7e <github@luxolus.com> vimrc: fix coc.nvim bindings for >= v0.0.80
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-17 15:35:22 +00:00
Paul Stemmet f84cf7e4b3
vimrc: fix coc.nvim bindings for >= v0.0.80
coc.nvim introduced a metric ton of backwards incompatible changes to
various APIs they expose in Vim.

This commit updates the bits we use to use the new way of doing things.

It also adds a :Format command that can be used to format the current
buffer.

You'll need to do a :PlugUpdate if your psoxizsh has an old coc locally,
you can check your version with :CocInfo, if the `version` is <= v0.0.79
2022-08-17 15:31:17 +00:00
Paul Stemmet 654fa3670a
merge: develop <--- fix/ssh-agent-forwarding
* HEAD
| \
| * ca9d31b <github@luxolus.com> zshrc: fix zstyle ssh-agent forward option
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-17 15:10:25 +00:00
Paul Stemmet ca9d31b178
zshrc: fix zstyle ssh-agent forward option
It appears that during rearranging yonks ago we accidentally sourced
oh-my-zsh before we set this setting, leading to the ssh-agent _always_
creating a new agent, even when SSH_AUTH_SOCK had already been set.

This a fairly minor problem, but it does leave to session lingering, and
breaks programs that manage ssh-agent identities, like gnome-keyring, or
systemd user session ssh-agent services.
2022-08-17 15:04:41 +00:00
Paul Stemmet 78d01decfb
merge: develop <--- fix/bufferline-config-override
* HEAD
| \
| * 9f49d1a <github@luxolus.com> nvim/config/bufferline: allow overriding entire setup/1 object
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-11 18:35:19 +00:00
Paul Stemmet 9f49d1a2f8
nvim/config/bufferline: allow overriding entire setup/1 object
this allows users to add a custom 'highlights' object to the top level
object passed to bufferline's setup/1 method, rather than only allowing
them to override the 'options' sub-object. See h: bufferline-highlights
for more on how to configure this.
2022-08-11 18:34:28 +00:00
Paul Stemmet 3d8efb49ab
merge: develop <--- fix/update-coc-config
* HEAD
| \
| * e5909ca <github@luxolus.com> nvim/plug/coc: fix breaking changes from neoclide/coc.nvim@0.80+
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-03 19:27:30 +00:00
Paul Stemmet e5909caf6f
nvim/plug/coc: fix breaking changes from neoclide/coc.nvim@0.80+
Basically, a whole bunch of crap was changed in 0.80, and this fixes our
config to use the new way of doing things.

*important* to retain the old way of <TAB> _not auto selecting the first
element_ in a completion window you must set '"suggest.noselect": true'
in your CocConfig! This was previously true by default, but now is false
by default.
2022-08-03 19:22:29 +00:00
Paul Stemmet da1f6a8529
merge: develop <--- fix/nvim-late-config
* HEAD
| \
| * fde2348 <github@luxolus.com> nvim/plug: promote nvim-lua/plenary.nvim@master
| * 715d71e <github@luxolus.com> nvim/plugins: wait for plugins to load before running user config
| /
| develop

Signed-off-by: Bazaah <github@luxolus.com>
2022-08-03 16:48:27 +00:00
Paul Stemmet fde23482d9
nvim/plug: promote nvim-lua/plenary.nvim@master
Its been required by other plugins, but we now introduce it as a direct
dependency due to the usage in psoxizsh.plugins
2022-08-03 15:26:19 +00:00
Paul Stemmet 715d71e537
nvim/plugins: wait for plugins to load before running user config
This commit properly defers running of 'post' and 'late' user callbacks,
by spawning a coroutine that waits until '_G.packer_plugins' exists.

This only happens after packer's compiled config is executed, thereby
correctly delaying the callbacks.

Unfortunately, there's no easy way to do async in lua, so we _do_ take
on a dependency to plenary.nvim, however this shouldn't affect bootstrap
runs, as there we were already waiting for the 'PackerCompileDone'
autocmd, which is only emitted after the compiled config is sourced.
2022-08-03 15:13:07 +00:00
Paul Stemmet 2c8ed58cfe init.lua: entry point for neovim lua config
Adds psoxizsh/nvim to the runtimepath, and runs the main init script
2022-07-24 17:25:42 +01:00
Paul Stemmet 574f7641cc psoxizsh/init: use global statusline where possible
This is relatively recent feature, only available in neovim 0.7 or
higher
2022-07-24 17:25:42 +01:00
Paul Stemmet e00c378ac3 psoxizsh/init: port static configuration from vimrc
Using the hooks provided by psoxizsh.plugins, we recreate our
vimrc configuration, minus a lot of the vim<->nvim compat logic.

A lot of the remaining configuration has also been split out into
plugin specific modules that are managed directly by packer (and thus
loaded on demand without conditionals on our part)
2022-07-24 17:25:42 +01:00
Paul Stemmet 2a309d6e4f nvim/plug: port coc.nvim + config 2022-07-24 17:25:42 +01:00
Paul Stemmet 61d3ef5b6c nvim/plug: port vim-tmux-navigator + config 2022-07-24 17:25:42 +01:00
Paul Stemmet 8d0bc13e7e nvim/plug: nvim-lualine/lualine.nvim@master
Replacing airline, lualine seems to be a super customizable
statusline plugin.

I yoinked the base config file from the net and modified it to suit my
needs.
2022-07-24 17:25:42 +01:00
Paul Stemmet 4fe3d09d65 nvim/plug: akinsho/bufferline.nvim@v1.*
This commit adds replacement to airline's bufferline. It provides a
fast, flexible bufferline with a couple big improvements over airline:

1. Fast
2. Sidebar aware (e.x for NERDTree)
3. Buffer management, including grouping (via directory), movement and go-to-buffer
4. A lot of options to customize
5. Optional icon integration

It loses the powerline look, but I'm pretty sure I can get it back if
desired in the future.
2022-07-24 17:25:42 +01:00
Paul Stemmet 4ffaae034c nvim/plug: lewis6991/gitsigns.nvim@release
Replacing gitgutter, gitsigns appears to be the standard neovim git
integration plugin.

It is _significantly_ faster in responding to file deltas, and plays
really nicely with a lot of other tooling in the neovim ecosystem. It
also appears very customizable.
2022-07-24 17:25:42 +01:00
Paul Stemmet cc4a95f70d nvim/plug: nvim-neo-tree/neo-tree.nvim@v2.x
This plugin replaces the functionality of nerdtree, providing a much
smoother experience.

It also comes with a bunch new features:

- Floating window support
- Vastly more configurable
- Icon support
- Intelligent file grouping / hiding
- Faster responses to filesystem events
2022-07-24 17:25:42 +01:00
Paul Stemmet 330f5c0312 nvim/plug: port plugins from vimrc
Minus a lot of old of the old conditional code around vim/neovim
differences.

This commit also removes some of the default plugin list. Replacements
will be added in the following commits.

- scrooloose/vim-statline
  | 12 years old doesn't seem to have an effect
- vim-airline/vim-airline-themes
  vim-airline/vim-airline
  | Throwing all sorts of errors when loaded by packer. Not sure what is
    wrong, but I think it's just incompatible.
- airblade/vim-gitgutter
  | Nothing wrong with gitgutter, but it appears that a lot of the nvim
    world uses (and more importantly, integrates with) gitsigns. It's also
    a lot faster.
- scrooloose/nerdtree
  Xuyuanp/nerdtree-git-plugin
  | Again, nothing really wrong with nerdtree, but there are better
    options in neovim land (neo-tree.nvim)
2022-07-24 17:25:42 +01:00
Paul Stemmet 892e3dea02 nvim/plug: svermeulen/vimpeccable@master as 'vimp'
Nice utility for defining key mappings, as neovim doesn't have first
class support for it yet
2022-07-24 17:25:42 +01:00
Paul Stemmet 5117eb57ff nvim/autocmd: add lib for easy use of autocmds in lua
I couldn't find any nice, easy to use library or package for interacting
with autocmds from lua, and neovim has only in a very recent version
(0.7) added support for them through the vim.api object.

This commit adds a small module that provides an ergonomic api for
interacting with them in lua.

First import the module

  local au = 'psoxizsh.autocmd'

Then you can create grouped autocmds in a variety of ways, several of
which are shown below.

```lua
-- Invoke the group, and add { events, patterns, command } triples
au.Example1 {
  -- String commands are interpreted as vimscript to be executed
  { 'FileType', 'lua', 'echo "Hello from a lua file!"' }
  -- Or you can provide a lua function instead
  { 'FileType', { 'yaml', 'yml' }, function() print('hello from a yaml file!') end }

}
```

```lua
-- Or pass a function that takes the group as an arg
au.Example2(function(grp)
  -- And add the { patterns, command } tuple for each cmd
  grp.FileType { '*.md', 'MarkdownTidy' }
  grp.User { 'LSPError', 'messages' }
end)
```
2022-07-24 17:25:42 +01:00
Paul Stemmet 028f81f950 nvim/plug: wbthomason/packer.nvim@master
This commit adds packer to it's list of managed plugins, taking over
from the bootstrap install.

Notably, we ensure that it knows where to find itself (opt = true), and
take care to ensure that it will be loaded on require or command.
2022-07-24 17:25:42 +01:00
Paul Stemmet 1ce92532bd nvim/plug: add empty default plugin set
This commit adds an empty plugin set, along with functionality to
extend it via a list of extra plugin specs.

No attempt is made to deduplicate items in this list, though packer may
handle this itself.
2022-07-24 17:25:42 +01:00
Paul Stemmet cb591260b8 nvim/plugins: Plugins, a hookable wrapper around packer.nvim
This commit adds a wrapper api around packer.nvim, allowing callers to
provide hooks into packer's plugin initialization lifecycle.

There are 4 recognized hooks: 'early', 'pre', 'post' and 'late'.

'early' and 'pre' run before any plugins are loaded, with 'early' running
before *any* work has been done, while 'pre' runs just before calling
into packer.

'post' and 'late' are more interesting, as they are guaranteed to run
after all plugins (and their private configs) have fully loaded.
Furthermore, both hooks are provided the active Plugins object as their
first arg, allowing them access to the entire list of plugins and the
api suite of Plugins itself.

This behavior is very similar to vim-plug's plug#begin .. plug#end
fences, but improves on the pattern by:

- Properly handling bootstrap situations (our old setup would require a
 restart before everything loaded correctly)
- Async, does not block user activity while loading leading to a
 smoother experience

Special care has been taken to detect and handle bootstrap situations,
where if found, we completely defer a lot of activity (and the hooks
'post', 'late') until packer indicates that the entire install workflow
has completed.

-- Usage

The expected usage of this api set si via requiring the module, setting
up your hooks and initializing the module:

```lua
local htable = { early = early_hook, ... }
local plugs = require('psoxizsh.plugins'):setup({ hooks = htable }):init()
```

As a convenience, you may directly call the module with your hooks,
rather than writing out the above:

```
require 'psoxizsh.plugins' { hooks = ... }
```

Plugins also provides several other interesting methods:

- :reload/0     | completely reload plugin configuration, including rerunning
                  any hooks
- :list/0       | get the list of raw plugin specs that were passed to packer
- :do_hook/1    | request Plugins run @hook 'early' | 'pre' | 'post' | 'late'
- :get/1        | get the spec object for the provided plugin id
- :has/1        | check if the spec contains the provided plugin id
2022-07-24 17:25:42 +01:00
Paul Stemmet 0ff9ecdba3 nvim/plugins/bootstrap: install package manager if fresh system
This module bootstraps our plugin manager

It can (and should) be called before any plugins are initialized,
containing only a dependency on system git, for cloning the package
manager locally.

The 'install_path' variable was taken from packer.nvim's documentation
and installs packer as an optional (opt) plugin. This is important for
when we have packer manage itself, as we'll need to:

1. Ensure it's loaded during bootstrap via `packadd packer`
2. Install load hooks on it's various commands + module
2022-07-24 17:25:42 +01:00
Paul Stemmet 94facbcce9 nvim/util: add mreload/1, mconfig/2, try_* variants
These functions are primarily designed for reloading lua modules, and
specifically, lua modules returning some sort of local config object or
function.
2022-07-24 17:25:42 +01:00
Paul Stemmet 36fcf67bd6 zshrc: add experimental flag for testing lua based neovim config
This commit adds an env var, PSOXIZSH_EXPERIMENTAL_NEOVIM_LUA, that can
be set to opt into using an 'init.lua' based configuration.

This setting only makes sense to use with neovim, and thus even if we do
decide to switch to lua, we'll need to keep the old vimrc config around
for a long time yet, to ensure backwards compatibility
2022-07-24 17:25:42 +01:00
Sandeep Sen 9abd292329 Updated plugin from osx to macos
Fix for the warning
```
The `osx` plugin is deprecated and has been renamed to `macos`.
Please update your .zshrc to use the `macos` plugin instead.
```
2022-04-01 17:24:21 +01:00
psox 6914904823 Update to reflect latest changes and add some more documentation 2022-04-01 15:18:29 +01:00
André Stemmet a5156ed435
Updated to lasted comments 2022-04-01 14:49:16 +01:00
Paul Stemmet f93cdf9fc6 README: remove TLS skip, tidy code blocks 2021-12-05 11:45:38 +00:00
Paul Stemmet b2a684c579 ff all submodules 2021-11-11 19:50:07 +00:00
Paul Stemmet 2b6095933a ff submodules 2021-11-11 19:34:26 +00:00