Code Monkey home page Code Monkey logo

one.nvim's Introduction

One.nvim

All-in-one neovim configuration framework implemented with Lua. It is highly flexible to be customized and extended.

English | 中文

Features

Screenshots

Click to expend/collapse

Dashboard

dashboard.png

UI

UI.png

UI-2.png

Outline

outline.png

Press <space>o to open the outline.

File Finder

finder.png

Press <space>f to open the file finder.

Keymaps

keymaps.png

Press <space>k to open the keymap finder.

Command Finder

cmd-finder.png

Press <space>p to open the keymap finder.

Diagnostic

diagnostic.png

Press <space>d or <space>D to open the diagnostic list. See Diagnostic keymaps.

Completion

completion.png

Function signature completion

completion-function-args.png

Update

The source codes of one.nvim is not managed by plugin manager.

You can update them by lua functions or commands.

  • Update one.nvim: :OneUpdate one or :lua one.update('one')
  • Update pm: :OneUpdate pm or :lua one.update('pm')
  • Update all (one.nvim + pm): :OneUpdate or :OneUpdate all or :lua one.update()

Configuration

require('one').setup {}

All config options are optional. You can override default configs. Please read User Config.

Plugin Manager

Note: One.nvim will install plugin manager on start up. So user should not install one.nvim via plugin manager.

Choose your favorite plugin manager. Now available: lazy (default), vim-plug, packer, local.

require('one').setup {
  config = {
    pluginManager = { use = 'lazy' }, -- 'lazy' or 'vim-plug' or 'packer' or 'local'
  },
}
lazy vim-plug packer
Plugins Directory {DATA_DIR}/plugins {DATA_DIR}/plugins {DATA_DIR}/site/pack/user/start/packer.nvim
Default Config lua/one/config/lazy.lua lua/one/config/vim-plug.lua lua/one/config/packer.lua

The value of {DATA_DIR} is :lua print(vim.fn.stdpath('data')).

When you change to packer from lazy or vim-plug, the plugins should be reinstalled. Read initialization for details.

When config.pluginManager.use = 'local', this plugin manager can only load local plugins. It cannnot install packages from remote.

Plugin

All plugins can be turned off, overridden default config options, replaced with your favorites. It is highly flexible to be customized and extended.

Read ./doc/plugin.md for plugin definitions and references.

You can even set onlyPlugins = {} to disable all plugins. Read Debug - Disable other plugins.

You can invoke :OneShowPlugins to view disabled and enabled plugins.

Colors and Highlights

It's highly dependent on treesitter. If syntax highlights not work, check your treesitter parsers correct. Read ./doc/treesitter.md for troubleshooting.

You can override the default colors and highlights. Read ./doc/colors.md for more details.

Color Space

The colors are desiged based on Display P3 color space. It works for MacOS and iTerm2 users.

If your nvim colors looks different from below picture. Your terminal is not under Display P3 color space. You may try sRGB colors. Read Colors - Color Space for details.

Notice

$VIMRUNTIME/filetype.vim won't be loaded. Filetype detected in ./lua/one/plugins/filetype.lua

Read ./doc/note.md for other notes.

API

Just read codes.

Project File Structure

.
├── doc/                     // Documents
├── lua/
│   └── one/
│       ├── async.lua        // async library
│       ├── config/          // Keymaps
│       │   ├── colors.lua   // Default color config
│       │   ├── default.lua  // Default config
│       │   ├── packer.lua   // packer.nvim default config
│       │   ├── symbol.lua   // symbols
│       │   └── vim-plug.lua // vim-plug default config
│       ├── config.lua       // Config loader
│       ├── consts.lua       // Constants
│       ├── filetype.lua     // FileType autocmd
│       ├── one.lua          // The one singleton
│       ├── init.lua         // The lua required entry point
│       ├── plugins.lua      // Plugin loading list
│       ├── util.lua         // Utility functions
│       ├── util_spec.lua    // Unit test for util.lua
│       ├── keymap/          // Keymaps
│       ├── plugins/         // Available plugins written in lua
│       │   └── themes/      // Color schemas
│       └── plugin-manager/
│           ├── init.lua     // Plugin Manager
│           ├── lazy.lua     // Wrapper for lazy.nvim
│           ├── local.lua    // Only load local files
│           ├── vim-plug.lua // Wrapper for vim-plug
│           └── packer.lua   // Wrapper for packer.nvim
└── scripts/                 // scripts for building project

Startup Time

require('one').setup {
  plugins = {
    { 'profiling', disable = false }, -- This plugin is disabled in default
  }
}

Enable profiling plugin, and invoke :StartupTime in nvim. It will print each time on startup.

Suggestion, Bug Reporting, Contributing

Before opening new Issue/Discussion/PR and posting any comments, please read ./CONTRIBUTING.md.

Copyright and License

Copyright 2016-2024 ADoyle ([email protected]). Some Rights Reserved. The project is licensed under the BSD 3-clause License.

Read the LICENSE file for the specific language governing permissions and limitations under the License.

Read the NOTICE file distributed with this work for additional information regarding copyright ownership.

Other Projects

Other nvim projects created by me.

one.nvim's People

Contributors

adoyle-h 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

one.nvim's Issues

Errors when launch: luaformatter: failed to install

2023-01-30T12:06:47  INFO [mason-tool-installer] luaformatter: installing
2023-01-30T12:06:47  ERROR [mason-tool-installer] luaformatter: failed to install

This can be fixed by brew install luarocks, should be placed into the documentation?

Ubuntu 22.04 luaformatter: failed to install && Error detected

在 ubuntu 22.04 尝试安装 one.nvim 插件,并顺手执行了一下 nvim .bashrc,一开始是进入 nvim 直接报错

Error detected while processing BufReadPost Autocommands for "*":
E5108: Error executing lua vim/_editor.lua:0: BufReadPost Autocommands for "*"..script nvim_exec2() called at BufReadPost Autocommands for "*":0: Vim(call)
:E117: Unknown function: dist#ft#SetFileTypeSH
stack traceback:
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        ...plugins/filetype.nvim/lua/filetype/mappings/function.lua:480: in function 'name'
        ...l/share/nvim/plugins/filetype.nvim/lua/filetype/init.lua:17: in function 'set_filetype'
        ...l/share/nvim/plugins/filetype.nvim/lua/filetype/init.lua:65: in function 'try_lookup'
        ...l/share/nvim/plugins/filetype.nvim/lua/filetype/init.lua:171: in function 'resolve'
        [string ":lua"]:1: in main chunk

随后,mason-tool-installer 报错:

2023-06-08T19:52:06  INFO [mason-tool-installer] luaformatter: installing
2023-06-08T19:52:10  INFO [mason-tool-installer] lua-language-server: successfully installed
2023-06-08T19:52:39  ERROR [mason-tool-installer] luaformatter: failed to install

依赖版本:

lua -v
# Lua 5.3.5  Copyright (C) 1994-2018 Lua.org, PUC-Rio

luarocks --version
# /usr/local/bin/luarocks 3.8.0       
# LuaRocks main command-line interface

nvim -v
# NVIM v0.9.1        
# Build type: Release
# LuaJIT 2.1.0-beta3
#   system vimrc file: "$VIM/sysinit.vim"
#  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"
# Run :checkhealth for more info

python --version
# Python 3.10.10

pip3 --version
# pip 23.0.1 from /home/jasonos/miniconda3/lib/python3.10/site-packages/pip (python 3.10)

pip3 show pynvim
# Name: pynvim
# Version: 0.4.3
# Summary: Python client to neovim
# Home-page: http://github.com/neovim/pynvim
# Author: Thiago de Arruda
# Author-email: [email protected]
# License: Apache
# Location: /home/jasonos/miniconda3/lib/python3.10/site-packages
# Requires: greenlet, msgpack
# Required-by:

apt show ripgrep
# ...
# Version: 13.0.0-2ubuntu0.1
# Built-Using: rustc (= 1.59.0+dfsg1-1~ubuntu2~22.04.1)
# ...

gcc --version
# gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

dpkg -l | grep libstdc++
# libstdc++-11-dev:amd64  11.3.0-1ubuntu1~22.04.1 amd64 GNU Standard C++ Library v3 (development files)
# libstdc++6:amd64  12.1.0-2ubuntu1~22.04    amd64    GNU Standard C++ Library v3

Originally posted by @osjason in #10 (comment)

The 'tab' is not convenient

How could I get this tab style, like vscode?
image

Currently the 'tab' navigation is on the right cornor, and no file name.

安装

看了半天我还是不太懂你这个是怎么用的,如果直接在 init.lua 中 require(one)的话会警告找不到该模块,根据你的文档是 git clone 到/Users/macbook/.local/share/nvim/site/pack/user/start/one.vim,那按照 lua 的语法确实导入不了呀,而且也不在他寻找的一些备用路径里。

同时,如果按照 包管理器Lazy的包导入方式,导入是可以导入了,但什么效果都没有。

还是请你给出一个易于理解的使用方式谢谢。

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.