One.nvim
All-in-one neovim configuration framework implemented with Lua. It is highly flexible to be customized and extended.
Features
-
All in Lua. All configs can be overridden. Read Configuration.
-
Use many Neovim features: Native LSP, Float Window, Winbar.
-
The supported plugin managers: lazy.nvim, vim-plug and packer.nvim. Read Plugin Manager.
-
Awesome UI and color schema. Dark Mode. Support True-Color, Smooth-Scroll, Scrollbar, Dashboard. You can change colors and highlights. Read Colors and Highlights.
-
Configurable proxy for fast git download in China Mainland. Read Proxy.
-
Integrated 120+ powerful Vim/Nvim plugins. Enhancing the usage experience, and fixed some shortcomings of these plugins.
Click to expend/collapse plugin list
- Plugin Manager: lazy (default) or vim-plug or packer
- Vim Options: vim-options
- Utilities: plenary and Penlight and nui
- Dashboard: alpha.nvim
- Outline: aerial (default) or majutsushi/tagbar
- File Explorer: neo-tree (default) or nerdtree or nvim-tree
- Statusline: lualine (default) or airline
- Tabline: tabby
- Bufferline: barbar or bufferline (If use bufferline, you should disable tabline plugin)
- Cursorline Highlight: beacon (default) or specs.nvim
- Scrollbar: nvim-scrollbar
- Smooth-Scroll: neoscroll.nvim
- Session: persisted (default) or possession or xolox/vim-session or rmagatti/auto-session
- Fuzzy Finding: telescope and ctrlsf
- Diagnostics Window: trouble
- Undo: vim-mundo
- Syntax Highlight: treesitter and nvim-ts-rainbow and nvim-treesitter-pairs
- Highlight Words: vim-interestingwords
- Code Comment: Comment.nvim (default) or nerdcommenter
- LSP: nvim-lspconfig and treesitter and null-ls and nlsp and goto-preview and lsp-toggle
- DAP: nvim-dap
- Format: lsp-format and editorconfig-vim
- Formatter, Linter, LSP, DAP Manager: mason and mason-installer
- Completion: nvim-cmp
- Snippets: nvim-snippy
- Markdown: plasticboy/vim-markdown and markdown-preview and headlines.nvim and vim-MarkdownTOC
- Surrounds: nvim-surround and nvim-autopairs and nvim-ts-autotag and vim-matchup
- Git: gitsigns and lazygit and diffview.nvim
- Indent Line: indent-blankline
- Cursor Move: flash.nvim and accelerated-jk or hop.nvim
- Window Picker: nvim-window-picker (default) or yorickpeterse/nvim-window or vim-choosewin
- Window Resize: simeji/winresizer and windows.nvim
- Context: aerial (default) or navic and nvim-treesitter-context
- Text Align: vim-easy-align
- Bookmark: vim-bookmarks
- Mark: marks.nvim
- Calendar: mattn/calendar-vim
- Curl: rest.nvim
- Icons: devicons and icon-picker
- UI Enhancing: dressing and noice
- Escape: better-escape.nvim
- Increment: increment-activator
- Filetype: filetype.nvim
- Latex: nabla
- Notification: notify (default) or notifier
- Profiling: vim-startuptime
- Text-Objects: wildfire and nvim-treesitter-textobjects
- Table Edit: vim-table-mode
- Terminal: neoterm
- Testing: nvim-test
- TODO Comment: todo-comments
- Trailing Spaces: whitespace
- Yank: yanky
- Zen Mode: twilight and zen-mode
- Notebook: zk
- Live Command: live-command
- Color Highlighter: ccc.nvim (default) or vim-hexokinase or nvim-colorizer
- Translation: translate.nvim
- Games
- one.nvim enhanced plugin: one
Screenshots
Click to expend/collapse
Dashboard
UI
Outline
Press <space>o
to open the outline.
File Finder
Press <space>f
to open the file finder.
Keymaps
Press <space>k
to open the keymap finder.
Command Finder
Press <space>p
to open the keymap finder.
Diagnostic
Press <space>d
or <space>D
to open the diagnostic list. See Diagnostic keymaps.
Completion
Function signature completion
Installation
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()
FAQ
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.
Usage
- Debug
- Keymaps
- Commands
- Snippets
- LSP
- Code Format
- Telescope Extensions
- Window Picker
- Float Cmdline
- Unloaded Plugins
- Extend your plugins/highlights/commands and so on
- Global Variable
- Proxy
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-2023 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.