getting to the closing part of this repo

This commit is contained in:
TJ DeVries 2023-02-16 17:31:31 -05:00
parent e5c03b4206
commit bdbe2f3ae2
6 changed files with 152 additions and 125 deletions

1
.gitignore vendored
View File

@ -2,5 +2,4 @@ tags
test.sh test.sh
.luarc.json .luarc.json
nvim nvim
plugin/packer_compiled.lua
lazy-lock.json lazy-lock.json

View File

@ -1,34 +0,0 @@
# Build neovim separately in the first stage
FROM alpine:latest AS base
RUN apk --no-cache add \
autoconf \
automake \
build-base \
cmake \
ninja \
coreutils \
curl \
gettext-tiny-dev \
git \
libtool \
pkgconf \
unzip
# Build neovim (and use it as an example codebase
RUN git clone https://github.com/neovim/neovim.git
ARG VERSION=master
RUN cd neovim && git checkout ${VERSION} && make CMAKE_BUILD_TYPE=RelWithDebInfo install
# To support kickstart.nvim
RUN apk --no-cache add \
fd \
ctags \
ripgrep \
git
# Copy the kickstart.nvim init.lua
COPY ./init.lua /root/.config/nvim/init.lua
WORKDIR /neovim

218
init.lua
View File

@ -1,5 +1,23 @@
-- TODO BEFORE MERGE: --[[
-- - [ ] Document an example of adding your own custom plugins (for example, autopairs)
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
I have left several `:help X` comments throughout the init.lua
You should run that command and read the help for the section for more information.
In addition, I have some `NOTE:` items throughout the file.
These are for you, the reader to help understand what is happening. Feel free to delete
them once you know what you're doing, but they should serve as a guide for when you
are first encountering a few different constructs in your nvim config.
I hope you enjoy your Neovim journey,
- TJ
P.S. You can delete this when you're done too. It's your config now :)
--]]
-- Set <space> as the leader key -- Set <space> as the leader key
-- See `:help mapleader` -- See `:help mapleader`
@ -23,8 +41,23 @@ if not vim.loop.fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
-- NOTE: Here is where you install your plugins.
-- You can configure plugins using the `config` key.
--
-- You can also configure plugins after the setup call,
-- as they will be available in your neovim runtime.
require('lazy').setup({ require('lazy').setup({
---@diagnostic disable-next-line: assign-type-mismatch -- NOTE: First, some plugins that don't require any configuration
-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
-- Detect tabstop and shiftwidth automatically
'tpope/vim-sleuth',
-- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below.
{ -- LSP Configuration & Plugins { -- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
@ -32,18 +65,104 @@ require('lazy').setup({
'williamboman/mason.nvim', 'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP { -- Useful status updates for LSP
'j-hui/fidget.nvim', 'j-hui/fidget.nvim',
config = function()
require('fidget').setup()
end,
},
-- Additional lua configuration, makes nvim stuff amazing -- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim', 'folke/neodev.nvim',
}, },
}, },
{ -- Autocompletion { -- Autocompletion
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
}, },
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
config = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
require('which-key').setup {}
end,
},
{ -- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
config = function()
-- See `:help gitsigns.txt`
require('gitsigns').setup {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
}
end,
},
{ -- Theme inspired by Atom
'navarasu/onedark.nvim',
config = function()
vim.cmd.colorscheme 'onedark'
end,
},
{ -- Fancier statusline
'nvim-lualine/lualine.nvim',
config = function()
-- Set lualine as statusline
-- See `:help lualine.txt`
require('lualine').setup {
options = {
icons_enabled = false,
theme = 'onedark',
component_separators = '|',
section_separators = '',
},
}
end,
},
{ -- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim',
config = function()
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
require('indent_blankline').setup {
char = '',
show_trailing_blankline_indent = false,
}
end,
},
{ -- "gc" to comment visual regions/lines
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end,
},
-- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
-- Only load if `make` is available. Make sure you have the system
-- requirements installed.
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
dependencies = { dependencies = {
@ -54,45 +173,13 @@ require('lazy').setup({
end, end,
}, },
{ -- Useful plugin to show you pending keybinds. -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
'folke/which-key.nvim',
config = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
require('which-key').setup {}
end,
},
-- Git related plugins
'tpope/vim-fugitive',
'tpope/vim-rhubarb',
'lewis6991/gitsigns.nvim',
'navarasu/onedark.nvim', -- Theme inspired by Atom
'nvim-lualine/lualine.nvim', -- Fancier statusline
'lukas-reineke/indent-blankline.nvim', -- Add indentation guides even on blank lines
'numToStr/Comment.nvim', -- "gc" to comment visual regions/lines
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
-- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
-- Fuzzy Finder Algorithm which requires local dependencies to be built. Only load if `make` is available
{
'nvim-telescope/telescope-fzf-native.nvim',
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
end,
},
-- Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- require 'kickstart.plugins.autoformat', -- require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.debug',
-- Add your own custom plugins to `lua/custom/plugins/*.lua` -- NOTE: Add your own custom plugins to `lua/custom/plugins/*.lua`
-- For more information see: -- There are examples in the README.md for kickstar.nvim
-- https://github.com/folke/lazy.nvim#-structuring-your-plugins -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
{ import = 'custom.plugins' }, { import = 'custom.plugins' },
}, {}) }, {})
@ -122,13 +209,12 @@ vim.o.smartcase = true
vim.o.updatetime = 250 vim.o.updatetime = 250
vim.wo.signcolumn = 'yes' vim.wo.signcolumn = 'yes'
-- Set colorscheme
vim.o.termguicolors = true
vim.cmd [[colorscheme onedark]]
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect' vim.o.completeopt = 'menuone,noselect'
-- NOTE: You should make sure your terminal supports this
vim.o.termguicolors = true
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- Keymaps for better default experience -- Keymaps for better default experience
@ -150,39 +236,6 @@ vim.api.nvim_create_autocmd('TextYankPost', {
pattern = '*', pattern = '*',
}) })
-- Set lualine as statusline
-- See `:help lualine.txt`
require('lualine').setup {
options = {
icons_enabled = false,
theme = 'onedark',
component_separators = '|',
section_separators = '',
},
}
-- Enable Comment.nvim
require('Comment').setup()
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
require('indent_blankline').setup {
char = '',
show_trailing_blankline_indent = false,
}
-- Gitsigns
-- See `:help gitsigns.txt`
require('gitsigns').setup {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
}
-- [[ Configure Telescope ]] -- [[ Configure Telescope ]]
-- See `:help telescope` and `:help telescope.setup()` -- See `:help telescope` and `:help telescope.setup()`
require('telescope').setup { require('telescope').setup {
@ -355,7 +408,7 @@ local servers = {
-- Setup neovim lua configuration -- Setup neovim lua configuration
require('neodev').setup() require('neodev').setup()
--
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
@ -380,9 +433,6 @@ mason_lspconfig.setup_handlers {
end, end,
} }
-- Turn on lsp status information
require('fidget').setup()
-- nvim-cmp setup -- nvim-cmp setup
local cmp = require 'cmp' local cmp = require 'cmp'
local luasnip = require 'luasnip' local luasnip = require 'luasnip'
@ -398,7 +448,7 @@ cmp.setup {
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs(-4), ['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm { ['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true,

View File

@ -1,3 +1,5 @@
-- You can add your own plugins here or in other files in this directory! -- You can add your own plugins here or in other files in this directory!
-- I promise not to create any merge conflicts in this directory :) -- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {} return {}

View File

@ -1,3 +1,8 @@
-- autoformat.lua
--
-- Use your language server to automatically format your code on save.
-- Adds additional commands as well to manage the behavior
return { return {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',

View File

@ -1,5 +1,16 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return { return {
-- NOTE: Yes, you can install new plugins here!
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
-- NOTE: And you can specify dependencies as well
dependencies = { dependencies = {
-- Creates a beautiful debugger UI -- Creates a beautiful debugger UI
'rcarriga/nvim-dap-ui', 'rcarriga/nvim-dap-ui',
@ -13,12 +24,6 @@ return {
}, },
config = function() config = function()
-- Optional debug adapter setup
--
-- To enable setup, change `disable = true` in the packer section
-- of the init.lua. You'll also want to copy this file into your
-- config at ~/.config/nvim/after/plugin/dap.lua
local dap = require 'dap' local dap = require 'dap'
local dapui = require 'dapui' local dapui = require 'dapui'