Skip to content

Commit

Permalink
Merge pull request #1 from burberrymyshirt/update
Browse files Browse the repository at this point in the history
update
  • Loading branch information
burberrymyshirt authored Dec 7, 2024
2 parents 98df2ea + f1ebfaa commit ac7f1cf
Show file tree
Hide file tree
Showing 18 changed files with 443 additions and 279 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ External Requirements:
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
- Language Setup:
- If want to write Typescript, you need `npm`
- If want to write Golang, you will need `go`
- If you want to write Typescript, you need `npm`
- If you want to write Golang, you will need `go`
- etc.

> **NOTE**
Expand All @@ -48,8 +48,8 @@ Neovim's configurations are located under the following paths, depending on your
| OS | PATH |
| :- | :--- |
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
| Windows (cmd)| `%localappdata%\nvim\` |
| Windows (powershell)| `$env:LOCALAPPDATA\nvim\` |

#### Recommended Step

Expand All @@ -61,6 +61,10 @@ fork to your machine using one of the commands below, depending on your OS.
> Your fork's url will be something like this:
> `https://github.com/<your_github_username>/kickstart-modular.nvim.git`
You likely want to remove `lazy-lock.json` from your fork's `.gitignore` file
too - it's ignored in the kickstart repo to make maintenance easier, but it's
[recommmended to track it in version control](https://lazy.folke.io/usage/lockfile).

#### Clone kickstart.nvim
> **NOTE**
> If following the recommended step above (i.e., forking the repo), replace
Expand All @@ -79,13 +83,13 @@ git clone https://github.com/burberrymyshirt/kickstart-modular.nvim.git "${XDG_C
If you're using `cmd.exe`:

```
git clone https://github.com/dam9000/kickstart-modular.nvim.git %userprofile%\AppData\Local\nvim\
git clone https://github.com/dam9000/kickstart.nvim.git "%localappdata%\nvim"
```

If you're using `powershell.exe`

```
git clone https://github.com/dam9000/kickstart-modular.nvim.git $env:USERPROFILE\AppData\Local\nvim\
git clone https://github.com/dam9000/kickstart.nvim.git "${env:LOCALAPPDATA}\nvim"
```

</details>
Expand Down Expand Up @@ -128,7 +132,7 @@ examples of adding popularly requested plugins.
`~/.local/share/nvim-kickstart`. You can apply this approach to any Neovim
distribution that you would like to try out.
* What if I want to "uninstall" this configuration:
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
* See [lazy.nvim uninstall](https://lazy.folke.io/usage#-uninstalling) information
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
* The main purpose of kickstart is to serve as a teaching tool and a reference
configuration that someone can easily use to `git clone` as a basis for their own.
Expand Down
24 changes: 24 additions & 0 deletions lua/colorschemes/plugins/setup.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
-- Get the path to the current directory
local colorschemes_path = vim.fn.fnamemodify(debug.getinfo(1, 'S').source:sub(2), ':h')

-- Find all Lua files in the directory, excluding `setup.lua`
local files = vim.fn.glob(colorschemes_path .. '/*.lua', false, true)

-- Container for all plugin specifications
local plugins = {}

-- Iterate over the files and load each as a Lua module
for _, file in ipairs(files) do
local file_name = vim.fn.fnamemodify(file, ':t:r') -- Extract filename without extension
if file_name ~= 'setup' then -- Skip `setup.lua`
local success, spec = pcall(require, 'colorschemes.plugins.' .. file_name)
if success then
vim.list_extend(plugins, spec) -- Append plugin specs
else
vim.notify('Error loading colorscheme plugin: ' .. file_name, vim.log.levels.ERROR)
end
end
end

-- Return the aggregated plugins list
return plugins
1 change: 1 addition & 0 deletions lua/colorschemes/plugins/vscode-theme.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
return {

{
'Mofiqul/vscode.nvim',
priority = 999,
Expand Down
24 changes: 12 additions & 12 deletions lua/custom/plugins/bufferline.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
return {
{
'akinsho/bufferline.nvim',
version = '*',
dependencies = 'nvim-tree/nvim-web-devicons',
opts = {
options = {
numbers = 'buffer_id',
},
},
},
}
-- return {
-- {
-- 'akinsho/bufferline.nvim',
-- version = '*',
-- dependencies = 'nvim-tree/nvim-web-devicons',
-- opts = {
-- options = {
-- numbers = 'buffer_id',
-- },
-- },
-- },
-- }
7 changes: 2 additions & 5 deletions lua/keymaps.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`

-- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.opt.hlsearch = true
-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

-- Diagnostic keymaps
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })

-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
Expand Down
22 changes: 11 additions & 11 deletions lua/kickstart/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
--]]

local check_version = function()
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
if not vim.version.cmp then
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
return
end

if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
end
local verstr = tostring(vim.version())
if not vim.version.ge then
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
return
end

if vim.version.ge(vim.version(), '0.10-dev') then
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
end
end

local check_external_reqs = function()
Expand Down
27 changes: 16 additions & 11 deletions lua/kickstart/plugins/cmp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,21 @@ return {
end
end, { 'i', 's' }),

-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
},
}
end,
},
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
},
sources = {
{
name = 'lazydev',
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
group_index = 0,
},
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'path' },
},
}
end,
},
}
-- vim: ts=2 sts=2 sw=2 et
79 changes: 43 additions & 36 deletions lua/kickstart/plugins/conform.lua
Original file line number Diff line number Diff line change
@@ -1,40 +1,47 @@
return {
{ -- Autoformat
'stevearc/conform.nvim',
lazy = false,
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_fallback = true }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
lua = { 'stylua' },
go = { 'gofumpt', 'golines', 'goimports' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use a sub-list to tell conform to run *until* a formatter
-- is found.
-- javascript = { { "prettierd", "prettier" } },
},
},
{ -- Autoformat
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>f',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
mode = '',
desc = '[F]ormat buffer',
},
},
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
-- Disable "format_on_save lsp_fallback" for languages that don't
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
local lsp_format_opt
if disable_filetypes[vim.bo[bufnr].filetype] then
lsp_format_opt = 'never'
else
lsp_format_opt = 'fallback'
end
return {
timeout_ms = 500,
lsp_format = lsp_format_opt,
}
end,
formatters_by_ft = {
lua = { 'stylua' },
go = { 'gofumpt', 'golines', 'goimports' },

-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
-- You can use 'stop_after_first' to run the first available formatter from the list
-- javascript = { "prettierd", "prettier", stop_after_first = true },
},
},
},
}
-- vim: ts=2 sts=2 sw=2 et
Loading

0 comments on commit ac7f1cf

Please sign in to comment.