first commit

This commit is contained in:
Young Xu 2023-01-31 00:33:04 +08:00
commit a0085913ad
Signed by: xuthus5
GPG Key ID: A23CF9620CBB55F9
5 changed files with 126 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
plugin

3
init.lua Normal file
View File

@ -0,0 +1,3 @@
require('basic')
require('plugins')
require('plugins-config')

70
lua/basic.lua Normal file
View File

@ -0,0 +1,70 @@
-- 文件编码
vim.g.encoding = "UTF-8"
vim.o.fileencoding = "utf-8"
-- 显示行号
vim.wo.number = true
vim.wo.relativenumber = true
-- 高亮所在行
vim.wo.cursorline = true
-- 显示左侧图标指示列
vim.wo.signcolumn = "yes"
-- 右侧参考线,超过表示代码太长了,考虑换行
vim.wo.colorcolumn = "120"
-- 缩进2个空格等于一个Tab
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
vim.opt.autoindent = true
-- 新行对齐当前行
vim.o.autoindent = true
vim.bo.autoindent = true
vim.o.smartindent = true
-- 搜索大小写不敏感,除非包含大写
vim.o.ignorecase = true
vim.o.smartcase = true
-- 搜索不要高亮
vim.o.hlsearch = false
-- 边输入边搜索
vim.o.incsearch = true
-- 命令行高为2提供足够的显示空间
vim.o.cmdheight = 1
-- 当文件被外部程序修改时,自动加载
vim.o.autoread = true
vim.bo.autoread = true
-- 禁止折行
vim.wo.wrap = false
-- 光标在行首尾时<Left><Right>可以跳到下一行
vim.o.whichwrap = "<,>,[,]"
-- 允许隐藏被修改过的buffer
vim.o.hidden = true
-- 鼠标支持
vim.o.mouse = "a"
-- smaller updatetime
vim.o.updatetime = 300
-- 设置 timeoutlen 为等待键盘快捷键连击时间500毫秒可根据需要设置
-- 遇到问题详见https://github.com/nshen/learn-neovim-lua/issues/1
vim.o.timeoutlen = 500
-- split window 从下边和右边出现
vim.o.splitbelow = true
vim.o.splitright = true
-- 自动补全不自动选中
vim.g.completeopt = "menu,menuone,noselect,noinsert"
-- 样式
vim.o.termguicolors = true
vim.opt.termguicolors = true
-- 是否显示不可见字符
vim.o.list = false
-- 不可见字符的显示,这里只把空格显示为一个点
vim.o.listchars = "space:·,tab:··"
-- 补全增强
vim.o.wildmenu = true
-- Dont' pass messages to |ins-completin menu|
vim.o.shortmess = vim.o.shortmess .. "c"
-- 补全最多显示10行
vim.o.pumheight = 10
-- 永远显示 tabline
vim.o.showtabline = 2
-- 使用增强状态栏插件后不再需要 vim 的模式提示
vim.o.showmode = false
-- 配置剪切板
vim.opt.clipboard = "unnamedplus"

8
lua/plugins-config.lua Normal file
View File

@ -0,0 +1,8 @@
require('nvim-tree').setup()
require('symbols-outline').setup()
require('feline').setup()
require('bufferline').setup()
require('go').setup()
vim.o.background = "dark" -- or "light" for light mode
vim.cmd([[colorscheme gruvbox]])

44
lua/plugins.lua Normal file
View File

@ -0,0 +1,44 @@
return require('packer').startup(function()
-- Packer can manage itself
use 'wbthomason/packer.nvim'
-- nvim-tree
use {
'nvim-tree/nvim-tree.lua',
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},
tag = 'nightly' -- optional, updated every week. (see issue #1193)
}
-- greeter
use {
'goolord/alpha-nvim',
requires = { 'nvim-tree/nvim-web-devicons' },
config = function ()
require'alpha'.setup(require'alpha.themes.startify'.config)
end
}
-- theme
use { "ellisonleao/gruvbox.nvim" }
-- symbols outline
use 'simrat39/symbols-outline.nvim'
-- status tabbar
use 'feline-nvim/feline.nvim'
-- bufferline
use {'akinsho/bufferline.nvim', tag = "v3.*", requires = 'nvim-tree/nvim-web-devicons'}
-- golang ide
use 'ray-x/go.nvim'
use 'ray-x/guihua.lua' -- recommended if need floating window support
use 'neovim/nvim-lspconfig'
use 'nvim-treesitter/nvim-treesitter'
-- project manager
use {
"ahmedkhalf/project.nvim",
config = function()
require("project_nvim").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end
}
end)