Cleaning up neovim configuration
Due to the fact that this config is not used we are going to clean this up. Going forward only the plugins directory will be used so that any custom plugins I want to add can be added here and managed locally. This leaves the neovim distribution (if wanted) up to the user.
This commit is contained in:
@@ -1,19 +0,0 @@
|
|||||||
-- 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)
|
|
||||||
|
|
||||||
require("vim-options")
|
|
||||||
require("lazy").setup("plugins")
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
return {
|
|
||||||
"romgrk/barbar.nvim",
|
|
||||||
config = function()
|
|
||||||
require("barbar").setup({
|
|
||||||
init = function() vim.g.barbar_auto_setup = false end,
|
|
||||||
dependencies = {
|
|
||||||
'lewis6991/gitsigns.nvim', -- Optional, for git status signs
|
|
||||||
'nvim-tree/nvim-web-devicons', -- Optional, for file icons
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
|
|
||||||
},
|
|
||||||
vim.keymap.set('n', '<C-j>', ':BufferPrevious<CR>', {}),
|
|
||||||
vim.keymap.set('n', '<C-k>', ':BufferNext<CR>', {}),
|
|
||||||
vim.keymap.set('n', '<C-h>', ':BufferMovePrevious<CR>', {}),
|
|
||||||
vim.keymap.set('n', '<C-l>', ':BufferMoveNext<CR>', {}),
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"L3MON4D3/LuaSnip",
|
|
||||||
dependencies = {
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
"rafamadriz/friendly-snippets",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
-- REQUIRED - you must specify a snippet engine
|
|
||||||
expand = function(args)
|
|
||||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
||||||
require("luasnip").lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
|
||||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
|
||||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
-- { name = 'vsnip' }, -- For vsnip users.
|
|
||||||
{ name = "luasnip" }, -- For luasnip users.
|
|
||||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
|
||||||
-- { name = 'snippy' }, -- For snippy users.
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
config = function()
|
|
||||||
require("mason").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"williamboman/mason-lspconfig.nvim",
|
|
||||||
config = function()
|
|
||||||
require("mason-lspconfig").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"clangd",
|
|
||||||
"lua_ls",
|
|
||||||
"pyright",
|
|
||||||
"rust_analyzer",
|
|
||||||
"taplo",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
config = function()
|
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
lspconfig.clangd.setup({
|
|
||||||
capabilities = capabilities
|
|
||||||
})
|
|
||||||
lspconfig.lua_ls.setup({
|
|
||||||
capabilities = capabilities
|
|
||||||
})
|
|
||||||
lspconfig.pyright.setup({
|
|
||||||
capabilities = capabilities
|
|
||||||
})
|
|
||||||
lspconfig.rust_analyzer.setup({
|
|
||||||
capabilities = capabilities
|
|
||||||
})
|
|
||||||
lspconfig.taplo.setup({
|
|
||||||
capabilities = capabilities
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
|
|
||||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, {})
|
|
||||||
vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-lualine/lualine.nvim",
|
|
||||||
config = function()
|
|
||||||
require('lualine').setup({
|
|
||||||
options = {
|
|
||||||
theme = 'palenight'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
return {
|
|
||||||
"MeanderingProgrammer/render-markdown.nvim",
|
|
||||||
config = function ()
|
|
||||||
require("render-markdown").setup({
|
|
||||||
dependencies = {
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
'nvim-tree/nvim-web-devicons',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
branch = "v3.x",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
vim.keymap.set('n', '<leader>fe', ':Neotree filesystem reveal toggle left<CR>', {})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvimtools/none-ls.nvim",
|
|
||||||
config = function()
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
|
|
||||||
null_ls.setup({
|
|
||||||
sources = {
|
|
||||||
null_ls.builtins.formatting.black,
|
|
||||||
null_ls.builtins.formatting.clang_format,
|
|
||||||
null_ls.builtins.formatting.gersemi,
|
|
||||||
null_ls.builtins.formatting.stylua,
|
|
||||||
null_ls.builtins.diagnostics.cpplint,
|
|
||||||
null_ls.builtins.diagnostics.pylint,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope.nvim',
|
|
||||||
branch = '0.1.x',
|
|
||||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
|
||||||
config = function()
|
|
||||||
local builtin = require('telescope.builtin')
|
|
||||||
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
|
|
||||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nvim-telescope/telescope-ui-select.nvim',
|
|
||||||
config = function ()
|
|
||||||
-- This is your opts table
|
|
||||||
require("telescope").setup {
|
|
||||||
extensions = {
|
|
||||||
["ui-select"] = {
|
|
||||||
require("telescope.themes").get_dropdown {
|
|
||||||
-- even more opts
|
|
||||||
}
|
|
||||||
-- pseudo code / specification for writing custom displays, like the one
|
|
||||||
-- for "codeactions"
|
|
||||||
-- specific_opts = {
|
|
||||||
-- [kind] = {
|
|
||||||
-- make_indexed = function(items) -> indexed_items, width,
|
|
||||||
-- make_displayer = function(widths) -> displayer
|
|
||||||
-- make_display = function(displayer) -> function(e)
|
|
||||||
-- make_ordinal = function(e) -> string
|
|
||||||
-- },
|
|
||||||
-- -- for example to disable the custom builtin "codeactions" display
|
|
||||||
-- do the following
|
|
||||||
-- codeactions = false,
|
|
||||||
-- }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-- To get ui-select loaded and working with telescope, you need to call
|
|
||||||
-- load_extension, somewhere after setup function:
|
|
||||||
require("telescope").load_extension("ui-select")
|
|
||||||
end
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
return {
|
|
||||||
"folke/tokyonight.nvim",
|
|
||||||
lazy = false,
|
|
||||||
priority = 1000,
|
|
||||||
opts = {},
|
|
||||||
config = function()
|
|
||||||
vim.cmd.colorscheme "tokyonight-storm"
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
return{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
build = ":TSUpdate",
|
|
||||||
config = function()
|
|
||||||
local configs = require("nvim-treesitter.configs")
|
|
||||||
configs.setup({
|
|
||||||
ensure_installed = { "c", "cmake", "cpp", "lua", "markdown", "markdown_inline", "python", "rust", "toml" },
|
|
||||||
auto_install = true,
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true },
|
|
||||||
})
|
|
||||||
end
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
vim.cmd("set shiftwidth=2")
|
|
||||||
vim.cmd("set tabstop=2")
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
vim.wo.relativenumber = true
|
|
||||||
vim.wo.number = true
|
|
||||||
vim.cmd("set list")
|
|
||||||
vim.keymap.set('n', '<C-A-h>', '<C-w>h', {})
|
|
||||||
vim.keymap.set('n', '<C-A-j>', '<C-w>j', {})
|
|
||||||
vim.keymap.set('n', '<C-A-k>', '<C-w>k', {})
|
|
||||||
vim.keymap.set('n', '<C-A-l>', '<C-w>l', {})
|
|
||||||
Reference in New Issue
Block a user