Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ A starting point for Neovim that is:

This repo is meant to be used as by **YOU** to begin your Neovim journey; remove the things you don't use and add what you miss.

Distribution Alternatives:
- [LazyVim](https://www.lazyvim.org/): A delightful distribution maintained by @folke (the author of lazy.nvim, the package manager used here)

### Installation

Kickstart.nvim targets *only* the latest ['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest ['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim. If you are experiencing issues, please make sure you have the latest versions.
Expand All @@ -34,6 +37,7 @@ Additional system requirements:
* Then there are two primary configuration options available:
* Include the `lua/kickstart/plugins/*` files in your configuration.
* Add new configuration in `lua/custom/plugins/*` files, which will be auto sourced using `lazy.nvim`
* NOTE: To enable this, you need to uncomment `{ import = 'custom.plugins' }` in your `init.lua`

You can also merge updates/changes from the repo back into your fork, to keep up-to-date with any changes for the default configuration

Expand Down Expand Up @@ -62,7 +66,7 @@ In the file: `lua/custom/plugins/filetree.lua`, add:
```lua
return {
"nvim-neo-tree/neo-tree.nvim",
branch = "v2.x",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
Expand Down
128 changes: 69 additions & 59 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,26 @@
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================

Kickstart.nvim is *not* a distribution.

Kickstart.nvim is a template for your own configuration.
The goal is that you can read every line of code, top-to-bottom, and understand
what your configuration is doing.

Once you've done that, you should start exploring, configuring and tinkering to
explore Neovim!

If you don't know anything about Lua, I recommend taking some time to read through
a guide. One possible example:
- https://learnxinyminutes.com/docs/lua/

And then you can explore or search through `:help lua-guide`


Kickstart Guide:

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.
You should run that command and read that help 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
Expand All @@ -16,7 +34,6 @@ 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
Expand Down Expand Up @@ -65,12 +82,9 @@ require('lazy').setup({
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',

{ -- Useful status updates for LSP
'j-hui/fidget.nvim',
config = function()
require('fidget').setup()
end,
},
-- Useful status updates for LSP
-- NOTE: `opt = {}` is the same as calling `require('fidget').setup({})`
{ 'j-hui/fidget.nvim', opts = {} },

-- Additional lua configuration, makes nvim stuff amazing!
'folke/neodev.nvim',
Expand All @@ -82,81 +96,66 @@ require('lazy').setup({
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,
},

-- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opt = {} },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be opts. Same for a bunch of others below :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call haha

{ -- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
config = function()
opt = {
-- See `:help gitsigns.txt`
require('gitsigns').setup {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '‾' },
changedelete = { text = '~' },
},
}
end,
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '‾' },
changedelete = { text = '~' },
},
},
},

{ -- Theme inspired by Atom
'navarasu/onedark.nvim',
priority = 1000,
config = function()
vim.cmd.colorscheme 'onedark'
end,
},

{ -- Fancier statusline
{ -- Set lualine as 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,
-- See `:help lualine.txt`
opt = {
options = {
icons_enabled = false,
theme = 'onedark',
component_separators = '|',
section_separators = '',
},
},
},

{ -- 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,
-- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt`
opt = {
char = '┊',
show_trailing_blankline_indent = false,
},
},

{ -- "gc" to comment visual regions/lines
'numToStr/Comment.nvim',
config = function()
require('Comment').setup()
end,
},
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opt = {} },

-- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
{ 'nvim-telescope/telescope.nvim', version = '*', 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',
-- NOTE: If you are having trouble with this installation,
-- refer to the README for telescope-fzf-native for more instructions.
build = 'make',
cond = function()
return vim.fn.executable 'make' == 1
Expand All @@ -174,12 +173,19 @@ require('lazy').setup({
},

-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
-- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug',

-- NOTE: Add your own custom plugins to `lua/custom/plugins/*.lua`
-- There are examples in the README.md for kickstar.nvim
-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
-- up-to-date with whatever is in the kickstart repo.
--
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
--
-- An additional note is that if you only copied in the `init.lua`, you can just comment this line
-- to get rid of the warning telling you that there are not plugins in `lua/custom/plugins/`.
{ import = 'custom.plugins' },
}, {})

Expand All @@ -205,9 +211,13 @@ vim.o.undofile = true
vim.o.ignorecase = true
vim.o.smartcase = true

-- Keep signcolumn on by default
vim.wo.signcolumn = 'yes'

-- Decrease update time
vim.o.updatetime = 250
vim.wo.signcolumn = 'yes'
vim.o.timeout = true
vim.o.timeoutlen = 300

-- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect'
Expand Down
14 changes: 11 additions & 3 deletions lua/kickstart/plugins/autoformat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

return {
'neovim/nvim-lspconfig',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: For myself, could add null-ls here since I know that's a big hang up for a lot of people

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meh, i think i'll do this later if I want it


config = function()
-- Switch for controlling whether you want autoformatting.
-- Use :KickstartFormatToggle to toggle autoformatting on or off
Expand All @@ -29,9 +28,11 @@ return {
return _augroups[client.id]
end

-- Whenever an LSP attaches to a buffer, we will run this function.
--
-- See `:help LspAttach` for more information about this autocmd event.
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('kickstart-lsp-attach-format', { clear = true }),

-- This is where we attach the autoformatting for reasonable clients
callback = function(args)
local client_id = args.data.client_id
Expand All @@ -49,6 +50,8 @@ return {
return
end

-- Create an autocmd that will run *before* we save the buffer.
-- Run the formatting command for the LSP that has just attached.
vim.api.nvim_create_autocmd('BufWritePre', {
group = get_augroup(client),
buffer = bufnr,
Expand All @@ -57,7 +60,12 @@ return {
return
end

vim.lsp.buf.format { async = false }
vim.lsp.buf.format {
async = false,
filter = function(c)
return c.id == client.id
end,
}
end,
})
end,
Expand Down