Skip to content

Commit 2330a0d

Browse files
committed
more refactoring
I got the color scheme and tree sitter into their own files.
1 parent 84ca5bf commit 2330a0d

File tree

4 files changed

+50
-90
lines changed

4 files changed

+50
-90
lines changed

lua/plugins/icons.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
return vim.g.have_nerd_font and {}
2+
or {
3+
cmd = '',
4+
config = '🛠',
5+
event = '📅',
6+
ft = '📂',
7+
init = '',
8+
keys = '🗝',
9+
plugin = '🔌',
10+
runtime = '💻',
11+
require = '🌙',
12+
source = '📄',
13+
start = '🚀',
14+
task = '📌',
15+
lazy = '💤 ',
16+
}

lua/plugins/init.lua

Lines changed: 4 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -543,23 +543,7 @@ require('lazy').setup({
543543
end,
544544
},
545545

546-
{ -- You can easily change to a different colorscheme.
547-
-- Change the name of the colorscheme plugin below, and then
548-
-- change the command in the config to whatever the name of that colorscheme is.
549-
--
550-
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
551-
'folke/tokyonight.nvim',
552-
priority = 1000, -- Make sure to load this before all the other start plugins.
553-
init = function()
554-
-- Load the colorscheme here.
555-
-- Like many other themes, this one has different styles, and you could load
556-
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
557-
vim.cmd.colorscheme 'tokyonight-night'
558-
559-
-- You can configure highlights by doing something like:
560-
vim.cmd.hi 'Comment gui=none'
561-
end,
562-
},
546+
require 'plugins.kickstart.tokyo_night',
563547

564548
-- Highlight todo, notes, etc in comments
565549
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
@@ -601,64 +585,9 @@ require('lazy').setup({
601585
-- Check out: https://github.com/echasnovski/mini.nvim
602586
end,
603587
},
604-
{ -- Highlight, edit, and navigate code
605-
'nvim-treesitter/nvim-treesitter',
606-
build = ':TSUpdate',
607-
opts = {
608-
ensure_installed = {
609-
'bash',
610-
'c',
611-
'javascript',
612-
'typescript',
613-
'python',
614-
'diff',
615-
'html',
616-
'lua',
617-
'luadoc',
618-
'markdown',
619-
'markdown_inline',
620-
'query',
621-
'vim',
622-
'vimdoc',
623-
},
624-
-- Autoinstall languages that are not installed
625-
auto_install = true,
626-
highlight = {
627-
enable = true,
628-
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
629-
-- If you are experiencing weird indenting issues, add the language to
630-
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
631-
additional_vim_regex_highlighting = { 'ruby' },
632-
},
633-
indent = { enable = true, disable = { 'ruby' } },
634-
},
635-
config = function(_, opts)
636-
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
588+
require 'plugins.kickstart.treesitter',
637589

638-
-- Prefer git instead of curl in order to improve connectivity in some environments
639-
require('nvim-treesitter.install').prefer_git = true
640-
---@diagnostic disable-next-line: missing-fields
641-
require('nvim-treesitter.configs').setup(opts)
642-
643-
-- There are additional nvim-treesitter modules that you can use to interact
644-
-- with nvim-treesitter. You should go explore a few and see what interests you:
645-
--
646-
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
647-
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
648-
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
649-
end,
650-
},
651-
652-
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
653-
-- init.lua. If you want these files, they are in the repository, so you can just download them and
654-
-- place them in the correct locations.
655-
656-
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
657-
--
658-
-- Here are some example plugins that I've included in the Kickstart repository.
659-
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
660-
--
661-
-- require 'kickstart.plugins.debug',
590+
-- require kickstart plugins
662591
require 'plugins.kickstart.indent_line',
663592
require 'plugins.kickstart.lint',
664593
require 'plugins.kickstart.autopairs',
@@ -673,20 +602,6 @@ require('lazy').setup({
673602
ui = {
674603
-- If you are using a Nerd Font: set icons to an empty table which will use the
675604
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
676-
icons = vim.g.have_nerd_font and {} or {
677-
cmd = '',
678-
config = '🛠',
679-
event = '📅',
680-
ft = '📂',
681-
init = '',
682-
keys = '🗝',
683-
plugin = '🔌',
684-
runtime = '💻',
685-
require = '🌙',
686-
source = '📄',
687-
start = '🚀',
688-
task = '📌',
689-
lazy = '💤 ',
690-
},
605+
icons = require 'plugins.icons',
691606
},
692607
})
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
return { -- You can easily change to a different colorscheme.
2+
-- Change the name of the colorscheme plugin below, and then
3+
-- change the command in the config to whatever the name of that colorscheme is.
4+
--
5+
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
6+
'folke/tokyonight.nvim',
7+
priority = 1000, -- Make sure to load this before all the other start plugins.
8+
init = function()
9+
-- Load the colorscheme here.
10+
-- Like many other themes, this one has different styles, and you could load
11+
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
12+
vim.cmd.colorscheme 'tokyonight-night'
13+
14+
-- You can configure highlights by doing something like:
15+
vim.cmd.hi 'Comment gui=none'
16+
end,
17+
}

lua/plugins/kickstart/treesitter.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,19 @@ return { -- Highlight, edit, and navigate code
22
'nvim-treesitter/nvim-treesitter',
33
build = ':TSUpdate',
44
opts = {
5-
ensure_installed = { 'bash', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'python', 'javascript', 'typescript' },
5+
ensure_installed = {
6+
'bash',
7+
'diff',
8+
'html',
9+
'lua',
10+
'luadoc',
11+
'markdown',
12+
'vim',
13+
'vimdoc',
14+
'python',
15+
'javascript',
16+
'typescript',
17+
},
618
-- Autoinstall languages that are not installed
719
auto_install = true,
820
highlight = {

0 commit comments

Comments
 (0)