Giter VIP home page Giter VIP logo

cosmic-ui's Introduction

๐Ÿ’ซ Cosmic-UI

Neovim Minimum Version GitHub last commit Discord

๐Ÿš€ Stellar Features

Warning: Under heavy development

Cosmic-UI is a simple wrapper around specific vim functionality. Built in order to provide a quick and easy way to create a Cosmic UI experience with Neovim!

  • Rename floating popup & file change notification
  • Code Actions

๐Ÿ“ท Screenshots

Code Actions

Screen Shot 2021-12-10 at 3 37 38 PM

Rename Floating Popup

Screen Shot 2021-12-10 at 4 22 28 PM

๐Ÿ›  Installation

  use({
    'CosmicNvim/cosmic-ui',
    requires = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim' },
    config = function()
      require('cosmic-ui').setup()
    end,
  })

โš™๏ธ Configuration

You may override any of the settings below by passing a config object to .setup

{
  -- default border to use
  -- 'single', 'double', 'rounded', 'solid', 'shadow'
  border_style = 'single',

  -- rename popup settings
  rename = {
    border = {
      highlight = 'FloatBorder',
      style = 'single',
      title = ' Rename ',
      title_align = 'left',
      title_hl = 'FloatBorder',
    },
    prompt = '> ',
    prompt_hl = 'Comment',
  },

  code_actions = {
    min_width = nil,
    border = {
      bottom_hl = 'FloatBorder',
      highlight = 'FloatBorder',
      style = 'single',
      title = 'Code Actions',
      title_align = 'center',
      title_hl = 'FloatBorder',
    },
  }
}

โœจ Usage

Rename

function map(mode, lhs, rhs, opts)
  local options = { noremap = true, silent = true }
  if opts then
    options = vim.tbl_extend('force', options, opts)
  end
  vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end

map('n', 'gn', '<cmd>lua require("cosmic-ui").rename()<cr>')

Code Actions

map('n', '<leader>ga', '<cmd>lua require("cosmic-ui").code_actions()<cr>')
map('v', '<leader>ga', '<cmd>lua require("cosmic-ui").range_code_actions()<cr>')

More coming soon...

cosmic-ui's People

Contributors

jeff-dh avatar jzone1366 avatar mattleong 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

Forkers

doodleesc

cosmic-ui's Issues

Renaming identifiers with 23 (or more) characters

I just wanted to rename a function with a name of the length of 23 characters and when calling cosmic-ui.rename() a -- seemingly -- empty textbox popup.

It turned out that the textbox actually was not empty but was "scrolled" and the whole identifier was "scrolled out of" the textbox. Hitting the left arrow key once fixed it, buuuuuuut.... this is at least confusing.

Same for identifiers longer than 23 characters, when renaming a 25 character identifier 2 characters -- seemingly -- show up in the textbox.

In both cases would I would expect the textbox to be completely filled and only truncated on the left side.

Missing Dependency - Getting an error at try to rename with cosmic-ui

At call:

require('cosmic-ui').rename()

In my attach function, with code like this:

function bufmap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end

bufmap('n', 'gn', '<cmd>lua require("cosmic-ui").rename()<cr>', { noremap = true, silent = true })

It shows an error at call it function in my file:

Error at executing vim.schedule lua callback: vim.lua:435: Chunk is not an array with one or two strings

Investigating, the file and the line is:

-- ~/.local/share/nvim/site/pack/packer/start/cosmic-ui/lua/cosmic-ui/rename/handler.lua:30
vim.notify(msg, vim.log.levels.INFO, { title = ('Rename: %s -> %s'):format(currName, new_word) })

I don't know what I am doing wrong

NOTE: Sorry for my english

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.