neovim config

This commit is contained in:
fanyx 2023-09-21 19:01:37 +02:00
parent ccdb107703
commit d8bbd3de43
11 changed files with 162 additions and 1 deletions

37
.config/nvim/init.lua Normal file
View File

@ -0,0 +1,37 @@
vim.cmd('source ~/.vimrc')
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
vim.g.mapleader = " "
require("lazy").setup("plugins", {
defaults = { lazy = true },
install = { colorscheme = { "tokyonight" } },
checker = { enabled = true },
change_detection = { notify = false },
performance = {
rtp = {
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})
require("config")

View File

@ -1 +0,0 @@
source ~/.vimrc

View File

@ -0,0 +1,11 @@
{
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
"monokai.nvim": { "branch": "master", "commit": "b8bd44d5796503173627d7a1fc51f77ec3a08a63" },
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
"nvim-tree.lua": { "branch": "master", "commit": "a3aa3b47eac8b6289f028743bef4ce9eb0f6782e" },
"nvim-treesitter": { "branch": "master", "commit": "b7f2dd5dfbd24a1239844e15637b637b990df164" },
"nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" },
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"telescope.nvim": { "branch": "master", "commit": "40c8d2fc2b729dd442eda093cf8c9496d6e23732" },
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }
}

View File

@ -0,0 +1,13 @@
require("config.settings")
require("config.yaml")
-- Remaps
vim.keymap.set("n", "<leader>ex", vim.cmd.Ex)
-- Telescope
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.git_files, {})
-- Nvim-Tree

View File

@ -0,0 +1,19 @@
vim.o.tabstop = 4
vim.o.expandtab = true
vim.o.softtabstop = 4
vim.o.shiftwidth = 4
vim.o.number = true
vim.o.relativenumber = true
vim.o.swapfile = false
vim.o.backup = false
vim.o.hlsearch = false
vim.o.incsearch = true
vim.o.termguicolors = true
vim.o.scrolloff = 8
vim.o.updatetime = 50

View File

@ -0,0 +1,6 @@
vim.api.nvim_create_autocmd("FileType", {
pattern = "yaml",
callback = function()
vim.opt_local.expandtab = false
end
})

View File

@ -0,0 +1,8 @@
return {
{
"mbbill/undotree",
cmd = { "UndotreeShow", "UndotreeToggle", "UndotreeHide", "UndotreeFocus" },
},
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
}

View File

@ -0,0 +1,10 @@
local monokai = {
'tanvirtin/monokai.nvim',
lazy = false,
priority = 1000,
config = function()
vim.cmd([[colorscheme monokai]])
end
}
return { monokai }

View File

@ -0,0 +1,8 @@
local telescope = {
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim"
}
}
return { telescope }

View File

@ -0,0 +1,19 @@
local tree = {
'nvim-tree/nvim-tree.lua',
lazy = false,
dependencies = { 'nvim-tree/nvim-web-devicons' },
opts = {
sort_by = "case_sensitive",
view = {
adaptive_size = true,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = true,
},
},
}
return { tree }

View File

@ -0,0 +1,31 @@
local treesitter = {
"nvim-treesitter/nvim-treesitter",
lazy = false,
build = ":TSUpdate",
config = function()
end,
opts = {
ensure_installed = {
"bash",
"css",
"dockerfile",
"elixir",
"git_rebase",
"gitcommit",
"gitignore",
"go",
"html",
"json",
"lua",
"markdown",
"php",
"python",
"rust",
"sql",
"toml",
"yaml",
}
}
}
return { treesitter }