* feat: add icons and colors to telescope picker
* feat: add configuration options for telescope icons
* fix: remove highlight group for telescope normal selection
* fix: properly resolve directories
The `vim.loop.fs_realpath()` function can be used to properly resolve
both the `.` shortcut as well as relative paths. This corrects scenarios
when opening nvim to a subdirectory of the working directory. With this
change doing so will properly resolve the session file to the directory
that was specified on the command line.
```console
$ pwd
/Users/username/.config
$ ls
fish iterm2 nvim
$ nvim nvim
```
This will result in using the path `/Users/username/.config/nvim` for
the session. The behavior will be the same as running plain `nvim` from
within the `/Users/username/.config/nvim` directory itself.
This change also quotes the path passed to `git` to properly handle
paths containing spaces.
This change also corrects some typos in the readme.
* fix: isdirectory is not necessary
The fs_realpath function will return nil if the path doesn't exist.
* fix: typos in comments
* fix: isdirectory is still necessary
Oops, the isdirectory check is necessary to confirm it's a directory and
not a file.
* Update logic for autoload or starting sessions.
The logic to prevent autoloading/starting sessions when any arguments
are supplied to neovim is to prevent session management from kicking in
when editing a single file.
This updates the logic to allow a single argument passed to neovim as
long as the argument is an existing directory. When neovim is launched
in this way it behaves the same as opening neovim with no arguments but
has changed the working directory.
This results in consistent behavior of the autoloading/starting of
sessions when passing a directory argument to start neovim.
See: https://github.com/olimorris/persisted.nvim/discussions/93
* Fix comment, make comparisons more direct
* Update functions to be directory-aware
The main functionality in `init.lua` assumes using current working
directory in most cases. This refactors these functions to allow passing
in a directory instead.
The default behavior is to now use the current directory unless neovim
was started with a single directory argument, using that instead.
This also special-cases `.` as `vim.fn.expand()` does not resolve that
to the current working directory.