add: neovim
This commit is contained in:
parent
5c94916c64
commit
0110dc23e3
14 changed files with 202 additions and 0 deletions
23
.config/nvim/init.lua
Normal file
23
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
-- Before configs
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- Plugins
|
||||
require("config.lazy")
|
||||
require("lazy").setup("plugins")
|
||||
|
||||
-- require("oil").setup()
|
||||
require("nvim-tree").setup()
|
||||
require("nvim-treesitter").setup()
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
require("mason-lspconfig").setup_handlers {
|
||||
function (server_name)
|
||||
require("lspconfig")[server_name].setup {}
|
||||
end
|
||||
}
|
||||
|
||||
-- Options
|
||||
require("config.option")
|
||||
require("config.keymap")
|
18
.config/nvim/lazy-lock.json
Normal file
18
.config/nvim/lazy-lock.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "fc8f183479a472df60aa86f00e295462f2308178" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "32b6a6449aaba11461fffbb596dd6310af79eea4" },
|
||||
"nvim-navbuddy": { "branch": "master", "commit": "f22bac988f2dd073601d75ba39ea5636ab6e38cb" },
|
||||
"nvim-navic": { "branch": "master", "commit": "39231352aec0d1e09cebbffdd9dc20a5dc691ffe" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "be5b788f2dc1522c73fb7afad9092331c8aebe80" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "684eeac91ed8e297685a97ef70031d19ac1de25a" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "855c97005c8eebcdd19846f2e54706bffd40ee96" },
|
||||
"oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"sonokai": { "branch": "master", "commit": "f59c796780655c3b9da442d310ad2f2d735f2e56" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }
|
||||
}
|
11
.config/nvim/lua/config/Mason.lua
Normal file
11
.config/nvim/lua/config/Mason.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
}
|
0
.config/nvim/lua/config/keymap.lua
Normal file
0
.config/nvim/lua/config/keymap.lua
Normal file
35
.config/nvim/lua/config/lazy.lua
Normal file
35
.config/nvim/lua/config/lazy.lua
Normal file
|
@ -0,0 +1,35 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
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 `mapleader` and `maplocalleader` 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 = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
9
.config/nvim/lua/config/option.lua
Normal file
9
.config/nvim/lua/config/option.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
-- Line number
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = false
|
||||
|
||||
-- Tab
|
||||
|
||||
-- Colors
|
||||
vim.opt.termguicolors = true
|
||||
vim.cmd.colorscheme("sonokai")
|
26
.config/nvim/lua/plugins/blink.lua
Normal file
26
.config/nvim/lua/plugins/blink.lua
Normal file
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"Saghen/blink.cmp",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
|
||||
version = "1.*",
|
||||
|
||||
---@module "blink.cmp"
|
||||
---@type blink.cmp.Config
|
||||
|
||||
opts = {
|
||||
keymap = { preset = "default" },
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = "mono"
|
||||
},
|
||||
|
||||
completion = { documentation = { auto_show = false } },
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "buffer" },
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "prefer_rust" }
|
||||
},
|
||||
opts_extend = { "sources.default"}
|
||||
}
|
11
.config/nvim/lua/plugins/mason.lua
Normal file
11
.config/nvim/lua/plugins/mason.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
-- lazy = true,
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
-- lazy = true,
|
||||
}
|
||||
}
|
13
.config/nvim/lua/plugins/nvim-lspconfig.lua
Normal file
13
.config/nvim/lua/plugins/nvim-lspconfig.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
{
|
||||
"SmiteshP/nvim-navbuddy",
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"MunifTanjim/nui.nvim"
|
||||
},
|
||||
opts = { lsp = { auto_attach = true } }
|
||||
}
|
||||
},
|
||||
}
|
19
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
19
.config/nvim/lua/plugins/nvim-tree.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
sort = {
|
||||
sorter = "name",
|
||||
},
|
||||
view = {
|
||||
width = 30,
|
||||
},
|
||||
renderer = {
|
||||
group_empty = false,
|
||||
highlight_git = "all",
|
||||
},
|
||||
filters = {
|
||||
dotfiles = true,
|
||||
},
|
||||
git = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
16
.config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
16
.config/nvim/lua/plugins/nvim-treesitter.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
{"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function ()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
ensure_installed = {"lua"},
|
||||
sync_install = false,
|
||||
highlight = {enable = true},
|
||||
indent = {enable = false},
|
||||
})
|
||||
|
||||
end
|
||||
},
|
||||
}
|
13
.config/nvim/lua/plugins/oil.lua
Normal file
13
.config/nvim/lua/plugins/oil.lua
Normal file
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {},
|
||||
-- Optional dependencies
|
||||
-- dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
}
|
||||
}
|
5
.config/nvim/lua/plugins/telescope.lua
Normal file
5
.config/nvim/lua/plugins/telescope.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.8",
|
||||
dependencies = { "nvim-lua/plenary.nvim" }
|
||||
}
|
3
.config/nvim/lua/plugins/themes.lua
Normal file
3
.config/nvim/lua/plugins/themes.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
"sainnhe/sonokai"
|
||||
}
|
Loading…
Reference in a new issue