Git Product home page Git Product logo

ccc.nvim's Introduction

GitHub Stars PRs Welcome Last Commit GitHub Open Issues GitHub Closed Issues GitHub License Lua

ccc.nvim

ccc.nvim is a fork of Neovim plugin 'fm-nvim' that lets you use your favorite terminal file managers (and fuzzy finders) from within Neovim.

Supported File Managers

Supported Fuzzy Finders

Keep in mind that support for fuzzy finding is quite limited and using seperate plugins would be more practical.

1. Partial Support as files cannot be opened.

Demo and Screenshots:

Demo

Screenshots

fnf

ccc

Installation:

Configuration:

The following configuration contains the defaults so if you find them satisfactory, there is no need to use the setup function.

require('ccc').setup{
	-- (Vim) Command used to open files
	edit_cmd = "edit",

	-- See `Q&A` for more info
	on_close = {},
	on_open = {},

	-- UI Options
	ui = {
		-- Default UI (can be "split" or "float")
		default = "float",

		float = {
			-- Floating window border (see ':h nvim_open_win')
			border    = "none",

			-- Highlight group for floating window/border (see ':h winhl')
			float_hl  = "Normal",
			border_hl = "FloatBorder",

			-- Floating Window Transparency (see ':h winblend')
			blend     = 0,

			-- Num from 0 - 1 for measurements
			height    = 0.8,
			width     = 0.8,

			-- X and Y Axis of Window
			x         = 0.5,
			y         = 0.5
		},

		split = {
			-- Direction of split
			direction = "topleft",

			-- Size of split
			size      = 24
		}
	},

	-- Terminal commands used w/ file manager (have to be in your $PATH)
	cmds = {
        ccc_cmd     = "ccc",
        fnf_cmd     = "find . | fnf",
	},

	-- Mappings used with the plugin
	mappings = {
		vert_split = "<C-v>",
		horz_split = "<C-h>",
		tabedit    = "<C-t>",
		edit       = "<C-e>",
		ESC        = "<ESC>"
	},
}

Usage:

Any of the following commands are fine...

  • Commands
    • :Ccc
    • :Fnf

but you can add a directory path w/ the command (doesn't work with fnf).

Example:

:Ccc ~/.config/nvim/

Q&A

Q: What if I want to open files in splits or tabs?

A: Use any of the default mappings (unless you've changed them)...

  • <C-h> for horizontal split
  • <C-v> for vertical split
  • <C-e> for normal edit
  • <C-t> for tabs

Q: Can I run a function once exiting or entering the plugin?

A: Yes you can! Use the following code as a guide...

local function yourFunction()
	-- Your code goes here
end

require('ccc').setup{
	-- Runs yourFunction() upon exiting the floating window (can only be a function)
	on_close = { yourFunction },

	-- Runs yourFunction() upon opening the floating window (can only be a function)
	on_open = { yourFunction }
}

Q: What if I want to map <ESC> to close the window?

A: You can do this by mapping <ESC> to whatever closes your file manager (note that this may bring up other issues). This can be done with the following code...

require('ccc').setup{
	mappings = {
		-- Example for Vifm
		ESC        = ":q<CR>"
	}
}

Q: Am I able to have image previews?

A: Not yet

Q: Can I use splits instead of a floating window

A: It's possible by changing the "default" option in the "ui" table to "split"

ccc.nvim's People

Contributors

night0721 avatar

Stargazers

Yuta Katayama avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.