Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only single file or directory is allowed. #4

Open
azinsharaf opened this issue Oct 20, 2022 · 11 comments
Open

Only single file or directory is allowed. #4

azinsharaf opened this issue Oct 20, 2022 · 11 comments

Comments

@azinsharaf
Copy link

Hi. I am getting the following error when running :Lf command in neovim. Any idea?
Only single file or directory is allowed.

@azinsharaf azinsharaf changed the title Only single file or directory is allowed. Only single file or directory is allowed. Oct 20, 2022
@lmburns
Copy link
Owner

lmburns commented Oct 26, 2022

What is your configuration?

@azinsharaf
Copy link
Author

i haven't set any configuration for lf. Below is my neovim configuration (which is Astronvim config.)

Click to expand (neovim config)
--              AstroNvim Configuration Table
-- All configuration changes should go inside of the table below

-- You can think of a Lua "table" as a dictionary like data structure the
-- normal format is "key = value". These also handle array like data structures
-- where a value with no key simply has an implicit numeric key
local config = {
	-- Configure AstroNvim updates
	updater = {
		remote = "origin", -- remote to use
		channel = "nightly", -- "stable" or "nightly"
		version = "latest", -- "latest", tag name, or regex search like "v1.*" to only do updates before v2 (STABLE ONLY)
		branch = "main", -- branch name (NIGHTLY ONLY)
		commit = nil, -- commit hash (NIGHTLY ONLY)
		pin_plugins = nil, -- nil, true, false (nil will pin plugins o stable only)
		skip_prompts = false, -- skip prompts about breaking changes
		show_changelog = true, -- show the changelog after performing an update
		auto_reload = false, -- automatically reload and sync packer after a successful update
		auto_quit = false

		-- automatically quit the current session after a successful update
		-- remotes = { -- easily add new remotes to track
		--
		--
		--
		--
		--
		--   ["remote_name"] = "https://remote_url.come/repo.git", -- full remote url
		--   ["remote2"] = "github_user/repo", -- GitHub user/repo shortcut,
		--   ["remote3"] = "github_user", -- GitHub user assume AstroNvim fork
		-- },
	},

	-- Set colorscheme to use
	colorscheme = "gruvbox",

	-- Add highlight groups in any theme
	highlights = {
		-- apply highlight group to all colorschemes (include the default_theme)
		init = { -- set the transparency for all of these highlight groups
			Normal = { bg = "NONE", ctermbg = "NONE" },
			NormalNC = { bg = "NONE", ctermbg = "NONE" },
			CursorColumn = { cterm = {}, ctermbg = "NONE", ctermfg = "NONE" },
			CursorLine = { cterm = {}, ctermbg = "NONE", ctermfg = "NONE" },
			CursorLineNr = { cterm = {}, ctermbg = "NONE", ctermfg = "NONE" },
			LineNr = {},
			SignColumn = {},
			StatusLine = {},
			NeoTreeNormal = { bg = "NONE", ctermbg = "NONE" },



			NeoTreeNormalNC = { bg = "NONE", ctermbg = "NONE" },
		},
	},

	-- set vim options here (vim.<first_key>.<second_key> =  value)
	options = {
		opt = {
			-- set to true or false etc.
			relativenumber = true, -- sets vim.opt.relativenumber
			number = true, -- sets vim.opt.number
			spell = false, -- sets vim.opt.spell
			signcolumn = "auto", -- sets vim.opt.signcolumn to auto
			wrap = false, -- sets vim.opt.wrap
		},
		g = {
			mapleader = " ", -- sets vim.g.mapleader
			autoformat_enabled = true, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
			cmp_enabled = true, -- enable completion at start
			autopairs_enabled = true, -- enable autopairs at start
			diagnostics_enabled = true, -- enable diagnostics at start
			status_diagnostics_enabled = true, -- enable diagnostics in statusline
			icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
			python3_host_prog = "C:\\Users\\asharaf\\AppData\\Local\\ESRI\\conda\\envs\\arcgispro-py3-clone\\python.exe"
		},
	},
	-- If you need more control, you can use the function()...end notation
	-- options = function(local_vim)
	--   local_vim.opt.relativenumber = true
	--   local_vim.g.mapleader = " "
	--   local_vim.opt.whichwrap = vim.opt.whichwrap - { 'b', 's' } -- removing option from list
	--   local_vim.opt.shortmess = vim.opt.shortmess + { I = true } -- add to option list
	--
	--   return local_vim
	-- end,

	-- Set dashboard header
	header = {
		" █████  ███████ ████████ ██████   ██████",
		"██   ██ ██         ██    ██   ██ ██    ██",
		"███████ ███████    ██    ██████  ██    ██",
		"██   ██      ██    ██    ██   ██ ██    ██",
		"██   ██ ███████    ██    ██   ██  ██████",
		" ",
		"    ███    ██ ██    ██ ██ ███    ███",
		"    ████   ██ ██    ██ ██ ████  ████",
		"    ██ ██  ██ ██    ██ ██ ██ ████ ██",
		"    ██  ██ ██  ██  ██  ██ ██  ██  ██",
		"    ██   ████   ████   ██ ██      ██",
	},

	-- Default theme configuration
	default_theme = {
		-- Modify the color palette for the default theme
		colors = {
			fg = "#abb2bf",
			bg = "#1e222a",
		},
		highlights = function(hl) -- or a function that returns a new table of colors to set
			local C = require "default_theme.colors"

			hl.Normal = { fg = C.fg, bg = C.bg }

			-- New approach instead of diagnostic_style
			hl.DiagnosticError.italic = true
			hl.DiagnosticHint.italic = true
			hl.DiagnosticInfo.italic = true
			hl.DiagnosticWarn.italic = true

			return hl
		end,
		-- enable or disable highlighting for extra plugins
		plugins = {
			aerial = true,
			beacon = false,
			bufferline = true,
			cmp = true,
			dashboard = true,
			highlighturl = true,
			hop = false,
			indent_blankline = true,
			lightspeed = false,
			["neo-tree"] = true,
			notify = true,
			["nvim-tree"] = false,
			["nvim-web-devicons"] = true,
			rainbow = true,
			symbols_outline = false,
			telescope = true,
			treesitter = true,
			vimwiki = false,
			["which-key"] = true,
		},
	},

	-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
	diagnostics = {
		virtual_text = true,
		underline = true,
	},

	-- Extend LSP configuration
	lsp = {
		-- enable servers that you already have installed without mason
		servers = {
			-- "pyright"
		},
		formatting = {
			-- control auto formatting on save
			format_on_save = {
				enabled = false, -- enable or disable format on save globally
				disable_filetypes = { -- disable format on save for specified filetypes
					-- "python",
				},
			},
			disabled = { -- disable formatting capabilities for the listed language servers
				-- "sumneko_lua",
			},
			timeout_ms = 1000, -- default format timeout
			-- filter = function(client) -- fully override the default formatting function
			--   return true
			-- end
		},
		-- easily add or disable built in mappings added during LSP attaching
		mappings = {
			n = {
				-- ["<leader>lf"] = false -- disable formatting keymap
			},
		},
		-- add to the global LSP on_attach function
		-- on_attach = function(client, bufnr)
		-- end,

		-- override the mason server-registration function
		-- server_registration = function(server, opts)
		--   require("lspconfig")[server].setup(opts)
		-- end,

		-- Add overrides for LSP server settings, the keys are the name of the server
		["server-settings"] = {
			-- example for addings schemas to yamlls
			-- yamlls = { -- override table for require("lspconfig").yamlls.setup({...})
			--   settings = {
			--     yaml = {
			--       schemas = {
			--         ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*.{yml,yaml}",
			--         ["http://json.schemastore.org/github-action"] = ".github/action.{yml,yaml}",
			--         ["http://json.schemastore.org/ansible-stable-2.9"] = "roles/tasks/*.{yml,yaml}",
			--       },
			--     },
			--   },
			-- },
		},
	},

	-- Mapping data with "desc" stored directly by vim.keymap.set().
	--
	-- Please use this mappings table to set keyboard mapping since this is the
	-- lower level configuration and more robust one. (which-key will
	-- automatically pick-up stored data by this setting.)
	mappings = {
		-- first key is the mode
		n = {
			-- second key is the lefthand side of the map
			-- mappings seen under group name "Buffer"
			["<leader>h"] = false,

			["<leader>bb"] = { "<cmd>tabnew<cr>", desc = "New tab" },
			["<leader>bc"] = { "<cmd>BufferLinePickClose<cr>", desc = "Pick to close" },
			["<leader>bj"] = { "<cmd>BufferLinePick<cr>", desc = "Pick to jump" },
			["<leader>bt"] = { "<cmd>BufferLineSortByTabs<cr>", desc = "Sort by tabs" },
			-- quick save
			-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" },  -- change description but the same command
			["<leader>ti"] = { function() astronvim.toggle_term_cmd "ipython" end, desc = "IPython" },
			["<leader>tt"] = { function() astronvim.toggle_term_cmd "wsl" end, desc = "WSL Fish" },

			["<leader>hw"] = { "<cmd>HopWord<cr>", desc = "Hop Word" },
			["<leader>hl"] = { "<cmd>HopLine<cr>", desc = "Hop Line" },

			-- ["<leader>a"] = { "<cmd>Telescope aerial<cr>", desc = "Aerial & Telescope" },
		},
		t = {
			-- setting a mapping to false will disable it
			-- ["<esc>"] = false,
		},
	},

	-- Configure plugins
	plugins = {
		init = {
			-- You can disable default plugins as follows:
			-- ["goolord/alpha-nvim"] = { disable = true },
			["feline-nvim/feline.nvim"] = { disable = true },

			-- You can also add new plugins here as well:
			-- Add plugins, the packer syntax without the "use"
			-- { "andweeb/presence.nvim" },
			-- {
			--   "ray-x/lsp_signature.nvim",
			--   event = "BufRead",
			--   config = function()
			--     require("lsp_signature").setup()
			--   end,
			-- },

			-- hop plugin
			{
				"phaazon/hop.nvim",
				branch = 'v2', -- optional but strongly recommended
				config = function()
					-- you can configure Hop the way you like here; see :h hop-config
					require 'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
				end,
			},

			{
				"nvim-lualine/lualine.nvim",
				requires = { 'kyazdani42/nvim-web-devicons', opt = true }
			},

			{
				"Pocco81/auto-save.nvim",
			},

			{ 'christoomey/vim-tmux-navigator' },

			{
				"lmburns/kimbox"
			},

			{
				"lmburns/lf.nvim",
				config = function()
					-- This feature will not work if the plugin is lazy-loaded
					vim.g.lf_netrw = 1

					require("lf").setup(
						{
							escape_quit = false,
							border = "rounded",
							highlights = { FloatBorder = { guifg = require("kimbox.palette")
									.colors.magenta } }
						}
					)

					vim.keymap.set("n", "<C-o>", ":Lf<CR>")
				end,
				requires = { "plenary.nvim", "toggleterm.nvim" }
			},

			{ "ellisonleao/gruvbox.nvim" },
			{ 'rbgrouleff/bclose.vim' },

			-- We also support a key value style plugin definition similar to NvChad:
			-- ["ray-x/lsp_signature.nvim"] = {
			--   event = "BufRead",
			--   config = function()
			--     require("lsp_signature").setup()
			--   end,
			-- },
		},
		-- All other entries override the require("<key>").setup({...}) call for default plugins
		["null-ls"] = function(config) -- overrides `require("null-ls").setup(config)`
			-- config variable is the default configuration table for the setup function call
			-- local null_ls = require "null-ls"

			-- Check supported formatters and linters
			-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
			-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
			config.sources = {
				-- Set a formatter
				-- null_ls.builtins.formatting.stylua,
				-- null_ls.builtins.formatting.prettier,
			}
			return config -- return final config table
		end,
		treesitter = { -- overrides `require("treesitter").setup(...)`
			-- ensure_installed = { "lua" },
		},
		-- use mason-lspconfig to configure LSP installations
		["mason-lspconfig"] = { -- overrides `require("mason-lspconfig").setup(...)`
			-- ensure_installed = { "sumneko_lua" },
		},
		-- use mason-null-ls to configure Formatters/Linter installation for null-ls sources
		["mason-null-ls"] = { -- overrides `require("mason-null-ls").setup(...)`
			-- ensure_installed = { "prettier", "stylua" },
		},
	},

	-- neo-tree options
	["neo-tree"] = {
		filesystem = {
			filtered_items = {
				hide_dotfiles = false,
				hide_gitignored = false,
				hide_hidden = false
			},
			follow_current_file = true,
		},
	},

	-- lualine
	require('lualine').setup({
		options = {
			theme = "dracula"
		},
		sections = {
			lualine_x = { "aerial" },
		},
	}),

	-- Telescope
	require('telescope').setup({
		extensions = {
			aerial = {
				-- Display symbols as <root>.<parent>.<symbol>
				show_nesting = {
					['_'] = false, -- This key will be the default
					json = true, -- You can set the option for specific filetypes
					yaml = true,
					python = true,
				}
			}
		}
	}),

	-- LuaSnip Options
	luasnip = {
		-- Add paths for including more VS Code style snippets in luasnip
		vscode_snippet_paths = {},
		-- Extend filetypes
		filetype_extend = {
			-- javascript = { "javascriptreact" },
		},
	},

	-- CMP Source Priorities
	-- modify here the priorities of default cmp sources
	-- higher value == higher priority
	-- The value can also be set to a boolean for disabling default sources:
	-- false == disabled
	-- true == 1000
	cmp = {
		source_priority = {
			nvim_lsp = 1000,
			luasnip = 750,
			buffer = 500,
			path = 250,
		},
	},


	-- Modify which-key registration (Use this with mappings table in the above.)
	["which-key"] = {
		-- Add bindings which show up as group name
		register = {
			-- first key is the mode, n == normal mode
			n = {
				-- second key is the prefix, <leader> prefixes
				["<leader>"] = {
					-- third key is the key to bring up next level and its displayed
					-- group name in which-key top level menu
					["b"] = { name = "Buffer" },
					["h"] = { name = "Hop" },

				},
			},
		},
	},

	-- This function is run last and is a good place to configuring
	-- augroups/autocommands and custom filetypes also this just pure lua so
	-- anything that doesn't fit in the normal config locations above can go here
	polish = function()
		-- Set up custom filetypes
		-- vim.filetype.add {
		--   extension = {
		--     foo = "fooscript",
		--   },
		--   filename = {
		--     ["Foofile"] = "fooscript",
		--   },
		--   pattern = {
		--     ["~/%.config/foo/.*"] = "fooscript",
		--   },
		-- }
	end,
}

return config

@lmburns
Copy link
Owner

lmburns commented Oct 27, 2022

What happens if you run this :lua require('lf').start()?

@azinsharaf
Copy link
Author

the exact same message. Only single file or directory is allowed.

@azinsharaf
Copy link
Author

@lmburns Have you been able to reproduce this? Do you know if the plugin works on Windows? Since lf is cross platform (comparing to ranger) that would be great if lf.nvim supports Windows. That is the main reason i've switched from Ranger to lf.

this is my configuration and still getting the same error mentioned above.

return {
        "lmburns/lf.nvim",
        enabled = true,
        event = "VeryLazy",
        dependencies = {"plenary.nvim", "toggleterm.nvim"},
        config = function()
          -- This feature will not work if the plugin is lazy-loaded
          vim.g.lf_netrw = 1

          require("lf").setup(
              {
                  escape_quit = false,
                  border = "rounded",
                  -- highlights = {FloatBorder = {guifg = require("kimbox.palette").colors.magenta}}
              }
          )

          vim.keymap.set("n", "<C-o>", ":Lf<CR>")
        end,
    }

@lmburns
Copy link
Owner

lmburns commented Aug 10, 2023

I will test out this sometime by Monday and try and see about windows compatibility issues. I don't have a way to test the results though, so I will have you do that.

@roocker
Copy link

roocker commented Dec 17, 2023

I am getting the same error on Windows. Would love to see lf working within neovim as it does on Linux.

@claykom
Copy link

claykom commented Jul 23, 2024

I'd like to know if you've found a fix for this issue, I've experienced the same issues. I've got neovim and lf installed via scoop package manager on windows. If not I'll dig into this myself when I've got time.

@azinsharaf
Copy link
Author

i haven't found a solution yet.

@roocker
Copy link

roocker commented Jul 26, 2024

me niether but i looked for alternatives and i have to say yazi looks somewhat cleaner and very much similar to lf and i am happy with it for now. it integrates into neovim with tfm.nvim w/o issues for me. working with that with windows-git-bash, windows wsl and linux.

@azinsharaf
Copy link
Author

azinsharaf commented Jul 26, 2024

i tried yazi but it had issue with my neovim config and terminal. i have no idea how to fix it.

EDIT: I was able to fix the PowerShell issue. I can use Yazi. no issue!
https://www.reddit.com/r/neovim/comments/1ed3qeb/floating_window_and_powershell_issue/

2024-07-26 09_32_51-Inbox - Unified Folders - Mozilla Thunderbird

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants