Neovim #292
Replies: 14 comments
-
InstallInstalling Neovim · neovim/neovim Wiki (github.com) Ubuntu 20.04 apt-get 安装 Neovim v0.6.1 - SegmentFault 思否 apk add neovim apt install neovim brew install neovim Setup |
Beta Was this translation helpful? Give feedback.
-
Luananotee/nvim-lua-guide: A guide to using Lua in Neovim (github.com) LUA-VIMSCRIPT BRIDGE - Lua - Neovim docs
vim.o.listchars = 'space:_,tab:>~'
vim.opt.listchars = { space = '_', tab = '>~' } |
Beta Was this translation helpful? Give feedback.
-
Configuration
local opt = vim.opt
-- 2 moving around, searching and patterns
-- opt.incsearch = true
opt.ignorecase = true
opt.smartcase = true
-- 4 displaying text
-- opt.wrap = true
opt.cmdheight = 2
-- opt.columns = 150
-- opt.lines = 30
opt.list = true
opt.listchars = { tab = '»·', trail = '·', nbsp = '+' }
opt.number = true
-- 5 syntax, highlighting and spelling
-- opt.syntax = 'ON'
-- opt.hlsearch = true
opt.cursorline = true
opt.colorcolumn = '80'
-- opt.spell = false
-- 6 multiple windows
-- opt.hidden = true
-- 11 messages and info
-- opt.showcmd = true
opt.showmode = false
-- opt.ruler = true
-- 14 tabs and indenting
opt.tabstop = 4
opt.shiftwidth = 2
-- opt.smarttab = true
opt.softtabstop = 2
opt.expandtab = true
-- opt.autoindent = true
opt.smartindent = true
-- 17 mapping
-- opt.timeoutlen = 500
-- 18 reading and writing files
-- opt.endofline = true
-- opt.bomb = false
-- opt.fileformat = 'unix'
-- 24 multi-byte characters
-- opt.encoding = 'utf-8'
opt.fileencoding = 'utf-8' |
Beta Was this translation helpful? Give feedback.
-
Theme
return {
-- tokyonight
{
"folke/tokyonight.nvim",
lazy = false,
priority = 1000,
opt = {
style = "moon",
transparent = true,
styles = {
sidebars = "transparent",
floats = "transparent",
},
},
config = function()
-- load the colorscheme here
vim.cmd([[colorscheme tokyonight]])
end,
},
} |
Beta Was this translation helpful? Give feedback.
-
PluginPlugin Managerfolke/lazy.nvim: 💤 A modern plugin manager for Neovim (github.com)
require("config.lazy")
-- Bootstrap lazy.vim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Make sure to setup before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
require("config.options")
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
-- Congigure any other settings here.
-- colorscheme that will be used when installing plugins.
-- install = { colorscheme = { "habamax" } },
-- automatically check for plugin updates
checker = { enabled = true },
}) |
Beta Was this translation helpful? Give feedback.
-
Editor
File explorer -- file explorer
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
},
cmd = "Neotree",
opts = {
source_selector = {
winbar = true,
}
}
}, Usage:Neotree Show key bindings -- show key bindings
{
"folke/which-key.nvim",
opts = {
},
}, git statuslewis6991/gitsigns.nvim: Git integration for buffers (github.com) -- git status
{
"lewis6991/gitsigns.nvim",
opts = {
},
}, DiagnosticsTBD TODO listfolke/todo-comments.nvim: ✅ Highlight, list and search todo comments in your projects (github.com) TBD Fuzzy Findernvim-telescope/telescope.nvim: Find, Filter, Preview, Pick. All lua, all the time. (github.com) Dependenciesapt install ripgrep
apt install fd Install -- fuzzy finder
{
"nvim-telescope/telescope.nvim",
version = false,
cmd = "Telescope",
dependencies = {
"nvim-lua/plenary.nvim",
},
opts = {
}
} Usage:checkhealth telescope Pickers :Telescope find_files
:Telescope live_grep
:Telescope buffers
:Telescope help_tags |
Beta Was this translation helpful? Give feedback.
-
UI
Tabsakinsho/bufferline.nvim: A snazzy bufferline for Neovim (github.com) -- tabs
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = {
"nvim-tree/nvim-web-devicons",
},
opts = {
options = {
diagnostics = "nvim_lsp",
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "Directory",
text_align = "left",
},
},
},
},
}, Statusline -- statusline
{
"nvim-lualine/lualine.nvim",
opts = {
options = {
theme = "auto",
}
},
extensions = { "neo-tree", "lazy" },
},
return {
"rebelot/heirline.nvim",
event = "BufEnter",
opts = {
statusline = {},
winbar = {},
tabline = {},
statuscolumn = {},
}
} |
Beta Was this translation helpful? Give feedback.
-
TreeSitter
treesitternvim-treesitter/nvim-treesitter: Nvim Treesitter configurations and abstraction layer (github.com) Dependenciesapt install gcc Install -- treesitter
{
"nvim-treesitter/nvim-treesitter",
main = "nvim-treesitter.configs",
build = ":TSUpdate",
opts = {
ensure_installed = {
"bash",
"css",
"diff",
"html",
"java",
"javascript",
"json",
"lua",
"markdown",
"python",
"typescript",
"vim",
"vimdoc",
"xml",
"yaml",
},
sync_install = false,
highlight = {
enable = true
},
indent = {
enable = true
},
},
}, Usage:TSUpdate Auto close tagswindwp/nvim-ts-autotag: Use treesitter to auto close and auto rename html tag (github.com) TBD |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
-
Coding
Auto completionhrsh7th/nvim-cmp: A completion plugin for neovim coded in Lua. (github.com) -- auto completion
{
"hrsh7th/nvim-cmp",
version = false,
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
},
opts = {
auto_brackets = {},
},
}, |
Beta Was this translation helpful? Give feedback.
-
Copilot
return {
-- copilot
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
build = ":Copilot auth",
opts = {
},
},
} Usage:Copilot auth |
Beta Was this translation helpful? Give feedback.
-
UsageGo backGo back to where exited vim :marks
`0 Go back to edited recently :browse oldfiles |
Beta Was this translation helpful? Give feedback.
-
Insert Mode
Insert mode completion
Ctrl+x - suggestions
Insert special characters:digraphs
|
Beta Was this translation helpful? Give feedback.
-
Documentation - Neovim
Beta Was this translation helpful? Give feedback.
All reactions