Skip to content

Commit

Permalink
Merge pull request #127 from SidOfc/insanity
Browse files Browse the repository at this point in the history
insanity
  • Loading branch information
SidOfc authored Apr 22, 2023
2 parents 8d6c1fd + 707819d commit 779fed6
Show file tree
Hide file tree
Showing 22 changed files with 2,212 additions and 2,220 deletions.
55 changes: 15 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,49 +44,30 @@ Install on Nightly Neovim (0.8.0+) using your favorite plugin manager:
| **[dein.vim](https://github.com/Shougo/dein.vim)** | `call dein#add('SidOfc/carbon.nvim')` |
| **[minpac](https://github.com/k-takata/minpac)** | `call minpac#add('SidOfc/carbon.nvim')` |
| **[packer.nvim](https://github.com/wbthomason/packer.nvim)** | `use 'SidOfc/carbon.nvim'` |
| **[paq-nvim](https://github.com/savq/paq-nvim)** | `{ 'SidOfc/carbon.nvim', }` |
| **[paq-nvim](https://github.com/savq/paq-nvim)** | `{ 'SidOfc/carbon.nvim' }` |
| **[lazy.nvim](https://github.com/folke/lazy.nvim)** | `{ 'SidOfc/carbon.nvim' }` |

**NOTE**: when using `lazy.nvim` please read `:h carbon-lazy-init`.
# Usage and configuration

# Configuration
Depending on whether you use native vim packages or a plugin manager
the way Carbon is set up will be slightly different. The most important
part is that Carbon's `setup` method **must** be called somewhere in your
`init.lua` / `init.vim` to initialize and use Carbon. It can be called like this:

Configuration can be supplied like this:

**init.vim**

```viml
lua << EOF
require('carbon').setup({
setting = 'value',
})
EOF
```lua
require('carbon').setup()
```

**init.lua**
Configuration can be supplied like this:

```lua
require('carbon').setup({
setting = 'value',
})
require('carbon').setup({ setting = 'value' })
```

These settings will be deep merged with the default settings. See
`:h carbon-settings-table` for a list of available settings. An
alternative option of calling this method also exists:

**init.vim**

```viml
lua << EOF
require('carbon').setup(function(settings)
settings.setting = 'value'
end)
EOF
```

**init.lua**

```lua
require('carbon').setup(function(settings)
settings.setting = 'value'
Expand All @@ -99,12 +80,6 @@ You are free to modify them as you wish, no merging will occur.
See `:h carbon-setup` for a more detailed explanation on configuration.
See `:h carbon-carbon-setup` for documentation about the `.setup` method.

# Usage

After installation, Carbon will launch automatically and disable NetRW.
These behaviors and many others can be customized, see `:h carbon-settings` for
more information about customization or `:h carbon-toc` for a table of contents.

Carbon comes with a few commands and mappings out of the box, each is described below:

## Commands
Expand All @@ -115,8 +90,8 @@ customization options.
All commands also support bang (`!`) versions which will make Carbon expand the
tree to reveal the current buffer path if possible. When successful, the cursor
will be moved to the entry and it will be highlighted for a short time as well.
See `:h carbon-buffer-flash-bang` for more information. This behavior can also
be enabled by default by setting: `:h carbon-setting-always-reveal`.
See `:h carbon-view-flash-bang` for more information. This behavior can also
be enabled by default by setting: `:h carbon-setting-auto-reveal`.

### `:Carbon` / `:Explore`

Expand Down Expand Up @@ -254,7 +229,7 @@ opened with [`Fcarbon`](#fcarbon) or [`Lcarbon` / `Rcarbon`](#lcarbon--lexplore-
Enters an interactive mode in which a path can be entered. When
done typing, press <kbd>enter</kbd> to confirm or <kbd>escape</kbd>
to cancel. Prepending a `count` to <kbd>c</kbd> will select the `count`_nth_
directory from the left as base. See `:h carbon-buffer-create` for more details.
directory from the left as base. See `:h carbon-view-create` for more details.

### <kbd>m</kbd> Moving files and directories

Expand All @@ -263,7 +238,7 @@ directory from the left as base. See `:h carbon-buffer-create` for more details.
Prompts to enter a new destination of the current entry under the cursor.
Will throw an error when the new destination already exists. Prepending
a `count` to <kbd>c</kbd> will select the `count`_nth_ directory from
the left as base. See `:h carbon-buffer-move` for more details.
the left as base. See `:h carbon-view-move` for more details.

### <kbd>d</kbd> Deleting files and directories

Expand All @@ -272,7 +247,7 @@ the left as base. See `:h carbon-buffer-move` for more details.
Prompts confirmation to delete the current entry under the cursor. Press <kbd>enter</kbd>
to confirm the currently highlighted option, <kbd>D</kbd> to confirm deletion directly,
or <kbd>escape</kbd> to cancel. Prepending a `count` to <kbd>c</kbd> will select
the `count`_nth_ directory from the left as base. See `:h carbon-buffer-delete`
the `count`_nth_ directory from the left as base. See `:h carbon-view-delete`
for more details.

# File icons
Expand Down
3 changes: 2 additions & 1 deletion dev/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
vim.opt.termguicolors = true
vim.opt.packpath:remove({ vim.env.HOME .. '/.local/share/nvim/site' })
vim.opt.runtimepath:remove({ vim.env.HOME .. '/.config/nvim' })
vim.opt.runtimepath:append({
vim.env.HOME .. '/Dev/sidofc/lua/carbon.nvim',
vim.env.HOME .. '/.local/share/nvim/site/pack/packer/start/nvim-web-devicons',
})

require('carbon').setup({ file_icons = false })
require('carbon').setup({ file_icons = false, sync_pwd = true })
Loading

0 comments on commit 779fed6

Please sign in to comment.