Coder Social home page Coder Social logo

nvim-ide's Introduction

███╗   ██╗██╗   ██╗██╗███╗   ███╗      ██╗██████╗ ███████╗
████╗  ██║██║   ██║██║████╗ ████║      ██║██╔══██╗██╔════╝
██╔██╗ ██║██║   ██║██║██╔████╔██║█████╗██║██║  ██║█████╗  
██║╚██╗██║╚██╗ ██╔╝██║██║╚██╔╝██║╚════╝██║██║  ██║██╔══╝  
██║ ╚████║ ╚████╔╝ ██║██║ ╚═╝ ██║      ██║██████╔╝███████╗
╚═╝  ╚═══╝  ╚═══╝  ╚═╝╚═╝     ╚═╝      ╚═╝╚═════╝ ╚══════╝

nvim-ide

LazyVim + NVIM-IDE + Github NVIM Theme

Workflow Video

nvim-ide is a complete IDE layer for Neovim, heavily inspired by vscode.

It provides a default set of components, an extensible API for defining your own, IDE-like panels and terminal/utility windows, and the ability to swap between user defined panels.

This plugin is for individuals who are looking for a cohesive IDE experience from Neovim and are less concerned with mixing and matching from the awesome ecosystem of Neovim plugins.

The current set of default components include:

  • Bookmarks - Per-workspace collections of bookmarks with sticky support.
  • Branches - Checkout and administer the workspaces's git branches
  • Buffers - Display and administer the currently opened buffers.
  • CallHierarchy - Display an LSP's CallHierarchy request in an intuitive tree.
  • Changes - Display the current git status and stage/restore/commit/amend the diff.
  • Commits - Display the list of commits from HEAD, view a read only diff or checkout a commit and view a modifiable diff.
  • Explorer - A file explorer which supports file selection and recursive operations.
  • Outline - A real-time LSP powered source code outline supporting jumping and tracking.
  • TerminalBrowser - A terminal manager for creating, renaming, jumping-to, and deleting terminal instances.
  • Timeline - Displays the git history of a file, showing you how the file was manipulated over several commits.

We put a lot of efforts into writing docs/nvim-ide.txt, so please refer to this file for introduction, usage, and development information.

Getting started

Ensure you have Neovim v0.8.0 or greater.

  1. Get the plugin via your favorite plugin manager.

Plug:

Plug 'ldelossa/nvim-ide'

Packer.nvim:

use {
    'ldelossa/nvim-ide'
}
  1. Call the setup function (optionally with the default config):
-- default components
local bufferlist      = require('ide.components.bufferlist')
local explorer        = require('ide.components.explorer')
local outline         = require('ide.components.outline')
local callhierarchy   = require('ide.components.callhierarchy')
local timeline        = require('ide.components.timeline')
local terminal        = require('ide.components.terminal')
local terminalbrowser = require('ide.components.terminal.terminalbrowser')
local changes         = require('ide.components.changes')
local commits         = require('ide.components.commits')
local branches        = require('ide.components.branches')
local bookmarks       = require('ide.components.bookmarks')

require('ide').setup({
    -- The global icon set to use.
    -- values: "nerd", "codicon", "default"
    icon_set = "default",
    -- Set the log level for nvim-ide's log. Log can be accessed with 
    -- 'Workspace OpenLog'. Values are 'debug', 'warn', 'info', 'error'
    log_level = "info",
    -- Component specific configurations and default config overrides.
    components = {
        -- The global keymap is applied to all Components before construction.
        -- It allows common keymaps such as "hide" to be overridden, without having
        -- to make an override entry for all Components.
        --
        -- If a more specific keymap override is defined for a specific Component
        -- this takes precedence.
        global_keymaps = {
            -- example, change all Component's hide keymap to "h"
            -- hide = h
        },
        -- example, prefer "x" for hide only for Explorer component.
        -- Explorer = {
        --     keymaps = {
        --         hide = "x",
        --     }
        -- }
    },
    -- default panel groups to display on left and right.
    panels = {
        left = "explorer",
        right = "git"
    },
    -- panels defined by groups of components, user is free to redefine the defaults
    -- and/or add additional.
    panel_groups = {
        explorer = { outline.Name, bufferlist.Name, explorer.Name, bookmarks.Name, callhierarchy.Name, terminalbrowser.Name },
        terminal = { terminal.Name },
        git = { changes.Name, commits.Name, timeline.Name, branches.Name }
    },
    -- workspaces config
    workspaces = {
        -- which panels to open by default, one of: 'left', 'right', 'both', 'none'
        auto_open = 'left',
    },
    -- default panel sizes for the different positions
    panel_sizes = {
        left = 30,
        right = 30,
        bottom = 15
    }
})
  1. Issue the "Workspace" command to begin discovering what's available.

  2. Begin reading ":h nvim-ide"

Best used with

nvim-ide is best used with:

fuzzy-searching:

pretty notifications:

vscode-like "peek":

deeper git integration:

debugging:

nvim-ide's People

Contributors

alwaysingame avatar ansidev avatar augtheo avatar beeverfeever avatar distek avatar dundargoc avatar ldelossa avatar mrjones2014 avatar rosstang avatar siddhantdev avatar technicalpickles avatar theodegeest avatar vidocqh avatar yusefnapora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvim-ide's Issues

How to get the component windows back if I close them?

I didn’t expect <ESC> to close the single window, IMO it should toggle the whole sidebar.

anyway, if I accidentally close one or more component windows, is there an easy way to get them back and fully restore the window layout?

Global keymap overrides.

Per this conversation:
#35 (comment)

Make a way to set some global keymap overrides, such that users do not need to specify the same keybind override for every component.

Default panel width

I've found a few "issues" while testing and i'm adding them individually so as to keep the discussions focused.

Is it possible to set a wider default width for the panels?

docs: Add more information on installing via a package manager

The statement "Get the plugin via your favorite plugin manager" in the README likely makes a lot of sense to advanced neovim users. But if the user is newer to neovim, and doesn't necessarily have a plugin manager, it's not very helpful. It would be great to provide some additional context:

  • What package managers are available (and which one is preferred)?
  • What's the name of the package to install? Is it nvim-ide?
  • Are there any additional caveats? For example, does installing on windows work OOTB?

Issues creating new files/directories from the file tree

If a given filename ends with /, it should create a directory instead (I know there is a separate keymap but this is what my muscle memory does)

Additionally, given a path like path/with/subdirs/file.txt, it should create any necessary directories automatically.

Buffer list needs some additional options

I think the buffer list needs the following options:

{
  -- custom function that user can implement to filter buffers out of list
  filter = <function>,
  -- customize the character indicating current buffer
  -- maybe it can also be a highlight?
  indicator_current = '*',
  -- indicator for when buffer is modified
  indicator_modified = '!',
}

I also think the indicators should be placed before the filetype icons, and the rest of the items padded so that the filetype icons remain aligned.

Commands aren't registered properly when lazy loading with packer.nvim

The only lazy-loading mechanism that works for nvim-ide is event = 'VimEnter' which sorta defeats the purpose of lazy-loading.

Here's my current config:

return {
  -- localplugin just returns the local path to the cloned repo
  -- if it exists on disk
  localplugin('ldelossa/nvim-ide'),
  event = 'VimEnter',
  config = function()
    local explorer = require('ide.components.explorer')
    local outline = require('ide.components.outline')
    local bufferlist = require('ide.components.bufferlist')
    local changes = require('ide.components.changes')
    local commits = require('ide.components.commits')
    require('ide').setup({
      components = {
        [explorer.Name] = {
          list_directories_first = true,
          show_file_permissions = false,
          keymaps = {
            hide = '<NOP>',
          },
        },
        [outline.Name] = {
          keymaps = {
            hide = '<NOP>',
          },
        },
      },
      panel_groups = {
        explorer = { bufferlist.Name, explorer.Name, outline.Name },
        git = { changes.Name, commits.Name },
      },
      workspaces = {
        auto_close = false,
      },
    })
  end,
}

However if I change event = 'VimEnter' to cmd = 'Workspace', the command doesn't get registered properly and I'm unable to open the panels.

`Buffers` built-in component

VS Code has an option to show currently opened files as a separate list from the file tree, I'd like to replace barbar.nvim with this plugin.

image

Help file not found

I've found a few "issues" while testing and i'm adding them individually so as to keep the discussions focused.

:h nvim-ide doesn't seem to open the help file.

Git errors in non-git repo

Was getting the following when starting neovim in a non-git directory (in this case, home directory):

Error executing vim.schedule lua callback: ...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:147: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
	[C]: in function 'ipairs'
	...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:147: in function 'callback'
	...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:37: in function 'callback'
	.../pack/packer/start/nvim-ide/lua/ide/lib/async_client.lua:137: in function <.../pack/packer/start/nvim-ide/lua/ide/lib/async_client.lua:132>
Error executing vim.schedule lua callback: ...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:334: bad argument #1 to 'ipairs' (table expected, got nil)
stack traceback:
	[C]: in function 'ipairs'
	...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:334: in function 'parse'
	...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:357: in function 'callback'
	...te/pack/packer/start/nvim-ide/lua/ide/lib/git/client.lua:37: in function 'callback'
	.../pack/packer/start/nvim-ide/lua/ide/lib/async_client.lua:137: in function <.../pack/packer/start/nvim-ide/lua/ide/lib/async_client.lua:132>

I made a few changes and I think it fixes the issue?:

diff --git a/lua/ide/lib/async_client.lua b/lua/ide/lib/async_client.lua
index 6889afc..6ae7702 100644
--- a/lua/ide/lib/async_client.lua
+++ b/lua/ide/lib/async_client.lua
@@ -127,6 +127,14 @@ Client.new = function(cmd)
             if exit_code ~= 0 then
                 req.error = true
                 req.reason = "non-zero status code: " .. exit_code
+
+                -- request failed so close pipes and return
+                stdout:read_stop()
+                stderr:read_stop()
+                stdout:close()
+                stderr:close()
+                handle:close()
+                return
             end
             req.signal = signal
             vim.schedule(function()
diff --git a/lua/ide/lib/git/client.lua b/lua/ide/lib/git/client.lua
index 145378d..50445e7 100644
--- a/lua/ide/lib/git/client.lua
+++ b/lua/ide/lib/git/client.lua
@@ -142,7 +142,9 @@ Git.new = function()
             function(stdout)
                 if stdout == nil then
                     cb(nil)
+                    return
                 end
+
                 local commits = {}
                 for _, commit in ipairs(stdout) do
                     local parts = vim.fn.split(commit, Git.RECORD_SEP)
@@ -330,6 +332,9 @@ Git.new = function()
     --          is_head - @bool, whether this branch is the current HEAD.
     function self.branch(cb)
         local function parse(branches)
+            if branches == nil then
+                return
+            end
             local out = {}
             for _, b in ipairs(branches) do
                 local parts = vim.fn.split(b)

If this looks alright to you, I can cut a PR for it.

Git commit component

It would be neat to have a component like VS Code's commit window, where you can type a message and commit.

image

Logging needs attention

There is a logger package in ide.logger module.

Currently, its logging all levels unconditionally. We should set a log level in the config and log everything from that level and above. The logger calls should no-op if they are used and the given log level (and higher) is not specified in the config.

Additionally, a logging pass is needed. A logger is setup in a lot of functions, but never used, since I got enticed by adding features 😁

Issues closing Nvim/Buffers

I've found a few "issues" while testing and i'm adding them individually so as to keep the discussions focused.

  • Just noticed :q on a buffer, which would normally close Nvim, seems to close the buffers, but keeps the left and right panels open, which need to be individually closed.

  • Closing a buffer, with the panels open, means that the panels take up the entire viewport, then when I try to move to another buffer, it opens inside one of the IDE panels.

offset for bufferline.nvim

If you are using bufferline.nvim, by you'll end up with the first tab right above the left hand panel:

CleanShot 2022-12-04 at 15 10 56

There's an option to offset this, but requires a bit of extra configuration:

require("bufferline").setup({
	options = {
		offsets = {
                         -- you might already have this if you've used nvim-tree
			{
				filetype = "NvimTree",
				text = "",
				highlight = "Directory",
				text_align = "left",
			},
                         -- add this
			{
				filetype = "filetree",
				text = "",
				highlight = "Explorer",
				text_align = "left",
			}
		},
	},
})

Afterwards, it looks like this:

CleanShot 2022-12-04 at 15 18 10

I'm not sure where the boundaries lie between these plugins, if it should account for it, or update the other plugin or what, but wanted to note it as something users may run into.

Support for detatched git worktrees

When editing my Neovim config, the git root is located at ~, and the .git repo directory is at ~/.dotfiles. With gitsigns I can do:

require('gisigns').setup({
  worktrees = {
     {
      toplevel = vim.env.HOME,
      gitdir = string.format('%s/.dotfiles', vim.env.HOME),
     },
  }
})

Expose More of the API

I'm not sure how much of an undertaking this would be.

Idea is basically exposing more of the underlying API.

One way to maybe go about this is to just expose a get and set for certain options at the top level of the various elements (workspace, panel, and components).

End result being something like:
Workspace.panels.set("left", "git")
or
Workspace.panel[pos].get("is_open")
(not really sure the best way to handle it, but I figure sanitizing user input is probably needed)

This would allow for a much more script-able environment.

Few ideas where this would be nice:

  • Map swapping left and right panels without needing the select UI
  • Check if a panel is open so user can do some related function if desired
  • Insert/remove components from a group on-the-fly
  • New named terminal running a specific command, like how the commit functionality works

Just thoughts right now! Let me know what you think.

Help docs directory needs to be moved to make it available

Hello!

It seems if the docs are in nvim-ide/docs, they are not available within vim, but renaming the docs dir to doc seems to do the trick. So:

mv docs doc

to clarify.

Do you have them available within nvim while they're under the docs dir?

Hidden component overrides

All components should expose a Component config option which determines if they are "hidden" by default.

Right now, this is a bit hard coded, for instance CallHierarchy is hidden by default, until the CallHierarchy commands are used, in which the Component then "focuses" itself after populating its UI.

Question mark icons in outline even when nerd font is installed

I am using a nerd font, and icon_set is set to "nerd" (I also tried "default"), but it still shows question marks instead of the proper icons in every panel except for the file icons.

Screenshot 2022-12-09 at 11 12 58

My full config for nvim-ide:

-- default components
local bufferlist      = require('ide.components.bufferlist')
local explorer        = require('ide.components.explorer')
local outline         = require('ide.components.outline')
local callhierarchy   = require('ide.components.callhierarchy')
local timeline        = require('ide.components.timeline')
local terminal        = require('ide.components.terminal')
local terminalbrowser = require('ide.components.terminal.terminalbrowser')
local changes         = require('ide.components.changes')
local commits         = require('ide.components.commits')
local branches        = require('ide.components.branches')
local bookmarks       = require('ide.components.bookmarks')

require('ide').setup({
    -- The global icon set to use.
    -- values: "nerd", "codicon", "default"
    icon_set = "nerd",
    -- Component specific configurations and default config overrides.
    components = {
        -- The global keymap is applied to all Components before construction.
        -- It allows common keymaps such as "hide" to be overriden, without having
        -- to make an override entry for all Components.
        --
        -- If a more specific keymap override is defined for a specific Component
        -- this takes precedence.
        global_keymaps = {
            jump = "o",
            maximize = "=",
            minimize = "-"
        },
        -- example, prefer "x" for hide only for Explorer component.
        -- Explorer = {
        --     keymaps = {
        --         hide = "x",
        --     }
        -- }
    },
    -- default panel groups to display on left and right.
    panels = {
        left = "explorer",
        right = "git",
        bottom = "terminal",
    },
    -- panels defined by groups of components, user is free to redefine the defaults
    -- and/or add additional.
    panel_groups = {
        explorer = { outline.Name, bufferlist.Name, explorer.Name, bookmarks.Name, callhierarchy.Name,
            terminalbrowser.Name },
        terminal = { terminal.Name },
        git = { changes.Name, commits.Name, timeline.Name, branches.Name }
    },
    -- workspaces config
    workspaces = {
        -- which panels to open by default, one of: 'left', 'right', 'both', 'none'
        auto_open = 'left',
    },
    -- default panel sizes for the different positions
    panel_sizes = {
        left = 30,
        right = 30,
        bottom = 15
    }
})

[Branches] - Detached heads parse incorrectly

When in a detached head, its breaks the current parsing in the "Branches" component.

~/git/dotfiles heads/master*
0 🖳  git branch 
* (HEAD detached at 91d092c)
  master

produces the following output in the Branches tree:

image

Changing panel highlight groups colors/styles?

I've found a few "issues" while testing and i'm adding them individually so as to keep the discussions focused.

Is it possible to change the panel text colors highlighted row color? I checked for highlight in the repo and couldn't see anything and NvimIde (or similar) didn't popup inside of Telescope highlight group search. It's quite hard to know which panel is currently focused without checking each one for the different title color.

ToggleTerm/Terminal floatting window

I've found a few "issues" while testing and i'm adding them individually so as to keep the discussions focused.

t seems to prevent floating terminal windows from opening - I use Toggle Term to add shortcuts for terminal programs like Lazygit that open in a floating window and they seem to immediately close with Nvim-IDE open, but without the terminal panel being open, the floating terminal windows act normally.

Explorer holds on to cwd when tab was created

Heyo.

I've started playing with the concept of never leaving vim lol In this, I've found that Explorer doesn't seem to detect when a tab's cwd changes (such as with :tcd /somewhere/else). Instead it holds on to whatever the cwd was when the tab was created.

Should the Explorer component pick up if the cwd has changed in a tab? Or is this outside of scope of nvim-ide.

Terminal does not work

when opening the terminal panel, no shell is shown, just an empty editor pane.No error shown.

I do have ToggleTerm installed - maybe related...

[BUG] error when init as basic config

trying to use nvim-ide in my wsl machine(ubuntu20.04), error like below

Error executing vim.schedule lua callback: ...lugged/nvim-ide/lua/ide/components/outline/component.lua:445: unexpected event
stack traceback:
        [C]: in function 'nvim_create_autocmd'
        ...lugged/nvim-ide/lua/ide/components/outline/component.lua:445: in function 'constructor'
        ...e/nvim/plugged/nvim-ide/lua/ide/workspaces/workspace.lua:152: in function 'init_panels'
        ...e/nvim/plugged/nvim-ide/lua/ide/workspaces/workspace.lua:161: in function 'init'
        ...ged/nvim-ide/lua/ide/workspaces/workspace_controller.lua:169: in function 'assign_ws'
        ...ged/nvim-ide/lua/ide/workspaces/workspace_controller.lua:258: in function 'fn'
        vim/_editor.lua:384: in function 'cb'
        vim/_editor.lua:256: in function <vim/_editor.lua:256>

my init.lua

local Plug = vim.fn['plug#']

vim.call 'plug#begin'
Plug 'ldelossa/nvim-ide'
vim.call 'plug#end'

-- default components
local explorer        = require('ide.components.explorer')
local outline         = require('ide.components.outline')
local callhierarchy   = require('ide.components.callhierarchy')
local timeline        = require('ide.components.timeline')
local terminal        = require('ide.components.terminal')
local terminalbrowser = require('ide.components.terminal.terminalbrowser')
local changes         = require('ide.components.changes')
local commits         = require('ide.components.commits')
local branches        = require('ide.components.branches')
local bookmarks       = require('ide.components.bookmarks')
local bufferlist      = require('ide.components.bufferlist')

require('ide').setup({
    -- The global icon set to use.
    -- values: "nerd", "codicon", "default"
    icon_set = "default",
    -- Component specific configurations and default config overrides.
    components = {
        -- The global keymap is applied to all Components before construction.
        -- It allows common keymaps such as "hide" to be overriden, without having
        -- to make an override entry for all Components.
        --
        -- If a more specific keymap override is defined for a specific Component
        -- this takes precedence.
        global_keymaps = {
            -- example, change all Component's hide keymap to "h"
            -- hide = h
        },
        -- example, prefer "x" for hide only for Explorer component.
        -- Explorer = {
        --     keymaps = {
        --         hide = "x",
        --     }
        -- }
    },
    -- default panel groups to display on left and right.
    panels = {
        left = "explorer",
        right = "git"
    },
    -- panels defined by groups of components, user is free to redefine the defaults
    -- and/or add additional.
    panel_groups = {
        explorer = { outline.Name, bufferlist.Name, explorer.Name, bookmarks.Name, callhierarchy.Name, terminalbrowser.Name },
        terminal = { terminal.Name },
        git = { changes.Name, commits.Name, timeline.Name, branches.Name }
    },
    -- workspaces config
    workspaces = {
        -- which panels to open by default, one of: 'left', 'right', 'both', 'none'
        auto_open = 'left',
    },
    -- default panel sizes for the different positions
    panel_sizes = {
        left = 30,
        right = 30,
        bottom = 15
    }
})

my neovim version info

xx:~$ nvim --version
NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

system info

5.15.74.2-microsoft-standard-WSL2 #1 SMP Wed Nov 2 19:50:29 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

There seems to be some problem with the config given in README.md

Error detected while processing /home/aditya/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/aditya/.config/nvim/init.lua:40: attempt to index global 'outline' (a nil va
lue)
stack traceback:
        /home/aditya/.config/nvim/init.lua:40: in main chunk
Press ENTER or type command to continue

This is what I am getting while opening neovim.

My init.lua file

-- Variables
local Plug = vim.fn["plug#"]
local g = vim.g
local set = vim.opt

vim.call("plug#begin", "~/.config/nvim/plugged")
Plug "ldelossa/nvim-ide" --make nvim like VSCode
Plug "ellisonleao/gruvbox.nvim" --gruvbox theme
Plug "arcticicestudio/nord-vim" --nord theme
Plug "joshdick/onedark.vim" --one dark
Plug "nvim-lualine/lualine.nvim"
Plug "kyazdani42/nvim-web-devicons"
Plug "projekt0n/github-nvim-theme" --github theme
vim.call("plug#end")

-- theming
require('lualine').setup {
  options = {
    theme = "auto" -- or you can assign github_* themes individually.
    -- ... your lualine config
  }
}

require('ide').setup({
    -- the global icon set to use.
    -- values: "nerd", "codicon", "default"
    icon_set = "default",
    -- place Component config overrides here. 
    -- they key to this table must be the Component's unique name and the value 
    -- is a table which overrides any default config values.
    components = {},
    -- default panel groups to display on left and right.
    panels = {
        left = "explorer",
        right = "git"
    },
    -- panels defined by groups of components, user is free to redefine these
    -- or add more.
    panel_groups = {
        explorer = { outline.Name, explorer.Name, bookmarks.Name, callhierarchy.Name, terminalbrowser.Name },
        terminal = { terminal.Name },
        git = { changes.Name, commits.Name, timeline.Name, branches.Name }
    }
})

require("gruvbox").setup({
  undercurl = true,
  underline = true,
  bold = true,
  italic = false,
  strikethrough = true,
  invert_selection = false,
  invert_signs = false,
  invert_tabline = false,
  invert_intend_guides = false,
  inverse = true, -- invert background for search, diffs, statuslines and errors
  contrast = "hard", -- can be "hard", "soft" or empty string
  palette_overrides = {},
  overrides = {},
  dim_inactive = false,
  transparent_mode = false,
})

-- keymaps
function map(mode, shortcut, command)
    vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
end

function nmap(shortcut, command)
    map('n', shortcut, command)
end

function imap(shortcut, command)
    map('i', shortcut, command)
end

-- common vim options
vim.cmd [[
    colorscheme gruvbox
    syntax on
    filetype plugin indent on
    autocmd Filetype cpp setlocal tabstop=2
]]

set.number = true
set.mouse = "a"
set.autoindent = true
set.termguicolors = true
set.showmode = false
set.expandtab = true
set.hlsearch = true
set.ruler = true
set.title = true
set.autoread = true
set.tabstop = 4
set.shiftwidth = 4

Feature Request: Named Workspaces

Hi,

I am working a lot with different projects and different languages (bash, python, java, lua, rust...). So it would be awesome to have the ability to change the default panels depending on the filetype being used. and which panels are opened and which are not.

I would probably try to rely on existing features for this functionality, like adding some code to ftplugin-dir.

e.g. when opening bash-scripts, it would open an explorer on the right, but probably not outline (outline does not really work with lua or bash - maybe another feature request).

when opening a java-file (or related), it would show more panels, maybe by default.

It was mentioned to have some kind of named configurations, so it would be great to use those for example in ftplugins or anything alike...

I hope that does make sense...

Prevent polluting global Lua namespace

I noticed that in most of the modules, you're just doing something like:

Whatever = {}

-- some stuff

return Whatever

This creates a global variable, which isn't really ideal. Unless you have some specific reason they need to be globals, you should do:

local Whatever = {}

-- some stuff

return Whatever

No `:Workspace` command exposed?

👋🏻

Reading the docs it looks like I should see a bunch of panels displayed after the .setup() is executed (that doesn't happen, no errors either), but also that a :Workspace command should be exposed (but there isn't).

  use {
    "ldelossa/nvim-ide",
    config = function()
      require("ide").setup({
        icon_set = "default",
        panels = {
          left = "explorer",
          right = "git"
        },
      })
    end
  }

Error when starting more than one terminal from terminal browser

Haven't dug in to it yet, but this keeps happening every time I open a new terminal beyond the first one:

E5108: Error executing lua: Vim:Can only call this function in an unmodified buffer
stack traceback:
	[C]: in function 'termopen'
	...start/nvim-ide/lua/ide/components/terminal/component.lua:91: in function 'new_term'
	...ua/ide/components/terminal/terminalbrowser/component.lua:103: in function 'new_term'
	...ua/ide/components/terminal/terminalbrowser/component.lua:49: in function <...ua/ide/components/terminal/terminalbrowser/component.lua:49>

This happens whether I press "n" in the terminal browser, or if I call :Workspace TerminalBrowser New, or both.

However, the terminal browser shows multiple terminals as though there is more than one, and I can rename them individually, but they all bring up the same terminal if I hit enter on them.

Hoping someone can confirm if this is just a me thing, as this hasn't happened until recently.

Edit: I did just update neovim to the latest nightly. Investigating.

Edit 2: Seems like it's rather not actually creating the new buffer or the nvim_win_set_buf isn't working correctly for the terminal in new_term(). Might be a me thing, not sure. I'll play with it tomorrow.

outline component errors with "attempt to index field 'cursor' (a nil value)" when switching buffers

I get this error anytime I switch between buffers:

Error executing vim. schedule lua callback:
stack traceback: • /start/nvim-ide/lua/ide/components/outline/component.lua:161: attempt to index field 'cursor' ( a nil value)
.../start/nvim-ide/lua/ide/components/outline/component lua: 161: in function ' build outline'
./start/nvim-ide/lua/ide/components/outline/component.lua:195: in function 'callback'
.w/Cellar/neovim/0.8.0/share/nvim/runtime/lua/vim/lsp.lua:1958: in function 'handler'
w/Cellar/neovim/0.8.0/share/nvim/runtime/lua/vim/lsp.lua:1390: in function
vim/ editor. lua: in function <vim/ editor. lua:

CleanShot 2022-11-30 at 09 30 24

I'm getting this on Ruby files using ruby-lsp and Lua files using sumoneko. Files without attached LSP seem unaffected.

This happens even if the symbol outline component is not shown. Is there a way to disable it in the meantime?

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.